Commit 7dae5481 authored by 陈萌's avatar 陈萌
Browse files

HDFSClient (for connect and disconnect) but not used really

parent 627661b0
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.

#include "HDFSClient.h"

namespace milvus{
namespace storage{

bool
HDFSClient::ConnectToHdfs(){
    hdfs_fs = hdfsConnect("default",0);

    if(hdfs_fs == nullptr)
        return false;
    else
        return true;
}

bool
HDFSClient::DisconnectFromHdfs(){
    int flag = hdfsDisconnect(hdfs_fs);
    if(flag == 0)
        return true;
    else
        return false;
}


}
}
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.

#pragma once

#include "hdfs.h"

namespace milvus{
namespace storage{

//didn't use
class HDFSClient{
    public:
            static bool
            ConnectToHdfs();

            static bool
            DisconnectFromHdfs();
    public:
           static hdfsFS hdfs_fs;
};

}
}
 No newline at end of file