2019-07-22 10:14:23 +08:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
|
|
|
|
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
|
|
* Proprietary and confidential.
|
|
|
|
******************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2019-07-24 19:29:18 +08:00
|
|
|
#include "../include/MilvusApi.h"
|
|
|
|
#include "src/sdk/grpc/ClientProxy.h"
|
2019-07-22 10:14:23 +08:00
|
|
|
|
|
|
|
namespace milvus {
|
|
|
|
|
|
|
|
class ConnectionImpl : public Connection {
|
|
|
|
public:
|
|
|
|
ConnectionImpl();
|
|
|
|
|
|
|
|
// Implementations of the Connection interface
|
|
|
|
virtual Status Connect(const ConnectParam ¶m) override;
|
|
|
|
|
|
|
|
virtual Status Connect(const std::string &uri) override;
|
|
|
|
|
|
|
|
virtual Status Connected() const override;
|
|
|
|
|
|
|
|
virtual Status Disconnect() override;
|
|
|
|
|
|
|
|
virtual Status CreateTable(const TableSchema ¶m) override;
|
|
|
|
|
|
|
|
virtual bool HasTable(const std::string &table_name) override;
|
|
|
|
|
|
|
|
virtual Status DropTable(const std::string &table_name) override;
|
|
|
|
|
2019-07-24 19:29:18 +08:00
|
|
|
virtual Status DeleteTable(const std::string &table_name) override;
|
|
|
|
|
2019-07-22 10:14:23 +08:00
|
|
|
virtual Status BuildIndex(const std::string &table_name) override;
|
|
|
|
|
|
|
|
virtual Status InsertVector(const std::string &table_name,
|
|
|
|
const std::vector<RowRecord> &record_array,
|
|
|
|
std::vector<int64_t> &id_array) override;
|
|
|
|
|
2019-07-24 19:29:18 +08:00
|
|
|
virtual Status AddVector(const std::string &table_name,
|
|
|
|
const std::vector<RowRecord> &record_array,
|
|
|
|
std::vector<int64_t> &id_array) override;
|
|
|
|
|
2019-07-22 10:14:23 +08:00
|
|
|
virtual Status SearchVector(const std::string &table_name,
|
|
|
|
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 GetTableRowCount(const std::string &table_name, int64_t &row_count) override;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<ClientProxy> client_proxy_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|