milvus_types.h 8.2 KB
Newer Older
G
groot 已提交
1
/**
G
groot 已提交
2
 * Autogenerated by Thrift Compiler (0.12.0)
G
groot 已提交
3 4 5 6
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
G
groot 已提交
7 8
#ifndef milvus_TYPES_H
#define milvus_TYPES_H
G
groot 已提交
9 10 11 12 13 14 15 16 17 18 19 20

#include <iosfwd>

#include <thrift/Thrift.h>
#include <thrift/TApplicationException.h>
#include <thrift/TBase.h>
#include <thrift/protocol/TProtocol.h>
#include <thrift/transport/TTransport.h>

#include <thrift/stdcxx.h>


G
groot 已提交
21
namespace milvus { namespace thrift {
G
groot 已提交
22

G
groot 已提交
23
struct ErrorCode {
G
groot 已提交
24 25
  enum type {
    SUCCESS = 0,
S
starlord 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    UNEXPECTED_ERROR = 1,
    CONNECT_FAILED = 2,
    PERMISSION_DENIED = 3,
    TABLE_NOT_EXISTS = 4,
    ILLEGAL_ARGUMENT = 5,
    ILLEGAL_RANGE = 6,
    ILLEGAL_DIMENSION = 7,
    ILLEGAL_INDEX_TYPE = 8,
    ILLEGAL_TABLE_NAME = 9,
    ILLEGAL_TOPK = 10,
    ILLEGAL_ROWRECORD = 11,
    ILLEGAL_VECTOR_ID = 12,
    ILLEGAL_SEARCH_RESULT = 13,
    FILE_NOT_FOUND = 14,
    META_FAILED = 15,
    CACHE_FAILED = 16,
    CANNOT_CREATE_FOLDER = 17,
    CANNOT_CREATE_FILE = 18,
    CANNOT_DELETE_FOLDER = 19,
    CANNOT_DELETE_FILE = 20
G
groot 已提交
46 47 48
  };
};

G
groot 已提交
49
extern const std::map<int, const char*> _ErrorCode_VALUES_TO_NAMES;
G
groot 已提交
50

G
groot 已提交
51
std::ostream& operator<<(std::ostream& out, const ErrorCode::type& val);
G
groot 已提交
52

G
groot 已提交
53
class Exception;
G
groot 已提交
54

G
groot 已提交
55
class TableSchema;
G
groot 已提交
56

G
groot 已提交
57
class Range;
G
groot 已提交
58

G
groot 已提交
59
class RowRecord;
G
groot 已提交
60

G
groot 已提交
61
class QueryResult;
G
groot 已提交
62

G
groot 已提交
63
class TopKQueryResult;
G
groot 已提交
64

G
groot 已提交
65 66
typedef struct _Exception__isset {
  _Exception__isset() : code(false), reason(false) {}
G
groot 已提交
67 68
  bool code :1;
  bool reason :1;
G
groot 已提交
69
} _Exception__isset;
G
groot 已提交
70

G
groot 已提交
71
class Exception : public ::apache::thrift::TException {
G
groot 已提交
72 73
 public:

G
groot 已提交
74 75 76
  Exception(const Exception&);
  Exception& operator=(const Exception&);
  Exception() : code((ErrorCode::type)0), reason() {
G
groot 已提交
77 78
  }

G
groot 已提交
79 80
  virtual ~Exception() throw();
  ErrorCode::type code;
G
groot 已提交
81 82
  std::string reason;

G
groot 已提交
83
  _Exception__isset __isset;
G
groot 已提交
84

G
groot 已提交
85
  void __set_code(const ErrorCode::type val);
G
groot 已提交
86 87 88

  void __set_reason(const std::string& val);

G
groot 已提交
89
  bool operator == (const Exception & rhs) const
G
groot 已提交
90 91 92 93 94 95 96
  {
    if (!(code == rhs.code))
      return false;
    if (!(reason == rhs.reason))
      return false;
    return true;
  }
G
groot 已提交
97
  bool operator != (const Exception &rhs) const {
G
groot 已提交
98 99 100
    return !(*this == rhs);
  }

G
groot 已提交
101
  bool operator < (const Exception & ) const;
G
groot 已提交
102 103 104 105 106 107 108 109 110

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
  mutable std::string thriftTExceptionMessageHolder_;
  const char* what() const throw();
};

G
groot 已提交
111
void swap(Exception &a, Exception &b);
G
groot 已提交
112

G
groot 已提交
113
std::ostream& operator<<(std::ostream& out, const Exception& obj);
G
groot 已提交
114

G
groot 已提交
115
typedef struct _TableSchema__isset {
G
groot 已提交
116 117 118 119
  _TableSchema__isset() : index_type(true), dimension(true), store_raw_vector(true) {}
  bool index_type :1;
  bool dimension :1;
  bool store_raw_vector :1;
G
groot 已提交
120
} _TableSchema__isset;
G
groot 已提交
121

G
groot 已提交
122
class TableSchema : public virtual ::apache::thrift::TBase {
G
groot 已提交
123 124
 public:

G
groot 已提交
125 126
  TableSchema(const TableSchema&);
  TableSchema& operator=(const TableSchema&);
G
groot 已提交
127
  TableSchema() : table_name(), index_type(0), dimension(0LL), store_raw_vector(false) {
G
groot 已提交
128 129
  }

G
groot 已提交
130 131
  virtual ~TableSchema() throw();
  std::string table_name;
G
groot 已提交
132 133 134
  int32_t index_type;
  int64_t dimension;
  bool store_raw_vector;
G
groot 已提交
135

G
groot 已提交
136
  _TableSchema__isset __isset;
G
groot 已提交
137

G
groot 已提交
138
  void __set_table_name(const std::string& val);
G
groot 已提交
139

G
groot 已提交
140
  void __set_index_type(const int32_t val);
G
groot 已提交
141

G
groot 已提交
142
  void __set_dimension(const int64_t val);
G
groot 已提交
143

G
groot 已提交
144
  void __set_store_raw_vector(const bool val);
G
groot 已提交
145

G
groot 已提交
146
  bool operator == (const TableSchema & rhs) const
G
groot 已提交
147
  {
G
groot 已提交
148
    if (!(table_name == rhs.table_name))
G
groot 已提交
149
      return false;
G
groot 已提交
150
    if (!(index_type == rhs.index_type))
G
groot 已提交
151
      return false;
G
groot 已提交
152
    if (!(dimension == rhs.dimension))
G
groot 已提交
153
      return false;
G
groot 已提交
154
    if (!(store_raw_vector == rhs.store_raw_vector))
G
groot 已提交
155
      return false;
G
groot 已提交
156 157
    return true;
  }
G
groot 已提交
158
  bool operator != (const TableSchema &rhs) const {
G
groot 已提交
159 160 161
    return !(*this == rhs);
  }

G
groot 已提交
162
  bool operator < (const TableSchema & ) const;
G
groot 已提交
163 164 165 166 167 168 169

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
};

G
groot 已提交
170
void swap(TableSchema &a, TableSchema &b);
G
groot 已提交
171

G
groot 已提交
172
std::ostream& operator<<(std::ostream& out, const TableSchema& obj);
G
groot 已提交
173

G
groot 已提交
174 175 176 177 178
typedef struct _Range__isset {
  _Range__isset() : start_value(false), end_value(false) {}
  bool start_value :1;
  bool end_value :1;
} _Range__isset;
G
groot 已提交
179

G
groot 已提交
180
class Range : public virtual ::apache::thrift::TBase {
G
groot 已提交
181 182
 public:

G
groot 已提交
183 184 185
  Range(const Range&);
  Range& operator=(const Range&);
  Range() : start_value(), end_value() {
G
groot 已提交
186 187
  }

G
groot 已提交
188 189 190 191
  virtual ~Range() throw();
  std::string start_value;
  std::string end_value;

G
groot 已提交
192 193
  _Range__isset __isset;

G
groot 已提交
194
  void __set_start_value(const std::string& val);
G
groot 已提交
195

G
groot 已提交
196
  void __set_end_value(const std::string& val);
G
groot 已提交
197

G
groot 已提交
198
  bool operator == (const Range & rhs) const
G
groot 已提交
199
  {
G
groot 已提交
200 201 202
    if (!(start_value == rhs.start_value))
      return false;
    if (!(end_value == rhs.end_value))
G
groot 已提交
203 204 205
      return false;
    return true;
  }
G
groot 已提交
206
  bool operator != (const Range &rhs) const {
G
groot 已提交
207 208 209
    return !(*this == rhs);
  }

G
groot 已提交
210
  bool operator < (const Range & ) const;
G
groot 已提交
211 212 213 214 215 216 217

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
};

G
groot 已提交
218
void swap(Range &a, Range &b);
G
groot 已提交
219

G
groot 已提交
220
std::ostream& operator<<(std::ostream& out, const Range& obj);
G
groot 已提交
221

G
groot 已提交
222

G
groot 已提交
223
class RowRecord : public virtual ::apache::thrift::TBase {
G
groot 已提交
224 225
 public:

G
groot 已提交
226 227
  RowRecord(const RowRecord&);
  RowRecord& operator=(const RowRecord&);
G
groot 已提交
228
  RowRecord() : vector_data() {
G
groot 已提交
229 230
  }

G
groot 已提交
231
  virtual ~RowRecord() throw();
G
groot 已提交
232
  std::string vector_data;
G
groot 已提交
233

G
groot 已提交
234
  void __set_vector_data(const std::string& val);
G
groot 已提交
235

G
groot 已提交
236
  bool operator == (const RowRecord & rhs) const
G
groot 已提交
237
  {
G
groot 已提交
238
    if (!(vector_data == rhs.vector_data))
G
groot 已提交
239 240 241
      return false;
    return true;
  }
G
groot 已提交
242
  bool operator != (const RowRecord &rhs) const {
G
groot 已提交
243 244 245
    return !(*this == rhs);
  }

G
groot 已提交
246
  bool operator < (const RowRecord & ) const;
G
groot 已提交
247 248 249 250 251 252 253

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
};

G
groot 已提交
254
void swap(RowRecord &a, RowRecord &b);
G
groot 已提交
255

G
groot 已提交
256
std::ostream& operator<<(std::ostream& out, const RowRecord& obj);
G
groot 已提交
257

G
groot 已提交
258
typedef struct _QueryResult__isset {
G
groot 已提交
259
  _QueryResult__isset() : id(false), score(false) {}
G
groot 已提交
260 261 262
  bool id :1;
  bool score :1;
} _QueryResult__isset;
G
groot 已提交
263

G
groot 已提交
264
class QueryResult : public virtual ::apache::thrift::TBase {
G
groot 已提交
265 266
 public:

G
groot 已提交
267 268 269
  QueryResult(const QueryResult&);
  QueryResult& operator=(const QueryResult&);
  QueryResult() : id(0), score(0) {
G
groot 已提交
270 271
  }

G
groot 已提交
272 273 274
  virtual ~QueryResult() throw();
  int64_t id;
  double score;
G
groot 已提交
275

G
groot 已提交
276
  _QueryResult__isset __isset;
G
groot 已提交
277

G
groot 已提交
278
  void __set_id(const int64_t val);
G
groot 已提交
279

G
groot 已提交
280
  void __set_score(const double val);
G
groot 已提交
281

G
groot 已提交
282
  bool operator == (const QueryResult & rhs) const
G
groot 已提交
283
  {
G
groot 已提交
284
    if (!(id == rhs.id))
G
groot 已提交
285
      return false;
G
groot 已提交
286
    if (!(score == rhs.score))
G
groot 已提交
287 288 289
      return false;
    return true;
  }
G
groot 已提交
290
  bool operator != (const QueryResult &rhs) const {
G
groot 已提交
291 292 293
    return !(*this == rhs);
  }

G
groot 已提交
294
  bool operator < (const QueryResult & ) const;
G
groot 已提交
295 296 297 298 299 300 301

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
};

G
groot 已提交
302
void swap(QueryResult &a, QueryResult &b);
G
groot 已提交
303

G
groot 已提交
304
std::ostream& operator<<(std::ostream& out, const QueryResult& obj);
G
groot 已提交
305

G
groot 已提交
306 307 308 309
typedef struct _TopKQueryResult__isset {
  _TopKQueryResult__isset() : query_result_arrays(false) {}
  bool query_result_arrays :1;
} _TopKQueryResult__isset;
G
groot 已提交
310

G
groot 已提交
311
class TopKQueryResult : public virtual ::apache::thrift::TBase {
G
groot 已提交
312 313
 public:

G
groot 已提交
314 315 316
  TopKQueryResult(const TopKQueryResult&);
  TopKQueryResult& operator=(const TopKQueryResult&);
  TopKQueryResult() {
G
groot 已提交
317 318
  }

G
groot 已提交
319 320
  virtual ~TopKQueryResult() throw();
  std::vector<QueryResult>  query_result_arrays;
G
groot 已提交
321

G
groot 已提交
322
  _TopKQueryResult__isset __isset;
G
groot 已提交
323

G
groot 已提交
324
  void __set_query_result_arrays(const std::vector<QueryResult> & val);
G
groot 已提交
325

G
groot 已提交
326
  bool operator == (const TopKQueryResult & rhs) const
G
groot 已提交
327
  {
G
groot 已提交
328
    if (!(query_result_arrays == rhs.query_result_arrays))
G
groot 已提交
329
      return false;
G
groot 已提交
330 331
    return true;
  }
G
groot 已提交
332
  bool operator != (const TopKQueryResult &rhs) const {
G
groot 已提交
333 334 335
    return !(*this == rhs);
  }

G
groot 已提交
336
  bool operator < (const TopKQueryResult & ) const;
G
groot 已提交
337 338 339 340 341 342 343

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

  virtual void printTo(std::ostream& out) const;
};

G
groot 已提交
344
void swap(TopKQueryResult &a, TopKQueryResult &b);
G
groot 已提交
345

G
groot 已提交
346
std::ostream& operator<<(std::ostream& out, const TopKQueryResult& obj);
G
groot 已提交
347

G
groot 已提交
348
}} // namespace
G
groot 已提交
349 350

#endif