mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-03 09:22:30 +08:00
add new api for batch binary search
Former-commit-id: 3729408c50d0ab9a482e3ddea8e1672188a9acd8
This commit is contained in:
parent
167ae9c22c
commit
13d7ebb5cf
@ -96,4 +96,6 @@ service VecService {
|
||||
*/
|
||||
VecSearchResult search_vector(2: string group_id, 3: i64 top_k, 4: VecTensor tensor, 5: VecTimeRangeList time_range_list) throws(1: VecException e);
|
||||
VecSearchResultList search_vector_batch(2: string group_id, 3: i64 top_k, 4: VecTensorList tensor_list, 5: VecTimeRangeList time_range_list) throws(1: VecException e);
|
||||
VecSearchResult search_binary_vector(2: string group_id, 3: i64 top_k, 4: VecBinaryTensor tensor, 5: VecTimeRangeList time_range_list) throws(1: VecException e);
|
||||
VecSearchResultList search_binary_vector_batch(2: string group_id, 3: i64 top_k, 4: VecBinaryTensorList tensor_list, 5: VecTimeRangeList time_range_list) throws(1: VecException e);
|
||||
}
|
||||
@ -1911,6 +1911,516 @@ uint32_t VecService_search_vector_batch_presult::read(::apache::thrift::protocol
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_args::~VecService_search_binary_vector_args() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_args::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 2:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRING) {
|
||||
xfer += iprot->readString(this->group_id);
|
||||
this->__isset.group_id = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (ftype == ::apache::thrift::protocol::T_I64) {
|
||||
xfer += iprot->readI64(this->top_k);
|
||||
this->__isset.top_k = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->tensor.read(iprot);
|
||||
this->__isset.tensor = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->time_range_list.read(iprot);
|
||||
this->__isset.time_range_list = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
uint32_t VecService_search_binary_vector_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
uint32_t xfer = 0;
|
||||
::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_args");
|
||||
|
||||
xfer += oprot->writeFieldBegin("group_id", ::apache::thrift::protocol::T_STRING, 2);
|
||||
xfer += oprot->writeString(this->group_id);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("top_k", ::apache::thrift::protocol::T_I64, 3);
|
||||
xfer += oprot->writeI64(this->top_k);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("tensor", ::apache::thrift::protocol::T_STRUCT, 4);
|
||||
xfer += this->tensor.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("time_range_list", ::apache::thrift::protocol::T_STRUCT, 5);
|
||||
xfer += this->time_range_list.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_pargs::~VecService_search_binary_vector_pargs() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
uint32_t xfer = 0;
|
||||
::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_pargs");
|
||||
|
||||
xfer += oprot->writeFieldBegin("group_id", ::apache::thrift::protocol::T_STRING, 2);
|
||||
xfer += oprot->writeString((*(this->group_id)));
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("top_k", ::apache::thrift::protocol::T_I64, 3);
|
||||
xfer += oprot->writeI64((*(this->top_k)));
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("tensor", ::apache::thrift::protocol::T_STRUCT, 4);
|
||||
xfer += (*(this->tensor)).write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("time_range_list", ::apache::thrift::protocol::T_STRUCT, 5);
|
||||
xfer += (*(this->time_range_list)).write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_result::~VecService_search_binary_vector_result() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_result::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 0:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->success.read(iprot);
|
||||
this->__isset.success = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->e.read(iprot);
|
||||
this->__isset.e = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
uint32_t VecService_search_binary_vector_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
|
||||
uint32_t xfer = 0;
|
||||
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_result");
|
||||
|
||||
if (this->__isset.success) {
|
||||
xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
|
||||
xfer += this->success.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
} else if (this->__isset.e) {
|
||||
xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
|
||||
xfer += this->e.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
}
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_presult::~VecService_search_binary_vector_presult() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 0:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += (*(this->success)).read(iprot);
|
||||
this->__isset.success = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->e.read(iprot);
|
||||
this->__isset.e = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_batch_args::~VecService_search_binary_vector_batch_args() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_args::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 2:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRING) {
|
||||
xfer += iprot->readString(this->group_id);
|
||||
this->__isset.group_id = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (ftype == ::apache::thrift::protocol::T_I64) {
|
||||
xfer += iprot->readI64(this->top_k);
|
||||
this->__isset.top_k = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->tensor_list.read(iprot);
|
||||
this->__isset.tensor_list = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->time_range_list.read(iprot);
|
||||
this->__isset.time_range_list = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
uint32_t xfer = 0;
|
||||
::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_batch_args");
|
||||
|
||||
xfer += oprot->writeFieldBegin("group_id", ::apache::thrift::protocol::T_STRING, 2);
|
||||
xfer += oprot->writeString(this->group_id);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("top_k", ::apache::thrift::protocol::T_I64, 3);
|
||||
xfer += oprot->writeI64(this->top_k);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("tensor_list", ::apache::thrift::protocol::T_STRUCT, 4);
|
||||
xfer += this->tensor_list.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("time_range_list", ::apache::thrift::protocol::T_STRUCT, 5);
|
||||
xfer += this->time_range_list.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_batch_pargs::~VecService_search_binary_vector_batch_pargs() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
uint32_t xfer = 0;
|
||||
::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_batch_pargs");
|
||||
|
||||
xfer += oprot->writeFieldBegin("group_id", ::apache::thrift::protocol::T_STRING, 2);
|
||||
xfer += oprot->writeString((*(this->group_id)));
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("top_k", ::apache::thrift::protocol::T_I64, 3);
|
||||
xfer += oprot->writeI64((*(this->top_k)));
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("tensor_list", ::apache::thrift::protocol::T_STRUCT, 4);
|
||||
xfer += (*(this->tensor_list)).write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldBegin("time_range_list", ::apache::thrift::protocol::T_STRUCT, 5);
|
||||
xfer += (*(this->time_range_list)).write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_batch_result::~VecService_search_binary_vector_batch_result() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_result::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 0:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->success.read(iprot);
|
||||
this->__isset.success = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->e.read(iprot);
|
||||
this->__isset.e = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
|
||||
|
||||
uint32_t xfer = 0;
|
||||
|
||||
xfer += oprot->writeStructBegin("VecService_search_binary_vector_batch_result");
|
||||
|
||||
if (this->__isset.success) {
|
||||
xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
|
||||
xfer += this->success.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
} else if (this->__isset.e) {
|
||||
xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
|
||||
xfer += this->e.write(oprot);
|
||||
xfer += oprot->writeFieldEnd();
|
||||
}
|
||||
xfer += oprot->writeFieldStop();
|
||||
xfer += oprot->writeStructEnd();
|
||||
return xfer;
|
||||
}
|
||||
|
||||
|
||||
VecService_search_binary_vector_batch_presult::~VecService_search_binary_vector_batch_presult() throw() {
|
||||
}
|
||||
|
||||
|
||||
uint32_t VecService_search_binary_vector_batch_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
|
||||
|
||||
::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
|
||||
uint32_t xfer = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TType ftype;
|
||||
int16_t fid;
|
||||
|
||||
xfer += iprot->readStructBegin(fname);
|
||||
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
|
||||
|
||||
while (true)
|
||||
{
|
||||
xfer += iprot->readFieldBegin(fname, ftype, fid);
|
||||
if (ftype == ::apache::thrift::protocol::T_STOP) {
|
||||
break;
|
||||
}
|
||||
switch (fid)
|
||||
{
|
||||
case 0:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += (*(this->success)).read(iprot);
|
||||
this->__isset.success = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
|
||||
xfer += this->e.read(iprot);
|
||||
this->__isset.e = true;
|
||||
} else {
|
||||
xfer += iprot->skip(ftype);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xfer += iprot->skip(ftype);
|
||||
break;
|
||||
}
|
||||
xfer += iprot->readFieldEnd();
|
||||
}
|
||||
|
||||
xfer += iprot->readStructEnd();
|
||||
|
||||
return xfer;
|
||||
}
|
||||
|
||||
void VecServiceClient::add_group(const VecGroup& group)
|
||||
{
|
||||
send_add_group(group);
|
||||
@ -2440,6 +2950,134 @@ void VecServiceClient::recv_search_vector_batch(VecSearchResultList& _return)
|
||||
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "search_vector_batch failed: unknown result");
|
||||
}
|
||||
|
||||
void VecServiceClient::search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
send_search_binary_vector(group_id, top_k, tensor, time_range_list);
|
||||
recv_search_binary_vector(_return);
|
||||
}
|
||||
|
||||
void VecServiceClient::send_search_binary_vector(const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t cseqid = 0;
|
||||
oprot_->writeMessageBegin("search_binary_vector", ::apache::thrift::protocol::T_CALL, cseqid);
|
||||
|
||||
VecService_search_binary_vector_pargs args;
|
||||
args.group_id = &group_id;
|
||||
args.top_k = &top_k;
|
||||
args.tensor = &tensor;
|
||||
args.time_range_list = &time_range_list;
|
||||
args.write(oprot_);
|
||||
|
||||
oprot_->writeMessageEnd();
|
||||
oprot_->getTransport()->writeEnd();
|
||||
oprot_->getTransport()->flush();
|
||||
}
|
||||
|
||||
void VecServiceClient::recv_search_binary_vector(VecSearchResult& _return)
|
||||
{
|
||||
|
||||
int32_t rseqid = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TMessageType mtype;
|
||||
|
||||
iprot_->readMessageBegin(fname, mtype, rseqid);
|
||||
if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
|
||||
::apache::thrift::TApplicationException x;
|
||||
x.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
throw x;
|
||||
}
|
||||
if (mtype != ::apache::thrift::protocol::T_REPLY) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
if (fname.compare("search_binary_vector") != 0) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
VecService_search_binary_vector_presult result;
|
||||
result.success = &_return;
|
||||
result.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
if (result.__isset.success) {
|
||||
// _return pointer has now been filled
|
||||
return;
|
||||
}
|
||||
if (result.__isset.e) {
|
||||
throw result.e;
|
||||
}
|
||||
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "search_binary_vector failed: unknown result");
|
||||
}
|
||||
|
||||
void VecServiceClient::search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
send_search_binary_vector_batch(group_id, top_k, tensor_list, time_range_list);
|
||||
recv_search_binary_vector_batch(_return);
|
||||
}
|
||||
|
||||
void VecServiceClient::send_search_binary_vector_batch(const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t cseqid = 0;
|
||||
oprot_->writeMessageBegin("search_binary_vector_batch", ::apache::thrift::protocol::T_CALL, cseqid);
|
||||
|
||||
VecService_search_binary_vector_batch_pargs args;
|
||||
args.group_id = &group_id;
|
||||
args.top_k = &top_k;
|
||||
args.tensor_list = &tensor_list;
|
||||
args.time_range_list = &time_range_list;
|
||||
args.write(oprot_);
|
||||
|
||||
oprot_->writeMessageEnd();
|
||||
oprot_->getTransport()->writeEnd();
|
||||
oprot_->getTransport()->flush();
|
||||
}
|
||||
|
||||
void VecServiceClient::recv_search_binary_vector_batch(VecSearchResultList& _return)
|
||||
{
|
||||
|
||||
int32_t rseqid = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TMessageType mtype;
|
||||
|
||||
iprot_->readMessageBegin(fname, mtype, rseqid);
|
||||
if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
|
||||
::apache::thrift::TApplicationException x;
|
||||
x.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
throw x;
|
||||
}
|
||||
if (mtype != ::apache::thrift::protocol::T_REPLY) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
if (fname.compare("search_binary_vector_batch") != 0) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
VecService_search_binary_vector_batch_presult result;
|
||||
result.success = &_return;
|
||||
result.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
if (result.__isset.success) {
|
||||
// _return pointer has now been filled
|
||||
return;
|
||||
}
|
||||
if (result.__isset.e) {
|
||||
throw result.e;
|
||||
}
|
||||
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "search_binary_vector_batch failed: unknown result");
|
||||
}
|
||||
|
||||
bool VecServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
|
||||
ProcessMap::iterator pfn;
|
||||
pfn = processMap_.find(fname);
|
||||
@ -2966,6 +3604,120 @@ void VecServiceProcessor::process_search_vector_batch(int32_t seqid, ::apache::t
|
||||
}
|
||||
}
|
||||
|
||||
void VecServiceProcessor::process_search_binary_vector(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
|
||||
{
|
||||
void* ctx = NULL;
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
ctx = this->eventHandler_->getContext("VecService.search_binary_vector", callContext);
|
||||
}
|
||||
::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "VecService.search_binary_vector");
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->preRead(ctx, "VecService.search_binary_vector");
|
||||
}
|
||||
|
||||
VecService_search_binary_vector_args args;
|
||||
args.read(iprot);
|
||||
iprot->readMessageEnd();
|
||||
uint32_t bytes = iprot->getTransport()->readEnd();
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->postRead(ctx, "VecService.search_binary_vector", bytes);
|
||||
}
|
||||
|
||||
VecService_search_binary_vector_result result;
|
||||
try {
|
||||
iface_->search_binary_vector(result.success, args.group_id, args.top_k, args.tensor, args.time_range_list);
|
||||
result.__isset.success = true;
|
||||
} catch (VecException &e) {
|
||||
result.e = e;
|
||||
result.__isset.e = true;
|
||||
} catch (const std::exception& e) {
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->handlerError(ctx, "VecService.search_binary_vector");
|
||||
}
|
||||
|
||||
::apache::thrift::TApplicationException x(e.what());
|
||||
oprot->writeMessageBegin("search_binary_vector", ::apache::thrift::protocol::T_EXCEPTION, seqid);
|
||||
x.write(oprot);
|
||||
oprot->writeMessageEnd();
|
||||
oprot->getTransport()->writeEnd();
|
||||
oprot->getTransport()->flush();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->preWrite(ctx, "VecService.search_binary_vector");
|
||||
}
|
||||
|
||||
oprot->writeMessageBegin("search_binary_vector", ::apache::thrift::protocol::T_REPLY, seqid);
|
||||
result.write(oprot);
|
||||
oprot->writeMessageEnd();
|
||||
bytes = oprot->getTransport()->writeEnd();
|
||||
oprot->getTransport()->flush();
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->postWrite(ctx, "VecService.search_binary_vector", bytes);
|
||||
}
|
||||
}
|
||||
|
||||
void VecServiceProcessor::process_search_binary_vector_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
|
||||
{
|
||||
void* ctx = NULL;
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
ctx = this->eventHandler_->getContext("VecService.search_binary_vector_batch", callContext);
|
||||
}
|
||||
::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "VecService.search_binary_vector_batch");
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->preRead(ctx, "VecService.search_binary_vector_batch");
|
||||
}
|
||||
|
||||
VecService_search_binary_vector_batch_args args;
|
||||
args.read(iprot);
|
||||
iprot->readMessageEnd();
|
||||
uint32_t bytes = iprot->getTransport()->readEnd();
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->postRead(ctx, "VecService.search_binary_vector_batch", bytes);
|
||||
}
|
||||
|
||||
VecService_search_binary_vector_batch_result result;
|
||||
try {
|
||||
iface_->search_binary_vector_batch(result.success, args.group_id, args.top_k, args.tensor_list, args.time_range_list);
|
||||
result.__isset.success = true;
|
||||
} catch (VecException &e) {
|
||||
result.e = e;
|
||||
result.__isset.e = true;
|
||||
} catch (const std::exception& e) {
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->handlerError(ctx, "VecService.search_binary_vector_batch");
|
||||
}
|
||||
|
||||
::apache::thrift::TApplicationException x(e.what());
|
||||
oprot->writeMessageBegin("search_binary_vector_batch", ::apache::thrift::protocol::T_EXCEPTION, seqid);
|
||||
x.write(oprot);
|
||||
oprot->writeMessageEnd();
|
||||
oprot->getTransport()->writeEnd();
|
||||
oprot->getTransport()->flush();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->preWrite(ctx, "VecService.search_binary_vector_batch");
|
||||
}
|
||||
|
||||
oprot->writeMessageBegin("search_binary_vector_batch", ::apache::thrift::protocol::T_REPLY, seqid);
|
||||
result.write(oprot);
|
||||
oprot->writeMessageEnd();
|
||||
bytes = oprot->getTransport()->writeEnd();
|
||||
oprot->getTransport()->flush();
|
||||
|
||||
if (this->eventHandler_.get() != NULL) {
|
||||
this->eventHandler_->postWrite(ctx, "VecService.search_binary_vector_batch", bytes);
|
||||
}
|
||||
}
|
||||
|
||||
::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > VecServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
|
||||
::apache::thrift::ReleaseHandler< VecServiceIfFactory > cleanup(handlerFactory_);
|
||||
::apache::thrift::stdcxx::shared_ptr< VecServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
|
||||
@ -3739,5 +4491,187 @@ void VecServiceConcurrentClient::recv_search_vector_batch(VecSearchResultList& _
|
||||
} // end while(true)
|
||||
}
|
||||
|
||||
void VecServiceConcurrentClient::search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t seqid = send_search_binary_vector(group_id, top_k, tensor, time_range_list);
|
||||
recv_search_binary_vector(_return, seqid);
|
||||
}
|
||||
|
||||
int32_t VecServiceConcurrentClient::send_search_binary_vector(const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t cseqid = this->sync_.generateSeqId();
|
||||
::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
|
||||
oprot_->writeMessageBegin("search_binary_vector", ::apache::thrift::protocol::T_CALL, cseqid);
|
||||
|
||||
VecService_search_binary_vector_pargs args;
|
||||
args.group_id = &group_id;
|
||||
args.top_k = &top_k;
|
||||
args.tensor = &tensor;
|
||||
args.time_range_list = &time_range_list;
|
||||
args.write(oprot_);
|
||||
|
||||
oprot_->writeMessageEnd();
|
||||
oprot_->getTransport()->writeEnd();
|
||||
oprot_->getTransport()->flush();
|
||||
|
||||
sentry.commit();
|
||||
return cseqid;
|
||||
}
|
||||
|
||||
void VecServiceConcurrentClient::recv_search_binary_vector(VecSearchResult& _return, const int32_t seqid)
|
||||
{
|
||||
|
||||
int32_t rseqid = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TMessageType mtype;
|
||||
|
||||
// the read mutex gets dropped and reacquired as part of waitForWork()
|
||||
// The destructor of this sentry wakes up other clients
|
||||
::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid);
|
||||
|
||||
while(true) {
|
||||
if(!this->sync_.getPending(fname, mtype, rseqid)) {
|
||||
iprot_->readMessageBegin(fname, mtype, rseqid);
|
||||
}
|
||||
if(seqid == rseqid) {
|
||||
if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
|
||||
::apache::thrift::TApplicationException x;
|
||||
x.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
sentry.commit();
|
||||
throw x;
|
||||
}
|
||||
if (mtype != ::apache::thrift::protocol::T_REPLY) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
if (fname.compare("search_binary_vector") != 0) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
// in a bad state, don't commit
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
throw TProtocolException(TProtocolException::INVALID_DATA);
|
||||
}
|
||||
VecService_search_binary_vector_presult result;
|
||||
result.success = &_return;
|
||||
result.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
if (result.__isset.success) {
|
||||
// _return pointer has now been filled
|
||||
sentry.commit();
|
||||
return;
|
||||
}
|
||||
if (result.__isset.e) {
|
||||
sentry.commit();
|
||||
throw result.e;
|
||||
}
|
||||
// in a bad state, don't commit
|
||||
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "search_binary_vector failed: unknown result");
|
||||
}
|
||||
// seqid != rseqid
|
||||
this->sync_.updatePending(fname, mtype, rseqid);
|
||||
|
||||
// this will temporarily unlock the readMutex, and let other clients get work done
|
||||
this->sync_.waitForWork(seqid);
|
||||
} // end while(true)
|
||||
}
|
||||
|
||||
void VecServiceConcurrentClient::search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t seqid = send_search_binary_vector_batch(group_id, top_k, tensor_list, time_range_list);
|
||||
recv_search_binary_vector_batch(_return, seqid);
|
||||
}
|
||||
|
||||
int32_t VecServiceConcurrentClient::send_search_binary_vector_batch(const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list)
|
||||
{
|
||||
int32_t cseqid = this->sync_.generateSeqId();
|
||||
::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
|
||||
oprot_->writeMessageBegin("search_binary_vector_batch", ::apache::thrift::protocol::T_CALL, cseqid);
|
||||
|
||||
VecService_search_binary_vector_batch_pargs args;
|
||||
args.group_id = &group_id;
|
||||
args.top_k = &top_k;
|
||||
args.tensor_list = &tensor_list;
|
||||
args.time_range_list = &time_range_list;
|
||||
args.write(oprot_);
|
||||
|
||||
oprot_->writeMessageEnd();
|
||||
oprot_->getTransport()->writeEnd();
|
||||
oprot_->getTransport()->flush();
|
||||
|
||||
sentry.commit();
|
||||
return cseqid;
|
||||
}
|
||||
|
||||
void VecServiceConcurrentClient::recv_search_binary_vector_batch(VecSearchResultList& _return, const int32_t seqid)
|
||||
{
|
||||
|
||||
int32_t rseqid = 0;
|
||||
std::string fname;
|
||||
::apache::thrift::protocol::TMessageType mtype;
|
||||
|
||||
// the read mutex gets dropped and reacquired as part of waitForWork()
|
||||
// The destructor of this sentry wakes up other clients
|
||||
::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid);
|
||||
|
||||
while(true) {
|
||||
if(!this->sync_.getPending(fname, mtype, rseqid)) {
|
||||
iprot_->readMessageBegin(fname, mtype, rseqid);
|
||||
}
|
||||
if(seqid == rseqid) {
|
||||
if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
|
||||
::apache::thrift::TApplicationException x;
|
||||
x.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
sentry.commit();
|
||||
throw x;
|
||||
}
|
||||
if (mtype != ::apache::thrift::protocol::T_REPLY) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
}
|
||||
if (fname.compare("search_binary_vector_batch") != 0) {
|
||||
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
// in a bad state, don't commit
|
||||
using ::apache::thrift::protocol::TProtocolException;
|
||||
throw TProtocolException(TProtocolException::INVALID_DATA);
|
||||
}
|
||||
VecService_search_binary_vector_batch_presult result;
|
||||
result.success = &_return;
|
||||
result.read(iprot_);
|
||||
iprot_->readMessageEnd();
|
||||
iprot_->getTransport()->readEnd();
|
||||
|
||||
if (result.__isset.success) {
|
||||
// _return pointer has now been filled
|
||||
sentry.commit();
|
||||
return;
|
||||
}
|
||||
if (result.__isset.e) {
|
||||
sentry.commit();
|
||||
throw result.e;
|
||||
}
|
||||
// in a bad state, don't commit
|
||||
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "search_binary_vector_batch failed: unknown result");
|
||||
}
|
||||
// seqid != rseqid
|
||||
this->sync_.updatePending(fname, mtype, rseqid);
|
||||
|
||||
// this will temporarily unlock the readMutex, and let other clients get work done
|
||||
this->sync_.waitForWork(seqid);
|
||||
} // end while(true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ class VecServiceIf {
|
||||
*/
|
||||
virtual void search_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecTensor& tensor, const VecTimeRangeList& time_range_list) = 0;
|
||||
virtual void search_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecTensorList& tensor_list, const VecTimeRangeList& time_range_list) = 0;
|
||||
virtual void search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list) = 0;
|
||||
virtual void search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list) = 0;
|
||||
};
|
||||
|
||||
class VecServiceIfFactory {
|
||||
@ -110,6 +112,12 @@ class VecServiceNull : virtual public VecServiceIf {
|
||||
void search_vector_batch(VecSearchResultList& /* _return */, const std::string& /* group_id */, const int64_t /* top_k */, const VecTensorList& /* tensor_list */, const VecTimeRangeList& /* time_range_list */) {
|
||||
return;
|
||||
}
|
||||
void search_binary_vector(VecSearchResult& /* _return */, const std::string& /* group_id */, const int64_t /* top_k */, const VecBinaryTensor& /* tensor */, const VecTimeRangeList& /* time_range_list */) {
|
||||
return;
|
||||
}
|
||||
void search_binary_vector_batch(VecSearchResultList& /* _return */, const std::string& /* group_id */, const int64_t /* top_k */, const VecBinaryTensorList& /* tensor_list */, const VecTimeRangeList& /* time_range_list */) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
typedef struct _VecService_add_group_args__isset {
|
||||
@ -1142,6 +1150,272 @@ class VecService_search_vector_batch_presult {
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_args__isset {
|
||||
_VecService_search_binary_vector_args__isset() : group_id(false), top_k(false), tensor(false), time_range_list(false) {}
|
||||
bool group_id :1;
|
||||
bool top_k :1;
|
||||
bool tensor :1;
|
||||
bool time_range_list :1;
|
||||
} _VecService_search_binary_vector_args__isset;
|
||||
|
||||
class VecService_search_binary_vector_args {
|
||||
public:
|
||||
|
||||
VecService_search_binary_vector_args(const VecService_search_binary_vector_args&);
|
||||
VecService_search_binary_vector_args& operator=(const VecService_search_binary_vector_args&);
|
||||
VecService_search_binary_vector_args() : group_id(), top_k(0) {
|
||||
}
|
||||
|
||||
virtual ~VecService_search_binary_vector_args() throw();
|
||||
std::string group_id;
|
||||
int64_t top_k;
|
||||
VecBinaryTensor tensor;
|
||||
VecTimeRangeList time_range_list;
|
||||
|
||||
_VecService_search_binary_vector_args__isset __isset;
|
||||
|
||||
void __set_group_id(const std::string& val);
|
||||
|
||||
void __set_top_k(const int64_t val);
|
||||
|
||||
void __set_tensor(const VecBinaryTensor& val);
|
||||
|
||||
void __set_time_range_list(const VecTimeRangeList& val);
|
||||
|
||||
bool operator == (const VecService_search_binary_vector_args & rhs) const
|
||||
{
|
||||
if (!(group_id == rhs.group_id))
|
||||
return false;
|
||||
if (!(top_k == rhs.top_k))
|
||||
return false;
|
||||
if (!(tensor == rhs.tensor))
|
||||
return false;
|
||||
if (!(time_range_list == rhs.time_range_list))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator != (const VecService_search_binary_vector_args &rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < (const VecService_search_binary_vector_args & ) const;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class VecService_search_binary_vector_pargs {
|
||||
public:
|
||||
|
||||
|
||||
virtual ~VecService_search_binary_vector_pargs() throw();
|
||||
const std::string* group_id;
|
||||
const int64_t* top_k;
|
||||
const VecBinaryTensor* tensor;
|
||||
const VecTimeRangeList* time_range_list;
|
||||
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_result__isset {
|
||||
_VecService_search_binary_vector_result__isset() : success(false), e(false) {}
|
||||
bool success :1;
|
||||
bool e :1;
|
||||
} _VecService_search_binary_vector_result__isset;
|
||||
|
||||
class VecService_search_binary_vector_result {
|
||||
public:
|
||||
|
||||
VecService_search_binary_vector_result(const VecService_search_binary_vector_result&);
|
||||
VecService_search_binary_vector_result& operator=(const VecService_search_binary_vector_result&);
|
||||
VecService_search_binary_vector_result() {
|
||||
}
|
||||
|
||||
virtual ~VecService_search_binary_vector_result() throw();
|
||||
VecSearchResult success;
|
||||
VecException e;
|
||||
|
||||
_VecService_search_binary_vector_result__isset __isset;
|
||||
|
||||
void __set_success(const VecSearchResult& val);
|
||||
|
||||
void __set_e(const VecException& val);
|
||||
|
||||
bool operator == (const VecService_search_binary_vector_result & rhs) const
|
||||
{
|
||||
if (!(success == rhs.success))
|
||||
return false;
|
||||
if (!(e == rhs.e))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator != (const VecService_search_binary_vector_result &rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < (const VecService_search_binary_vector_result & ) const;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_presult__isset {
|
||||
_VecService_search_binary_vector_presult__isset() : success(false), e(false) {}
|
||||
bool success :1;
|
||||
bool e :1;
|
||||
} _VecService_search_binary_vector_presult__isset;
|
||||
|
||||
class VecService_search_binary_vector_presult {
|
||||
public:
|
||||
|
||||
|
||||
virtual ~VecService_search_binary_vector_presult() throw();
|
||||
VecSearchResult* success;
|
||||
VecException e;
|
||||
|
||||
_VecService_search_binary_vector_presult__isset __isset;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_batch_args__isset {
|
||||
_VecService_search_binary_vector_batch_args__isset() : group_id(false), top_k(false), tensor_list(false), time_range_list(false) {}
|
||||
bool group_id :1;
|
||||
bool top_k :1;
|
||||
bool tensor_list :1;
|
||||
bool time_range_list :1;
|
||||
} _VecService_search_binary_vector_batch_args__isset;
|
||||
|
||||
class VecService_search_binary_vector_batch_args {
|
||||
public:
|
||||
|
||||
VecService_search_binary_vector_batch_args(const VecService_search_binary_vector_batch_args&);
|
||||
VecService_search_binary_vector_batch_args& operator=(const VecService_search_binary_vector_batch_args&);
|
||||
VecService_search_binary_vector_batch_args() : group_id(), top_k(0) {
|
||||
}
|
||||
|
||||
virtual ~VecService_search_binary_vector_batch_args() throw();
|
||||
std::string group_id;
|
||||
int64_t top_k;
|
||||
VecBinaryTensorList tensor_list;
|
||||
VecTimeRangeList time_range_list;
|
||||
|
||||
_VecService_search_binary_vector_batch_args__isset __isset;
|
||||
|
||||
void __set_group_id(const std::string& val);
|
||||
|
||||
void __set_top_k(const int64_t val);
|
||||
|
||||
void __set_tensor_list(const VecBinaryTensorList& val);
|
||||
|
||||
void __set_time_range_list(const VecTimeRangeList& val);
|
||||
|
||||
bool operator == (const VecService_search_binary_vector_batch_args & rhs) const
|
||||
{
|
||||
if (!(group_id == rhs.group_id))
|
||||
return false;
|
||||
if (!(top_k == rhs.top_k))
|
||||
return false;
|
||||
if (!(tensor_list == rhs.tensor_list))
|
||||
return false;
|
||||
if (!(time_range_list == rhs.time_range_list))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator != (const VecService_search_binary_vector_batch_args &rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < (const VecService_search_binary_vector_batch_args & ) const;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class VecService_search_binary_vector_batch_pargs {
|
||||
public:
|
||||
|
||||
|
||||
virtual ~VecService_search_binary_vector_batch_pargs() throw();
|
||||
const std::string* group_id;
|
||||
const int64_t* top_k;
|
||||
const VecBinaryTensorList* tensor_list;
|
||||
const VecTimeRangeList* time_range_list;
|
||||
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_batch_result__isset {
|
||||
_VecService_search_binary_vector_batch_result__isset() : success(false), e(false) {}
|
||||
bool success :1;
|
||||
bool e :1;
|
||||
} _VecService_search_binary_vector_batch_result__isset;
|
||||
|
||||
class VecService_search_binary_vector_batch_result {
|
||||
public:
|
||||
|
||||
VecService_search_binary_vector_batch_result(const VecService_search_binary_vector_batch_result&);
|
||||
VecService_search_binary_vector_batch_result& operator=(const VecService_search_binary_vector_batch_result&);
|
||||
VecService_search_binary_vector_batch_result() {
|
||||
}
|
||||
|
||||
virtual ~VecService_search_binary_vector_batch_result() throw();
|
||||
VecSearchResultList success;
|
||||
VecException e;
|
||||
|
||||
_VecService_search_binary_vector_batch_result__isset __isset;
|
||||
|
||||
void __set_success(const VecSearchResultList& val);
|
||||
|
||||
void __set_e(const VecException& val);
|
||||
|
||||
bool operator == (const VecService_search_binary_vector_batch_result & rhs) const
|
||||
{
|
||||
if (!(success == rhs.success))
|
||||
return false;
|
||||
if (!(e == rhs.e))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator != (const VecService_search_binary_vector_batch_result &rhs) const {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < (const VecService_search_binary_vector_batch_result & ) const;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
|
||||
|
||||
};
|
||||
|
||||
typedef struct _VecService_search_binary_vector_batch_presult__isset {
|
||||
_VecService_search_binary_vector_batch_presult__isset() : success(false), e(false) {}
|
||||
bool success :1;
|
||||
bool e :1;
|
||||
} _VecService_search_binary_vector_batch_presult__isset;
|
||||
|
||||
class VecService_search_binary_vector_batch_presult {
|
||||
public:
|
||||
|
||||
|
||||
virtual ~VecService_search_binary_vector_batch_presult() throw();
|
||||
VecSearchResultList* success;
|
||||
VecException e;
|
||||
|
||||
_VecService_search_binary_vector_batch_presult__isset __isset;
|
||||
|
||||
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
|
||||
|
||||
};
|
||||
|
||||
class VecServiceClient : virtual public VecServiceIf {
|
||||
public:
|
||||
VecServiceClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
|
||||
@ -1194,6 +1468,12 @@ class VecServiceClient : virtual public VecServiceIf {
|
||||
void search_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void send_search_vector_batch(const std::string& group_id, const int64_t top_k, const VecTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_vector_batch(VecSearchResultList& _return);
|
||||
void search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list);
|
||||
void send_search_binary_vector(const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_binary_vector(VecSearchResult& _return);
|
||||
void search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void send_search_binary_vector_batch(const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_binary_vector_batch(VecSearchResultList& _return);
|
||||
protected:
|
||||
apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
|
||||
apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
|
||||
@ -1218,6 +1498,8 @@ class VecServiceProcessor : public ::apache::thrift::TDispatchProcessor {
|
||||
void process_add_binary_vector_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
|
||||
void process_search_vector(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
|
||||
void process_search_vector_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
|
||||
void process_search_binary_vector(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
|
||||
void process_search_binary_vector_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
|
||||
public:
|
||||
VecServiceProcessor(::apache::thrift::stdcxx::shared_ptr<VecServiceIf> iface) :
|
||||
iface_(iface) {
|
||||
@ -1230,6 +1512,8 @@ class VecServiceProcessor : public ::apache::thrift::TDispatchProcessor {
|
||||
processMap_["add_binary_vector_batch"] = &VecServiceProcessor::process_add_binary_vector_batch;
|
||||
processMap_["search_vector"] = &VecServiceProcessor::process_search_vector;
|
||||
processMap_["search_vector_batch"] = &VecServiceProcessor::process_search_vector_batch;
|
||||
processMap_["search_binary_vector"] = &VecServiceProcessor::process_search_binary_vector;
|
||||
processMap_["search_binary_vector_batch"] = &VecServiceProcessor::process_search_binary_vector_batch;
|
||||
}
|
||||
|
||||
virtual ~VecServiceProcessor() {}
|
||||
@ -1342,6 +1626,26 @@ class VecServiceMultiface : virtual public VecServiceIf {
|
||||
return;
|
||||
}
|
||||
|
||||
void search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list) {
|
||||
size_t sz = ifaces_.size();
|
||||
size_t i = 0;
|
||||
for (; i < (sz - 1); ++i) {
|
||||
ifaces_[i]->search_binary_vector(_return, group_id, top_k, tensor, time_range_list);
|
||||
}
|
||||
ifaces_[i]->search_binary_vector(_return, group_id, top_k, tensor, time_range_list);
|
||||
return;
|
||||
}
|
||||
|
||||
void search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list) {
|
||||
size_t sz = ifaces_.size();
|
||||
size_t i = 0;
|
||||
for (; i < (sz - 1); ++i) {
|
||||
ifaces_[i]->search_binary_vector_batch(_return, group_id, top_k, tensor_list, time_range_list);
|
||||
}
|
||||
ifaces_[i]->search_binary_vector_batch(_return, group_id, top_k, tensor_list, time_range_list);
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// The 'concurrent' client is a thread safe client that correctly handles
|
||||
@ -1399,6 +1703,12 @@ class VecServiceConcurrentClient : virtual public VecServiceIf {
|
||||
void search_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
int32_t send_search_vector_batch(const std::string& group_id, const int64_t top_k, const VecTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_vector_batch(VecSearchResultList& _return, const int32_t seqid);
|
||||
void search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list);
|
||||
int32_t send_search_binary_vector(const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_binary_vector(VecSearchResult& _return, const int32_t seqid);
|
||||
void search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
int32_t send_search_binary_vector_batch(const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list);
|
||||
void recv_search_binary_vector_batch(VecSearchResultList& _return, const int32_t seqid);
|
||||
protected:
|
||||
apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
|
||||
apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
|
||||
|
||||
@ -84,6 +84,16 @@ class VecServiceHandler : virtual public VecServiceIf {
|
||||
printf("search_vector_batch\n");
|
||||
}
|
||||
|
||||
void search_binary_vector(VecSearchResult& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensor& tensor, const VecTimeRangeList& time_range_list) {
|
||||
// Your implementation goes here
|
||||
printf("search_binary_vector\n");
|
||||
}
|
||||
|
||||
void search_binary_vector_batch(VecSearchResultList& _return, const std::string& group_id, const int64_t top_k, const VecBinaryTensorList& tensor_list, const VecTimeRangeList& time_range_list) {
|
||||
// Your implementation goes here
|
||||
printf("search_binary_vector_batch\n");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user