ClientProxy.h 2.5 KB
Newer Older
K
kun yu 已提交
1 2 3 4 5 6 7
/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#pragma once

K
kun yu 已提交
8
#include "MilvusApi.h"
K
kun yu 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#include "GrpcClient.h"

namespace milvus {

class ClientProxy : public Connection {
public:
    // Implementations of the Connection interface
    virtual Status
    Connect(const ConnectParam &param) override;

    virtual Status
    Connect(const std::string &uri) override;

    virtual Status
    Connected() const override;

    virtual Status
    Disconnect() override;

    virtual Status
    CreateTable(const TableSchema &param) override;

    virtual bool
    HasTable(const std::string &table_name) override;

    virtual Status
    DropTable(const std::string &table_name) override;

    virtual Status
Y
Yu Kun 已提交
38
    CreateIndex(const IndexParam &index_param) override;
K
kun yu 已提交
39 40

    virtual Status
Y
Yu Kun 已提交
41
    Insert(const std::string &table_name,
K
kun yu 已提交
42 43 44 45
                    const std::vector<RowRecord> &record_array,
                    std::vector<int64_t> &id_array) override;

    virtual Status
Y
Yu Kun 已提交
46
    Search(const std::string &table_name,
K
kun yu 已提交
47 48 49 50 51 52 53 54 55
                    const std::vector<RowRecord> &query_record_array,
                    const std::vector<Range> &query_range_array,
                    int64_t topk,
                    std::vector<TopKQueryResult> &topk_query_result_array) override;

    virtual Status
    DescribeTable(const std::string &table_name, TableSchema &table_schema) override;

    virtual Status
Y
Yu Kun 已提交
56
    CountTable(const std::string &table_name, int64_t &row_count) override;
K
kun yu 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69

    virtual Status
    ShowTables(std::vector<std::string> &table_array) override;

    virtual std::string
    ClientVersion() const override;

    virtual std::string
    ServerVersion() const override;

    virtual std::string
    ServerStatus() const override;

Y
Yu Kun 已提交
70 71 72 73 74 75 76 77 78 79 80 81 82
    virtual Status
    DeleteByRange(Range &range,
                  const std::string &table_name) override;

    virtual Status
    PreloadTable(const std::string &table_name) const override;

    virtual IndexParam
    DescribeIndex(const std::string &table_name) const override;

    virtual Status
    DropIndex(const std::string &table_name) const override;

K
kun yu 已提交
83 84 85 86
private:
    std::shared_ptr<::grpc::Channel> channel_;

private:
K
kun yu 已提交
87
    std::shared_ptr<GrpcClient> client_ptr_;
K
kun yu 已提交
88 89 90 91
    bool connected_ = false;
};

}