diff --git a/go.mod b/go.mod index 1d83d43b..086cfe4c 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gin-contrib/cors v1.5.0 github.com/gin-gonic/gin v1.9.1 github.com/gogo/protobuf v1.3.2 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/google/flatbuffers v2.0.8+incompatible github.com/google/uuid v1.3.1 github.com/opentracing/opentracing-go v1.2.0 @@ -33,6 +33,7 @@ require ( go.uber.org/atomic v1.9.0 golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.33.0 gotest.tools v2.1.1-0.20181001141646-317cc193f525+incompatible ) @@ -171,7 +172,6 @@ require ( google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/protobuf v1.31.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index a27e3ef7..1fff1c42 100644 --- a/go.sum +++ b/go.sum @@ -254,8 +254,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -1181,8 +1181,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/client/master.go b/internal/client/master.go index 0af900b7..c433be46 100644 --- a/internal/client/master.go +++ b/internal/client/master.go @@ -366,6 +366,27 @@ func (m *masterClient) QuerySpaceByName(ctx context.Context, dbID int64, spaceNa return nil, vearchpb.NewError(vearchpb.ErrorEnum_SPACE_NOTEXISTS, nil) } +// QueryAliasByName query alias by alias name +func (m *masterClient) QueryAliasByName(ctx context.Context, alias_name string) (*entity.Alias, error) { + alias := &entity.Alias{Name: alias_name} + + bs, err := m.client.master.Get(ctx, entity.AliasKey(alias_name)) + + if err != nil { + return nil, err + } + + if bs == nil { + return nil, vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_NOT_EXIST, nil) + } + + err = vjson.Unmarshal(bs, alias) + if err != nil { + return nil, fmt.Errorf("get alias:%s value:%s, err:%s", alias.Name, string(bs), err.Error()) + } + return alias, nil +} + // KeepAlive attempts to keep the given lease alive forever. If the keepalive responses posted // to the channel are not consumed promptly the channel may become full. When full, the lease // client will continue sending keep alive requests to the etcd server, but will drop responses diff --git a/internal/client/master_cache.go b/internal/client/master_cache.go index 6f949db6..df7ddbf7 100644 --- a/internal/client/master_cache.go +++ b/internal/client/master_cache.go @@ -44,14 +44,15 @@ var ( spaceReloadWorkder sync.Map partitionReloadWorkder sync.Map serverReloadWorkder sync.Map + aliasReloadWorkder sync.Map ) type clientCache struct { sync.Map - mc *masterClient - cancel context.CancelFunc - lock sync.Mutex - userCache, spaceCache, spaceIDCache, partitionCache, serverCache *cache.Cache + mc *masterClient + cancel context.CancelFunc + lock sync.Mutex + userCache, spaceCache, spaceIDCache, partitionCache, serverCache, aliasCache *cache.Cache } func newClientCache(serverCtx context.Context, masterClient *masterClient) (*clientCache, error) { @@ -65,6 +66,7 @@ func newClientCache(serverCtx context.Context, masterClient *masterClient) (*cli spaceIDCache: cache.New(cache.NoExpiration, cache.NoExpiration), partitionCache: cache.New(cache.NoExpiration, cache.NoExpiration), serverCache: cache.New(cache.NoExpiration, cache.NoExpiration), + aliasCache: cache.New(cache.NoExpiration, cache.NoExpiration), } if err := cc.startCacheJob(ctx); err != nil { @@ -186,7 +188,7 @@ func (cliCache *clientCache) reloadSpaceCache(ctx context.Context, sync bool, db space, err := cliCache.mc.QuerySpaceByName(ctx, dbID, spaceName) if err != nil { - return fmt.Errorf("can not found db by name:[%s] err:[%s]", db, err.Error()) + return fmt.Errorf("can not found space by space name:[%s] and db name:[%s] err:[%s]", spaceName, db, err.Error()) } if space.ResourceName != config.Conf().Global.ResourceName { log.Info("space name [%s] resource name don't match [%s], [%s], reloadSpaceCache failed. ", @@ -441,7 +443,6 @@ func (cliCache *clientCache) startCacheJob(ctx context.Context) error { return nil }, } - userJob.start() //init space @@ -569,6 +570,32 @@ func (cliCache *clientCache) startCacheJob(ctx context.Context) error { } serverJob.start() + //init alias + if err := cliCache.initAlias(ctx); err != nil { + return err + } + aliasJob := watcherJob{ctx: ctx, prefix: entity.PrefixAlias, masterClient: cliCache.mc, cache: cliCache.aliasCache, + put: func(value []byte) (err error) { + defer errutil.CatchError(&err) + alias := &entity.Alias{} + if err := vjson.Unmarshal(value, alias); err != nil { + return err + } + log.Debug("[%v] add to alias cache.", *alias) + cliCache.aliasCache.Set(alias.Name, alias, cache.NoExpiration) + return nil + }, + delete: func(key string) (err error) { + defer errutil.CatchError(&err) + aliasSplit := strings.Split(key, "/") + alias_name := aliasSplit[len(aliasSplit)-1] + log.Debug("[%s] delete from alias cache.", alias_name) + cliCache.aliasCache.Delete(alias_name) + return nil + }, + } + aliasJob.start() + log.Info("cache inited ok use time %v", time.Since(start)) return nil @@ -787,6 +814,86 @@ func (w *watcherJob) serverDelete(cacheKey string) (err error) { return err } +// find alias from cache +func (cliCache *clientCache) AliasByCache(ctx context.Context, alias_name string) (*entity.Alias, error) { + get, found := cliCache.aliasCache.Get(alias_name) + if found { + return get.(*entity.Alias), nil + } + + err := cliCache.reloadAliasCache(ctx, false, alias_name) + vearchlog.LogErrNotNil(err) + + if err != nil { + return nil, fmt.Errorf("alias_name:[%s] err:[%s]", alias_name, + vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_NOT_EXIST, nil)) + } + + for i := 0; i < retryNum; i++ { + time.Sleep(retrySleepTime) + log.Debug("to find alias by key:[%s] ", alias_name) + if get, found = cliCache.aliasCache.Get(alias_name); found { + return get.(*entity.Alias), nil + } + } + + return nil, fmt.Errorf("alias_name:[%s] err:[%s]", alias_name, vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_NOT_EXIST, nil)) +} + +func (cliCache *clientCache) reloadAliasCache(ctx context.Context, sync bool, alias_name string) error { + fun := func() error { + log.Info("to reload alias_name:[%s]", alias_name) + + alias, err := cliCache.mc.QueryAliasByName(ctx, alias_name) + + if err != nil { + return fmt.Errorf("can not found alias by name:[%s] err:[%s]", alias_name, err.Error()) + } + cliCache.aliasCache.Set(alias_name, alias, cache.NoExpiration) + return nil + } + + if sync { + return fun() + } + if _, ok := aliasReloadWorkder.LoadOrStore(alias_name, struct{}{}); ok { + return nil + } + go func() { + defer func() { + if r := recover(); r != nil { + vearchlog.LogErrNotNil(fmt.Errorf(cast.ToString(r))) + } + }() + if alias_name == "" { + return + } + defer aliasReloadWorkder.Delete(alias_name) + vearchlog.FunIfNotNil(fun) + }() + return nil +} + +func (cliCache *clientCache) initAlias(ctx context.Context) error { + _, values, err := cliCache.mc.PrefixScan(ctx, entity.PrefixAlias) + if err != nil { + log.Error("init server cache err , err:[%s]", err.Error()) + return err + } + for _, value := range values { + alias := &entity.Alias{} + err := vjson.Unmarshal(value, alias) + if err != nil { + log.Error("unmarshal alias cache err [%s]", err.Error()) + continue + } + if err := cliCache.aliasCache.Add(alias.Name, alias, cache.NoExpiration); err != nil { + log.Error(err.Error()) + } + } + return nil +} + func (wj *watcherJob) start() { go func() { defer func() { @@ -798,10 +905,10 @@ func (wj *watcherJob) start() { for { select { case <-wj.ctx.Done(): - log.Debug("watchjob job to stop") + log.Debug("watchjob job to stop %s", wj.prefix) return default: - log.Debug("start watcher routine") + log.Debug("start watcher routine %s", wj.prefix) } wj.wg.Add(1) @@ -816,7 +923,7 @@ func (wj *watcherJob) start() { select { case <-wj.ctx.Done(): - log.Debug("watchjob job to stop") + log.Debug("watchjob job to stop %s", wj.prefix) return default: } diff --git a/internal/config/config.go b/internal/config/config.go index a24f0bd2..7e5a11a6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -200,7 +200,6 @@ func (ms Masters) Self() *MasterCfg { } } return nil - } type MasterCfg struct { @@ -394,7 +393,6 @@ func LoadConfig(conf *Config, path string) { // CurrentByMasterNameDomainIp find this machine domain.The main purpose of this function is to find the master from from multiple masters and set it‘s Field:self to true. // The only criterion for judging is: Is the IP address the same with one of the masters? func (config *Config) CurrentByMasterNameDomainIp(masterName string) error { - //find local all ip addrMap := config.addrMap() @@ -460,7 +458,6 @@ func (config *Config) addrMap() map[string]bool { } func (config *Config) Validate(model Model) error { - switch model { case Master: masterNum := 0 @@ -477,7 +474,7 @@ func (config *Config) Validate(model Model) error { if config.PS.EngineDWPTNum == 0 { config.PS.EngineDWPTNum = 1 } - if config.PS.EngineDWPTNum < 0 || config.PS.EngineDWPTNum > 100 { + if config.PS.EngineDWPTNum > 100 { return fmt.Errorf("EngineDWPTNum need gt 0 and le 100") } } diff --git a/internal/engine/CMakeLists.txt b/internal/engine/CMakeLists.txt index 8a2b1199..9de28ee8 100644 --- a/internal/engine/CMakeLists.txt +++ b/internal/engine/CMakeLists.txt @@ -99,6 +99,7 @@ file(GLOB_RECURSE ALL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.c" ) list(FILTER ALL_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/third_party/scann-1.2.1/.*") +list(FILTER ALL_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers-*") list(FILTER ALL_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/tests/.*") list(FILTER ALL_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_SOURCE_DIR}/tools/.*") diff --git a/internal/engine/c_api/api_data/cpp_api.cc b/internal/engine/c_api/api_data/cpp_api.cc index cb41d3ec..70365731 100644 --- a/internal/engine/c_api/api_data/cpp_api.cc +++ b/internal/engine/c_api/api_data/cpp_api.cc @@ -33,7 +33,9 @@ int CPPSearch(void *engine, vearch::Request *request, vearch::Response *response) { - int ret = static_cast(engine)->Search(*request, *response); + vearch::Status status; + int ret = static_cast(engine)->Search(*request, *response, + status); if (ret) return ret; response->PackResults(request->Fields()); return 0; @@ -44,7 +46,7 @@ int CPPSearch2(void *engine, vearch::VectorResult *result) { vearch::GammaQuery gamma_query; PerfTool perf_tool; - gamma_query.condition = new vearch::GammaSearchCondition(&perf_tool); + gamma_query.condition = new vearch::SearchCondition(&perf_tool); auto vec_manager = static_cast(engine)->GetVectorManager(); @@ -86,10 +88,10 @@ int CPPAddOrUpdateDocs(void *engine, vearch::Docs *docs, void CPPSetNprobe(void *engine, int nprobe, std::string index_type) { auto index_model = static_cast(engine) - ->GetVectorManager() - ->IndexModels() - .begin() - ->second; + ->GetVectorManager() + ->IndexModels() + .begin() + ->second; if (index_type == "IVFPQ") { vearch::GammaIVFPQIndex *index = dynamic_cast(index_model); @@ -123,10 +125,10 @@ void CPPSetNprobe(void *engine, int nprobe, std::string index_type) { void CPPSetRerank(void *engine, int rerank, std::string index_type) { auto index_model = static_cast(engine) - ->GetVectorManager() - ->IndexModels() - .begin() - ->second; + ->GetVectorManager() + ->IndexModels() + .begin() + ->second; if (index_type == "IVFPQ") { vearch::GammaIVFPQIndex *index = dynamic_cast(index_model); diff --git a/internal/engine/c_api/api_data/response.cc b/internal/engine/c_api/api_data/response.cc index 881ad218..2cf9a9c0 100644 --- a/internal/engine/c_api/api_data/response.cc +++ b/internal/engine/c_api/api_data/response.cc @@ -33,8 +33,8 @@ Response::~Response() { } int Response::Serialize(const std::string &space_name, - std::vector &fields_name, char **out, - int *out_len) { + std::vector &fields_name, Status &status, + char **out, int *out_len) { std::vector vec_fields; std::map attr_idx; Table *table = static_cast(table_); @@ -106,42 +106,17 @@ int Response::Serialize(const std::string &space_name, builder.CreateVector(vec))); } } - std::string extra; - if (vec_fields.size() > 0 && vec_doc->fields_len > 0) { - cJSON *extra_json = cJSON_CreateObject(); - cJSON *vec_result_json = cJSON_CreateArray(); - cJSON_AddItemToObject(extra_json, EXTRA_VECTOR_RESULT.c_str(), - vec_result_json); - for (int k = 0; k < vec_doc->fields_len; ++k) { - VectorDocField *vec_field = vec_doc->fields + k; - cJSON *vec_field_json = cJSON_CreateObject(); - - cJSON_AddStringToObject(vec_field_json, - EXTRA_VECTOR_FIELD_NAME.c_str(), - vec_field->name.c_str()); - cJSON_AddNumberToObject(vec_field_json, - EXTRA_VECTOR_FIELD_SCORE.c_str(), - vec_field->score); - cJSON_AddItemToArray(vec_result_json, vec_field_json); - } - - char *extra_data = cJSON_PrintUnformatted(extra_json); - extra = std::string(extra_data, std::strlen(extra_data)); - free(extra_data); - cJSON_Delete(extra_json); - } result_items.emplace_back(gamma_api::CreateResultItem( - builder, score, builder.CreateVector(attributes), - builder.CreateString(extra))); + builder, score, builder.CreateVector(attributes))); } - std::string str_msg = "Success"; + std::string str_msg = status.ToString(); auto item_vec = builder.CreateVector(result_items); auto msg = builder.CreateString(str_msg); - gamma_api::SearchResultCode result_code = - gamma_api::SearchResultCode::SUCCESS; + vearch::status::Code result_code = + static_cast(status.code()); auto results = gamma_api::CreateSearchResult( builder, gamma_results_[i].total, result_code, msg, item_vec); search_results.push_back(results); @@ -270,7 +245,6 @@ int Response::PackResultItem(const VectorDoc *vec_doc, } } else { // get vector error - // TODO : release extra field ; } } else { @@ -285,26 +259,6 @@ int Response::PackResultItem(const VectorDoc *vec_doc, result_item.values.emplace_back(std::move(field.value)); } - cJSON *extra_json = cJSON_CreateObject(); - cJSON *vec_result_json = cJSON_CreateArray(); - cJSON_AddItemToObject(extra_json, EXTRA_VECTOR_RESULT.c_str(), - vec_result_json); - for (int i = 0; i < vec_doc->fields_len; ++i) { - VectorDocField *vec_field = vec_doc->fields + i; - cJSON *vec_field_json = cJSON_CreateObject(); - - cJSON_AddStringToObject(vec_field_json, EXTRA_VECTOR_FIELD_NAME.c_str(), - vec_field->name.c_str()); - cJSON_AddNumberToObject(vec_field_json, EXTRA_VECTOR_FIELD_SCORE.c_str(), - vec_field->score); - cJSON_AddItemToArray(vec_result_json, vec_field_json); - } - - char *extra_data = cJSON_PrintUnformatted(extra_json); - result_item.extra = std::string(extra_data, std::strlen(extra_data)); - free(extra_data); - cJSON_Delete(extra_json); - return 0; } diff --git a/internal/engine/c_api/api_data/response.h b/internal/engine/c_api/api_data/response.h index e6c3af66..29564488 100644 --- a/internal/engine/c_api/api_data/response.h +++ b/internal/engine/c_api/api_data/response.h @@ -11,6 +11,7 @@ #include "common/common_query_data.h" #include "idl/fbs-gen/c/response_generated.h" +#include "util/status.h" namespace vearch { @@ -27,14 +28,12 @@ struct ResultItem { score = other.score; names = other.names; values = other.values; - extra = other.extra; } ResultItem &operator=(const ResultItem &other) { score = other.score; names = other.names; values = other.values; - extra = other.extra; return *this; } @@ -42,21 +41,18 @@ struct ResultItem { score = other.score; names = std::move(other.names); values = std::move(other.values); - extra = std::move(other.extra); } ResultItem &operator=(ResultItem &&other) { score = other.score; names = std::move(other.names); values = std::move(other.values); - extra = std::move(other.extra); return *this; } double score; std::vector names; std::vector values; - std::string extra; }; struct SearchResult { @@ -105,8 +101,8 @@ class Response { virtual ~Response(); virtual int Serialize(const std::string &space_name, - std::vector &fields_name, char **out, - int *out_len); + std::vector &fields_name, Status &status, + char **out, int *out_len); virtual void Deserialize(const char *data, int len); diff --git a/internal/engine/c_api/api_data/table.cc b/internal/engine/c_api/api_data/table.cc index 6194b0db..11a5119b 100644 --- a/internal/engine/c_api/api_data/table.cc +++ b/internal/engine/c_api/api_data/table.cc @@ -35,7 +35,6 @@ int TableInfo::Serialize(char **out, int *out_len) { auto table = gamma_api::CreateTable(builder, builder.CreateString(name_), builder.CreateVector(field_info_vector), builder.CreateVector(vector_info_vector), - compress_mode_, builder.CreateString(index_type_), builder.CreateString(index_params_)); builder.Finish(table); @@ -84,7 +83,6 @@ void TableInfo::Deserialize(const char *data, int len) { if (training_threshold > 0) { training_threshold_ = training_threshold; } - compress_mode_ = table_->compress_mode(); } std::string &TableInfo::Name() { return name_; } diff --git a/internal/engine/c_api/api_data/table.h b/internal/engine/c_api/api_data/table.h index 07d08fde..01223529 100644 --- a/internal/engine/c_api/api_data/table.h +++ b/internal/engine/c_api/api_data/table.h @@ -45,7 +45,6 @@ class TableInfo : public RawData { public: TableInfo() { table_ = nullptr; - compress_mode_ = 0; } virtual int Serialize(char **out, int *out_len); @@ -55,10 +54,6 @@ class TableInfo : public RawData { void SetName(std::string &name); - bool IsCompress() { return compress_mode_; } - - void SetCompress(int compress_mode) { compress_mode_ = compress_mode; } - std::vector &Fields(); void AddField(struct FieldInfo &field); @@ -93,7 +88,6 @@ class TableInfo : public RawData { int training_threshold_ = 0; std::string index_type_; std::string index_params_; - int compress_mode_; }; } // namespace vearch diff --git a/internal/engine/c_api/gamma_api.cc b/internal/engine/c_api/gamma_api.cc index e9ccde02..4412ab08 100644 --- a/internal/engine/c_api/gamma_api.cc +++ b/internal/engine/c_api/gamma_api.cc @@ -24,6 +24,7 @@ #include "api_data/table.h" #include "search/engine.h" #include "util/log.h" +#include "util/status.h" #include "util/utils.h" INITIALIZE_EASYLOGGINGPP @@ -127,8 +128,9 @@ int Close(void *engine) { int CreateTable(void *engine, const char *table_str, int len) { vearch::TableInfo table; table.Deserialize(table_str, len); - int ret = static_cast(engine)->CreateTable(table); - return ret; + vearch::Status status = + static_cast(engine)->CreateTable(table); + return status.code(); } int AddOrUpdateDoc(void *engine, const char *doc_str, int len) { @@ -175,13 +177,15 @@ int Search(void *engine, const char *request_str, int req_len, vearch::Request request; request.Deserialize(request_str, req_len); - int ret = static_cast(engine)->Search(request, response); + vearch::Status status; + int ret = + static_cast(engine)->Search(request, response, status); if (ret != 0) { return ret; } response.Serialize(static_cast(engine)->SpaceName(), - request.Fields(), response_str, res_len); + request.Fields(), status, response_str, res_len); return ret; } diff --git a/internal/engine/common/common_query_data.h b/internal/engine/common/common_query_data.h index 2e4c3a53..4a3a04cb 100644 --- a/internal/engine/common/common_query_data.h +++ b/internal/engine/common/common_query_data.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -54,7 +55,7 @@ struct VectorResult { } } - bool init(int a, int b) { + void init(int a, int b) { n = a; topn = b; dists = new float[n * topn]; @@ -63,8 +64,6 @@ struct VectorResult { idx.resize(n, -1); std::fill_n(dists, n * topn, 0.0); std::fill_n(docids, n * topn, -1); - - return true; } bool init(int a, int b, float *distances, int64_t *labels) { @@ -162,21 +161,13 @@ struct VectorDoc { } } - bool init(std::string *vec_names, int vec_num) { - if (vec_num <= 0) { - fields = nullptr; - fields_len = 0; - return true; - } + void init(std::string *vec_names, int vec_num) { fields = new (std::nothrow) VectorDocField[vec_num]; - if (fields == nullptr) { - return false; - } + assert(fields != nullptr); for (int i = 0; i < vec_num; i++) { fields[i].name = vec_names[i]; } fields_len = vec_num; - return true; } int docid; @@ -205,20 +196,15 @@ struct GammaResult { } } - bool init(int n, std::string *vec_names, int vec_num) { + void init(int n, std::string *vec_names, int vec_num) { topn = n; docs = new (std::nothrow) VectorDoc *[topn]; - if (!docs) { - // LOG(ERROR) << "docs in CommonDocs init error!"; - return false; - } + assert(docs != nullptr); + for (int i = 0; i < n; i++) { docs[i] = new VectorDoc(); - if (!docs[i]->init(vec_names, vec_num)) { - return false; - } + docs[i]->init(vec_names, vec_num); } - return true; } int topn; diff --git a/internal/engine/common/definition_list.h b/internal/engine/common/definition_list.h deleted file mode 100644 index 92037762..00000000 --- a/internal/engine/common/definition_list.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright 2019 The Gamma Authors. - * - * This source code is licensed under the Apache License, Version 2.0 license - * found in the LICENSE file in the root directory of this source tree. - */ - -#ifndef DEFINITION_LIST_H -#define DEFINITION_LIST_H - -#ifdef DefineResultCode - -// 0x0000 ~ 0x0FFF General Status -DefineResultCode(Success, 0x0000) -DefineResultCode(Fail, 0x0001) -DefineResultCode(FailedOpenFile, 0x0002) -DefineResultCode(FailedCreateFile, 0x0003) -DefineResultCode(ParamNotFound, 0x0010) -DefineResultCode(FailedParseValue, 0x0011) - -// 0x1000 ~ 0x1FFF Index Build Status -DefineResultCode(Index_NotFound, 0x1001) -DefineResultCode(Index_WriteError, 0x1002) -DefineResultCode(Index_RepeatedIndex, 0x1003) -DefineResultCode(Index_NoEnoughVectors, 0x1004) -DefineResultCode(Index_NumericIndexError, 0x1010) - -// 0x2000 ~ 0x2FFF Index Serve Status - -// 0x3000 ~ 0x3FFF Record Function Status -DefineResultCode(Record_No_id, 0x3000) -DefineResultCode(Record_DuplicatedId, 0x3001) -DefineResultCode(Record_IdNotFound, 0x3002) - -// 0x4000 ~ 0x4FFF Ini Function Status -DefineResultCode(ReadIni_FailedParseSection, 0x4000) -DefineResultCode(ReadIni_FailedParseParam, 0x4001) -DefineResultCode(ReadIni_DuplicatedSection, 0x4002) -DefineResultCode(ReadIni_DuplicatedParam, 0x4003) - -#endif // DefineResultCode - -#endif /* DEFINITION_LIST_H */ diff --git a/internal/engine/common/error_code.h b/internal/engine/common/error_code.h deleted file mode 100644 index 07695330..00000000 --- a/internal/engine/common/error_code.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2019 The Gamma Authors. - * - * This source code is licensed under the Apache License, Version 2.0 license - * found in the LICENSE file in the root directory of this source tree. - */ - -#ifndef ERROR_CODE_H_ -#define ERROR_CODE_H_ - -/* - * error code description - * 100~200: general errors, it is mostly caused by input paramaters or data - * 200~300: io error, file io error or read/write from/to db error - * 300~400: internal error, in most cases, it is caused by a system call error - */ -#define SUCC 0 // success -#define PARAM_ERR 100 // parameter error -#define FORMAT_ERR 101 // format error -#define IO_ERR 200 // io error -#define INTERNAL_ERR 300 // internal error -#define ALLOC_ERR 301 // bad memory allocation -#define SYSTEM_ERR 302 // system call error -#define LIMIT_ERR 303 // exceed system limit error -#define TIMEOUT_ERR 304 // timeout error - -#endif diff --git a/internal/engine/common/gamma_common_data.h b/internal/engine/common/gamma_common_data.h index 582148b1..7db20c04 100644 --- a/internal/engine/common/gamma_common_data.h +++ b/internal/engine/common/gamma_common_data.h @@ -19,27 +19,16 @@ namespace vearch { -const std::string EXTRA_VECTOR_FIELD_SCORE = "score"; -const std::string EXTRA_VECTOR_FIELD_NAME = "field"; -const std::string EXTRA_VECTOR_RESULT = "vector_result"; - const float GAMMA_INDEX_RECALL_RATIO = 1.0f; const int min_points_per_centroid = 39; const int max_points_per_centroid = 256; -enum class ResultCode : std::uint16_t { -#define DefineResultCode(Name, Value) Name = Value, -#include "definition_list.h" -#undef DefineResultCode - Undefined -}; - enum class VectorStorageType : std::uint8_t { MemoryOnly, RocksDB }; -class GammaSearchCondition : public RetrievalContext { +class SearchCondition : public RetrievalContext { public: - GammaSearchCondition(PerfTool *perf_tool) { + SearchCondition(PerfTool *perf_tool) { range_query_result = nullptr; topn = 0; multi_vector_rank = false; @@ -54,7 +43,7 @@ class GammaSearchCondition : public RetrievalContext { table = nullptr; } - GammaSearchCondition(GammaSearchCondition *condition) { + SearchCondition(SearchCondition *condition) { range_query_result = condition->range_query_result; topn = condition->topn; multi_vector_rank = condition->multi_vector_rank; @@ -70,7 +59,7 @@ class GammaSearchCondition : public RetrievalContext { table = condition->table; } - ~GammaSearchCondition() { + ~SearchCondition() { range_query_result = nullptr; // should not delete table = nullptr; // should not delete } @@ -135,7 +124,7 @@ struct GammaQuery { } std::vector vec_query; - GammaSearchCondition *condition; + SearchCondition *condition; }; } // namespace vearch diff --git a/internal/engine/idl/fbs-gen/c/response_generated.h b/internal/engine/idl/fbs-gen/c/response_generated.h index 98218864..18b79975 100644 --- a/internal/engine/idl/fbs-gen/c/response_generated.h +++ b/internal/engine/idl/fbs-gen/c/response_generated.h @@ -6,6 +6,8 @@ #include "flatbuffers/flatbuffers.h" +#include "status_generated.h" + namespace gamma_api { struct Attribute; @@ -16,37 +18,6 @@ struct SearchResult; struct Response; -enum SearchResultCode { - SUCCESS = 0, - INDEX_NOT_TRAINED = 1, - SEARCH_ERROR = 2 -}; - -inline const SearchResultCode (&EnumValuesSearchResultCode())[3] { - static const SearchResultCode values[] = { - SUCCESS, - INDEX_NOT_TRAINED, - SEARCH_ERROR - }; - return values; -} - -inline const char * const *EnumNamesSearchResultCode() { - static const char * const names[] = { - "SUCCESS", - "INDEX_NOT_TRAINED", - "SEARCH_ERROR", - nullptr - }; - return names; -} - -inline const char *EnumNameSearchResultCode(SearchResultCode e) { - if (e < SUCCESS || e > SEARCH_ERROR) return ""; - const size_t index = static_cast(e); - return EnumNamesSearchResultCode()[index]; -} - struct Attribute FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME = 4, @@ -114,8 +85,7 @@ inline flatbuffers::Offset CreateAttributeDirect( struct ResultItem FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SCORE = 4, - VT_ATTRIBUTES = 6, - VT_EXTRA = 8 + VT_ATTRIBUTES = 6 }; double score() const { return GetField(VT_SCORE, 0.0); @@ -123,17 +93,12 @@ struct ResultItem FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::Vector> *attributes() const { return GetPointer> *>(VT_ATTRIBUTES); } - const flatbuffers::String *extra() const { - return GetPointer(VT_EXTRA); - } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SCORE) && VerifyOffset(verifier, VT_ATTRIBUTES) && verifier.VerifyVector(attributes()) && verifier.VerifyVectorOfTables(attributes()) && - VerifyOffset(verifier, VT_EXTRA) && - verifier.VerifyString(extra()) && verifier.EndTable(); } }; @@ -147,9 +112,6 @@ struct ResultItemBuilder { void add_attributes(flatbuffers::Offset>> attributes) { fbb_.AddOffset(ResultItem::VT_ATTRIBUTES, attributes); } - void add_extra(flatbuffers::Offset extra) { - fbb_.AddOffset(ResultItem::VT_EXTRA, extra); - } explicit ResultItemBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); @@ -165,11 +127,9 @@ struct ResultItemBuilder { inline flatbuffers::Offset CreateResultItem( flatbuffers::FlatBufferBuilder &_fbb, double score = 0.0, - flatbuffers::Offset>> attributes = 0, - flatbuffers::Offset extra = 0) { + flatbuffers::Offset>> attributes = 0) { ResultItemBuilder builder_(_fbb); builder_.add_score(score); - builder_.add_extra(extra); builder_.add_attributes(attributes); return builder_.Finish(); } @@ -177,15 +137,12 @@ inline flatbuffers::Offset CreateResultItem( inline flatbuffers::Offset CreateResultItemDirect( flatbuffers::FlatBufferBuilder &_fbb, double score = 0.0, - const std::vector> *attributes = nullptr, - const char *extra = nullptr) { + const std::vector> *attributes = nullptr) { auto attributes__ = attributes ? _fbb.CreateVector>(*attributes) : 0; - auto extra__ = extra ? _fbb.CreateString(extra) : 0; return gamma_api::CreateResultItem( _fbb, score, - attributes__, - extra__); + attributes__); } struct SearchResult FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { @@ -198,8 +155,8 @@ struct SearchResult FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { int32_t total() const { return GetField(VT_TOTAL, 0); } - SearchResultCode result_code() const { - return static_cast(GetField(VT_RESULT_CODE, 0)); + vearch::status::Code result_code() const { + return static_cast(GetField(VT_RESULT_CODE, 0)); } const flatbuffers::String *msg() const { return GetPointer(VT_MSG); @@ -226,7 +183,7 @@ struct SearchResultBuilder { void add_total(int32_t total) { fbb_.AddElement(SearchResult::VT_TOTAL, total, 0); } - void add_result_code(SearchResultCode result_code) { + void add_result_code(vearch::status::Code result_code) { fbb_.AddElement(SearchResult::VT_RESULT_CODE, static_cast(result_code), 0); } void add_msg(flatbuffers::Offset msg) { @@ -250,7 +207,7 @@ struct SearchResultBuilder { inline flatbuffers::Offset CreateSearchResult( flatbuffers::FlatBufferBuilder &_fbb, int32_t total = 0, - SearchResultCode result_code = SUCCESS, + vearch::status::Code result_code = vearch::status::kOk, flatbuffers::Offset msg = 0, flatbuffers::Offset>> result_items = 0) { SearchResultBuilder builder_(_fbb); @@ -264,7 +221,7 @@ inline flatbuffers::Offset CreateSearchResult( inline flatbuffers::Offset CreateSearchResultDirect( flatbuffers::FlatBufferBuilder &_fbb, int32_t total = 0, - SearchResultCode result_code = SUCCESS, + vearch::status::Code result_code = vearch::status::kOk, const char *msg = nullptr, const std::vector> *result_items = nullptr) { auto msg__ = msg ? _fbb.CreateString(msg) : 0; diff --git a/internal/engine/idl/fbs-gen/c/status_generated.h b/internal/engine/idl/fbs-gen/c/status_generated.h new file mode 100644 index 00000000..a2a0534b --- /dev/null +++ b/internal/engine/idl/fbs-gen/c/status_generated.h @@ -0,0 +1,64 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_STATUS_VEARCH_STATUS_H_ +#define FLATBUFFERS_GENERATED_STATUS_VEARCH_STATUS_H_ + +#include "flatbuffers/flatbuffers.h" + +namespace vearch { +namespace status { + +enum Code { + kOk = 0, + kNotFound = 1, + kIndexError = 2, + kNotSupported = 3, + kInvalidArgument = 4, + kIOError = 5, + kBusy = 6, + kTimedOut = 7, + kMaxCode = 8 +}; + +inline const Code (&EnumValuesCode())[9] { + static const Code values[] = { + kOk, + kNotFound, + kIndexError, + kNotSupported, + kInvalidArgument, + kIOError, + kBusy, + kTimedOut, + kMaxCode + }; + return values; +} + +inline const char * const *EnumNamesCode() { + static const char * const names[] = { + "kOk", + "kNotFound", + "kIndexError", + "kNotSupported", + "kInvalidArgument", + "kIOError", + "kBusy", + "kTimedOut", + "kMaxCode", + nullptr + }; + return names; +} + +inline const char *EnumNameCode(Code e) { + if (e < kOk || e > kMaxCode) return ""; + const size_t index = static_cast(e); + return EnumNamesCode()[index]; +} + +} // namespace status +} // namespace vearch + +#endif // FLATBUFFERS_GENERATED_STATUS_VEARCH_STATUS_H_ diff --git a/internal/engine/idl/fbs-gen/c/table_generated.h b/internal/engine/idl/fbs-gen/c/table_generated.h index 201943af..a347097a 100644 --- a/internal/engine/idl/fbs-gen/c/table_generated.h +++ b/internal/engine/idl/fbs-gen/c/table_generated.h @@ -209,9 +209,8 @@ struct Table FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VT_NAME = 4, VT_FIELDS = 6, VT_VECTORS_INFO = 8, - VT_COMPRESS_MODE = 10, - VT_INDEX_TYPE = 12, - VT_INDEX_PARAMS = 14 + VT_INDEX_TYPE = 10, + VT_INDEX_PARAMS = 12 }; const flatbuffers::String *name() const { return GetPointer(VT_NAME); @@ -222,9 +221,6 @@ struct Table FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const flatbuffers::Vector> *vectors_info() const { return GetPointer> *>(VT_VECTORS_INFO); } - int32_t compress_mode() const { - return GetField(VT_COMPRESS_MODE, 0); - } const flatbuffers::String *index_type() const { return GetPointer(VT_INDEX_TYPE); } @@ -241,7 +237,6 @@ struct Table FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { VerifyOffset(verifier, VT_VECTORS_INFO) && verifier.VerifyVector(vectors_info()) && verifier.VerifyVectorOfTables(vectors_info()) && - VerifyField(verifier, VT_COMPRESS_MODE) && VerifyOffset(verifier, VT_INDEX_TYPE) && verifier.VerifyString(index_type()) && VerifyOffset(verifier, VT_INDEX_PARAMS) && @@ -262,9 +257,6 @@ struct TableBuilder { void add_vectors_info(flatbuffers::Offset>> vectors_info) { fbb_.AddOffset(Table::VT_VECTORS_INFO, vectors_info); } - void add_compress_mode(int32_t compress_mode) { - fbb_.AddElement(Table::VT_COMPRESS_MODE, compress_mode, 0); - } void add_index_type(flatbuffers::Offset index_type) { fbb_.AddOffset(Table::VT_INDEX_TYPE, index_type); } @@ -288,13 +280,11 @@ inline flatbuffers::Offset
CreateTable( flatbuffers::Offset name = 0, flatbuffers::Offset>> fields = 0, flatbuffers::Offset>> vectors_info = 0, - int32_t compress_mode = 0, flatbuffers::Offset index_type = 0, flatbuffers::Offset index_params = 0) { TableBuilder builder_(_fbb); builder_.add_index_params(index_params); builder_.add_index_type(index_type); - builder_.add_compress_mode(compress_mode); builder_.add_vectors_info(vectors_info); builder_.add_fields(fields); builder_.add_name(name); @@ -306,7 +296,6 @@ inline flatbuffers::Offset
CreateTableDirect( const char *name = nullptr, const std::vector> *fields = nullptr, const std::vector> *vectors_info = nullptr, - int32_t compress_mode = 0, const char *index_type = nullptr, const char *index_params = nullptr) { auto name__ = name ? _fbb.CreateString(name) : 0; @@ -319,7 +308,6 @@ inline flatbuffers::Offset
CreateTableDirect( name__, fields__, vectors_info__, - compress_mode, index_type__, index_params__); } diff --git a/internal/engine/idl/fbs-gen/go/gamma_api/Code.go b/internal/engine/idl/fbs-gen/go/gamma_api/Code.go new file mode 100644 index 00000000..bd61f987 --- /dev/null +++ b/internal/engine/idl/fbs-gen/go/gamma_api/Code.go @@ -0,0 +1,29 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package gamma_api + +type Code = int8 +const ( + CodekOk Code = 0 + CodekNotFound Code = 1 + CodekIndexError Code = 2 + CodekNotSupported Code = 3 + CodekInvalidArgument Code = 4 + CodekIOError Code = 5 + CodekBusy Code = 6 + CodekTimedOut Code = 7 + CodekMaxCode Code = 8 +) + +var EnumNamesCode = map[Code]string{ + CodekOk:"kOk", + CodekNotFound:"kNotFound", + CodekIndexError:"kIndexError", + CodekNotSupported:"kNotSupported", + CodekInvalidArgument:"kInvalidArgument", + CodekIOError:"kIOError", + CodekBusy:"kBusy", + CodekTimedOut:"kTimedOut", + CodekMaxCode:"kMaxCode", +} + diff --git a/internal/engine/idl/fbs-gen/go/gamma_api/ResultItem.go b/internal/engine/idl/fbs-gen/go/gamma_api/ResultItem.go index f5586553..01de0e37 100644 --- a/internal/engine/idl/fbs-gen/go/gamma_api/ResultItem.go +++ b/internal/engine/idl/fbs-gen/go/gamma_api/ResultItem.go @@ -58,16 +58,8 @@ func (rcv *ResultItem) AttributesLength() int { return 0 } -func (rcv *ResultItem) Extra() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) - if o != 0 { - return rcv._tab.ByteVector(o + rcv._tab.Pos) - } - return nil -} - func ResultItemStart(builder *flatbuffers.Builder) { - builder.StartObject(3) + builder.StartObject(2) } func ResultItemAddScore(builder *flatbuffers.Builder, score float64) { builder.PrependFloat64Slot(0, score, 0.0) @@ -78,9 +70,6 @@ func ResultItemAddAttributes(builder *flatbuffers.Builder, attributes flatbuffer func ResultItemStartAttributesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } -func ResultItemAddExtra(builder *flatbuffers.Builder, extra flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(extra), 0) -} func ResultItemEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() } diff --git a/internal/engine/idl/fbs-gen/go/gamma_api/SearchResult.go b/internal/engine/idl/fbs-gen/go/gamma_api/SearchResult.go index 9097648b..70350759 100644 --- a/internal/engine/idl/fbs-gen/go/gamma_api/SearchResult.go +++ b/internal/engine/idl/fbs-gen/go/gamma_api/SearchResult.go @@ -38,7 +38,7 @@ func (rcv *SearchResult) MutateTotal(n int32) bool { return rcv._tab.MutateInt32Slot(4, n) } -func (rcv *SearchResult) ResultCode() SearchResultCode { +func (rcv *SearchResult) ResultCode() Code { o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) if o != 0 { return rcv._tab.GetInt8(o + rcv._tab.Pos) @@ -46,7 +46,7 @@ func (rcv *SearchResult) ResultCode() SearchResultCode { return 0 } -func (rcv *SearchResult) MutateResultCode(n SearchResultCode) bool { +func (rcv *SearchResult) MutateResultCode(n Code) bool { return rcv._tab.MutateInt8Slot(6, n) } diff --git a/internal/engine/idl/fbs-gen/go/gamma_api/SearchResultCode.go b/internal/engine/idl/fbs-gen/go/gamma_api/SearchResultCode.go deleted file mode 100644 index 00095ec0..00000000 --- a/internal/engine/idl/fbs-gen/go/gamma_api/SearchResultCode.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by the FlatBuffers compiler. DO NOT EDIT. - -package gamma_api - -type SearchResultCode = int8 -const ( - SearchResultCodeSUCCESS SearchResultCode = 0 - SearchResultCodeINDEX_NOT_TRAINED SearchResultCode = 1 - SearchResultCodeSEARCH_ERROR SearchResultCode = 2 -) - -var EnumNamesSearchResultCode = map[SearchResultCode]string{ - SearchResultCodeSUCCESS:"SUCCESS", - SearchResultCodeINDEX_NOT_TRAINED:"INDEX_NOT_TRAINED", - SearchResultCodeSEARCH_ERROR:"SEARCH_ERROR", -} - diff --git a/internal/engine/idl/fbs-gen/go/gamma_api/Table.go b/internal/engine/idl/fbs-gen/go/gamma_api/Table.go index 7f704214..d9dca491 100644 --- a/internal/engine/idl/fbs-gen/go/gamma_api/Table.go +++ b/internal/engine/idl/fbs-gen/go/gamma_api/Table.go @@ -74,20 +74,8 @@ func (rcv *Table) VectorsInfoLength() int { return 0 } -func (rcv *Table) CompressMode() int32 { - o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) - if o != 0 { - return rcv._tab.GetInt32(o + rcv._tab.Pos) - } - return 0 -} - -func (rcv *Table) MutateCompressMode(n int32) bool { - return rcv._tab.MutateInt32Slot(10, n) -} - func (rcv *Table) IndexType() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) + o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) } @@ -95,7 +83,7 @@ func (rcv *Table) IndexType() []byte { } func (rcv *Table) IndexParams() []byte { - o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) + o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) if o != 0 { return rcv._tab.ByteVector(o + rcv._tab.Pos) } @@ -103,7 +91,7 @@ func (rcv *Table) IndexParams() []byte { } func TableStart(builder *flatbuffers.Builder) { - builder.StartObject(6) + builder.StartObject(5) } func TableAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) @@ -120,14 +108,11 @@ func TableAddVectorsInfo(builder *flatbuffers.Builder, vectorsInfo flatbuffers.U func TableStartVectorsInfoVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { return builder.StartVector(4, numElems, 4) } -func TableAddCompressMode(builder *flatbuffers.Builder, compressMode int32) { - builder.PrependInt32Slot(3, compressMode, 0) -} func TableAddIndexType(builder *flatbuffers.Builder, indexType flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(indexType), 0) + builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(indexType), 0) } func TableAddIndexParams(builder *flatbuffers.Builder, indexParams flatbuffers.UOffsetT) { - builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(indexParams), 0) + builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(indexParams), 0) } func TableEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() diff --git a/internal/engine/idl/fbs-gen/python/gamma_api/ResultItem.py b/internal/engine/idl/fbs-gen/python/gamma_api/ResultItem.py index a3847717..082d50dc 100644 --- a/internal/engine/idl/fbs-gen/python/gamma_api/ResultItem.py +++ b/internal/engine/idl/fbs-gen/python/gamma_api/ResultItem.py @@ -45,16 +45,8 @@ def AttributesLength(self): return self._tab.VectorLen(o) return 0 - # ResultItem - def Extra(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) - if o != 0: - return self._tab.String(o + self._tab.Pos) - return None - -def ResultItemStart(builder): builder.StartObject(3) +def ResultItemStart(builder): builder.StartObject(2) def ResultItemAddScore(builder, score): builder.PrependFloat64Slot(0, score, 0.0) def ResultItemAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) def ResultItemStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def ResultItemAddExtra(builder, extra): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(extra), 0) def ResultItemEnd(builder): return builder.EndObject() diff --git a/internal/engine/idl/fbs-gen/python/gamma_api/SearchResultCode.py b/internal/engine/idl/fbs-gen/python/gamma_api/SearchResultCode.py deleted file mode 100644 index 7b56c79a..00000000 --- a/internal/engine/idl/fbs-gen/python/gamma_api/SearchResultCode.py +++ /dev/null @@ -1,9 +0,0 @@ -# automatically generated by the FlatBuffers compiler, do not modify - -# namespace: gamma_api - -class SearchResultCode(object): - SUCCESS = 0 - INDEX_NOT_TRAINED = 1 - SEARCH_ERROR = 2 - diff --git a/internal/engine/idl/fbs-gen/python/gamma_api/Table.py b/internal/engine/idl/fbs-gen/python/gamma_api/Table.py index e43feb8f..c57944fb 100644 --- a/internal/engine/idl/fbs-gen/python/gamma_api/Table.py +++ b/internal/engine/idl/fbs-gen/python/gamma_api/Table.py @@ -65,34 +65,26 @@ def VectorsInfoLength(self): return self._tab.VectorLen(o) return 0 - # Table - def CompressMode(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) - if o != 0: - return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 0 - # Table def IndexType(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # Table def IndexParams(self): - o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) if o != 0: return self._tab.String(o + self._tab.Pos) return None -def TableStart(builder): builder.StartObject(6) +def TableStart(builder): builder.StartObject(5) def TableAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) def TableAddFields(builder, fields): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(fields), 0) def TableStartFieldsVector(builder, numElems): return builder.StartVector(4, numElems, 4) def TableAddVectorsInfo(builder, vectorsInfo): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(vectorsInfo), 0) def TableStartVectorsInfoVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def TableAddCompressMode(builder, compressMode): builder.PrependInt32Slot(3, compressMode, 0) -def TableAddIndexType(builder, indexType): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(indexType), 0) -def TableAddIndexParams(builder, indexParams): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(indexParams), 0) +def TableAddIndexType(builder, indexType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(indexType), 0) +def TableAddIndexParams(builder, indexParams): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(indexParams), 0) def TableEnd(builder): return builder.EndObject() diff --git a/internal/engine/idl/fbs-gen/python/vearch/status/Code.py b/internal/engine/idl/fbs-gen/python/vearch/status/Code.py new file mode 100644 index 00000000..a90321c2 --- /dev/null +++ b/internal/engine/idl/fbs-gen/python/vearch/status/Code.py @@ -0,0 +1,15 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: status + +class Code(object): + kOk = 0 + kNotFound = 1 + kIndexError = 2 + kNotSupported = 3 + kInvalidArgument = 4 + kIOError = 5 + kBusy = 6 + kTimedOut = 7 + kMaxCode = 8 + diff --git a/internal/engine/idl/fbs/response.fbs b/internal/engine/idl/fbs/response.fbs index 4939666e..f3a0cb25 100644 --- a/internal/engine/idl/fbs/response.fbs +++ b/internal/engine/idl/fbs/response.fbs @@ -1,6 +1,6 @@ -namespace gamma_api; +include "status.fbs"; -enum SearchResultCode : byte { SUCCESS = 0, INDEX_NOT_TRAINED, SEARCH_ERROR } +namespace gamma_api; table Attribute { name:string; @@ -10,12 +10,11 @@ table Attribute { table ResultItem { score:double; attributes:[Attribute]; - extra:string; } table SearchResult { total:int; - result_code:SearchResultCode; + result_code:vearch.status.Code; msg:string; result_items:[ResultItem]; } diff --git a/internal/engine/idl/fbs/status.fbs b/internal/engine/idl/fbs/status.fbs new file mode 100644 index 00000000..7fb11cee --- /dev/null +++ b/internal/engine/idl/fbs/status.fbs @@ -0,0 +1,13 @@ +namespace vearch.status; + +enum Code : byte { + kOk = 0, + kNotFound = 1, + kIndexError = 2, + kNotSupported = 3, + kInvalidArgument = 4, + kIOError = 5, + kBusy = 6, + kTimedOut = 7, + kMaxCode +} diff --git a/internal/engine/idl/fbs/table.fbs b/internal/engine/idl/fbs/table.fbs index 67ebc028..6bcaa0e9 100644 --- a/internal/engine/idl/fbs/table.fbs +++ b/internal/engine/idl/fbs/table.fbs @@ -21,7 +21,6 @@ table Table { name:string; fields:[FieldInfo]; vectors_info:[VectorInfo]; - compress_mode:int; // 0: not compress, 1: table compress index_type:string; // IVFPQ, GPU, HNSW, BINARY index_params:string; } diff --git a/internal/engine/index/impl/gamma_index_binary_ivf.cc b/internal/engine/index/impl/gamma_index_binary_ivf.cc index 01260d1c..d6a6f597 100644 --- a/internal/engine/index/impl/gamma_index_binary_ivf.cc +++ b/internal/engine/index/impl/gamma_index_binary_ivf.cc @@ -7,7 +7,6 @@ #include "gamma_index_binary_ivf.h" -#include "common/error_code.h" #include "common/gamma_common_data.h" #include "faiss/IndexBinaryFlat.h" #include "faiss/utils/hamming.h" @@ -20,11 +19,12 @@ struct BinaryModelParams { BinaryModelParams() { ncentroids = 256; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse IVF model parameters error: " << str; - return -1; + std::string msg = std::string("parse IVF model parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } int ncentroids; @@ -32,13 +32,15 @@ struct BinaryModelParams { // -1 as default if (!jp.GetInt("ncentroids", ncentroids)) { if (ncentroids < -1) { - LOG(ERROR) << "invalid ncentroids =" << ncentroids; - return -1; + std::string msg = + std::string("invalid ncentroids = ") + std::to_string(ncentroids); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (ncentroids > 0) this->ncentroids = ncentroids; } - return 0; + return Status::OK(); } bool Validate() { @@ -79,11 +81,12 @@ GammaIndexBinaryIVF::~GammaIndexBinaryIVF() { } } -int GammaIndexBinaryIVF::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaIndexBinaryIVF::Init(const std::string &model_parameters, + int training_threshold) { BinaryModelParams binary_param; - if (model_parameters != "" && binary_param.Parse(model_parameters.c_str())) { - return -1; + if (model_parameters != "") { + Status status = binary_param.Parse(model_parameters.c_str()); + if (!status.ok()) return status; } nlist = binary_param.ncentroids; if (training_threshold) { @@ -125,7 +128,7 @@ int GammaIndexBinaryIVF::Init(const std::string &model_parameters, this->invlists = new realtime::RTInvertedLists(rt_invert_index_ptr_, nlist, code_size); } - return 0; + return Status::OK(); } RetrievalParameters *GammaIndexBinaryIVF::Parse(const std::string ¶meters) { @@ -219,8 +222,9 @@ int GammaIndexBinaryIVF::Indexing() { size_t num; if ((size_t)training_threshold_ < nlist) { num = nlist * 39; - LOG(WARNING) << "Because training_threshold[" << training_threshold_ << "] < ncentroids[" - << nlist << "], training_threshold becomes ncentroids * 39[" << num + LOG(WARNING) << "Because training_threshold[" << training_threshold_ + << "] < ncentroids[" << nlist + << "], training_threshold becomes ncentroids * 39[" << num << "]."; } else if ((size_t)training_threshold_ <= nlist * 256) { if ((size_t)training_threshold_ < nlist * 39) { diff --git a/internal/engine/index/impl/gamma_index_binary_ivf.h b/internal/engine/index/impl/gamma_index_binary_ivf.h index 968d7b96..c61e690d 100644 --- a/internal/engine/index/impl/gamma_index_binary_ivf.h +++ b/internal/engine/index/impl/gamma_index_binary_ivf.h @@ -13,8 +13,8 @@ #include #include "c_api/api_data/request.h" -#include "index/realtime/realtime_invert_index.h" #include "index/index_model.h" +#include "index/realtime/realtime_invert_index.h" #include "vector/raw_vector.h" namespace vearch { @@ -80,7 +80,8 @@ class GammaIndexBinaryIVF : public IndexModel, faiss::IndexBinaryIVF { virtual ~GammaIndexBinaryIVF(); - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; @@ -94,8 +95,11 @@ class GammaIndexBinaryIVF : public IndexModel, faiss::IndexBinaryIVF { long GetTotalMemBytes() override; - int Dump(const std::string &dir) override { return 0; } - int Load(const std::string &index_dir) override { return 0; } + Status Dump(const std::string &dir) override { return Status::OK(); } + Status Load(const std::string &index_dir, int &load_num) override { + load_num = 0; + return Status::OK(); + } int Delete(const std::vector &ids) override; diff --git a/internal/engine/index/impl/gamma_index_flat.cc b/internal/engine/index/impl/gamma_index_flat.cc index 2bdc7e75..fd4b2ad9 100644 --- a/internal/engine/index/impl/gamma_index_flat.cc +++ b/internal/engine/index/impl/gamma_index_flat.cc @@ -31,26 +31,29 @@ struct FLATModelParams { FLATModelParams() { metric_type = DistanceComputeType::INNER_PRODUCT; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse FLAT retrieval parameters error: " << str; - return -1; + std::string msg = + std::string("parse FLAT retrieval parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } std::string metric_type; if (!jp.GetString("metric_type", metric_type)) { if (strcasecmp("L2", metric_type.c_str()) && strcasecmp("InnerProduct", metric_type.c_str())) { - LOG(ERROR) << "invalid metric_type = " << metric_type; - return -1; + std::string msg = std::string("invalid metric_type = ") + metric_type; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!strcasecmp("L2", metric_type.c_str())) this->metric_type = DistanceComputeType::L2; else this->metric_type = DistanceComputeType::INNER_PRODUCT; } - return 0; + return Status::OK(); } std::string ToString() { @@ -64,21 +67,23 @@ GammaFLATIndex::GammaFLATIndex() {} GammaFLATIndex::~GammaFLATIndex() {} -int GammaFLATIndex::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaFLATIndex::Init(const std::string &model_parameters, + int training_threshold) { training_threshold_ = 0; auto raw_vec_type = dynamic_cast(vector_); if (raw_vec_type == nullptr) { - LOG(ERROR) << "FLAT can only work in memory only mode"; - return -1; + std::string msg = "FLAT can only work in memory only mode"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } FLATModelParams flat_param; - if (model_parameters != "" && flat_param.Parse(model_parameters.c_str())) { - return -1; + if (model_parameters != "") { + Status status = flat_param.Parse(model_parameters.c_str()); + if (!status.ok()) return status; } metric_type_ = flat_param.metric_type; LOG(INFO) << flat_param.ToString(); - return 0; + return Status::OK(); } RetrievalParameters *GammaFLATIndex::Parse(const std::string ¶meters) { @@ -314,8 +319,11 @@ int GammaFLATIndex::Update(const std::vector &ids, return 0; } -int GammaFLATIndex::Dump(const std::string &dir) { return 0; } +Status GammaFLATIndex::Dump(const std::string &dir) { return Status::OK(); } -int GammaFLATIndex::Load(const std::string &index_dir) { return 0; } +Status GammaFLATIndex::Load(const std::string &index_dir, int &load_num) { + load_num = 0; + return Status::OK(); +} } // namespace vearch diff --git a/internal/engine/index/impl/gamma_index_flat.h b/internal/engine/index/impl/gamma_index_flat.h index d4d86e02..56cd421f 100644 --- a/internal/engine/index/impl/gamma_index_flat.h +++ b/internal/engine/index/impl/gamma_index_flat.h @@ -70,7 +70,8 @@ class GammaFLATIndex : public IndexModel { ~GammaFLATIndex(); - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; @@ -88,9 +89,9 @@ class GammaFLATIndex : public IndexModel { long GetTotalMemBytes() override; - int Dump(const std::string &dir) override; + Status Dump(const std::string &dir) override; - int Load(const std::string &index_dir) override; + Status Load(const std::string &index_dir, int &load_num) override; DistanceComputeType metric_type_; diff --git a/internal/engine/index/impl/gamma_index_ivfflat.cc b/internal/engine/index/impl/gamma_index_ivfflat.cc index 8f5b590c..ff73b412 100644 --- a/internal/engine/index/impl/gamma_index_ivfflat.cc +++ b/internal/engine/index/impl/gamma_index_ivfflat.cc @@ -29,7 +29,6 @@ #include #include -#include "common/error_code.h" #include "common/gamma_common_data.h" #include "index/index_io.h" #include "vector/rocksdb_raw_vector.h" @@ -54,11 +53,13 @@ struct IVFFlatModelParams { bucket_max_size = 1280000; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse IVFFLAT model parameters error: " << str; - return -1; + std::string msg = + std::string("parse IVFFLAT model parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } // -1 as default @@ -66,8 +67,9 @@ struct IVFFlatModelParams { int nprobe = 0; if (jp.Contains("ncentroids")) { if (jp.GetInt("ncentroids", nc)) { - LOG(ERROR) << "parse ncentroids error"; - return PARAM_ERR; + std::string msg = "parse ncentroids error"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nc > 0) { ncentroids = nc; @@ -75,13 +77,16 @@ struct IVFFlatModelParams { } if (!jp.GetInt("nprobe", nprobe)) { if (nprobe < -1) { - LOG(ERROR) << "invalid nprobe =" << nprobe; - return -1; + std::string msg = + std::string("invalid nprobe =") + std::to_string(nprobe); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nprobe > 0) this->nprobe = nprobe; if (this->nprobe > this->ncentroids) { - LOG(ERROR) << "nprobe should less than ncentroids"; - return -1; + std::string msg = "nprobe should less than ncentroids"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } } @@ -91,16 +96,19 @@ struct IVFFlatModelParams { // -1 as default if (!jp.GetInt("bucket_init_size", bucket_init_size)) { if (bucket_init_size < -1) { - LOG(ERROR) << "invalid bucket_init_size =" << bucket_init_size; - return -1; + std::string msg = std::string("invalid bucket_init_size =") + + std::to_string(bucket_init_size); + return Status::ParamError(msg); } if (bucket_init_size > 0) this->bucket_init_size = bucket_init_size; } if (!jp.GetInt("bucket_max_size", bucket_max_size)) { if (bucket_max_size < -1) { - LOG(ERROR) << "invalid bucket_max_size =" << bucket_max_size; - return -1; + std::string msg = std::string("invalid bucket_max_size =") + + std::to_string(bucket_max_size); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bucket_max_size > 0) this->bucket_max_size = bucket_max_size; } @@ -110,8 +118,9 @@ struct IVFFlatModelParams { if (!jp.GetString("metric_type", metric_type)) { if (strcasecmp("L2", metric_type.c_str()) && strcasecmp("InnerProduct", metric_type.c_str())) { - LOG(ERROR) << "invalid metric_type = " << metric_type; - return -1; + std::string msg = std::string("invalid metric_type = ") + metric_type; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!strcasecmp("L2", metric_type.c_str())) this->metric_type = DistanceComputeType::L2; @@ -119,7 +128,7 @@ struct IVFFlatModelParams { this->metric_type = DistanceComputeType::INNER_PRODUCT; } - return 0; + return Status::OK(); } std::string ToString() { @@ -152,19 +161,23 @@ GammaIndexIVFFlat::~GammaIndexIVFFlat() { CHECK_DELETE(quantizer); } -int GammaIndexIVFFlat::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaIndexIVFFlat::Init(const std::string &model_parameters, + int training_threshold) { IVFFlatModelParams params; - if (model_parameters != "" && params.Parse(model_parameters.c_str())) { - LOG(ERROR) << "parse model parameters error"; - return PARAM_ERR; + if (model_parameters != "") { + Status status = params.Parse(model_parameters.c_str()); + if (!status.ok()) { + LOG(ERROR) << status.ToString(); + return status; + } } RawVector *raw_vec = nullptr; raw_vec = dynamic_cast(vector_); if (raw_vec == nullptr) { - LOG(ERROR) << "IVFFlat needs store type=RocksDB"; - return PARAM_ERR; + std::string msg = "IVFFlat needs store type=RocksDB"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } d = vector_->MetaInfo()->Dimension(); @@ -194,8 +207,9 @@ int GammaIndexIVFFlat::Init(const std::string &model_parameters, bool ret = rt_invert_index_ptr_->Init(); if (!ret) { - LOG(ERROR) << "init realtime invert index error"; - return INTERNAL_ERR; + std::string msg = "init realtime invert index error"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } this->invlists = new realtime::RTInvertedLists(rt_invert_index_ptr_, nlist, code_size); @@ -208,7 +222,7 @@ int GammaIndexIVFFlat::Init(const std::string &model_parameters, } this->nprobe = params.nprobe; - return 0; + return Status::OK(); } RetrievalParameters *GammaIndexIVFFlat::Parse(const std::string ¶meters) { @@ -278,8 +292,9 @@ int GammaIndexIVFFlat::Indexing() { size_t num; if ((size_t)training_threshold_ < nlist) { num = nlist * 39; - LOG(WARNING) << "Because training_threshold[" << training_threshold_ << "] < ncentroids[" - << nlist << "], training_threshold becomes ncentroids * 39[" << num + LOG(WARNING) << "Because training_threshold[" << training_threshold_ + << "] < ncentroids[" << nlist + << "], training_threshold becomes ncentroids * 39[" << num << "]."; } else if ((size_t)training_threshold_ <= nlist * 256) { if ((size_t)training_threshold_ < nlist * 39) { @@ -650,16 +665,17 @@ std::string IVFFlatToString(const faiss::IndexIVFFlat *ivfl) { return ss.str(); } -int GammaIndexIVFFlat::Dump(const std::string &dir) { +Status GammaIndexIVFFlat::Dump(const std::string &dir) { if (!this->is_trained) { LOG(INFO) << "gamma index is not trained, skip dumping"; - return 0; + return Status::OK(); } std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_dir = dir + "/" + index_name; if (utils::make_dir(index_dir.c_str())) { - LOG(ERROR) << "mkdir error, index dir=" << index_dir; - return IO_ERR; + std::string msg = std::string("mkdir error, index dir=") + index_dir; + LOG(ERROR) << msg; + return Status::PathNotFound(msg); } std::string index_file = index_dir + "/ivfflat.index"; @@ -672,22 +688,25 @@ int GammaIndexIVFFlat::Dump(const std::string &dir) { int indexed_count = indexed_vec_count_; if (WriteInvertedLists(f, rt_invert_index_ptr_)) { - LOG(ERROR) << "write invert list error, index name=" << index_name; - return INTERNAL_ERR; + std::string msg = + std::string("write invert list error, index name=") + index_name; + LOG(ERROR) << msg; + return Status::IOError(msg); } WRITE1(indexed_count); LOG(INFO) << "dump:" << IVFFlatToString(ivfl) << ", indexed count=" << indexed_count; - return 0; + return Status::OK(); }; -int GammaIndexIVFFlat::Load(const std::string &dir) { +Status GammaIndexIVFFlat::Load(const std::string &dir, int &load_num) { std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_file = dir + "/" + index_name + "/ivfflat.index"; if (!utils::file_exist(index_file)) { LOG(INFO) << index_file << " isn't existed, skip loading"; - return 0; // it should train again after load + load_num = 0; + return Status::OK(); // it should train again after load } faiss::IOReader *f = new FileIOReader(index_file.c_str()); @@ -699,25 +718,31 @@ int GammaIndexIVFFlat::Load(const std::string &dir) { vearch::read_ivf_header(ivfl, f, nullptr); // not legacy int indexed_vec_count = 0; - int ret = ReadInvertedLists(f, rt_invert_index_ptr_, indexed_vec_count); - if (ret == FORMAT_ERR) { + Status status = ReadInvertedLists(f, rt_invert_index_ptr_, indexed_vec_count); + if (status.code() == status::kIndexError) { indexed_vec_count_ = 0; + load_num = 0; LOG(INFO) << "unsupported inverted list format, it need rebuilding!"; - } else if (ret == 0) { + } else if (status.ok()) { READ1(indexed_vec_count_); if (indexed_vec_count_ < 0) { - LOG(ERROR) << "invalid indexed count [" << indexed_vec_count_ - << "] vector size [" << vector_->MetaInfo()->size_ << "]"; - return INTERNAL_ERR; + std::string msg = std::string("invalid indexed count [") + + std::to_string(indexed_vec_count_) + "] vector size [" + + std::to_string(vector_->MetaInfo()->size_) + "]"; + LOG(ERROR) << msg; + return Status::IndexError(msg); } LOG(INFO) << "load: " << IVFFlatToString(ivfl) << ", indexed vector count=" << indexed_vec_count_; } else { - LOG(ERROR) << "read invert list error, index name=" << index_name; - return INTERNAL_ERR; + std::string msg = + std::string("read invert list error, index name=") + index_name; + LOG(ERROR) << msg; + return Status::IndexError(msg); } assert(this->is_trained); - return indexed_vec_count_; + load_num = indexed_vec_count_; + return Status::OK(); }; GammaInvertedListScanner *GammaIndexIVFFlat::GetGammaInvertedListScanner( diff --git a/internal/engine/index/impl/gamma_index_ivfflat.h b/internal/engine/index/impl/gamma_index_ivfflat.h index 2b0cdbaa..8d32fb00 100644 --- a/internal/engine/index/impl/gamma_index_ivfflat.h +++ b/internal/engine/index/impl/gamma_index_ivfflat.h @@ -25,6 +25,7 @@ #include "gamma_scanner.h" #include "index/realtime/realtime_invert_index.h" +#include "util/status.h" namespace vearch { @@ -124,7 +125,8 @@ struct GammaIndexIVFFlat : faiss::IndexIVFFlat, public IndexModel { const float *coarse_dis, float *distances, idx_t *labels, int nprobe, bool store_pairs) const; - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; int Indexing() override; bool Add(int n, const uint8_t *vec) override; @@ -143,8 +145,8 @@ struct GammaIndexIVFFlat : faiss::IndexIVFFlat, public IndexModel { long GetTotalMemBytes() override { return 0; }; - int Dump(const std::string &dir) override; - int Load(const std::string &dir) override; + Status Dump(const std::string &dir) override; + Status Load(const std::string &dir, int &load_num) override; void train(int64_t n, const float *x) override { faiss::IndexIVFFlat::train(n, x); diff --git a/internal/engine/index/impl/gamma_index_ivfpq.cc b/internal/engine/index/impl/gamma_index_ivfpq.cc index 658a5dbf..3bf81bf2 100644 --- a/internal/engine/index/impl/gamma_index_ivfpq.cc +++ b/internal/engine/index/impl/gamma_index_ivfpq.cc @@ -23,7 +23,6 @@ #include #include -#include "common/error_code.h" #include "faiss/IndexFlat.h" #include "index/index_io.h" #include "omp.h" @@ -105,12 +104,13 @@ GammaInvertedListScanner *GammaIVFPQIndex::GetGammaInvertedListScanner( return nullptr; } -int GammaIVFPQIndex::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaIVFPQIndex::Init(const std::string &model_parameters, + int training_threshold) { model_param_ = new IVFPQModelParams(); IVFPQModelParams &ivfpq_param = *model_param_; - if (model_parameters != "" && ivfpq_param.Parse(model_parameters.c_str())) { - return -1; + if (model_parameters != "") { + Status status = ivfpq_param.Parse(model_parameters.c_str()); + if (!status.ok()) return status; } d = vector_->MetaInfo()->Dimension(); @@ -118,10 +118,12 @@ int GammaIVFPQIndex::Init(const std::string &model_parameters, ivfpq_param.nsubvector = int(d / 2); } if (d % ivfpq_param.nsubvector != 0) { - LOG(ERROR) << "Dimension [" << vector_->MetaInfo()->Dimension() - << "] cannot divide by nsubvector [" << ivfpq_param.nsubvector - << "]."; - return -2; + std::string msg = std::string("Dimension [") + + std::to_string(vector_->MetaInfo()->Dimension()) + + "] cannot divide by nsubvector [" + + std::to_string(ivfpq_param.nsubvector) + "]."; + LOG(ERROR) << msg; + return Status::ParamError(msg); } RawVector *raw_vec = dynamic_cast(vector_); @@ -150,9 +152,12 @@ int GammaIVFPQIndex::Init(const std::string &model_parameters, if (ivfpq_param.has_opq) { if (d % ivfpq_param.opq_nsubvector != 0) { - LOG(ERROR) << d << " % " << ivfpq_param.opq_nsubvector - << " != 0, opq nsubvector should be divisible by dimension."; - return -2; + std::string msg = + std::to_string(d) + " % " + + std::to_string(ivfpq_param.opq_nsubvector) + + " != 0, opq nsubvector should be divisible by dimension."; + LOG(ERROR) << msg; + return Status::ParamError(msg); } opq_ = new faiss::OPQMatrix(d, ivfpq_param.opq_nsubvector, d); } @@ -203,7 +208,7 @@ int GammaIVFPQIndex::Init(const std::string &model_parameters, } this->nprobe = ivfpq_param.nprobe; - return 0; + return Status::OK(); } RetrievalParameters *GammaIVFPQIndex::Parse(const std::string ¶meters) { @@ -280,8 +285,9 @@ int GammaIVFPQIndex::Indexing() { size_t num; if ((size_t)training_threshold_ < nlist) { num = nlist * 39; - LOG(WARNING) << "Because training_threshold[" << training_threshold_ << "] < ncentroids[" - << nlist << "], training_threshold becomes ncentroids * 39[" << num + LOG(WARNING) << "Because training_threshold[" << training_threshold_ + << "] < ncentroids[" << nlist + << "], training_threshold becomes ncentroids * 39[" << num << "]."; } else if ((size_t)training_threshold_ <= nlist * 256) { if ((size_t)training_threshold_ < nlist * 39) { @@ -488,8 +494,8 @@ int GammaIVFPQIndex::Search(RetrievalContext *retrieval_context, int n, del_params.set(retrieval_params); } - GammaSearchCondition *condition = - dynamic_cast(retrieval_context); + SearchCondition *condition = + dynamic_cast(retrieval_context); if (condition->brute_force_search == true || is_trained == false) { // reset retrieval_params delete retrieval_context->RetrievalParams(); @@ -654,8 +660,7 @@ void GammaIVFPQIndex::search_preassigned( // for opq, rerank need raw vector float *vec_q = const_cast(x); float *vec_applied_q = const_cast(applied_x); - GammaSearchCondition *context = - dynamic_cast(retrieval_context); + SearchCondition *context = dynamic_cast(retrieval_context); IVFPQRetrievalParameters *retrieval_params = dynamic_cast( retrieval_context->RetrievalParams()); @@ -907,16 +912,16 @@ std::string IVFPQToString(const faiss::IndexIVFPQ *ivpq, return ss.str(); } -int GammaIVFPQIndex::Dump(const std::string &dir) { +Status GammaIVFPQIndex::Dump(const std::string &dir) { if (!this->is_trained) { LOG(INFO) << "gamma index is not trained, skip dumping"; - return 0; + return Status::OK(); } std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_dir = dir + "/" + index_name; if (utils::make_dir(index_dir.c_str())) { - LOG(ERROR) << "mkdir error, index dir=" << index_dir; - return IO_ERR; + std::string msg = std::string("mkdir error, index dir=") + index_dir; + return Status::IOError(msg); } std::string index_file = index_dir + "/ivfpq.index"; @@ -933,21 +938,23 @@ int GammaIVFPQIndex::Dump(const std::string &dir) { if (opq_ != nullptr) write_opq(opq_, f); if (WriteInvertedLists(f, rt_invert_index_ptr_)) { - LOG(ERROR) << "write invert list error, index name=" << index_name; - return INTERNAL_ERR; + std::string msg = + std::string("write invert list error, index name=") + index_name; + LOG(ERROR) << msg; + return Status::IndexError(msg); } LOG(INFO) << "dump:" << IVFPQToString(ivpq, opq_) << ", indexed count=" << indexed_vec_count_; - return 0; + return Status::OK(); } -int GammaIVFPQIndex::Load(const std::string &index_dir) { +Status GammaIVFPQIndex::Load(const std::string &index_dir, int &load_num) { std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_file = index_dir + "/" + index_name + "/ivfpq.index"; if (!utils::file_exist(index_file)) { LOG(INFO) << index_file << " isn't existed, skip loading"; - return 0; // it should train again after load + return Status::OK(); // it should train again after load } faiss::IOReader *f = new FileIOReader(index_file.c_str()); @@ -971,11 +978,12 @@ int GammaIVFPQIndex::Load(const std::string &index_dir) { read_opq(opq_, f); } - int ret = ReadInvertedLists(f, rt_invert_index_ptr_, indexed_vec_count_); - if (ret == FORMAT_ERR) { + Status status = + ReadInvertedLists(f, rt_invert_index_ptr_, indexed_vec_count_); + if (status.code() == status::kIndexError) { indexed_vec_count_ = 0; LOG(INFO) << "unsupported inverted list format, it need rebuilding!"; - } else if (ret == 0) { + } else if (status.ok()) { // if (indexed_vec_count_ < 0 || // indexed_vec_count_ > (int)vector_->MetaInfo()->size_) { // LOG(ERROR) << "invalid indexed count [" << indexed_vec_count_ @@ -988,8 +996,10 @@ int GammaIVFPQIndex::Load(const std::string &index_dir) { LOG(INFO) << "load: " << IVFPQToString(ivpq, opq_) << ", indexed vector count=" << indexed_vec_count_; } else { - LOG(ERROR) << "read invert list error, index name=" << index_name; - return INTERNAL_ERR; + std::string msg = + std::string("read invert list error, index name=") + index_name; + LOG(ERROR) << msg; + return Status::IOError(msg); } if (ivpq->metric_type == faiss::METRIC_INNER_PRODUCT) { metric_type_ = DistanceComputeType::INNER_PRODUCT; @@ -997,7 +1007,8 @@ int GammaIVFPQIndex::Load(const std::string &index_dir) { metric_type_ = DistanceComputeType::L2; } assert(this->is_trained); - return indexed_vec_count_; + load_num = indexed_vec_count_; + return Status::OK(); } } // namespace vearch diff --git a/internal/engine/index/impl/gamma_index_ivfpq.h b/internal/engine/index/impl/gamma_index_ivfpq.h index e2bd3ea1..4260bab3 100644 --- a/internal/engine/index/impl/gamma_index_ivfpq.h +++ b/internal/engine/index/impl/gamma_index_ivfpq.h @@ -39,8 +39,8 @@ #include "faiss/utils/utils.h" #include "gamma_index_flat.h" #include "gamma_scanner.h" -#include "index/realtime/realtime_invert_index.h" #include "index/index_model.h" +#include "index/realtime/realtime_invert_index.h" #include "table/field_range_index.h" #include "util/log.h" #include "util/utils.h" @@ -709,11 +709,13 @@ struct IVFPQModelParams { bucket_max_size = 1280000; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse IVFPQ retrieval parameters error: " << str; - return -1; + std::string msg = + std::string("parse IVFPQ retrieval parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } int ncentroids; @@ -724,37 +726,46 @@ struct IVFPQModelParams { // -1 as default if (!jp.GetInt("ncentroids", ncentroids)) { if (ncentroids < -1) { - LOG(ERROR) << "invalid ncentroids =" << ncentroids; - return -1; + std::string msg = + std::string("invalid ncentroids =") + std::to_string(ncentroids); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (ncentroids > 0) this->ncentroids = ncentroids; } if (!jp.GetInt("nsubvector", nsubvector)) { if (nsubvector < -1) { - LOG(ERROR) << "invalid nsubvector =" << nsubvector; - return -1; + std::string msg = + std::string("invalid nsubvector =") + std::to_string(nsubvector); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nsubvector > 0) this->nsubvector = nsubvector; } if (!jp.GetInt("nbits_per_idx", nbits_per_idx)) { if (nbits_per_idx < -1) { - LOG(ERROR) << "invalid nbits_per_idx =" << nbits_per_idx; - return -1; + std::string msg = std::string("invalid nbits_per_idx =") + + std::to_string(nbits_per_idx); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nbits_per_idx > 0) this->nbits_per_idx = nbits_per_idx; } if (!jp.GetInt("nprobe", nprobe)) { if (nprobe < -1) { - LOG(ERROR) << "invalid nprobe =" << nprobe; - return -1; + std::string msg = + std::string("invalid nprobe =") + std::to_string(nprobe); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nprobe > 0) this->nprobe = nprobe; if (this->nprobe > this->ncentroids) { - LOG(ERROR) << "nprobe should less than ncentroids"; - return -1; + std::string msg = "nprobe should less than ncentroids"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } } @@ -764,16 +775,20 @@ struct IVFPQModelParams { // -1 as default if (!jp.GetInt("bucket_init_size", bucket_init_size)) { if (bucket_init_size < -1) { - LOG(ERROR) << "invalid bucket_init_size =" << bucket_init_size; - return -1; + std::string msg = std::string("invalid bucket_init_size =") + + std::to_string(bucket_init_size); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bucket_init_size > 0) this->bucket_init_size = bucket_init_size; } if (!jp.GetInt("bucket_max_size", bucket_max_size)) { if (bucket_max_size < -1) { - LOG(ERROR) << "invalid bucket_max_size =" << bucket_max_size; - return -1; + std::string msg = std::string("invalid bucket_max_size =") + + std::to_string(bucket_max_size); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bucket_max_size > 0) this->bucket_max_size = bucket_max_size; } @@ -783,8 +798,9 @@ struct IVFPQModelParams { if (!jp.GetString("metric_type", metric_type)) { if (strcasecmp("L2", metric_type.c_str()) && strcasecmp("InnerProduct", metric_type.c_str())) { - LOG(ERROR) << "invalid metric_type = " << metric_type; - return -1; + std::string msg = std::string("invalid metric_type = ") + metric_type; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!strcasecmp("L2", metric_type.c_str())) this->metric_type = DistanceComputeType::L2; @@ -801,24 +817,30 @@ struct IVFPQModelParams { // -1 as default if (!jp_hnsw.GetInt("nlinks", nlinks)) { if (nlinks < -1) { - LOG(ERROR) << "invalid nlinks = " << nlinks; - return -1; + std::string msg = + std::string("invalid nlinks = ") + std::to_string(nlinks); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nlinks > 0) this->nlinks = nlinks; } if (!jp_hnsw.GetInt("efConstruction", efConstruction)) { if (efConstruction < -1) { - LOG(ERROR) << "invalid efConstruction = " << efConstruction; - return -1; + std::string msg = std::string("invalid efConstruction = ") + + std::to_string(efConstruction); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efConstruction > 0) this->efConstruction = efConstruction; } if (!jp_hnsw.GetInt("efSearch", efSearch)) { if (efSearch < -1) { - LOG(ERROR) << "invalid efSearch = " << efSearch; - return -1; + std::string msg = + std::string("invalid efSearch = ") + std::to_string(efSearch); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efSearch > 0) this->efSearch = efSearch; } @@ -831,15 +853,17 @@ struct IVFPQModelParams { // -1 as default if (!jp_opq.GetInt("nsubvector", opq_nsubvector)) { if (nsubvector < -1) { - LOG(ERROR) << "invalid opq_nsubvector = " << opq_nsubvector; - return -1; + std::string msg = std::string("invalid opq_nsubvector = ") + + std::to_string(opq_nsubvector); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (opq_nsubvector > 0) this->opq_nsubvector = opq_nsubvector; } } - if (!Validate()) return -1; - return 0; + if (!Validate()) return Status::ParamError(); + return Status::OK(); } bool Validate() { @@ -890,7 +914,8 @@ struct GammaIVFPQIndex : GammaFLATIndex, faiss::IndexIVFPQ { GammaInvertedListScanner *GetGammaInvertedListScanner( bool store_pairs, faiss::MetricType metric_type); - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; @@ -919,9 +944,9 @@ struct GammaIVFPQIndex : GammaFLATIndex, faiss::IndexIVFPQ { return rt_invert_index_ptr_->GetTotalMemBytes(); } - int Dump(const std::string &dir) override; + Status Dump(const std::string &dir) override; - int Load(const std::string &index_dir) override; + Status Load(const std::string &index_dir, int &load_num) override; virtual void copy_subset_to(faiss::IndexIVF &other, int subset_type, idx_t a1, idx_t a2) const override; diff --git a/internal/engine/index/impl/gamma_index_ivfpqfs.cc b/internal/engine/index/impl/gamma_index_ivfpqfs.cc index 59812c30..9996402a 100644 --- a/internal/engine/index/impl/gamma_index_ivfpqfs.cc +++ b/internal/engine/index/impl/gamma_index_ivfpqfs.cc @@ -23,7 +23,6 @@ #include #include -#include "common/error_code.h" #include "faiss/invlists/BlockInvertedLists.h" #include "index/index_io.h" #include "omp.h" @@ -73,21 +72,25 @@ GammaIVFPQFastScanIndex::~GammaIVFPQFastScanIndex() { } } -int GammaIVFPQFastScanIndex::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaIVFPQFastScanIndex::Init(const std::string &model_parameters, + int training_threshold) { model_param_ = new IVFPQFastScanModelParams(); IVFPQFastScanModelParams &ivfpqfs_param = *model_param_; - if (model_parameters != "" && ivfpqfs_param.Parse(model_parameters.c_str())) { - return -1; + if (model_parameters != "") { + Status status = ivfpqfs_param.Parse(model_parameters.c_str()); + if (!status.ok()) return status; } LOG(INFO) << ivfpqfs_param.ToString(); d = vector_->MetaInfo()->Dimension(); if (d % ivfpqfs_param.nsubvector != 0) { - LOG(ERROR) << "Dimension [" << vector_->MetaInfo()->Dimension() - << "] cannot divide by nsubvector [" << ivfpqfs_param.nsubvector; - return -2; + std::string msg = std::string("Dimension [") + + std::to_string(vector_->MetaInfo()->Dimension()) + + "] cannot divide by nsubvector [" + + std::to_string(ivfpqfs_param.nsubvector); + LOG(ERROR) << msg; + return Status::IndexError(msg); } nlist = ivfpqfs_param.ncentroids; @@ -111,9 +114,12 @@ int GammaIVFPQFastScanIndex::Init(const std::string &model_parameters, if (ivfpqfs_param.has_opq) { if (d % ivfpqfs_param.opq_nsubvector != 0) { - LOG(ERROR) << d << " % " << ivfpqfs_param.opq_nsubvector - << " != 0, opq nsubvector should be divisible by dimension."; - return -2; + std::string msg = + std::to_string(d) + " % " + + std::to_string(ivfpqfs_param.opq_nsubvector) + + " != 0, opq nsubvector should be divisible by dimension."; + LOG(ERROR) << msg; + return Status::IndexError(msg); } opq_ = new faiss::OPQMatrix(d, ivfpqfs_param.opq_nsubvector, d); } @@ -159,7 +165,7 @@ int GammaIVFPQFastScanIndex::Init(const std::string &model_parameters, LOG(ERROR) << "init read-write lock error, ret=" << ret; } - return ret; + return Status::OK(); } RetrievalParameters *GammaIVFPQFastScanIndex::Parse( @@ -219,8 +225,9 @@ int GammaIVFPQFastScanIndex::Indexing() { size_t num; if ((size_t)training_threshold_ < nlist) { num = nlist * 39; - LOG(WARNING) << "Because training_threshold[" << training_threshold_ << "] < ncentroids[" - << nlist << "], training_threshold becomes ncentroids * 39[" << num + LOG(WARNING) << "Because training_threshold[" << training_threshold_ + << "] < ncentroids[" << nlist + << "], training_threshold becomes ncentroids * 39[" << num << "]."; } else if ((size_t)training_threshold_ <= nlist * 256) { if ((size_t)training_threshold_ < nlist * 39) { @@ -387,8 +394,8 @@ int GammaIVFPQFastScanIndex::Search(RetrievalContext *retrieval_context, int n, del_params.set(retrieval_params); } - GammaSearchCondition *condition = - dynamic_cast(retrieval_context); + SearchCondition *condition = + dynamic_cast(retrieval_context); if (condition->brute_force_search == true || is_trained == false) { // reset retrieval_params delete retrieval_context->RetrievalParams(); @@ -454,8 +461,14 @@ int GammaIVFPQFastScanIndex::Search(RetrievalContext *retrieval_context, int n, return 0; } -int GammaIVFPQFastScanIndex::Dump(const std::string &dir) { return 0; } +Status GammaIVFPQFastScanIndex::Dump(const std::string &dir) { + return Status::OK(); +} -int GammaIVFPQFastScanIndex::Load(const std::string &index_dir) { return 0; } +Status GammaIVFPQFastScanIndex::Load(const std::string &index_dir, + int &load_num) { + load_num = 0; + return Status::OK(); +} } // namespace vearch diff --git a/internal/engine/index/impl/gamma_index_ivfpqfs.h b/internal/engine/index/impl/gamma_index_ivfpqfs.h index 57784876..62fb8c78 100644 --- a/internal/engine/index/impl/gamma_index_ivfpqfs.h +++ b/internal/engine/index/impl/gamma_index_ivfpqfs.h @@ -40,8 +40,8 @@ #include "gamma_index_flat.h" #include "gamma_scanner.h" #include "index/impl/gamma_index_ivfpq.h" -#include "index/realtime/realtime_invert_index.h" #include "index/index_model.h" +#include "index/realtime/realtime_invert_index.h" #include "table/field_range_index.h" #include "util/log.h" #include "util/utils.h" @@ -56,11 +56,13 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { bbs = 32; nbits_per_idx = 4; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse IVFPQ retrieval parameters error: " << str; - return -1; + std::string msg = + std::string("parse IVFPQ retrieval parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } int ncentroids; @@ -72,24 +74,32 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { // -1 as default if (!jp.GetInt("ncentroids", ncentroids)) { if (ncentroids < -1) { - LOG(ERROR) << "invalid ncentroids =" << ncentroids; - return -1; + std::string msg = + std::string("invalid ncentroids =") + std::to_string(ncentroids); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (ncentroids > 0) this->ncentroids = ncentroids; } else { - LOG(ERROR) << "cannot get ncentroids for ivfpq, set it when create space"; - return -1; + std::string msg = + "cannot get ncentroids for ivfpq, set it when create space"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!jp.GetInt("nsubvector", nsubvector)) { if (nsubvector < -1) { - LOG(ERROR) << "invalid nsubvector =" << nsubvector; - return -1; + std::string msg = + std::string("invalid nsubvector =") + std::to_string(nsubvector); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nsubvector > 0) this->nsubvector = nsubvector; } else { - LOG(ERROR) << "cannot get nsubvector for ivfpq, set it when create space"; - return -1; + std::string msg = + "cannot get nsubvector for ivfpq, set it when create space"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } /* if (!jp.GetInt("nbits_per_idx", nbits_per_idx)) { @@ -102,20 +112,24 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { */ if (!jp.GetInt("nprobe", nprobe)) { if (nprobe < -1) { - LOG(ERROR) << "invalid nprobe =" << nprobe; - return -1; + std::string msg = + std::string("invalid nprobe =") + std::to_string(nprobe); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nprobe > 0) this->nprobe = nprobe; if (this->nprobe > this->ncentroids) { - LOG(ERROR) << "nprobe should less than ncentroids"; - return -1; + std::string msg = "nprobe should less than ncentroids"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } } if (!jp.GetInt("bbs", bbs)) { if (bbs < -1) { - LOG(ERROR) << "invalid bbs =" << bbs; - return -1; + std::string msg = std::string("invalid bbs =") + std::to_string(bbs); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bbs > 0) this->bbs = bbs; } @@ -126,16 +140,20 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { // -1 as default if (!jp.GetInt("bucket_init_size", bucket_init_size)) { if (bucket_init_size < -1) { - LOG(ERROR) << "invalid bucket_init_size =" << bucket_init_size; - return -1; + std::string msg = std::string("invalid bucket_init_size =") + + std::to_string(bucket_init_size); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bucket_init_size > 0) this->bucket_init_size = bucket_init_size; } if (!jp.GetInt("bucket_max_size", bucket_max_size)) { if (bucket_max_size < -1) { - LOG(ERROR) << "invalid bucket_max_size =" << bucket_max_size; - return -1; + std::string msg = std::string("invalid bucket_max_size =") + + std::to_string(bucket_max_size); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (bucket_max_size > 0) this->bucket_max_size = bucket_max_size; } @@ -145,8 +163,9 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { if (!jp.GetString("metric_type", metric_type)) { if (strcasecmp("L2", metric_type.c_str()) && strcasecmp("InnerProduct", metric_type.c_str())) { - LOG(ERROR) << "invalid metric_type = " << metric_type; - return -1; + std::string msg = std::string("invalid metric_type = ") + metric_type; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!strcasecmp("L2", metric_type.c_str())) this->metric_type = DistanceComputeType::L2; @@ -163,24 +182,29 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { // -1 as default if (!jp_hnsw.GetInt("nlinks", nlinks)) { if (nlinks < -1) { - LOG(ERROR) << "invalid nlinks = " << nlinks; - return -1; + std::string msg = + std::string("invalid nlinks = ") + std::to_string(nlinks); + return Status::ParamError(msg); } if (nlinks > 0) this->nlinks = nlinks; } if (!jp_hnsw.GetInt("efConstruction", efConstruction)) { if (efConstruction < -1) { - LOG(ERROR) << "invalid efConstruction = " << efConstruction; - return -1; + std::string msg = std::string("invalid efConstruction = ") + + std::to_string(efConstruction); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efConstruction > 0) this->efConstruction = efConstruction; } if (!jp_hnsw.GetInt("efSearch", efSearch)) { if (efSearch < -1) { - LOG(ERROR) << "invalid efSearch = " << efSearch; - return -1; + std::string msg = + std::string("invalid efSearch = ") + std::to_string(efSearch); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efSearch > 0) this->efSearch = efSearch; } @@ -193,15 +217,17 @@ struct IVFPQFastScanModelParams : IVFPQModelParams { // -1 as default if (!jp_opq.GetInt("nsubvector", opq_nsubvector)) { if (nsubvector < -1) { - LOG(ERROR) << "invalid opq_nsubvector = " << opq_nsubvector; - return -1; + std::string msg = std::string("invalid opq_nsubvector = ") + + std::to_string(opq_nsubvector); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (opq_nsubvector > 0) this->opq_nsubvector = opq_nsubvector; } } - if (!Validate()) return -1; - return 0; + if (!Validate()) return Status::ParamError(); + return Status::OK(); } bool Validate() { @@ -250,7 +276,8 @@ struct GammaIVFPQFastScanIndex : GammaFLATIndex, faiss::IndexIVFPQFastScan { virtual ~GammaIVFPQFastScanIndex(); - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; @@ -271,9 +298,9 @@ struct GammaIVFPQFastScanIndex : GammaFLATIndex, faiss::IndexIVFPQFastScan { return rt_invert_index_ptr_->GetTotalMemBytes(); } - int Dump(const std::string &dir) override; + Status Dump(const std::string &dir) override; - int Load(const std::string &index_dir) override; + Status Load(const std::string &index_dir, int &load_num) override; int Delete(const std::vector &ids) override; diff --git a/internal/engine/index/impl/gpu/gamma_index_ivfpq_gpu.cc b/internal/engine/index/impl/gpu/gamma_index_ivfpq_gpu.cc index 483163b8..514ad9dc 100644 --- a/internal/engine/index/impl/gpu/gamma_index_ivfpq_gpu.cc +++ b/internal/engine/index/impl/gpu/gamma_index_ivfpq_gpu.cc @@ -628,7 +628,7 @@ int GammaIVFPQGPUIndex::GPUThread() { namespace { -int ParseFilters(GammaSearchCondition *condition, +int ParseFilters(SearchCondition *condition, vector &range_filter_types, vector> &all_term_items) { for (size_t i = 0; i < condition->range_filters.size(); ++i) { @@ -691,7 +691,7 @@ bool IsInRange(Table *table, RangeFilter &range, long docid) { return false; } -bool FilteredByRangeFilter(GammaSearchCondition *condition, +bool FilteredByRangeFilter(SearchCondition *condition, vector &range_filter_types, long docid) { for (size_t i = 0; i < condition->range_filters.size(); ++i) { @@ -710,7 +710,7 @@ bool FilteredByRangeFilter(GammaSearchCondition *condition, return false; } -bool FilteredByTermFilter(GammaSearchCondition *condition, +bool FilteredByTermFilter(SearchCondition *condition, vector> &all_term_items, long docid) { for (size_t i = 0; i < condition->term_filters.size(); ++i) { auto term = condition->term_filters[i]; @@ -820,8 +820,8 @@ int GammaIVFPQGPUIndex::Search(RetrievalContext *retrieval_context, int n, #endif bool right_filter = false; - GammaSearchCondition *condition = - dynamic_cast(retrieval_context); + SearchCondition *condition = + dynamic_cast(retrieval_context); vector range_filter_types(condition->range_filters.size()); diff --git a/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.cc b/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.cc index 8b9febd7..ff8eca3f 100644 --- a/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.cc +++ b/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.cc @@ -14,7 +14,6 @@ #include #include -#include "common/error_code.h" #include "util/utils.h" #include "vector/memory_raw_vector.h" @@ -42,11 +41,13 @@ struct HNSWLIBModelParams { return true; } - int Parse(const char *str) { + Status Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse HNSW retrieval parameters error: " << str; - return -1; + std::string msg = + std::string("parse HNSW retrieval parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } int nlinks; @@ -57,32 +58,40 @@ struct HNSWLIBModelParams { // for -1, set as default if (!jp.GetInt("nlinks", nlinks)) { if (nlinks < -1) { - LOG(ERROR) << "invalid nlinks = " << nlinks; - return -1; + std::string msg = + std::string("invalid nlinks = ") + std::to_string(nlinks); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (nlinks > 0) this->nlinks = nlinks; } if (!jp.GetInt("efConstruction", efConstruction)) { if (efConstruction < -1) { - LOG(ERROR) << "invalid efConstruction = " << efConstruction; - return -1; + std::string msg = std::string("invalid efConstruction = ") + + std::to_string(efConstruction); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efConstruction > 0) this->efConstruction = efConstruction; } if (!jp.GetInt("efSearch", efSearch)) { if (efSearch < -1) { - LOG(ERROR) << "invalid efSearch = " << efSearch; - return -1; + std::string msg = + std::string("invalid efSearch = ") + std::to_string(efSearch); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (efSearch > 0) this->efSearch = efSearch; } if (!jp.GetInt("do_efSearch_check", do_efSearch_check)) { if (do_efSearch_check < -1) { - LOG(ERROR) << "invalid do_efSearch_check = " << do_efSearch_check; - return -1; + std::string msg = std::string("invalid do_efSearch_check = ") + + std::to_string(do_efSearch_check); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (do_efSearch_check > 0) this->do_efSearch_check = 1; if (do_efSearch_check == 0) this->do_efSearch_check = 0; @@ -93,8 +102,9 @@ struct HNSWLIBModelParams { if (!jp.GetString("metric_type", metric_type)) { if (strcasecmp("L2", metric_type.c_str()) && strcasecmp("InnerProduct", metric_type.c_str())) { - LOG(ERROR) << "invalid metric_type = " << metric_type; - return -1; + std::string msg = std::string("invalid metric_type = ") + metric_type; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!strcasecmp("L2", metric_type.c_str())) this->metric_type = DistanceComputeType::L2; @@ -103,7 +113,7 @@ struct HNSWLIBModelParams { } else { this->metric_type = DistanceComputeType::L2; } - return 0; + return Status::OK(); } std::string ToString() { @@ -142,18 +152,20 @@ GammaIndexHNSWLIB::~GammaIndexHNSWLIB() { } } -int GammaIndexHNSWLIB::Init(const std::string &model_parameters, - int training_threshold) { +Status GammaIndexHNSWLIB::Init(const std::string &model_parameters, + int training_threshold) { training_threshold_ = 0; raw_vec_ = dynamic_cast(vector_); if (raw_vec_ == nullptr) { - LOG(ERROR) << "HNSW can only work in memory only mode"; - return -1; + std::string msg = "HNSW can only work in memory only mode"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } HNSWLIBModelParams hnsw_param; - if (model_parameters != "" && hnsw_param.Parse(model_parameters.c_str())) { - return -2; + if (model_parameters != "") { + Status status = hnsw_param.Parse(model_parameters.c_str()); + if (!status.ok()) return status; } LOG(INFO) << hnsw_param.ToString(); @@ -221,7 +233,7 @@ int GammaIndexHNSWLIB::Init(const std::string &model_parameters, LOG(ERROR) << "init read-write lock error, ret=" << ret; } - return 0; + return Status::OK(); } RetrievalParameters *GammaIndexHNSWLIB::Parse(const std::string ¶meters) { @@ -354,8 +366,8 @@ int GammaIndexHNSWLIB::Search(RetrievalContext *retrieval_context, int n, retrieval_context->retrieval_params_ = retrieval_params; } - GammaSearchCondition *condition = - dynamic_cast(retrieval_context); + SearchCondition *condition = + dynamic_cast(retrieval_context); if (condition->brute_force_search == true) { // reset retrieval_params delete retrieval_context->RetrievalParams(); @@ -451,26 +463,28 @@ int GammaIndexHNSWLIB::Delete(const std::vector &ids) { return 0; } -int GammaIndexHNSWLIB::Dump(const std::string &dir) { +Status GammaIndexHNSWLIB::Dump(const std::string &dir) { std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_dir = dir + "/" + index_name; if (utils::make_dir(index_dir.c_str())) { - LOG(ERROR) << "mkdir error, index dir=" << index_dir; - return IO_ERR; + std::string msg = std::string("mkdir error, index dir=") + index_dir; + LOG(ERROR) << msg; + return Status::IOError(msg); } std::string index_file = index_dir + "/hnswlib.index"; std::unique_lock templock(dump_mutex_); saveIndex(index_file); - return 0; + return Status::OK(); } -int GammaIndexHNSWLIB::Load(const std::string &index_dir) { +Status GammaIndexHNSWLIB::Load(const std::string &index_dir, int &load_num) { std::string index_name = vector_->MetaInfo()->AbsoluteName(); std::string index_file = index_dir + "/" + index_name + "/hnswlib.index"; if (!utils::file_exist(index_file)) { LOG(INFO) << index_file << " isn't existed, skip loading"; - return 0; // it should train again after load + load_num = 0; + return Status::OK(); // it should train again after load } if (metric_type_ == DistanceComputeType::INNER_PRODUCT) { loadIndex(index_file, space_interface_ip_); @@ -478,7 +492,8 @@ int GammaIndexHNSWLIB::Load(const std::string &index_dir) { loadIndex(index_file, space_interface_); } indexed_vec_count_ = cur_element_count; - return indexed_vec_count_; + load_num = indexed_vec_count_; + return Status::OK(); } } // namespace vearch diff --git a/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.h b/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.h index 29ff11bc..2b807cc4 100644 --- a/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.h +++ b/internal/engine/index/impl/hnswlib/gamma_index_hnswlib.h @@ -67,7 +67,8 @@ struct GammaIndexHNSWLIB : public GammaFLATIndex, virtual ~GammaIndexHNSWLIB(); - int Init(const std::string &model_parameters, int training_threshold) override; + Status Init(const std::string &model_parameters, + int training_threshold) override; RetrievalParameters *Parse(const std::string ¶meters) override; @@ -87,9 +88,9 @@ struct GammaIndexHNSWLIB : public GammaFLATIndex, long GetTotalMemBytes() override; - int Dump(const std::string &dir) override; + Status Dump(const std::string &dir) override; - int Load(const std::string &index_dir) override; + Status Load(const std::string &index_dir, int &load_num) override; /* virtual char *getDataByInternalId(tableint internal_id) const override { diff --git a/internal/engine/index/impl/scann/gamma_index_vearch.cc b/internal/engine/index/impl/scann/gamma_index_vearch.cc index 8dc2c833..24c55914 100644 --- a/internal/engine/index/impl/scann/gamma_index_vearch.cc +++ b/internal/engine/index/impl/scann/gamma_index_vearch.cc @@ -1,26 +1,28 @@ #ifdef USE_SCANN - -#include "common/gamma_common_data.h" #include "gamma_index_vearch.h" -#include "vector/raw_vector.h" -#include "scann_api.h" -#include "util/log.h" -#include -#include + #include -#include #include +#include +#include +#include + #include +#include "common/gamma_common_data.h" +#include "scann_api.h" +#include "util/log.h" +#include "vector/raw_vector.h" + namespace vearch { REGISTER_MODEL(VEARCH, GammaVearchIndex); struct VearchModelParams { - int ncentroids; // coarse cluster center number - int nsubvector; // number of sub cluster center + int ncentroids; // coarse cluster center number + int nsubvector; // number of sub cluster center std::string metric_type; double noise_shaping_threshold; bool reordering; @@ -53,7 +55,8 @@ struct VearchModelParams { } if (ncentroids > 0) this->ncentroids = ncentroids; } else { - LOG(ERROR) << "cannot get ncentroids for vearch, set it when create space"; + LOG(ERROR) + << "cannot get ncentroids for vearch, set it when create space"; return -1; } @@ -64,7 +67,8 @@ struct VearchModelParams { } if (nsubvector > 0) this->nsubvector = nsubvector; } else { - LOG(ERROR) << "cannot get nsubvector for vearch, set it when create space"; + LOG(ERROR) + << "cannot get nsubvector for vearch, set it when create space"; return -1; } @@ -89,7 +93,8 @@ struct VearchModelParams { if (!jp.GetBool("reordering", use_reordering)) { if (use_reordering == true) { - LOG(INFO) << "The raw vectors are stored inside vearch. Using vearch reordering."; + LOG(INFO) << "The raw vectors are stored inside vearch. Using vearch " + "reordering."; reordering = true; } } @@ -129,7 +134,8 @@ struct VearchModelParams { std::string max_spill_centers = "1"; std::string use_residual_quantization = "False"; std::string use_global_topn = "False"; - std::string str_noise_shaping_threshold = std::to_string(noise_shaping_threshold); + std::string str_noise_shaping_threshold = + std::to_string(noise_shaping_threshold); if (noise_shaping_threshold < 0) { str_noise_shaping_threshold = "nan"; } @@ -142,35 +148,54 @@ struct VearchModelParams { } std::string projection = -" projection {\n\ - input_dim: " + std::to_string(dimension) + "\n\ + " projection {\n\ + input_dim: " + + std::to_string(dimension) + + "\n\ projection_type: CHUNK\n\ - num_blocks: " + std::to_string(num_blocks) + "\n\ - num_dims_per_block: " + std::to_string(num_dims_per_block) + "\n\ + num_blocks: " + + std::to_string(num_blocks) + + "\n\ + num_dims_per_block: " + + std::to_string(num_dims_per_block) + + "\n\ }\n"; int residual_dims = dimension % num_blocks; if (residual_dims > 0) { projection = -" projection {\n\ - input_dim: " + std::to_string(dimension) + "\n\ + " projection {\n\ + input_dim: " + + std::to_string(dimension) + + "\n\ projection_type: VARIABLE_CHUNK\n\ variable_blocks {\n\ - num_blocks: " + std::to_string(num_blocks) + "\n\ - num_dims_per_block: " + std::to_string(num_dims_per_block) + "\n\ + num_blocks: " + + std::to_string(num_blocks) + + "\n\ + num_dims_per_block: " + + std::to_string(num_dims_per_block) + + "\n\ }\n\ variable_blocks {\n\ num_blocks: 1\n\ - num_dims_per_block: " + std::to_string(residual_dims) + "\n\ + num_dims_per_block: " + + std::to_string(residual_dims) + + "\n\ }\n\ }\n"; } - std::string str_config = "num_neighbors: 100\n\ + std::string str_config = + "num_neighbors: 100\n\ distance_measure {\n\ - distance_measure: \"" + metric_type + "\"\n\ + distance_measure: \"" + + metric_type + + "\"\n\ }\n\ partitioning {\n\ - num_children: " + std::to_string(num_children) + "\n\ + num_children: " + + std::to_string(num_children) + + "\n\ min_cluster_size: 50\n\ max_clustering_iterations: 12\n\ single_machine_center_initialization: RANDOM_INITIALIZATION\n\ @@ -179,34 +204,51 @@ partitioning {\n\ }\n\ query_spilling {\n\ spilling_type: FIXED_NUMBER_OF_CENTERS\n\ - max_spill_centers: " + max_spill_centers + "\n\ + max_spill_centers: " + + max_spill_centers + + "\n\ }\n\ - expected_sample_size: " + std::to_string(sample_size) + "\n\ + expected_sample_size: " + + std::to_string(sample_size) + + "\n\ query_tokenization_distance_override {\n\ - distance_measure: \"" + metric_type + "\"\n\ + distance_measure: \"" + + metric_type + + "\"\n\ }\n\ - partitioning_type: " + partitioning_type + "\n\ + partitioning_type: " + + partitioning_type + + "\n\ query_tokenization_type: FIXED_POINT_INT8\n\ }\n\ hash {\n\ asymmetric_hash {\n\ lookup_type: INT8_LUT16\n\ - use_residual_quantization: " + use_residual_quantization + "\n\ - use_global_topn: " + use_global_topn + "\n\ + use_residual_quantization: " + + use_residual_quantization + + "\n\ + use_global_topn: " + + use_global_topn + + "\n\ quantization_distance {\n\ distance_measure: \"SquaredL2Distance\"\n\ }\n\ num_clusters_per_block: 16\n" + - projection + "\ - noise_shaping_threshold: " + str_noise_shaping_threshold + "\n\ - expected_sample_size: " + std::to_string(sample_size) + "\n\ + projection + + "\ + noise_shaping_threshold: " + + str_noise_shaping_threshold + + "\n\ + expected_sample_size: " + + std::to_string(sample_size) + + "\n\ min_cluster_size: 100\n\ max_clustering_iterations: 10\n\ }\n\ }\n"; if (reordering) { std::string reorder_config = -"exact_reordering {\n\ + "exact_reordering {\n\ approx_num_neighbors: 100\n\ fixed_point {\n\ enabled: False\n\ @@ -220,14 +262,12 @@ hash {\n\ int ToJson(utils::JsonParser &jp) { return 0; } }; - -GammaVearchIndex::GammaVearchIndex(VectorReader *vec, const std::string &model_parameters) { +GammaVearchIndex::GammaVearchIndex(VectorReader *vec, + const std::string &model_parameters) { indexed_count_ = 0; } -GammaVearchIndex::GammaVearchIndex() { - indexed_count_ = 0; -} +GammaVearchIndex::GammaVearchIndex() { indexed_count_ = 0; } GammaVearchIndex::~GammaVearchIndex() { is_run_ = false; @@ -251,8 +291,9 @@ void GammaVearchIndex::ThreadRun(int timeout) { while (is_run_) { if (task_queue_.wait_dequeue_timed(task, timeout) > 0) { if (task->done_status_ != 0) continue; - task->done_status_ = ScannSearch(vearch_index_, task->x_, task->n_, task->k_, - task->k_, task->leaves_, task->results); + task->done_status_ = + ScannSearch(vearch_index_, task->x_, task->n_, task->k_, task->k_, + task->leaves_, task->results); task->Notify(); } } @@ -262,16 +303,20 @@ int GammaVearchIndex::CreateThreads(int thread_num) { if (thread_num <= 0) return 0; threads_.resize(thread_num); for (int i = 0; i < thread_num; ++i) { - auto func_search = std::bind(&GammaVearchIndex::ThreadRun, this, 4 * (i + 1)); + auto func_search = + std::bind(&GammaVearchIndex::ThreadRun, this, 4 * (i + 1)); threads_[i] = std::thread(func_search); } LOG(INFO) << "Create search thread, num:" << thread_num; return 0; } -int GammaVearchIndex::Init(const std::string &model_parameters, int training_threshold) { +int GammaVearchIndex::Init(const std::string &model_parameters, + int training_threshold) { training_threshold_ = training_threshold; - if (model_param_) { delete model_param_; } + if (model_param_) { + delete model_param_; + } model_param_ = new VearchModelParams(); if (model_param_->Parse(model_parameters.c_str()) != 0) { return -1; @@ -281,7 +326,7 @@ int GammaVearchIndex::Init(const std::string &model_parameters, int training_thr std::string str_config = model_param_->GetConfig(d_, training_threshold_); #ifndef PYTHON_SDK LOG(INFO) << str_config; -#endif // PYTHON_SDK +#endif // PYTHON_SDK vearch_index_ = ScannInit(str_config.c_str(), str_config.length()); if (vearch_index_ == nullptr) { @@ -294,7 +339,7 @@ int GammaVearchIndex::Init(const std::string &model_parameters, int training_thr } RetrievalParameters *GammaVearchIndex::Parse(const std::string ¶meters) { -if (parameters == "") { + if (parameters == "") { return new VearchRetrievalParameters(metric_type_); } @@ -340,7 +385,9 @@ if (parameters == "") { } int GammaVearchIndex::Indexing() { - if (is_trained_) { return -1; } + if (is_trained_) { + return -1; + } RawVector *raw_vec = dynamic_cast(vector_); ScopeVectors headers; @@ -365,9 +412,9 @@ int GammaVearchIndex::Indexing() { offset += sizeof(float) * raw_d * lens[i]; } } - - int ret = ScannTraining(vearch_index_, train_raw_vec, bytes_num, - raw_d, model_param_->n_thread); + + int ret = ScannTraining(vearch_index_, train_raw_vec, bytes_num, raw_d, + model_param_->n_thread); indexed_count_ = training_threshold_; is_trained_ = true; @@ -377,7 +424,9 @@ int GammaVearchIndex::Indexing() { } bool GammaVearchIndex::Add(int n, const uint8_t *vec) { - if (is_trained_ == false) { return false; } + if (is_trained_ == false) { + return false; + } #ifdef PERFORMANCE_TESTING double t0 = utils::getmillisecs(); #endif @@ -401,19 +450,24 @@ bool GammaVearchIndex::Add(int n, const uint8_t *vec) { int GammaVearchIndex::Update(const std::vector &ids, const std::vector &vecs) { - if (is_trained_ == false) { return -1; } + if (is_trained_ == false) { + return -1; + } LOG(WARNING) << "vearch not support update."; return 0; } int GammaVearchIndex::Delete(const std::vector &ids) { - if (is_trained_ == false) { return -1; } + if (is_trained_ == false) { + return -1; + } ++delete_num_; return 0; } -int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const uint8_t *x, - int k, float *distances, int64_t *ids) { +int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, + const uint8_t *x, int k, float *distances, + int64_t *ids) { if (is_trained_ == false) return -1; int ret = -1; @@ -422,20 +476,23 @@ int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const u const float *q = (const float *)x; if (rerank_ <= k) rerank_ = k; std::vector>> results; -#else // else PYTHON_SDK +#else // else PYTHON_SDK VearchRetrievalParameters *retrieval_params = - dynamic_cast(retrieval_context->RetrievalParams()); + dynamic_cast( + retrieval_context->RetrievalParams()); int leaves = leaves_; if (retrieval_params && retrieval_params->nprobe_ > 0 && retrieval_params->nprobe_ < model_param_->ncentroids) { leaves = retrieval_params->nprobe_; } - + const float *q = (const float *)x; int top = k; - GammaSearchCondition *condition = - dynamic_cast(retrieval_context); - if (condition->range_query_result) { top *= 1.5; } + SearchCondition *condition = + dynamic_cast(retrieval_context); + if (condition->range_query_result) { + top *= 1.5; + } #endif // PYTHON_SDK #ifdef PERFORMANCE_TESTING @@ -452,13 +509,14 @@ int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const u ids[i * k + j] = (int64_t)results[i][j].first; } } -#else // else PYTHON_SDK +#else // else PYTHON_SDK if (model_param_->n_thread > 0) { if (task_queue_.size_approx() > 3000) { LOG(INFO) << "task_queue.size_approx() > 3000. abandon"; return -1; } - std::shared_ptr task = std::make_shared(n, q, top, leaves); + std::shared_ptr task = + std::make_shared(n, q, top, leaves); task_queue_.enqueue(task); ret = task->WaitForDone(); if (ret != 0) { @@ -472,7 +530,9 @@ int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const u if (condition->IsValid(task->results[i][j].first)) { float score = fabs(task->results[i][j].second); if (count >= k || score < condition->min_score || - score > condition->max_score) { break; } + score > condition->max_score) { + break; + } distances[i * k + count] = score; ids[i * k + count] = (int64_t)(task->results[i][j].first); ++count; @@ -489,7 +549,9 @@ int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const u if (condition->IsValid(results[i][j].first)) { float score = fabs(results[i][j].second); if (count >= k || score < condition->min_score || - score > condition->max_score) { break; } + score > condition->max_score) { + break; + } distances[i * k + count] = score; ids[i * k + count] = (int64_t)(results[i][j].first); ++count; @@ -504,21 +566,11 @@ int GammaVearchIndex::Search(RetrievalContext *retrieval_context, int n, const u return ret; } -long GammaVearchIndex::GetTotalMemBytes() { +long GammaVearchIndex::GetTotalMemBytes() { return 0; } - return 0; -} - -int GammaVearchIndex::Dump(const std::string &dir) { - - return 0; -} +int GammaVearchIndex::Dump(const std::string &dir) { return 0; } -int GammaVearchIndex::Load(const std::string &index_dir) { +int GammaVearchIndex::Load(const std::string &index_dir) { return 0; } - return 0; -} - -} +} // namespace vearch #endif - diff --git a/internal/engine/index/index.cc b/internal/engine/index/index.cc index 66f4039d..8260b0bd 100644 --- a/internal/engine/index/index.cc +++ b/internal/engine/index/index.cc @@ -59,7 +59,7 @@ IndexIVFFlat::~IndexIVFFlat() { } } -int IndexIVFFlat::init(const std::string &index_param) { +Status IndexIVFFlat::init(const std::string &index_param) { if (index_param != "") { this->index_param = index_param; } @@ -73,18 +73,19 @@ int IndexIVFFlat::init(const std::string &index_param) { std::string vec_root_path = index_root_path_ + "/vectors"; if (utils::make_dir(vec_root_path.c_str())) { - LOG(ERROR) << "make directory error, path=" << vec_root_path; - return -2; + std::string msg = + std::string("make directory error, path=") + vec_root_path; + LOG(ERROR) << msg; + return Status::PathNotFound(msg); } VectorMetaInfo *meta_info = new VectorMetaInfo(vec_name, d, value_type); meta_info->with_io_ = false; StoreParams store_params(meta_info->AbsoluteName()); - // std::string store_param = "{\"cache_size\": 16, \"compress\": - // {\"rate\":16}}"; std::string store_param = ""; - if (store_param != "" && store_params.Parse(store_param.c_str())) { - return PARAM_ERR; + if (store_param != "") { + Status status = store_params.Parse(store_param.c_str()); + if (!status.ok()) return status; } LOG(INFO) << "store params=" << store_params.ToJsonStr(); @@ -92,38 +93,42 @@ int IndexIVFFlat::init(const std::string &index_param) { docids_bitmap_ = new bitmap::BitmapManager(); int init_bitmap_size = 1000 * 10000; if (docids_bitmap_->Init(init_bitmap_size) != 0) { - LOG(ERROR) << "Cannot create bitmap!"; - return INTERNAL_ERR; + std::string msg = "Cannot create bitmap!"; + LOG(ERROR) << msg; + return Status::IOError(msg); } raw_vector_ = RawVectorFactory::Create(meta_info, storage_type, vec_root_path, store_params, docids_bitmap_); if (raw_vector_ == nullptr) { - LOG(ERROR) << "create raw vector error"; - return -1; + std::string msg = "create raw vector error"; + LOG(ERROR) << msg; + return Status::IOError(msg); } LOG(INFO) << "create raw vector success, vec_name[" << vec_name << "]"; int ret = raw_vector_->Init(vec_name, false); if (ret != 0) { - LOG(ERROR) << "Raw vector " << vec_name << " init error, code [" << ret - << "]!"; + std::string msg = std::string("Raw vector ") + vec_name + + " init error, code [" + std::to_string(ret) + "]!"; + LOG(ERROR) << msg; delete raw_vector_; - return -1; + return Status::IOError(msg); } vector_ = raw_vector_; - if (GammaIndexIVFFlat::Init(this->index_param, 100000) != 0) { + Status status = GammaIndexIVFFlat::Init(this->index_param, 100000); + if (!status.ok()) { LOG(ERROR) << "gamma index init " << vec_name << " error!"; - return -1; + return status; } // init indexed count indexed_count_ = 0; - return 0; + return Status::OK(); } -int IndexIVFFlat::init() { return init(index_param); } +Status IndexIVFFlat::init() { return init(index_param); } void IndexIVFFlat::train(idx_t n, const float *x) { faiss::IndexIVFFlat::train(n, x); @@ -134,7 +139,7 @@ void IndexIVFFlat::add(idx_t n, const float *x) { Add(n, (const uint8_t *)x); } void IndexIVFFlat::search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) { PerfTool perf_tool; - GammaSearchCondition *condition = new GammaSearchCondition(&perf_tool); + SearchCondition *condition = new SearchCondition(&perf_tool); condition->has_rank = false; condition->topn = k; condition->Init(std::numeric_limits::lowest(), @@ -143,7 +148,7 @@ void IndexIVFFlat::search(idx_t n, const float *x, idx_t k, float *distances, delete condition; } -int IndexIVFFlat::dump(const std::string &dir) { +Status IndexIVFFlat::dump(const std::string &dir) { if (utils::isFolderExist(dir.c_str()) == 0) { utils::make_dir(dir.c_str()); } @@ -154,7 +159,7 @@ int IndexIVFFlat::dump(const std::string &dir) { return Dump(dir); } -int IndexIVFFlat::load(const std::string &dir) { +Status IndexIVFFlat::load(const std::string &dir, int &load_num) { std::string index_param_file_path = dir + "/index_param_file.txt"; long file_size = utils::get_file_size(index_param_file_path); char index_param_str[file_size]; @@ -163,7 +168,7 @@ int IndexIVFFlat::load(const std::string &dir) { index_param_io.Read(index_param_str, file_size, 1); index_param = std::string(index_param_str, file_size); init(index_param); - return Load(dir); + return Load(dir, load_num); } IndexIVFPQ::IndexIVFPQ(faiss::Index *quantizer, size_t d, size_t nlist, @@ -195,7 +200,7 @@ IndexIVFPQ::~IndexIVFPQ() { } } -int IndexIVFPQ::init(const std::string &index_param) { +Status IndexIVFPQ::init(const std::string &index_param) { if (index_param != "") { this->index_param = index_param; } @@ -209,18 +214,19 @@ int IndexIVFPQ::init(const std::string &index_param) { std::string vec_root_path = index_root_path_ + "/vectors"; if (utils::make_dir(vec_root_path.c_str())) { - LOG(ERROR) << "make directory error, path=" << vec_root_path; - return -2; + std::string msg = + std::string("make directory error, path=") + vec_root_path; + LOG(ERROR) << msg; + return Status::PathNotFound(msg); } VectorMetaInfo *meta_info = new VectorMetaInfo(vec_name, d, value_type); meta_info->with_io_ = false; StoreParams store_params(meta_info->AbsoluteName()); - // std::string store_param = "{\"cache_size\": 16, \"compress\": - // {\"rate\":16}}"; std::string store_param = ""; - if (store_param != "" && store_params.Parse(store_param.c_str())) { - return PARAM_ERR; + if (store_param != "") { + Status status = store_params.Parse(store_param.c_str()); + if (!status.ok()) return status; } LOG(INFO) << "store params=" << store_params.ToJsonStr(); @@ -228,45 +234,51 @@ int IndexIVFPQ::init(const std::string &index_param) { docids_bitmap_ = new bitmap::BitmapManager(); int init_bitmap_size = 1000 * 10000; if (docids_bitmap_->Init(init_bitmap_size) != 0) { - LOG(ERROR) << "Cannot create bitmap!"; - return INTERNAL_ERR; + std::string msg = "Cannot create bitmap!"; + LOG(ERROR) << msg; + return Status::IOError(msg); } raw_vector_ = RawVectorFactory::Create(meta_info, storage_type, vec_root_path, store_params, docids_bitmap_); if (raw_vector_ == nullptr) { - LOG(ERROR) << "create raw vector error"; - return -1; + std::string msg = "create raw vector error"; + LOG(ERROR) << msg; + return Status::IOError(msg); } LOG(INFO) << "create raw vector success, vec_name[" << vec_name << "]"; int ret = raw_vector_->Init(vec_name, false); if (ret != 0) { - LOG(ERROR) << "Raw vector " << vec_name << " init error, code [" << ret - << "]!"; + std::string msg = std::string("Raw vector ") + vec_name + + " init error, code [" + std::to_string(ret) + "]!"; + LOG(ERROR) << msg; delete raw_vector_; - return -1; + return Status::IOError(msg); } vector_ = raw_vector_; + Status status; #ifdef OPT_IVFPQ_RELAYOUT - if (GammaIndexIVFPQRelayout::Init(this->index_param, 100000) != 0) { + status = GammaIndexIVFPQRelayout::Init(this->index_param, 100000); + if (!status.ok()) { LOG(ERROR) << "gamma index init " << vec_name << " error!"; - return -1; + return status; } #else - if (GammaIVFPQIndex::Init(this->index_param, 100000) != 0) { + status = GammaIVFPQIndex::Init(this->index_param, 100000); + if (!status.ok()) { LOG(ERROR) << "gamma index init " << vec_name << " error!"; - return -1; + return status; } #endif // init indexed count indexed_count_ = 0; - return 0; + return Status::OK(); } -int IndexIVFPQ::init() { return init(index_param); } +Status IndexIVFPQ::init() { return init(index_param); } void IndexIVFPQ::train(idx_t n, const float *x) { faiss::IndexIVFPQ::train(n, x); @@ -277,7 +289,7 @@ void IndexIVFPQ::add(idx_t n, const float *x) { Add(n, (const uint8_t *)x); } void IndexIVFPQ::search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) { PerfTool perf_tool; - GammaSearchCondition *condition = new GammaSearchCondition(&perf_tool); + SearchCondition *condition = new SearchCondition(&perf_tool); condition->has_rank = false; condition->topn = k; condition->Init(std::numeric_limits::lowest(), @@ -286,7 +298,7 @@ void IndexIVFPQ::search(idx_t n, const float *x, idx_t k, float *distances, delete condition; } -int IndexIVFPQ::dump(const std::string &dir) { +Status IndexIVFPQ::dump(const std::string &dir) { if (utils::isFolderExist(dir.c_str()) == 0) { utils::make_dir(dir.c_str()); } @@ -297,7 +309,7 @@ int IndexIVFPQ::dump(const std::string &dir) { return Dump(dir); } -int IndexIVFPQ::load(const std::string &dir) { +Status IndexIVFPQ::load(const std::string &dir, int &load_num) { std::string index_param_file_path = dir + "/index_param_file.txt"; long file_size = utils::get_file_size(index_param_file_path); char index_param_str[file_size]; @@ -309,7 +321,7 @@ int IndexIVFPQ::load(const std::string &dir) { #ifdef OPT_IVFPQ_RELAYOUT check_vector_size_ = false; #endif - return Load(dir); + return Load(dir, load_num); } #ifdef USE_SCANN @@ -359,8 +371,6 @@ int IndexScann::init(const std::string &index_param) { meta_info->with_io_ = false; StoreParams store_params(meta_info->AbsoluteName()); - // std::string store_param = "{\"cache_size\": 16, \"compress\": - // {\"rate\":16}}"; std::string store_param = ""; if (store_param != "" && store_params.Parse(store_param.c_str())) { return PARAM_ERR; @@ -414,7 +424,7 @@ void IndexScann::add(idx_t n, const float *x) { Add(n, (const uint8_t *)x); } void IndexScann::search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) { PerfTool perf_tool; - GammaSearchCondition *condition = new GammaSearchCondition(&perf_tool); + SearchCondition *condition = new SearchCondition(&perf_tool); condition->has_rank = false; condition->topn = k; condition->Init(std::numeric_limits::lowest(), diff --git a/internal/engine/index/index.h b/internal/engine/index/index.h index 8c912137..30c12a59 100644 --- a/internal/engine/index/index.h +++ b/internal/engine/index/index.h @@ -47,9 +47,9 @@ class Index { * ,\"nsubvector\" : 64}" * @return int */ - virtual int init(const std::string &index_param) { return 0; }; + virtual Status init(const std::string &index_param) { return Status::OK(); }; - virtual int init() { return 0; }; + virtual Status init() { return Status::OK(); }; virtual void train(idx_t n, const float *x){}; @@ -58,9 +58,12 @@ class Index { virtual void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels){}; - virtual int dump(const std::string &dir) { return 0; }; + virtual Status dump(const std::string &dir) { return Status::OK(); }; - virtual int load(const std::string &dir) { return 0; }; + virtual Status load(const std::string &dir, int &load_num) { + load_num = 0; + return Status::OK(); + }; protected: bitmap::BitmapManager *docids_bitmap_; @@ -80,9 +83,9 @@ class IndexIVFFlat : public GammaIndexIVFFlat, public Index { virtual ~IndexIVFFlat(); - int init(const std::string &index_param) override; + Status init(const std::string &index_param) override; - int init() override; + Status init() override; void train(idx_t n, const float *x) override; @@ -91,9 +94,9 @@ class IndexIVFFlat : public GammaIndexIVFFlat, public Index { void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) override; - int dump(const std::string &dir) override; + Status dump(const std::string &dir) override; - int load(const std::string &dir) override; + Status load(const std::string &dir, int &load_num) override; }; #ifdef OPT_IVFPQ_RELAYOUT @@ -107,9 +110,9 @@ class IndexIVFPQ : public GammaIVFPQIndex, public Index { virtual ~IndexIVFPQ(); - int init(const std::string &index_param) override; + Status init(const std::string &index_param) override; - int init() override; + Status init() override; void train(idx_t n, const float *x) override; @@ -118,9 +121,9 @@ class IndexIVFPQ : public GammaIVFPQIndex, public Index { void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) override; - int dump(const std::string &dir) override; + Status dump(const std::string &dir) override; - int load(const std::string &dir) override; + Status load(const std::string &dir, int &load_num) override; }; #ifdef USE_SCANN diff --git a/internal/engine/index/index_io.cc b/internal/engine/index/index_io.cc index 7f3a5399..51ce8d69 100644 --- a/internal/engine/index/index_io.cc +++ b/internal/engine/index/index_io.cc @@ -9,7 +9,6 @@ #include -#include "common/error_code.h" #include "util/log.h" namespace vearch { @@ -141,9 +140,9 @@ int WriteInvertedLists(faiss::IOWriter *f, return 0; } -int ReadInvertedLists(faiss::IOReader *f, - realtime::RTInvertIndex *rt_invert_index, - int &indexed_vec_count) { +Status ReadInvertedLists(faiss::IOReader *f, + realtime::RTInvertIndex *rt_invert_index, + int &indexed_vec_count) { realtime::RealTimeMemData *rt_data = rt_invert_index->cur_ptr_; uint32_t h; size_t buckets_num = 0, code_bytes = 0; @@ -157,7 +156,7 @@ int ReadInvertedLists(faiss::IOReader *f, assert(list_type == faiss::fourcc("full")); if (buckets_num != rt_data->buckets_num_ || code_bytes != rt_data->code_bytes_per_vec_) { - return FORMAT_ERR; + return Status::IndexError(); } std::vector sizes; @@ -169,8 +168,9 @@ int ReadInvertedLists(faiss::IOReader *f, indexed_vec_count += sizes[bno]; if (rt_data->ExtendBucketIfNeed(bno, sizes[bno])) { - LOG(ERROR) << "loading, extend bucket error"; - return INTERNAL_ERR; + std::string msg = "loading, extend bucket error"; + LOG(ERROR) << msg; + return Status::IndexError(msg); } uint8_t *codes = rt_data->cur_invert_ptr_->codes_array_[bno]; long *ids = rt_data->cur_invert_ptr_->idx_array_[bno]; @@ -190,7 +190,7 @@ int ReadInvertedLists(faiss::IOReader *f, indexed_vec_count -= rt_data->cur_invert_ptr_->deleted_nums_[bno]; rt_data->cur_invert_ptr_->retrieve_idx_pos_[bno] = sizes[bno]; } - return 0; + return Status::OK(); } void write_hnsw(const faiss::HNSW *hnsw, faiss::IOWriter *f) { diff --git a/internal/engine/index/index_io.h b/internal/engine/index/index_io.h index 721a74ee..cc8f266e 100644 --- a/internal/engine/index/index_io.h +++ b/internal/engine/index/index_io.h @@ -14,6 +14,7 @@ #include "faiss/impl/io.h" #include "faiss/index_io.h" #include "realtime/realtime_invert_index.h" +#include "util/status.h" namespace vearch { /************************************************************* @@ -143,7 +144,7 @@ struct FileIOWriter : faiss::IOWriter { int WriteInvertedLists(faiss::IOWriter *f, realtime::RTInvertIndex *rt_invert_index); -int ReadInvertedLists(faiss::IOReader *f, - realtime::RTInvertIndex *rt_invert_index, - int &indexed_vec_count); +Status ReadInvertedLists(faiss::IOReader *f, + realtime::RTInvertIndex *rt_invert_index, + int &indexed_vec_count); } // namespace vearch diff --git a/internal/engine/index/index_model.h b/internal/engine/index/index_model.h index b3145635..e16632c7 100644 --- a/internal/engine/index/index_model.h +++ b/internal/engine/index/index_model.h @@ -13,6 +13,7 @@ // #include "concurrentqueue/concurrentqueue.h" #include "reflector.h" +#include "util/status.h" #include "util/utils.h" enum class VectorValueType : std::uint8_t { FLOAT = 0, BINARY = 1, INT8 = 2 }; @@ -68,7 +69,9 @@ class RetrievalParameters { } int CollectMetrics() { return collect_metrics_; } - void SetCollectMetrics(int collect_metrics) { collect_metrics_ = collect_metrics; } + void SetCollectMetrics(int collect_metrics) { + collect_metrics_ = collect_metrics; + } protected: enum DistanceComputeType distance_compute_type_; @@ -80,7 +83,7 @@ class RetrievalParameters { // it also provides performance tool to record performance info class RetrievalContext { public: - RetrievalContext() { + RetrievalContext() { retrieval_params_ = nullptr; perf_tool_ = nullptr; } @@ -197,7 +200,7 @@ class VectorReader { public: VectorReader(VectorMetaInfo *meta_info) : meta_info_(meta_info) {} - virtual ~VectorReader() { + virtual ~VectorReader() { delete meta_info_; meta_info_ = nullptr; }; @@ -234,7 +237,8 @@ class IndexModel { * @param model_parameters include model params, need parse by yourself * @return 0 if successed */ - virtual int Init(const std::string &model_parameters, int training_threshold) = 0; + virtual vearch::Status Init(const std::string &model_parameters, + int training_threshold) = 0; /** Parse parameters for dynamic retrieval * @@ -293,16 +297,17 @@ class IndexModel { /** Dump model and index * * @param dir dump directory - * @return 0 if successed + * @return Status::OK if successed */ - virtual int Dump(const std::string &dir) = 0; + virtual vearch::Status Dump(const std::string &dir) = 0; /** Load model and index * * @param dir load directory + * @param load_num load doc num * @return load number(>=0) if successed */ - virtual int Load(const std::string &dir) = 0; + virtual vearch::Status Load(const std::string &dir, int &load_num) = 0; virtual void train(int64_t n, const float *x) {} diff --git a/internal/engine/index/realtime/realtime_mem_data.cc b/internal/engine/index/realtime/realtime_mem_data.cc index 97583dea..cdb376fc 100644 --- a/internal/engine/index/realtime/realtime_mem_data.cc +++ b/internal/engine/index/realtime/realtime_mem_data.cc @@ -12,7 +12,6 @@ #include #include -#include "common/error_code.h" #include "faiss/impl/io.h" #include "util/bitmap.h" #include "util/log.h" diff --git a/internal/engine/io/async_flush.h b/internal/engine/io/async_flush.h index 1b5328db..11c4ec9d 100644 --- a/internal/engine/io/async_flush.h +++ b/internal/engine/io/async_flush.h @@ -11,29 +11,30 @@ #include #include #include -#include "common/error_code.h" + #include "util/log.h" +#include "util/status.h" #include "util/utils.h" struct AsyncFlusher { AsyncFlusher(std::string name) : name_(name) { nflushed_ = 0; } ~AsyncFlusher() {} - int Until(int vid, int timeout = 0) { + vearch::Status Until(int vid, int timeout = 0) { double begin = utils::getmillisecs(); while (nflushed_ < vid) { std::this_thread::sleep_for(std::chrono::milliseconds(100)); if (timeout > 0 && utils::getmillisecs() - begin > timeout) { - return TIMEOUT_ERR; + return vearch::Status::TimedOut(); } } - return 0; + return vearch::Status::OK(); } // reset after load() void Reset(int num) { nflushed_ = num; } - virtual int FlushOnce() = 0; + virtual vearch::Status FlushOnce() = 0; std::string name_; std::atomic nflushed_; @@ -74,28 +75,29 @@ struct AsyncFlushExecutor { static void Handler(AsyncFlushExecutor *executor) { LOG(INFO) << "async flush executor is started!"; - int ret = executor->Flush(); - if (ret != 0) { - LOG(ERROR) << "async flush executor exit unexpectedly! ret=" << ret; + vearch::Status status = executor->Flush(); + if (!status.ok()) { + LOG(ERROR) << "async flush executor exit unexpectedly! ret=" + << status.ToString(); } else { LOG(INFO) << "async flush executor exit successfully!"; } } - int Flush() { + vearch::Status Flush() { while (!stopped_) { for (AsyncFlusher *af : async_flushers_) { - int ret = af->FlushOnce(); - if (ret) { - LOG(ERROR) << "aysnc flush error, ret=" << ret + vearch::Status status = af->FlushOnce(); + if (!status.ok()) { + LOG(ERROR) << "aysnc flush error, ret=" << status.ToString() << ", name=" << af->name_; - return ret; + return status; } - if (stopped_) return 0; + if (stopped_) return vearch::Status::OK(); } std::this_thread::sleep_for(std::chrono::milliseconds(interval_)); } - return 0; + return vearch::Status::OK(); } void Add(AsyncFlusher *af) { async_flushers_.push_back(af); } diff --git a/internal/engine/io/memory_raw_vector_io.cc b/internal/engine/io/memory_raw_vector_io.cc index d78d534c..02ab5499 100644 --- a/internal/engine/io/memory_raw_vector_io.cc +++ b/internal/engine/io/memory_raw_vector_io.cc @@ -7,32 +7,30 @@ #include "memory_raw_vector_io.h" -#include "common/error_code.h" #include "io_common.h" namespace vearch { using std::string; using std::vector; -using namespace rocksdb; -int MemoryRawVectorIO::Init() { +Status MemoryRawVectorIO::Init() { const std::string &name = raw_vector->MetaInfo()->AbsoluteName(); string db_path = raw_vector->RootPath() + "/" + name; - if (rdb.Open(db_path)) { - LOG(ERROR) << "open rocks db error, path=" << db_path; - return IO_ERR; + Status status = rdb.Open(db_path); + if (!status.ok()) { + return status; } - return 0; + return Status::OK(); } -int MemoryRawVectorIO::Dump(int start_vid, int end_vid) { - int ret = Until(end_vid, 1000 * 10); - if (ret == TIMEOUT_ERR) { - LOG(ERROR) << "dump wait async flusher timeout!"; - return TIMEOUT_ERR; +Status MemoryRawVectorIO::Dump(int start_vid, int end_vid) { + Status status = Until(end_vid, 1000 * 10); + if (!status.ok()) { + LOG(ERROR) << status.ToString(); + return status; } - return 0; + return Status::OK(); } int MemoryRawVectorIO::GetDiskVecNum(int &vec_num) { @@ -41,7 +39,8 @@ int MemoryRawVectorIO::GetDiskVecNum(int &vec_num) { string key, value; for (int i = disk_vec_num; i >= 0; --i) { rdb.ToRowKey(i, key); - Status s = rdb.db_->Get(ReadOptions(), Slice(key), &value); + rocksdb::Status s = + rdb.db_->Get(rocksdb::ReadOptions(), rocksdb::Slice(key), &value); if (s.ok()) { vec_num = i + 1; LOG(INFO) << "In the disk rocksdb vec_num=" << vec_num; @@ -53,48 +52,51 @@ int MemoryRawVectorIO::GetDiskVecNum(int &vec_num) { return 0; } -int MemoryRawVectorIO::Load(int vec_num) { +Status MemoryRawVectorIO::Load(int vec_num) { rocksdb::Iterator *it = rdb.db_->NewIterator(rocksdb::ReadOptions()); utils::ScopeDeleter1 del1(it); string start_key; rdb.ToRowKey(0, start_key); - it->Seek(Slice(start_key)); + it->Seek(rocksdb::Slice(start_key)); for (int c = 0; c < vec_num; c++, it->Next()) { if (!it->Valid()) { - LOG(ERROR) << "load vectors error, expected num=" << vec_num - << ", current=" << c; - return INTERNAL_ERR; + std::string msg = std::string("load vectors error, expected num=") + + std::to_string(vec_num) + + ", current=" + std::to_string(c); + LOG(ERROR) << msg; + return Status::IOError(msg); } - Slice value = it->value(); + rocksdb::Slice value = it->value(); raw_vector->AddToMem((uint8_t *)value.data_, raw_vector->VectorByteSize()); } raw_vector->MetaInfo()->size_ = vec_num; Reset(vec_num); - return 0; + return Status::OK(); } -int MemoryRawVectorIO::FlushOnce() { +Status MemoryRawVectorIO::FlushOnce() { int size = raw_vector->MetaInfo()->size_; - if (nflushed_ == size) return 0; + if (nflushed_ == size) return Status::OK(); for (int vid = nflushed_; vid < size; vid++) { - if (Put(vid)) return -1; + Status status = Put(vid); + if (!status.ok()) return status; } nflushed_ = size; - return 0; + return Status::OK(); } -int MemoryRawVectorIO::Put(int vid) { +Status MemoryRawVectorIO::Put(int vid) { const uint8_t *vec = raw_vector->GetFromMem(vid); return rdb.Put(vid, (const char *)vec, raw_vector->VectorByteSize()); } -int MemoryRawVectorIO::Update(int vid) { - int ret = Until(vid + 1, 1000 * 3); // waiting until vid is flushed - if (ret == TIMEOUT_ERR) { +Status MemoryRawVectorIO::Update(int vid) { + Status status = Until(vid + 1, 1000 * 3); // waiting until vid is flushed + if (status.code() == status::kTimedOut) { LOG(ERROR) << "update vector, wait async flush timeout"; - return TIMEOUT_ERR; + return status; } return Put(vid); } diff --git a/internal/engine/io/memory_raw_vector_io.h b/internal/engine/io/memory_raw_vector_io.h index 3f606dba..047a79a0 100644 --- a/internal/engine/io/memory_raw_vector_io.h +++ b/internal/engine/io/memory_raw_vector_io.h @@ -24,15 +24,15 @@ struct MemoryRawVectorIO : public RawVectorIO, public AsyncFlusher { : AsyncFlusher(raw_vector_->MetaInfo()->Name()), raw_vector(raw_vector_) {} ~MemoryRawVectorIO() {} - int Init() override; - int Dump(int start_vid, int end_vid) override; + Status Init() override; + Status Dump(int start_vid, int end_vid) override; int GetDiskVecNum(int &vec_num) override; - int Load(int vec_num) override; - int Update(int vid) override; + Status Load(int vec_num) override; + Status Update(int vid) override; - int FlushOnce() override; + Status FlushOnce() override; - int Put(int vid); + Status Put(int vid); }; } // namespace vearch diff --git a/internal/engine/io/raw_vector_io.h b/internal/engine/io/raw_vector_io.h index 05f19170..bfad8cf1 100644 --- a/internal/engine/io/raw_vector_io.h +++ b/internal/engine/io/raw_vector_io.h @@ -9,17 +9,19 @@ #include +#include "util/status.h" + namespace vearch { struct RawVectorIO { virtual ~RawVectorIO(){}; - virtual int Init() { return 0; } + virtual Status Init() { return Status::OK(); } // [start_vid, end_vid) - virtual int Dump(int start_vid, int end_vid) = 0; + virtual Status Dump(int start_vid, int end_vid) = 0; virtual int GetDiskVecNum(int &vec_num) = 0; - virtual int Load(int vec_num) = 0; - virtual int Update(int vid) = 0; + virtual Status Load(int vec_num) = 0; + virtual Status Update(int vid) = 0; }; } // namespace vearch diff --git a/internal/engine/io/rocksdb_raw_vector_io.cc b/internal/engine/io/rocksdb_raw_vector_io.cc index 9e88cd81..0cdbf0e0 100644 --- a/internal/engine/io/rocksdb_raw_vector_io.cc +++ b/internal/engine/io/rocksdb_raw_vector_io.cc @@ -9,16 +9,14 @@ namespace vearch { -using std::string; -using namespace rocksdb; - int RocksDBRawVectorIO::GetDiskVecNum(int &vec_num) { if (vec_num <= 0) return 0; int max_id_in_disk = vec_num - 1; - string key, value; + std::string key, value; for (int i = max_id_in_disk; i >= 0; --i) { raw_vector->ToRowKey(i, key); - Status s = raw_vector->db_->Get(ReadOptions(), Slice(key), &value); + rocksdb::Status s = raw_vector->db_->Get(rocksdb::ReadOptions(), + rocksdb::Slice(key), &value); if (s.ok()) { vec_num = i + 1; LOG(INFO) << "In the disk rocksdb vec_num=" << vec_num; @@ -30,19 +28,21 @@ int RocksDBRawVectorIO::GetDiskVecNum(int &vec_num) { return 0; } -int RocksDBRawVectorIO::Load(int vec_num) { - if (vec_num == 0) return 0; - string key, value; +Status RocksDBRawVectorIO::Load(int vec_num) { + if (vec_num == 0) return Status::OK(); + std::string key, value; raw_vector->ToRowKey(vec_num - 1, key); - Status s = raw_vector->db_->Get(ReadOptions(), Slice(key), &value); + rocksdb::Status s = + raw_vector->db_->Get(rocksdb::ReadOptions(), rocksdb::Slice(key), &value); if (!s.ok()) { - LOG(ERROR) << "load vectors, get error:" << s.ToString() - << ", expected key=" << key; - return INTERNAL_ERR; + std::string msg = std::string("load vectors, get error:") + s.ToString() + + ", expected key=" + key; + LOG(ERROR) << msg; + return Status::IOError(msg); } raw_vector->MetaInfo()->size_ = vec_num; LOG(INFO) << "rocksdb load success! vec_num=" << vec_num; - return 0; + return Status::OK(); } } // namespace vearch diff --git a/internal/engine/io/rocksdb_raw_vector_io.h b/internal/engine/io/rocksdb_raw_vector_io.h index e95a3dc3..99b44df1 100644 --- a/internal/engine/io/rocksdb_raw_vector_io.h +++ b/internal/engine/io/rocksdb_raw_vector_io.h @@ -19,11 +19,11 @@ struct RocksDBRawVectorIO : public RawVectorIO { RocksDBRawVectorIO(RocksDBRawVector *raw_vector_) : raw_vector(raw_vector_) {} ~RocksDBRawVectorIO() {} - int Init() override { return 0; }; - int Dump(int start_vid, int end_vid) override { return 0; }; + Status Init() override { return Status::OK(); }; + Status Dump(int start_vid, int end_vid) override { return Status::OK(); }; int GetDiskVecNum(int &vec_num) override; - int Load(int vec_num) override; - int Update(int vid) override { return 0; }; + Status Load(int vec_num) override; + Status Update(int vid) override { return Status::OK(); }; }; } // namespace vearch diff --git a/internal/engine/sdk/go/gamma/gamma.go b/internal/engine/sdk/go/gamma/gamma.go index da69426c..4bb0228c 100644 --- a/internal/engine/sdk/go/gamma/gamma.go +++ b/internal/engine/sdk/go/gamma/gamma.go @@ -138,24 +138,6 @@ func Load(engine unsafe.Pointer) int { return int(C.Load(engine)) } -/*func Search(engine unsafe.Pointer, request *Request, response *Response) int { - var buffer []byte - request.Serialize(&buffer) - - var CBuffer *C.char - zero := 0 - length := &zero - - ret := int(C.Search(engine, - (*C.char)(unsafe.Pointer(&buffer[0])), C.int(len(buffer)), - (**C.char)(unsafe.Pointer(&CBuffer)), - (*C.int)(unsafe.Pointer(length)))) - defer C.free(unsafe.Pointer(CBuffer)) - res := C.GoBytes(unsafe.Pointer(CBuffer), C.int(*length)) - response.DeSerialize(res) - return ret -}*/ - func Search(engine unsafe.Pointer, reqByte []byte) (int, []byte) { var CBuffer *C.char zero := 0 diff --git a/internal/engine/sdk/go/gamma/response.go b/internal/engine/sdk/go/gamma/response.go index d671a660..96307a1d 100644 --- a/internal/engine/sdk/go/gamma/response.go +++ b/internal/engine/sdk/go/gamma/response.go @@ -29,7 +29,6 @@ type Attribute struct { type ResultItem struct { Score float64 Attributes []Attribute - Extra string } type SearchResult struct { @@ -79,12 +78,9 @@ func (response *Response) Serialize(buffer *[]byte) int { } attrs := builder.EndVector(len(response.Results[i].ResultItems[j].Attributes)) - extra := builder.CreateString(response.Results[i].ResultItems[j].Extra) - gamma_api.ResultItemStart(builder) gamma_api.ResultItemAddScore(builder, response.Results[i].ResultItems[j].Score) gamma_api.ResultItemAddAttributes(builder, attrs) - gamma_api.ResultItemAddExtra(builder, extra) resultItems[j] = gamma_api.ResultItemEnd(builder) } @@ -141,7 +137,6 @@ func (response *Response) DeSerialize(buffer []byte) { result.ResultItems(&item, j) response.Results[i].ResultItems[j].Score = item.Score() - response.Results[i].ResultItems[j].Extra = string(item.Extra()) response.Results[i].ResultItems[j].Attributes = make([]Attribute, item.AttributesLength()) for k := 0; k < item.AttributesLength(); k++ { @@ -187,7 +182,6 @@ func DeSerialize(buffer []byte, resp *vearchpb.SearchResponse) { } resultItem := vearchpb.ResultItem{} resultItem.Score = item.Score() - resultItem.Extra = string(item.Extra()) for k := 0; k < item.AttributesLength(); k++ { var attrs gamma_api.Attribute diff --git a/internal/engine/sdk/python/python/__init__.py b/internal/engine/sdk/python/python/__init__.py index cac0a989..2cb78647 100644 --- a/internal/engine/sdk/python/python/__init__.py +++ b/internal/engine/sdk/python/python/__init__.py @@ -242,7 +242,6 @@ def parse_other_info(self): if engine.get("retrieval_param") == None: engine["retrieval_param"] = "" - engine["compress_mode"] = 0 engine["retrieval_types"] = [] engine["retrieval_params"] = [] @@ -373,7 +372,6 @@ def serialize(self): Table.TableAddFields(builder, ser_fields) Table.TableAddVectorsInfo(builder, ser_vectors) Table.TableAddIndexingSize(builder, self.engine["index_size"]) - Table.TableAddCompressMode(builder, self.engine["compress_mode"]) Table.TableAddRetrievalType(builder, retrieval_type) Table.TableAddRetrievalParam(builder, retrieval_param) Table.TableAddRetrievalTypes(builder, retrieval_types) diff --git a/internal/engine/search/engine.cc b/internal/engine/search/engine.cc index 4fbf2e61..711e18b0 100644 --- a/internal/engine/search/engine.cc +++ b/internal/engine/search/engine.cc @@ -26,17 +26,15 @@ #include #include "cjson/cJSON.h" -#include "common/error_code.h" #include "common/gamma_common_data.h" #include "io/raw_vector_io.h" #include "omp.h" #include "table/table_io.h" #include "util/bitmap.h" #include "util/log.h" +#include "util/status.h" #include "util/utils.h" -using std::string; - namespace vearch { bool RequestConcurrentController::Acquire(int req_num) { @@ -113,49 +111,6 @@ int RequestConcurrentController::GetSystemInfo(const char *cmd) { return num; } -#ifdef DEBUG -static string float_array_to_string(float *data, int len) { - if (data == nullptr) return ""; - std::stringstream ss; - ss << "["; - for (int i = 0; i < len; ++i) { - ss << data[i]; - if (i != len - 1) { - ss << ","; - } - } - ss << "]"; - return ss.str(); -} - -static string VectorQueryToString(VectorQuery *vector_query) { - std::stringstream ss; - ss << "name:" - << std::string(vector_query->name->value, vector_query->name->len) - << " min score:" << vector_query->min_score - << " max score:" << vector_query->max_score - << " boost:" << vector_query->boost - << " has boost:" << vector_query->has_boost << " value:" - << float_array_to_string((float *)vector_query->value->value, - vector_query->value->len / sizeof(float)); - return ss.str(); -} - -// static string RequestToString(const Request *request) { -// std::stringstream ss; -// ss << "{req_num:" << request->req_num << " topn:" << request->topn -// << " has_rank:" << request->has_rank -// << " vec_num:" << request->vec_fields_num; -// for (int i = 0; i < request->vec_fields_num; ++i) { -// ss << " vec_id:" << i << " [" << -// VectorQueryToString(request->vec_fields[i]) -// << "]"; -// } -// ss << "}"; -// return ss.str(); -// } -#endif // DEBUG - #ifndef __APPLE__ static std::thread *gMemTrimThread = nullptr; void MemTrimHandler() { @@ -168,7 +123,8 @@ void MemTrimHandler() { } #endif -Engine::Engine(const string &index_root_path, const string &space_name) +Engine::Engine(const std::string &index_root_path, + const std::string &space_name) : index_root_path_(index_root_path), space_name_(space_name), date_time_format_("%Y-%m-%d-%H:%M:%S") { @@ -221,11 +177,11 @@ Engine::~Engine() { } } -Engine *Engine::GetInstance(const string &index_root_path, - const string &space_name) { +Engine *Engine::GetInstance(const std::string &index_root_path, + const std::string &space_name) { Engine *engine = new Engine(index_root_path, space_name); - int ret = engine->Setup(); - if (ret < 0) { + Status status = engine->Setup(); + if (!status.ok()) { LOG(ERROR) << "Build " << space_name << " [" << index_root_path << "] failed!"; return nullptr; @@ -233,7 +189,7 @@ Engine *Engine::GetInstance(const string &index_root_path, return engine; } -int Engine::Setup() { +Status Engine::Setup() { if (!utils::isFolderExist(index_root_path_.c_str())) { mkdir(index_root_path_.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); } @@ -254,8 +210,9 @@ int Engine::Setup() { } if (docids_bitmap_->Init(init_bitmap_size) != 0) { - LOG(ERROR) << "Cannot create bitmap!"; - return INTERNAL_ERR; + std::string msg = "Cannot create bitmap!"; + LOG(ERROR) << msg; + return Status::IOError(msg); } if (is_load) { docids_bitmap_->Load(); @@ -286,28 +243,27 @@ int Engine::Setup() { max_docid_ = 0; LOG(INFO) << space_name_ << " setup successed! bitmap_bytes_size=" << docids_bitmap_->BytesSize(); - return 0; + return Status::OK(); } -int Engine::Search(Request &request, Response &response_results) { -#ifdef DEBUG -// LOG(INFO) << "search request:" << RequestToString(request); -#endif - - int ret = 0; +int Engine::Search(Request &request, Response &response_results, + Status &status) { int req_num = request.ReqNum(); if (req_num <= 0) { - string msg = space_name_ + " req_num should not less than 0"; + std::string msg = space_name_ + " req_num should not less than 0"; + status = Status::InvalidArgument(msg); LOG(ERROR) << msg; - return -1; + return status.code(); } bool req_permit = RequestConcurrentController::GetInstance().Acquire(req_num); if (not req_permit) { - LOG(WARNING) << "Resource temporarily unavailable"; + std::string msg = "Resource temporarily unavailable"; + LOG(WARNING) << msg; RequestConcurrentController::GetInstance().Release(req_num); - return -1; + status = Status::ResourceExhausted(); + return status.code(); } int topn = request.TopN(); @@ -317,7 +273,7 @@ int Engine::Search(Request &request, Response &response_results) { if (vec_fields_num > 0 && (not brute_force_search) && (index_status_ != IndexStatus::INDEXED)) { - string msg = "index not trained!"; + std::string msg = "index not trained!"; LOG(WARNING) << msg; for (int i = 0; i < req_num; ++i) { SearchResult result; @@ -326,13 +282,14 @@ int Engine::Search(Request &request, Response &response_results) { response_results.AddResults(std::move(result)); } RequestConcurrentController::GetInstance().Release(req_num); - return -2; + status = Status::IndexNotTrained(); + return status.code(); } GammaQuery gamma_query; gamma_query.vec_query = vec_fields; - gamma_query.condition = new GammaSearchCondition( + gamma_query.condition = new SearchCondition( static_cast(response_results.GetPerTool())); gamma_query.condition->topn = topn; gamma_query.condition->multi_vector_rank = @@ -357,7 +314,7 @@ int Engine::Search(Request &request, Response &response_results) { &range_query_result); if (num == 0) { RequestConcurrentController::GetInstance().Release(req_num); - return 0; + return status.code(); } } #ifdef PERFORMANCE_TESTING @@ -373,9 +330,10 @@ int Engine::Search(Request &request, Response &response_results) { gamma_results[i].total = doc_num; } - ret = vec_manager_->Search(gamma_query, gamma_results); - if (ret != 0) { - string msg = space_name_ + " search error [" + std::to_string(ret) + "]"; + status = vec_manager_->Search(gamma_query, gamma_results); + if (!status.ok()) { + std::string msg = + space_name_ + " search error [" + status.ToString() + "]"; for (int i = 0; i < req_num; ++i) { SearchResult result; result.msg = msg; @@ -384,7 +342,7 @@ int Engine::Search(Request &request, Response &response_results) { } RequestConcurrentController::GetInstance().Release(req_num); delete[] gamma_results; - return -3; + return status.code(); } #ifdef PERFORMANCE_TESTING @@ -418,10 +376,10 @@ int Engine::Search(Request &request, Response &response_results) { #endif // PERFORMANCE_TESTING RequestConcurrentController::GetInstance().Release(req_num); - return ret; + return status.code(); } -int Engine::MultiRangeQuery(Request &request, GammaSearchCondition *condition, +int Engine::MultiRangeQuery(Request &request, SearchCondition *condition, Response &response_results, MultiRangeQueryResults *range_query_result) { std::vector filters; @@ -459,7 +417,8 @@ int Engine::MultiRangeQuery(Request &request, GammaSearchCondition *condition, int num = field_range_index_->Search(filters, range_query_result); if (num == 0) { - string msg = space_name_ + " no result: numeric filter return 0 result"; + std::string msg = + space_name_ + " no result: numeric filter return 0 result"; LOG(DEBUG) << msg; for (int i = 0; i < request.ReqNum(); ++i) { SearchResult result; @@ -475,13 +434,14 @@ int Engine::MultiRangeQuery(Request &request, GammaSearchCondition *condition, return num; } -int Engine::CreateTable(TableInfo &table) { +Status Engine::CreateTable(TableInfo &table) { if (!vec_manager_ || !table_) { - LOG(ERROR) << space_name_ << " vector and table should not be null!"; - return -1; + std::string msg = space_name_ + " vector and table should not be null!"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } - string dump_meta_path = index_root_path_ + "/dump.meta"; + std::string dump_meta_path = index_root_path_ + "/dump.meta"; utils::JsonParser *meta_jp = nullptr; utils::ScopeDeleter1 del1; if (utils::file_exist(dump_meta_path)) { @@ -489,25 +449,27 @@ int Engine::CreateTable(TableInfo &table) { if (len > 0) { utils::FileIO fio(dump_meta_path); if (fio.Open("r")) { - LOG(ERROR) << space_name_ - << " open file error, path=" << dump_meta_path; - return IO_ERR; + std::string msg = + space_name_ + " open file error, path=" + dump_meta_path; + LOG(ERROR) << msg; + return Status::IOError(msg); } char *buf = new char[len + 1]; buf[len] = '\0'; if ((size_t)len != fio.Read(buf, 1, (size_t)len)) { - LOG(ERROR) << space_name_ - << " read file error, path=" << dump_meta_path; + std::string msg = + space_name_ + " read file error, path=" + dump_meta_path; + LOG(ERROR) << msg; delete[] buf; buf = nullptr; - return IO_ERR; + return Status::IOError(msg); } meta_jp = new utils::JsonParser(); del1.set(meta_jp); if (meta_jp->Parse(buf)) { delete[] buf; buf = nullptr; - return FORMAT_ERR; + return Status::ParamError(); } delete[] buf; buf = nullptr; @@ -515,9 +477,10 @@ int Engine::CreateTable(TableInfo &table) { } if (vec_manager_->CreateVectorTable(table, meta_jp) != 0) { - LOG(ERROR) << space_name_ << " cannot create VectorTable!"; + std::string msg = space_name_ + " cannot create VectorTable!"; + LOG(ERROR) << msg; vec_manager_->Close(); - return -2; + return Status::ParamError(msg); } TableParams disk_table_params; if (meta_jp) { @@ -525,12 +488,14 @@ int Engine::CreateTable(TableInfo &table) { meta_jp->GetObject("table", table_jp); disk_table_params.Parse(table_jp); } - int ret_table = table_->CreateTable(table, disk_table_params, docids_bitmap_); + Status status = table_->CreateTable(table, disk_table_params, docids_bitmap_); training_threshold_ = table.TrainingThreshold(); - LOG(INFO) << space_name_ << " init training_threshold=" << training_threshold_; - if (ret_table != 0) { - LOG(ERROR) << space_name_ << " cannot create table!"; - return -2; + LOG(INFO) << space_name_ + << " init training_threshold=" << training_threshold_; + if (!status.ok()) { + std::string msg = space_name_ + " cannot create table!"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } af_exector_ = new AsyncFlushExecutor(); @@ -555,7 +520,7 @@ int Engine::CreateTable(TableInfo &table) { utils::FileIO fio(dump_meta_path); fio.Open("w"); - string meta_str = dump_meta_.ToStr(true); + std::string meta_str = dump_meta_.ToStr(true); fio.Write(meta_str.c_str(), 1, meta_str.size()); } for (auto &[key, raw_vector_ptr] : vec_manager_->RawVectors()) { @@ -571,8 +536,9 @@ int Engine::CreateTable(TableInfo &table) { utils::make_dir(scalar_index_path.c_str()); field_range_index_ = new MultiFieldsRangeIndex(scalar_index_path, table_); if ((nullptr == field_range_index_) || (AddNumIndexFields() < 0)) { - LOG(ERROR) << "add numeric index fields error!"; - return -3; + std::string msg = "add numeric index fields error!"; + LOG(ERROR) << msg; + return Status::ParamError(msg); } std::string table_name = table.Name(); @@ -586,7 +552,7 @@ int Engine::CreateTable(TableInfo &table) { LOG(INFO) << "create table [" << table_name << "] success!"; created_table_ = true; - return 0; + return Status::OK(); } int Engine::AddOrUpdate(Doc &doc) { @@ -630,8 +596,8 @@ int Engine::AddOrUpdate(Doc &doc) { if (not b_running_ and index_status_ == UNINDEXED) { if (max_docid_ >= training_threshold_) { - LOG(INFO) << space_name_ - << " begin indexing. training_threshold=" << training_threshold_; + LOG(INFO) << space_name_ << " begin indexing. training_threshold=" + << training_threshold_; this->BuildIndex(); } } @@ -748,7 +714,7 @@ int Engine::GetDoc(int docid, Doc &doc, bool next) { std::vector index_names; vec_manager_->VectorNames(index_names); - std::vector table_fields; + std::vector table_fields; ret = table_->GetDocInfo(docid, doc, table_fields); if (ret != 0) { return ret; @@ -809,7 +775,8 @@ int Engine::RebuildIndex(int drop_before_rebuild, int limit_cpu, int describe) { std::map vector_indexes; if (!drop_before_rebuild) { - ret = vec_manager_->CreateVectorIndexes(training_threshold_, vector_indexes); + ret = + vec_manager_->CreateVectorIndexes(training_threshold_, vector_indexes); if (vec_manager_->TrainIndex(vector_indexes) != 0) { LOG(ERROR) << "RebuildIndex TrainIndex failed!"; return -1; @@ -947,7 +914,7 @@ int Engine::Dump() { std::strftime(tm_str, sizeof(tm_str), date_time_format_.c_str(), std::localtime(&t)); - string path = dump_path_ + "/" + tm_str; + std::string path = dump_path_ + "/" + tm_str; if (!utils::isFolderExist(path.c_str())) { mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); } @@ -961,7 +928,7 @@ int Engine::Dump() { return -1; } - const string dump_done_file = path + "/dump.done"; + const std::string dump_done_file = path + "/dump.done"; std::ofstream f_done; f_done.open(dump_done_file); if (!f_done.is_open()) { @@ -984,8 +951,8 @@ int Engine::Dump() { } int Engine::CreateTableFromLocal(std::string &table_name) { - std::vector file_paths = utils::ls(index_root_path_); - for (string &file_path : file_paths) { + std::vector file_paths = utils::ls(index_root_path_); + for (std::string &file_path : file_paths) { std::string::size_type pos = file_path.rfind(".schema"); if (pos == file_path.size() - 7) { std::string::size_type begin = file_path.rfind('/'); @@ -1000,7 +967,8 @@ int Engine::CreateTableFromLocal(std::string &table_name) { return -1; } - if (CreateTable(table)) { + Status status = CreateTable(table); + if (!status.ok()) { LOG(ERROR) << "create table error when loading"; return -1; } @@ -1012,7 +980,7 @@ int Engine::CreateTableFromLocal(std::string &table_name) { int Engine::Load() { if (!created_table_) { - string table_name; + std::string table_name; if (CreateTableFromLocal(table_name)) { LOG(ERROR) << space_name_ << " create table from local error"; return -1; @@ -1022,13 +990,13 @@ int Engine::Load() { } af_exector_->Stop(); - std::vector> folders_tm; - std::vector folders = utils::ls_folder(dump_path_); - std::vector folders_not_done; - for (const string &folder_name : folders) { + std::vector> folders_tm; + std::vector folders = utils::ls_folder(dump_path_); + std::vector folders_not_done; + for (const std::string &folder_name : folders) { if (folder_name == "") continue; - string folder_path = dump_path_ + "/" + folder_name; - string done_file = folder_path + "/dump.done"; + std::string folder_path = dump_path_ + "/" + folder_name; + std::string done_file = folder_path + "/dump.done"; if (!utils::file_exist(done_file)) { LOG(INFO) << "done file is not existed, skip it! path=" << done_file; folders_not_done.push_back(folder_path); @@ -1040,12 +1008,12 @@ int Engine::Load() { folders_tm.push_back(std::make_pair(t, folder_path)); } std::sort(folders_tm.begin(), folders_tm.end(), - [](const std::pair &a, - const std::pair &b) { + [](const std::pair &a, + const std::pair &b) { return a.first < b.first; }); if (folders_tm.size() > 0) { - string dump_done_file = + std::string dump_done_file = folders_tm[folders_tm.size() - 1].second + "/dump.done"; utils::FileIO fio(dump_done_file); if (fio.Open("r")) { @@ -1055,10 +1023,10 @@ int Engine::Load() { long fsize = utils::get_file_size(dump_done_file); char *buf = new char[fsize]; fio.Read(buf, 1, fsize); - string buf_str(buf, fsize); - std::vector lines = utils::split(buf_str, "\n"); + std::string buf_str(buf, fsize); + std::vector lines = utils::split(buf_str, "\n"); assert(lines.size() == 2); - std::vector items = utils::split(lines[1], " "); + std::vector items = utils::split(lines[1], " "); assert(items.size() == 2); int index_dump_num = (int)std::strtol(items[1].c_str(), nullptr, 10) + 1; LOG(INFO) << space_name_ << "read index_dump_num=" << index_dump_num @@ -1069,8 +1037,8 @@ int Engine::Load() { max_docid_ = table_->GetStorageManagerSize(); - string last_dir = ""; - std::vector dirs; + std::string last_dir = ""; + std::vector dirs; if (folders_tm.size() > 0) { last_dir = folders_tm[folders_tm.size() - 1].second; LOG(INFO) << "Loading from " << last_dir; @@ -1108,13 +1076,13 @@ int Engine::Load() { if (not b_running_ and index_status_ == UNINDEXED) { if (max_docid_ >= training_threshold_) { - LOG(INFO) << space_name_ - << " begin indexing. training_threshold=" << training_threshold_; + LOG(INFO) << space_name_ << " begin indexing. training_threshold=" + << training_threshold_; this->BuildIndex(); } } // remove directorys which are not done - for (const string &folder : folders_not_done) { + for (const std::string &folder : folders_not_done) { if (utils::remove_dir(folder.c_str())) { LOG(ERROR) << space_name_ << " clean error, not done directory=" << folder; @@ -1144,8 +1112,9 @@ int Engine::LoadFromFaiss() { } index_status_ = INDEXED; - int load_num = index->Load("files"); - if (load_num < 0) { + int load_num; + Status status = index->Load("files", load_num); + if (!status.ok()) { LOG(ERROR) << space_name_ << " vector [faiss] load gamma index failed!"; return -1; } @@ -1183,7 +1152,7 @@ int Engine::AddNumIndexFields() { std::map attr_index; retvals = table_->GetAttrIsIndex(attr_index); for (const auto &it : attr_type) { - string field_name = it.first; + std::string field_name = it.first; const auto &attr_index_it = attr_index.find(field_name); if (attr_index_it == attr_index.end()) { LOG(ERROR) << space_name_ << " cannot find field [" << field_name << "]"; diff --git a/internal/engine/search/engine.h b/internal/engine/search/engine.h index d5232400..6bc6b1f3 100644 --- a/internal/engine/search/engine.h +++ b/internal/engine/search/engine.h @@ -35,11 +35,11 @@ class Engine { ~Engine(); - int Setup(); + Status Setup(); - int Search(Request &request, Response &response_results); + int Search(Request &request, Response &response_results, Status &status); - int CreateTable(TableInfo &table); + Status CreateTable(TableInfo &table); int AddOrUpdate(Doc &doc); @@ -125,7 +125,7 @@ class Engine { int AddNumIndexFields(); - int MultiRangeQuery(Request &request, GammaSearchCondition *condition, + int MultiRangeQuery(Request &request, SearchCondition *condition, Response &response_results, MultiRangeQueryResults *range_query_result); diff --git a/internal/engine/storage/storage_manager.cc b/internal/engine/storage/storage_manager.cc index 11e9a6f7..48bcca09 100644 --- a/internal/engine/storage/storage_manager.cc +++ b/internal/engine/storage/storage_manager.cc @@ -7,7 +7,8 @@ #include "storage_manager.h" -#include "common/error_code.h" +#include + #include "util/log.h" #include "util/utils.h" @@ -33,17 +34,19 @@ StorageManager::~StorageManager() { void StorageManager::GetCacheSize(int &cache_size) { cache_size = 0; } -int StorageManager::Init(const std::string &name, int cache_size) { +Status StorageManager::Init(const std::string &name, int cache_size) { root_path_ += "/" + name; name_ = name; if (!options_.IsValid()) { - LOG(ERROR) << "invalid options=" << options_.ToStr(); - return PARAM_ERR; + std::string msg = std::string("invalid options=") + options_.ToStr(); + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (utils::make_dir(root_path_.c_str())) { - LOG(ERROR) << "mkdir error, path=" << root_path_; - return IO_ERR; + std::string msg = std::string("mkdir error, path=") + root_path_; + LOG(ERROR) << msg; + return Status::IOError(msg); } rocksdb::Options options; @@ -59,8 +62,9 @@ int StorageManager::Init(const std::string &name, int cache_size) { // open DB rocksdb::Status s = rocksdb::DB::Open(options, root_path_, &db_); if (!s.ok()) { - LOG(ERROR) << "open rocks db error: " << s.ToString(); - return IO_ERR; + std::string msg = std::string("open rocks db error: ") + s.ToString(); + LOG(ERROR) << msg; + return Status::IOError(msg); } std::string key_str = "_total"; @@ -76,14 +80,16 @@ int StorageManager::Init(const std::string &name, int cache_size) { LOG(INFO) << "init storage [" << name_ << "] success! options=" << options_.ToStr() << " size " << size_ << " cache_size [" << cache_size << "]M"; - return 0; + return Status::OK(); } -int StorageManager::Add(int id, const uint8_t *value, int len) { +Status StorageManager::Add(int id, const uint8_t *value, int len) { if (len != options_.fixed_value_bytes) { - LOG(ERROR) << "Add len error [" << len << "] != options_.fixed_value_bytes[" - << options_.fixed_value_bytes << "]"; - return PARAM_ERR; + std::stringstream msg; + msg << "Add len error [" << len << "] != options_.fixed_value_bytes[" + << options_.fixed_value_bytes << "]"; + LOG(ERROR) << msg.str(); + return Status::ParamError(msg.str()); } std::string key_str; @@ -92,22 +98,26 @@ int StorageManager::Add(int id, const uint8_t *value, int len) { rocksdb::Status s = db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key_str), rocksdb::Slice((char *)value, len)); if (!s.ok()) { - LOG(ERROR) << "rocksdb put error:" << s.ToString() << ", key=" << key_str; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb put error:" << s.ToString() << ", key=" << key_str; + LOG(ERROR) << msg.str(); + return Status::IOError(msg.str()); } size_++; key_str = "_total"; s = db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key_str), rocksdb::Slice(std::to_string(size_))); if (!s.ok()) { - LOG(ERROR) << "rocksdb put error:" << s.ToString() << ", key=" << key_str; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb put error:" << s.ToString() << ", key=" << key_str; + LOG(ERROR) << msg.str(); + return Status::IOError(msg.str()); } - return 0; + return Status::OK(); } -int StorageManager::AddString(int id, std::string field_name, const char *value, - int len) { +Status StorageManager::AddString(int id, std::string field_name, + const char *value, int len) { std::string key_str; ToRowKey(id, key_str); key_str = field_name + ":" + key_str; @@ -115,17 +125,21 @@ int StorageManager::AddString(int id, std::string field_name, const char *value, rocksdb::Status s = db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key_str), rocksdb::Slice((char *)value, len)); if (!s.ok()) { - LOG(ERROR) << "rocksdb put error:" << s.ToString() << ", key=" << key_str; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb put error:" << s.ToString() << ", key=" << key_str; + LOG(ERROR) << msg.str(); + return Status::IOError(msg.str()); } - return 0; + return Status::OK(); } -int StorageManager::Update(int id, uint8_t *value, int len) { +Status StorageManager::Update(int id, uint8_t *value, int len) { if (len != options_.fixed_value_bytes) { - LOG(ERROR) << "Add len error [" << len << "] != options_.fixed_value_bytes[" - << options_.fixed_value_bytes << "]"; - return PARAM_ERR; + std::stringstream msg; + msg << "Add len error [" << len << "] != options_.fixed_value_bytes[" + << options_.fixed_value_bytes << "]"; + LOG(ERROR) << msg.str(); + return Status::ParamError(msg.str()); } std::string key_str; @@ -134,35 +148,39 @@ int StorageManager::Update(int id, uint8_t *value, int len) { rocksdb::Status s = db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key_str), rocksdb::Slice((char *)value, len)); if (!s.ok()) { - LOG(ERROR) << "rocksdb put error:" << s.ToString() << ", key=" << key_str; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb put error:" << s.ToString() << ", key=" << key_str; + LOG(ERROR) << msg.str(); + return Status::IOError(msg.str()); } - return 0; + return Status::OK(); } -int StorageManager::UpdateString(int id, std::string field_name, - const char *value, int len) { +Status StorageManager::UpdateString(int id, std::string field_name, + const char *value, int len) { return AddString(id, field_name, value, len); } -int StorageManager::Get(int id, const uint8_t *&v) { +Status StorageManager::Get(int id, const uint8_t *&v) { std::string key, value; ToRowKey((int)id, key); rocksdb::Status s = db_->Get(rocksdb::ReadOptions(), rocksdb::Slice(key), &value); if (!s.ok()) { - LOG(DEBUG) << "rocksdb get error:" << s.ToString() << " key=" << key; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb get error:" << s.ToString() << " key=" << key; + LOG(DEBUG) << msg.str(); + return Status::IOError(msg.str()); } v = new uint8_t[value.size()]; memcpy((void *)v, value.c_str(), value.size()); - return 0; + return Status::OK(); } -int StorageManager::GetString(int id, std::string &field_name, - std::string &value) { +Status StorageManager::GetString(int id, std::string &field_name, + std::string &value) { std::string key_str; ToRowKey(id, key_str); key_str = field_name + ":" + key_str; @@ -170,11 +188,13 @@ int StorageManager::GetString(int id, std::string &field_name, rocksdb::Status s = db_->Get(rocksdb::ReadOptions(), rocksdb::Slice(key_str), &value); if (!s.ok()) { - LOG(DEBUG) << "rocksdb get error:" << s.ToString() << ", key=" << key_str; - return IO_ERR; + std::stringstream msg; + msg << "rocksdb get error:" << s.ToString() << ", key=" << key_str; + LOG(DEBUG) << msg.str(); + return Status::IOError(msg.str()); } - return 0; + return Status::OK(); } } // namespace vearch diff --git a/internal/engine/storage/storage_manager.h b/internal/engine/storage/storage_manager.h index 284f3092..4f890b53 100644 --- a/internal/engine/storage/storage_manager.h +++ b/internal/engine/storage/storage_manager.h @@ -13,6 +13,7 @@ #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/table.h" +#include "util/status.h" namespace vearch { @@ -42,20 +43,21 @@ class StorageManager { StorageManager(const std::string &root_path, const StorageManagerOptions &options); ~StorageManager(); - int Init(const std::string &name, int cache_size); + Status Init(const std::string &name, int cache_size); - int Add(int id, const uint8_t *value, int len); + Status Add(int id, const uint8_t *value, int len); - int AddString(int id, std::string field_name, const char *value, int len); + Status AddString(int id, std::string field_name, const char *value, int len); - int Update(int id, uint8_t *value, int len); + Status Update(int id, uint8_t *value, int len); - int UpdateString(int id, std::string field_name, const char *value, int len); + Status UpdateString(int id, std::string field_name, const char *value, + int len); // warning: vec can't be free - int Get(int id, const uint8_t *&value); + Status Get(int id, const uint8_t *&value); - int GetString(int id, std::string &field_name, std::string &value); + Status GetString(int id, std::string &field_name, std::string &value); int Size() { return size_; } diff --git a/internal/engine/table/field_range_index.cc b/internal/engine/table/field_range_index.cc index 2c8fe3da..90c6a547 100644 --- a/internal/engine/table/field_range_index.cc +++ b/internal/engine/table/field_range_index.cc @@ -35,7 +35,6 @@ #include "threadskv10h.h" #endif -#include "common/error_code.h" #include "util/utils.h" using std::string; diff --git a/internal/engine/table/table.cc b/internal/engine/table/table.cc index 9f4e9e49..d938c968 100644 --- a/internal/engine/table/table.cc +++ b/internal/engine/table/table.cc @@ -141,10 +141,10 @@ int Table::Load(int &num) { return 0; } -int Table::CreateTable(TableInfo &table, TableParams &table_params, - bitmap::BitmapManager *bitmap_mgr) { +Status Table::CreateTable(TableInfo &table, TableParams &table_params, + bitmap::BitmapManager *bitmap_mgr) { if (table_created_) { - return -10; + return Status::IOError(); } bitmap_mgr_ = bitmap_mgr; name_ = table.Name(); @@ -157,15 +157,16 @@ int Table::CreateTable(TableInfo &table, TableParams &table_params, bool is_index = fields[i].is_index; LOG(INFO) << name_ << " add field [" << name << "], type [" << (int)ftype << "], index [" << is_index << "]"; - int ret = AddField(name, ftype, is_index); - if (ret != 0) { - return ret; + Status status = AddField(name, ftype, is_index); + if (!status.ok()) { + return status; } } if (key_idx_ == -1) { - LOG(ERROR) << "No field _id! "; - return -1; + std::string msg = "No field _id! "; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (!utils::isFolderExist(root_path_.c_str())) { @@ -175,8 +176,10 @@ int Table::CreateTable(TableInfo &table, TableParams &table_params, item_to_docid_ = new ItemToDocID(root_path_); int ret = item_to_docid_->Open(); if (ret) { - LOG(ERROR) << name_ << " init item to docid error, ret=" << ret; - return ret; + std::stringstream msg; + msg << name_ << " init item to docid error, ret=" << ret; + LOG(ERROR) << msg.str(); + return Status::ParamError(msg.str()); } table_params_ = new TableParams("table"); @@ -189,15 +192,15 @@ int Table::CreateTable(TableInfo &table, TableParams &table_params, options.fixed_value_bytes = item_length_; storage_mgr_ = new StorageManager(root_path_, options); int cache_size = 512; // unit : M - ret = storage_mgr_->Init(name_ + "_table", cache_size); - if (ret) { - LOG(ERROR) << "init gamma db error, ret=" << ret; - return ret; + Status status = storage_mgr_->Init(name_ + "_table", cache_size); + if (!status.ok()) { + LOG(ERROR) << "init gamma db error, ret=" << status.ToString(); + return status; } LOG(INFO) << "init storageManager success! vector byte size=" << options.fixed_value_bytes << ", path=" << root_path_; - return 0; + return Status::OK(); } int Table::FTypeSize(DataType fType) { @@ -216,10 +219,11 @@ int Table::FTypeSize(DataType fType) { return length; } -int Table::AddField(const string &name, DataType ftype, bool is_index) { +Status Table::AddField(const string &name, DataType ftype, bool is_index) { if (attr_idx_map_.find(name) != attr_idx_map_.end()) { - LOG(ERROR) << name_ << " duplicate field " << name; - return -1; + std::string msg = name_ + " duplicate field " + name; + LOG(ERROR) << msg; + return Status::ParamError(msg); } if (name == key_field_name_) { key_idx_ = field_num_; @@ -233,7 +237,7 @@ int Table::AddField(const string &name, DataType ftype, bool is_index) { attr_type_map_.insert(std::pair(name, ftype)); attr_is_index_map_.insert(std::pair(name, is_index)); ++field_num_; - return 0; + return Status::OK(); } int Table::GetDocIDByKey(const std::string &key, int &docid) { @@ -254,9 +258,9 @@ int Table::GetKeyByDocid(int docid, std::string &key) { return -1; } const uint8_t *doc_value = nullptr; - int ret = storage_mgr_->Get(docid, doc_value); - if (ret != 0) { - return ret; + Status status = storage_mgr_->Get(docid, doc_value); + if (!status.ok()) { + return -1; } int field_id = attr_idx_map_[key_field_name_]; GetFieldRawValue(docid, field_id, key, doc_value); @@ -325,12 +329,11 @@ int Table::Update(const std::unordered_map &fields, int docid) { if (fields.size() == 0) return 0; - int ret = 0; const uint8_t *ori_doc_value = nullptr; - ret = storage_mgr_->Get(docid, ori_doc_value); - if (ret != 0) { - return ret; + Status status = storage_mgr_->Get(docid, ori_doc_value); + if (!status.ok()) { + return status.code(); } uint8_t doc_value[item_length_]; @@ -415,9 +418,9 @@ int Table::GetDocInfo(const int docid, Doc &doc, return -1; } const uint8_t *doc_value = nullptr; - int ret = storage_mgr_->Get(docid, doc_value); - if (ret != 0) { - return ret; + Status status = storage_mgr_->Get(docid, doc_value); + if (!status.ok()) { + return status.code(); } auto &table_fields = doc.TableFields(); @@ -477,9 +480,9 @@ int Table::GetFieldRawValue(int docid, int field_id, std::string &value, bool is_free = false; if (doc_value == nullptr) { is_free = true; - int ret = storage_mgr_->Get(docid, doc_value); - if (ret != 0) { - return ret; + Status status = storage_mgr_->Get(docid, doc_value); + if (!status.ok()) { + return status.code(); } } @@ -508,9 +511,9 @@ int Table::GetFieldRawValue(int docid, int field_id, bool is_free = false; if (doc_value == nullptr) { is_free = true; - int ret = storage_mgr_->Get(docid, doc_value); - if (ret != 0) { - return ret; + Status status = storage_mgr_->Get(docid, doc_value); + if (!status.ok()) { + return status.code(); } } diff --git a/internal/engine/table/table.h b/internal/engine/table/table.h index 366c154e..6cd8dd45 100755 --- a/internal/engine/table/table.h +++ b/internal/engine/table/table.h @@ -61,9 +61,9 @@ class Table { * * @param table table definition * @param table_params unused - * @return 0 if successed + * @return Status::OK() if successed */ - int CreateTable(TableInfo &table, TableParams &table_params, + Status CreateTable(TableInfo &table, TableParams &table_params, bitmap::BitmapManager *bitmap_mgr); /** add a doc to table @@ -159,7 +159,7 @@ class Table { private: int FTypeSize(DataType fType); - int AddField(const std::string &name, DataType ftype, bool is_index); + Status AddField(const std::string &name, DataType ftype, bool is_index); std::string name_; // table name int item_length_; // every doc item length diff --git a/internal/engine/tests/test.h b/internal/engine/tests/test.h index abab0ad0..fa098119 100644 --- a/internal/engine/tests/test.h +++ b/internal/engine/tests/test.h @@ -924,8 +924,7 @@ int Create(struct Options &opt) { vector_info.is_index = true; vector_info.dimension = opt.d; vector_info.store_type = opt.store_type; - vector_info.store_param = "{\"cache_size\": 16, \"compress\": {\"rate\":16}}"; - // vector_info.store_param = "{\"cache_size\": 16}"; + vector_info.store_param = "{\"cache_size\": 16}"; table.AddVectorInfo(vector_info); diff --git a/internal/engine/tests/test_load_faiss.cc b/internal/engine/tests/test_load_faiss.cc index c559121c..cf73013b 100644 --- a/internal/engine/tests/test_load_faiss.cc +++ b/internal/engine/tests/test_load_faiss.cc @@ -82,8 +82,7 @@ int CreateFaissTable(struct Options &opt) { vector_info.is_index = true; vector_info.dimension = opt.d; vector_info.store_type = opt.store_type; - vector_info.store_param = "{\"cache_size\": 16, \"compress\": {\"rate\":16}}"; - // vector_info.store_param = "{\"cache_size\": 16}"; + vector_info.store_param = "{\"cache_size\": 16}"; table.AddVectorInfo(vector_info); diff --git a/internal/engine/tests/test_raw_vector.cc b/internal/engine/tests/test_raw_vector.cc index c81db41e..ff027273 100644 --- a/internal/engine/tests/test_raw_vector.cc +++ b/internal/engine/tests/test_raw_vector.cc @@ -169,7 +169,7 @@ static void Delete(RawVector *raw_vector) { delete raw_vector; } -void TestRawVectorNormal(VectorStorageType store_type, bool compress = false) { +void TestRawVectorNormal(VectorStorageType store_type) { string root_path = "./" + GetCurrentCaseName(); string name = "abc"; int dimension = 512; @@ -214,8 +214,7 @@ void TestRawVectorNormal(VectorStorageType store_type, bool compress = false) { delete raw_vector; } -void TestRawVectorDumpLoad(VectorStorageType store_type, - bool compress = false) { +void TestRawVectorDumpLoad(VectorStorageType store_type) { string root_path = GetCurrentCaseName() + "/vectors"; string name = "abc"; int dimension = 512; diff --git a/internal/engine/tests/test_table.cc b/internal/engine/tests/test_table.cc index a86cc972..1f503e31 100644 --- a/internal/engine/tests/test_table.cc +++ b/internal/engine/tests/test_table.cc @@ -101,7 +101,9 @@ class TableTest : public ::testing::Test { meta_jp->GetObject("table", table_jp); table_params.Parse(table_jp); } - return table->CreateTable(*table_info, table_params, docids_bitmap); + Status status = + table->CreateTable(*table_info, table_params, docids_bitmap); + return status.ok(); } void CreateValue(int i, std::string &value, vearch::DataType dataype) { diff --git a/internal/engine/util/status.cc b/internal/engine/util/status.cc new file mode 100644 index 00000000..9241382c --- /dev/null +++ b/internal/engine/util/status.cc @@ -0,0 +1,96 @@ +#include "status.h" + +#include +#include + +namespace vearch { + +std::unique_ptr Status::CopyState(const char *s) { + const size_t cch = std::strlen(s) + 1; // +1 for the null terminator + char *rv = new char[cch]; + std::strncpy(rv, s, cch); + return std::unique_ptr(rv); +} + +static const char *msgs[static_cast(Status::kMaxSubCode)] = { + "", // kNone + "Index not trained", // kIndexNotTrained + "Parameters error", // kParamError + "Resource temporarily unavailable", // kResourceExhausted + "No space left on device", // kNoSpace + "No such file or directory", // kPathNotFound +}; + +Status::Status(status::Code _code, SubCode _subcode, const std::string &msg, + const std::string &msg2, Severity sev) + : code_(_code), subcode_(_subcode), sev_(sev) { + assert(subcode_ != kMaxSubCode); + const size_t len1 = msg.size(); + const size_t len2 = msg2.size(); + const size_t size = len1 + (len2 ? (2 + len2) : 0); + char *const result = new char[size + 1]; // +1 for null terminator + memcpy(result, msg.data(), len1); + if (len2) { + result[len1] = ':'; + result[len1 + 1] = ' '; + memcpy(result + len1 + 2, msg2.data(), len2); + } + result[size] = '\0'; // null terminator for C style string + state_.reset(result); +} + +std::string Status::ToString() const { + const char *type = nullptr; + switch (code_) { + case status::kOk: + return "OK"; + case status::kNotFound: + type = "NotFound: "; + break; + case status::kIndexError: + type = "IndexError: "; + break; + case status::kNotSupported: + type = "Not implemented: "; + break; + case status::kInvalidArgument: + type = "Invalid argument: "; + break; + case status::kIOError: + type = "IO error: "; + break; + case status::kBusy: + type = "Resource busy: "; + break; + case status::kTimedOut: + type = "Operation timed out: "; + break; + case status::kMaxCode: + assert(false); + break; + } + char tmp[30]; + if (type == nullptr) { + // This should not happen since `code_` should be a valid non-`kMaxCode` + // member of the `Code` enum. The above switch-statement should have had a + // case assigning `type` to a corresponding string. + assert(false); + snprintf(tmp, sizeof(tmp), "Unknown code(%d): ", static_cast(code())); + type = tmp; + } + std::string result(type); + if (subcode_ != kNone) { + uint32_t index = static_cast(subcode_); + assert(sizeof(msgs) / sizeof(msgs[0]) > index); + result.append(msgs[index]); + } + + if (state_ != nullptr) { + if (subcode_ != kNone) { + result.append(": "); + } + result.append(state_.get()); + } + return result; +} +} // namespace vearch diff --git a/internal/engine/util/status.h b/internal/engine/util/status.h new file mode 100644 index 00000000..469dec8e --- /dev/null +++ b/internal/engine/util/status.h @@ -0,0 +1,202 @@ +#pragma once + +#include +#include +#include + +#include "idl/fbs-gen/c/status_generated.h" + +namespace vearch { + +class Status { + public: + Status() + : code_(status::kOk), subcode_(kNone), sev_(kNoError), state_(nullptr) {} + ~Status() {} + + Status(const Status &s); + Status &operator=(const Status &s); + Status(Status &&s) noexcept; + Status &operator=(Status &&s) noexcept; + + bool operator==(const Status &rhs) const; + bool operator!=(const Status &rhs) const; + + status::Code code() const { return code_; } + + enum SubCode : unsigned char { + kNone = 0, + kIndexNotTrained = 1, + kParamError = 2, + kResourceExhausted = 3, + kNoSpace = 4, + kPathNotFound = 5, + kMaxSubCode + }; + + SubCode subcode() const { return subcode_; } + + enum Severity : unsigned char { + kNoError = 0, + kSoftError = 1, + kHardError = 2, + kFatalError = 3, + kUnrecoverableError = 4, + kMaxSeverity + }; + + Status(const Status &s, Severity sev); + Severity severity() const { return sev_; } + + // Returns a C style string indicating the message of the Status + const char *getState() const { return state_.get(); } + + // Return a success status. + static Status OK() { return Status(); } + + static Status NotSupported(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kNotSupported, msg, msg2); + } + static Status NotSupported(SubCode msg = kNone) { + return Status(status::kNotSupported, msg); + } + + static Status InvalidArgument(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kInvalidArgument, msg, msg2); + } + static Status InvalidArgument(SubCode msg = kNone) { + return Status(status::kInvalidArgument, msg); + } + + static Status ParamError(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kInvalidArgument, kParamError, msg, msg2); + } + static Status ParamError() { + return Status(status::kInvalidArgument, kParamError); + } + + static Status ResourceExhausted(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kBusy, kResourceExhausted, msg, msg2); + } + static Status ResourceExhausted() { + return Status(status::kBusy, kResourceExhausted); + } + + static Status IndexError(SubCode msg = kNone) { + return Status(status::kIndexError, msg); + } + static Status IndexError(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kIndexError, msg, msg2); + } + + static Status IndexNotTrained(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kIndexError, kIndexNotTrained, msg, msg2); + } + static Status IndexNotTrained() { + return Status(status::kIndexError, kIndexNotTrained); + } + + static Status TimedOut(SubCode msg = kNone) { + return Status(status::kTimedOut, msg); + } + static Status TimedOut(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kTimedOut, msg, msg2); + } + + static Status IOError(SubCode msg = kNone) { + return Status(status::kIOError, msg); + } + static Status IOError(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kIOError, msg, msg2); + } + + static Status PathNotFound() { + return Status(status::kIOError, kPathNotFound); + } + static Status PathNotFound(const std::string &msg, + const std::string &msg2 = std::string()) { + return Status(status::kIOError, kPathNotFound, msg, msg2); + } + + // Returns true iff the status indicates success. + bool ok() const { return code() == status::kOk; } + + std::string ToString() const; + + private: + // A nullptr state_ (which is always the case for OK) means the message + // is empty. + // of the following form: + // state_[0..3] == length of message + // state_[4..] == message + status::Code code_; + SubCode subcode_; + Severity sev_; + std::unique_ptr state_; + + explicit Status(status::Code _code, SubCode _subcode = kNone) + : code_(_code), subcode_(_subcode), sev_(kNoError) {} + + explicit Status(status::Code _code, SubCode _subcode, bool retryable, + bool data_loss, unsigned char scope) + : code_(_code), subcode_(_subcode), sev_(kNoError) {} + + Status(status::Code _code, SubCode _subcode, const std::string &msg, + const std::string &msg2, Severity sev = kNoError); + Status(status::Code _code, const std::string &msg, const std::string &msg2) + : Status(_code, kNone, msg, msg2) {} + + std::unique_ptr CopyState(const char *s); +}; + +inline bool Status::operator==(const Status &rhs) const { + return (code_ == rhs.code_); +} + +inline Status::Status(const Status &s) + : code_(s.code_), subcode_(s.subcode_), sev_(s.sev_) { + state_ = (s.state_ == nullptr) ? nullptr : CopyState(s.state_.get()); +} +inline Status::Status(const Status &s, Severity sev) + : code_(s.code_), subcode_(s.subcode_), sev_(sev) { + state_ = (s.state_ == nullptr) ? nullptr : CopyState(s.state_.get()); +} +inline Status &Status::operator=(const Status &s) { + // The following condition catches both aliasing (when this == &s), + // and the common case where both s and *this are ok. + if (this != &s) { + code_ = s.code_; + subcode_ = s.subcode_; + sev_ = s.sev_; + state_ = (s.state_ == nullptr) ? nullptr : CopyState(s.state_.get()); + } + return *this; +} + +inline Status::Status(Status &&s) noexcept : Status() { *this = std::move(s); } + +inline Status &Status::operator=(Status &&s) noexcept { + if (this != &s) { + code_ = std::move(s.code_); + s.code_ = status::kOk; + subcode_ = std::move(s.subcode_); + s.subcode_ = kNone; + sev_ = std::move(s.sev_); + s.sev_ = kNoError; + state_ = std::move(s.state_); + } + return *this; +} + +inline bool Status::operator!=(const Status &rhs) const { + return !(*this == rhs); +} +} // namespace vearch diff --git a/internal/engine/vector/memory_raw_vector.cc b/internal/engine/vector/memory_raw_vector.cc index 6c1072b8..fce39e5c 100644 --- a/internal/engine/vector/memory_raw_vector.cc +++ b/internal/engine/vector/memory_raw_vector.cc @@ -9,8 +9,6 @@ #include -#include "common/error_code.h" - using std::string; namespace vearch { @@ -42,12 +40,12 @@ int MemoryRawVector::InitStore(std::string &vec_name) { LOG(INFO) << "init memory raw vector success! vector byte size=" << vector_byte_size_ << ", path=" << root_path_ + "/" + meta_info_->Name(); - return SUCC; + return 0; } int MemoryRawVector::AddToStore(uint8_t *v, int len) { AddToMem(v, vector_byte_size_); - return SUCC; + return 0; } int MemoryRawVector::AddToMem(uint8_t *v, int len) { @@ -62,7 +60,7 @@ int MemoryRawVector::AddToMem(uint8_t *v, int len) { int MemoryRawVector::ExtendSegments() { if (nsegments_ >= kMaxSegments) { LOG(ERROR) << this->desc_ << "segment number can't be > " << kMaxSegments; - return LIMIT_ERR; + return -1; } segments_[nsegments_] = new (std::nothrow) uint8_t[segment_size_ * vector_byte_size_]; @@ -71,12 +69,12 @@ int MemoryRawVector::ExtendSegments() { LOG(ERROR) << this->desc_ << "malloc new segment failed, segment num=" << nsegments_ << ", segment size=" << segment_size_; - return ALLOC_ERR; + return -1; } curr_idx_in_seg_ = 0; ++nsegments_; LOG(INFO) << "extend segment sucess! nsegments=" << nsegments_; - return SUCC; + return 0; } int MemoryRawVector::GetVectorHeader(int start, int n, ScopeVectors &vecs, @@ -95,14 +93,14 @@ int MemoryRawVector::GetVectorHeader(int start, int n, ScopeVectors &vecs, start += len; n -= len; } - return SUCC; + return 0; } int MemoryRawVector::UpdateToStore(int vid, uint8_t *v, int len) { memcpy((void *)(segments_[vid / segment_size_] + (size_t)vid % segment_size_ * vector_byte_size_), (void *)v, vector_byte_size_); - return SUCC; + return 0; } int MemoryRawVector::GetVector(long vid, const uint8_t *&vec, @@ -111,7 +109,7 @@ int MemoryRawVector::GetVector(long vid, const uint8_t *&vec, (size_t)vid % segment_size_ * vector_byte_size_; deletable = false; - return SUCC; + return 0; } uint8_t *MemoryRawVector::GetFromMem(long vid) const { diff --git a/internal/engine/vector/raw_vector.cc b/internal/engine/vector/raw_vector.cc index ca30ed3a..5028a44f 100644 --- a/internal/engine/vector/raw_vector.cc +++ b/internal/engine/vector/raw_vector.cc @@ -121,40 +121,44 @@ DumpConfig *RawVector::GetDumpConfig() { return dynamic_cast(&store_params_); } -int StoreParams::Parse(const char *str) { +Status StoreParams::Parse(const char *str) { utils::JsonParser jp; if (jp.Parse(str)) { - LOG(ERROR) << "parse store parameters error: " << str; - return -1; + std::string msg = std::string("parse store parameters error: ") + str; + LOG(ERROR) << msg; + return Status::ParamError(msg); } return Parse(jp); } -int StoreParams::Parse(utils::JsonParser &jp) { +Status StoreParams::Parse(utils::JsonParser &jp) { double cache_size = 0; if (!jp.GetDouble("cache_size", cache_size)) { if (cache_size > MAX_CACHE_SIZE || cache_size < 0) { - LOG(ERROR) << "invalid cache size=" << cache_size << "M" - << ", limit size=" << MAX_CACHE_SIZE << "M"; - return -1; + std::stringstream msg; + msg << "invalid cache size=" << cache_size << "M" + << ", limit size=" << MAX_CACHE_SIZE << "M"; + LOG(ERROR) << msg.str(); + return Status::ParamError(msg.str()); } this->cache_size = cache_size; } if (!jp.GetInt("segment_size", segment_size)) { if (segment_size <= 0) { - LOG(ERROR) << "invalid segment size=" << segment_size; - return -1; + std::stringstream msg; + msg << "invalid segment size=" << segment_size; + LOG(ERROR) << msg.str(); + return Status::ParamError(msg.str()); } } - return 0; + return Status::OK(); } -int StoreParams::MergeRight(StoreParams &other) { +void StoreParams::MergeRight(StoreParams &other) { cache_size = other.cache_size; segment_size = other.segment_size; - return 0; } } // namespace vearch diff --git a/internal/engine/vector/raw_vector.h b/internal/engine/vector/raw_vector.h index f18a5135..fe744b83 100644 --- a/internal/engine/vector/raw_vector.h +++ b/internal/engine/vector/raw_vector.h @@ -41,9 +41,9 @@ struct StoreParams : DumpConfig { segment_size = other.segment_size; } - int Parse(const char *str); - int Parse(utils::JsonParser &jp); - int MergeRight(StoreParams &other); + Status Parse(const char *str); + Status Parse(utils::JsonParser &jp); + void MergeRight(StoreParams &other); std::string ToJsonStr() { std::stringstream ss; diff --git a/internal/engine/vector/raw_vector_common.h b/internal/engine/vector/raw_vector_common.h index 7450f3c5..1386cce9 100644 --- a/internal/engine/vector/raw_vector_common.h +++ b/internal/engine/vector/raw_vector_common.h @@ -9,7 +9,6 @@ #include -#include "common/error_code.h" #include "util/log.h" #include "util/utils.h" diff --git a/internal/engine/vector/raw_vector_factory.h b/internal/engine/vector/raw_vector_factory.h index 6b479ffe..31dfdd75 100644 --- a/internal/engine/vector/raw_vector_factory.h +++ b/internal/engine/vector/raw_vector_factory.h @@ -49,7 +49,7 @@ class RawVectorFactory { return nullptr; } if (meta_info->with_io_) { - if (vio && vio->Init()) { + if (vio && !vio->Init().ok()) { Fail(raw_vector, vio, "init raw vector io error"); return nullptr; } diff --git a/internal/engine/vector/rocksdb_raw_vector.cc b/internal/engine/vector/rocksdb_raw_vector.cc index fa27c178..19c248f4 100644 --- a/internal/engine/vector/rocksdb_raw_vector.cc +++ b/internal/engine/vector/rocksdb_raw_vector.cc @@ -9,13 +9,10 @@ #include -#include "common/error_code.h" #include "rocksdb/table.h" #include "util/log.h" #include "util/utils.h" -using namespace rocksdb; - namespace vearch { RocksDBRawVector::RocksDBRawVector(VectorMetaInfo *meta_info, @@ -37,9 +34,10 @@ RocksDBRawVector::~RocksDBRawVector() { int RocksDBRawVector::InitStore(std::string &vec_name) { block_cache_size_ = (size_t)store_params_.cache_size * 1024 * 1024; - std::shared_ptr cache = NewLRUCache(block_cache_size_); + std::shared_ptr cache = + rocksdb::NewLRUCache(block_cache_size_); table_options_.block_cache = cache; - Options options; + rocksdb::Options options; options.table_factory.reset(NewBlockBasedTableFactory(table_options_)); options.IncreaseParallelism(); @@ -53,10 +51,10 @@ int RocksDBRawVector::InitStore(std::string &vec_name) { } // open DB - Status s = DB::Open(options, db_path, &db_); + rocksdb::Status s = rocksdb::DB::Open(options, db_path, &db_); if (!s.ok()) { LOG(ERROR) << "open rocks db error: " << s.ToString(); - return IO_ERR; + return -1; } LOG(INFO) << "rocks raw vector init success! name=" << meta_info_->Name() << ", block cache size=" << block_cache_size_ << "Bytes"; @@ -71,10 +69,11 @@ int RocksDBRawVector::GetVector(long vid, const uint8_t *&vec, } std::string key, value; ToRowKey((int)vid, key); - Status s = db_->Get(ReadOptions(), Slice(key), &value); + rocksdb::Status s = + db_->Get(rocksdb::ReadOptions(), rocksdb::Slice(key), &value); if (!s.ok()) { LOG(ERROR) << "rocksdb get error:" << s.ToString() << ", key=" << key; - return IO_ERR; + return s.code(); } vec = new uint8_t[vector_byte_size_]; assert((size_t)vector_byte_size_ == value.size()); @@ -88,7 +87,7 @@ int RocksDBRawVector::Gets(const std::vector &vids, ScopeVectors &vecs) const { size_t k = vids.size(); std::vector keys_data(k); - std::vector keys; + std::vector keys; keys.reserve(k); size_t j = 0; @@ -103,7 +102,8 @@ int RocksDBRawVector::Gets(const std::vector &vids, } std::vector values(j); - std::vector statuses = db_->MultiGet(ReadOptions(), keys, &values); + std::vector statuses = + db_->MultiGet(rocksdb::ReadOptions(), keys, &values); assert(statuses.size() == j); j = 0; @@ -153,11 +153,12 @@ int RocksDBRawVector::UpdateToStore(int vid, uint8_t *v, int len) { std::string key; ToRowKey(vid, key); - Status s = db_->Put(WriteOptions(), Slice(key), - Slice((const char *)v, this->vector_byte_size_)); + rocksdb::Status s = + db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key), + rocksdb::Slice((const char *)v, this->vector_byte_size_)); if (!s.ok()) { LOG(ERROR) << "rocksdb update error:" << s.ToString() << ", key=" << key; - return IO_ERR; + return -1; } return 0; } @@ -165,14 +166,14 @@ int RocksDBRawVector::UpdateToStore(int vid, uint8_t *v, int len) { int RocksDBRawVector::GetVectorHeader(int start, int n, ScopeVectors &vecs, std::vector &lens) { if (start < 0 || (size_t)start + n > meta_info_->Size()) { - return PARAM_ERR; + return -1; } rocksdb::Iterator *it = db_->NewIterator(rocksdb::ReadOptions()); std::string start_key, end_key; ToRowKey(start, start_key); ToRowKey(start + n, end_key); - it->Seek(Slice(start_key)); + it->Seek(rocksdb::Slice(start_key)); int dimension = meta_info_->Dimension(); uint8_t *vectors = new uint8_t[(uint64_t)dimension * n * data_size_]; uint8_t *dst = vectors; @@ -181,10 +182,10 @@ int RocksDBRawVector::GetVectorHeader(int start, int n, ScopeVectors &vecs, LOG(ERROR) << "rocksdb iterator error, vid=" << start + c; delete it; delete[] vectors; - return INTERNAL_ERR; + return -1; } - Slice value = it->value(); + rocksdb::Slice value = it->value(); std::string vstr = value.ToString(); assert((size_t)vector_byte_size_ == vstr.size()); memcpy(dst, vstr.c_str(), vector_byte_size_); diff --git a/internal/engine/vector/rocksdb_wrapper.cc b/internal/engine/vector/rocksdb_wrapper.cc index 3606207f..244edd2e 100644 --- a/internal/engine/vector/rocksdb_wrapper.cc +++ b/internal/engine/vector/rocksdb_wrapper.cc @@ -7,11 +7,9 @@ #include "rocksdb_wrapper.h" -#include "common/error_code.h" #include "util/log.h" using std::string; -using namespace rocksdb; namespace vearch { @@ -24,10 +22,11 @@ RocksDBWrapper::~RocksDBWrapper() { } } -int RocksDBWrapper::Open(string db_path, size_t block_cache_size) { - Options options; +Status RocksDBWrapper::Open(string db_path, size_t block_cache_size) { + rocksdb::Options options; if (block_cache_size) { - std::shared_ptr cache = NewLRUCache(block_cache_size); + std::shared_ptr cache = + rocksdb::NewLRUCache(block_cache_size); table_options_.block_cache = cache; options.table_factory.reset(NewBlockBasedTableFactory(table_options_)); } @@ -36,30 +35,34 @@ int RocksDBWrapper::Open(string db_path, size_t block_cache_size) { // create the DB if it's not already present options.create_if_missing = true; // open DB - Status s = DB::Open(options, db_path, &db_); + rocksdb::Status s = rocksdb::DB::Open(options, db_path, &db_); if (!s.ok()) { - LOG(ERROR) << "open rocks db error: " << s.ToString(); - return IO_ERR; + std::string msg = std::string("open rocks db error: ") + s.ToString(); + LOG(ERROR) << msg; + return Status::IOError(msg); } - return 0; + return Status::OK(); } -int RocksDBWrapper::Put(int key, const char *v, size_t len) { +Status RocksDBWrapper::Put(int key, const char *v, size_t len) { string key_str; ToRowKey(key, key_str); return Put(key_str, v, len); } -int RocksDBWrapper::Put(const string &key, const char *v, size_t len) { - Status s = db_->Put(WriteOptions(), Slice(key), Slice(v, len)); +Status RocksDBWrapper::Put(const string &key, const char *v, size_t len) { + rocksdb::Status s = db_->Put(rocksdb::WriteOptions(), rocksdb::Slice(key), + rocksdb::Slice(v, len)); if (!s.ok()) { - LOG(ERROR) << "rocksdb put error:" << s.ToString() << ", key=" << key; - return IO_ERR; + std::string msg = + std::string("rocksdb put error:") + s.ToString() + ", key=" + key; + LOG(ERROR) << msg; + return Status::IOError(msg); } - return 0; + return Status::OK(); } -int RocksDBWrapper::Put(const string &key, const string &value) { +Status RocksDBWrapper::Put(const string &key, const string &value) { return Put(key, value.c_str(), value.size()); } diff --git a/internal/engine/vector/rocksdb_wrapper.h b/internal/engine/vector/rocksdb_wrapper.h index ba47e01e..fe8e5a76 100644 --- a/internal/engine/vector/rocksdb_wrapper.h +++ b/internal/engine/vector/rocksdb_wrapper.h @@ -10,6 +10,7 @@ #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/table.h" +#include "util/status.h" namespace vearch { @@ -19,10 +20,10 @@ struct RocksDBWrapper { RocksDBWrapper(); ~RocksDBWrapper(); - int Open(std::string db_path, size_t block_cache_size = 0); - int Put(int key, const char *v, size_t len); - int Put(const std::string &key, const char *v, size_t len); - int Put(const std::string &key, const std::string &value); + Status Open(std::string db_path, size_t block_cache_size = 0); + Status Put(int key, const char *v, size_t len); + Status Put(const std::string &key, const char *v, size_t len); + Status Put(const std::string &key, const std::string &value); void ToRowKey(int key, std::string &key_str); }; diff --git a/internal/engine/vector/vector_manager.cc b/internal/engine/vector/vector_manager.cc index de2d09e0..e6c4d16f 100644 --- a/internal/engine/vector/vector_manager.cc +++ b/internal/engine/vector/vector_manager.cc @@ -98,9 +98,12 @@ int VectorManager::CreateRawVector(struct VectorInfo &vector_info, new VectorMetaInfo(vec_name, dimension, value_type); StoreParams store_params(meta_info->AbsoluteName()); - if (store_param != "" && store_params.Parse(store_param.c_str())) { - delete meta_info; - return PARAM_ERR; + if (store_param != "") { + Status status = store_params.Parse(store_param.c_str()); + if (!status.ok()) { + delete meta_info; + return status.code(); + } } LOG(INFO) << "store params=" << store_params.ToJsonStr(); @@ -180,7 +183,8 @@ int VectorManager::CreateVectorIndex( } index_model->vector_ = vec; - if (index_model->Init(index_params, training_threshold) != 0) { + Status status = index_model->Init(index_params, training_threshold); + if (!status.ok()) { LOG(ERROR) << "gamma index init " << vec_name << " error!"; if (destroy_vec) { RawVectorIO *rio = vec->GetIO(); @@ -232,8 +236,8 @@ int VectorManager::CreateVectorIndexes( std::string &vec_name = index->MetaInfo()->Name(); for (size_t i = 0; i < index_types_.size(); ++i) { - ret = CreateVectorIndex(index_types_[i], index_params_[i], - index, training_threshold, false, vector_indexes); + ret = CreateVectorIndex(index_types_[i], index_params_[i], index, + training_threshold, false, vector_indexes); if (ret) { LOG(ERROR) << vec_name << " create index failed ret: " << ret; return ret; @@ -310,7 +314,8 @@ int VectorManager::CreateVectorTable(TableInfo &table, } // update TrainingThreshold when TrainingThreshold = 0 if (!table.TrainingThreshold()) { - IndexModel * index = vector_indexes_[IndexName(vec_name, index_types_[i])]; + IndexModel *index = + vector_indexes_[IndexName(vec_name, index_types_[i])]; if (index) { table.SetTrainingThreshold(index->training_threshold_); } @@ -367,8 +372,8 @@ int VectorManager::Update( } } if (raw_vector->GetIO()) { - ret = raw_vector->GetIO()->Update(vid); - if (ret) return ret; + Status status = raw_vector->GetIO()->Update(vid); + if (!status.ok()) return status.code(); } } @@ -538,8 +543,8 @@ int parse_index_search_result(int n, int k, VectorResult &result, } } // namespace -int VectorManager::Search(GammaQuery &query, GammaResult *results) { - int ret = 0, n = 0; +Status VectorManager::Search(GammaQuery &query, GammaResult *results) { + int n = 0; size_t vec_num = query.vec_query.size(); VectorResult all_vector_results[vec_num]; @@ -561,9 +566,10 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { std::map::iterator iter = vector_indexes_.find(index_name); if (iter == vector_indexes_.end()) { - LOG(ERROR) << "Query name " << index_name - << " not exist in created vector table"; - return -1; + std::string err = + "Query name " + index_name + " not exist in created vector table"; + LOG(ERROR) << err; + return Status::InvalidArgument(err); } IndexModel *index = iter->second; @@ -576,14 +582,12 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { } if (n <= 0) { - LOG(ERROR) << "Search n shouldn't less than 0!"; - return -1; + std::string err = "Search n shouldn't less than 0!"; + LOG(ERROR) << err; + return Status::InvalidArgument(err); } - if (!all_vector_results[i].init(n, query.condition->topn)) { - LOG(ERROR) << "Query name " << index_name << "init vector result error"; - return -2; - } + all_vector_results[i].init(n, query.condition->topn); query.condition->Init(vec_query.min_score, vec_query.max_score, docids_bitmap_, raw_vec); @@ -599,16 +603,16 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { all_vector_results[i].docids); if (ret_vec != 0) { - ret = ret_vec; - LOG(ERROR) << "faild search of query " << index_name; - return -3; - } else { - if (query.condition->sort_by_docid) { - parse_index_search_result(n, query.condition->topn, - all_vector_results[i], index); - all_vector_results[i].sort_by_docid(); - } + std::string err = "faild search of query " + index_name; + LOG(ERROR) << err; + return Status::InvalidArgument(err); } + if (query.condition->sort_by_docid) { + parse_index_search_result(n, query.condition->topn, all_vector_results[i], + index); + all_vector_results[i].sort_by_docid(); + } + #ifdef PERFORMANCE_TESTING std::string msg; msg += "search " + index_name; @@ -622,11 +626,8 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { size_t common_docid_count = 0; double score = 0; bool has_common_docid = true; - if (!results[i].init(query.condition->topn, vec_names, vec_num)) { - LOG(ERROR) << "init gamma result(sort by docid) error, topn=" - << query.condition->topn << ", vector number=" << vec_num; - return -4; - } + results[i].init(query.condition->topn, vec_names, vec_num); + while (start_docid < INT_MAX) { for (size_t j = 0; j < vec_num; j++) { float vec_dist = 0; @@ -679,11 +680,7 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { } else { for (int i = 0; i < n; i++) { // double score = 0; - if (!results[i].init(query.condition->topn, vec_names, vec_num)) { - LOG(ERROR) << "init gamma result error, topn=" << query.condition->topn - << ", vector number=" << vec_num; - return -5; - } + results[i].init(query.condition->topn, vec_names, vec_num); results[i].total = all_vector_results[0].total[i] > 0 ? all_vector_results[0].total[i] : results[i].total; @@ -706,7 +703,7 @@ int VectorManager::Search(GammaQuery &query, GammaResult *results) { #ifdef PERFORMANCE_TESTING query.condition->GetPerfTool().Perf("merge result"); #endif - return ret; + return Status::OK(); } int VectorManager::GetVector( @@ -803,10 +800,10 @@ void VectorManager::GetTotalMemBytes(long &index_total_mem_bytes, int VectorManager::Dump(const std::string &path, int dump_docid, int max_docid) { for (const auto &[name, index] : vector_indexes_) { - int ret = index->Dump(path); - if (ret != 0) { + Status status = index->Dump(path); + if (!status.ok()) { LOG(ERROR) << "vector " << name << " dump gamma index failed!"; - return -1; + return status.code(); } LOG(INFO) << "vector " << name << " dump gamma index success!"; } @@ -816,10 +813,10 @@ int VectorManager::Dump(const std::string &path, int dump_docid, if (raw_vector->GetIO()) { int start = raw_vector->VidMgr()->GetFirstVID(dump_docid); int end = raw_vector->VidMgr()->GetLastVID(max_docid); - int ret = raw_vector->GetIO()->Dump(start, end + 1); - if (ret != 0) { + Status status = raw_vector->GetIO()->Dump(start, end + 1); + if (!status.ok()) { LOG(ERROR) << "vector " << name << " dump failed!"; - return -1; + return status.code(); } LOG(INFO) << "vector " << name << " dump success!"; } @@ -843,9 +840,10 @@ int VectorManager::Load(const std::vector &index_dirs, if (vec->GetIO()) { // TODO: doc num to vector num int vec_num = min_vec_num; - if (0 != vec->GetIO()->Load(vec_num)) { + Status status = vec->GetIO()->Load(vec_num); + if (!status.ok()) { LOG(ERROR) << "vector [" << name << "] load failed!"; - return -1; + return status.code(); } LOG(INFO) << "vector [" << name << "] load success!"; } @@ -853,8 +851,9 @@ int VectorManager::Load(const std::vector &index_dirs, if (index_dirs.size() > 0) { for (const auto &[name, index] : vector_indexes_) { - int load_num = index->Load(index_dirs[0]); - if (load_num < 0) { + int load_num; + Status status = index->Load(index_dirs[0], load_num); + if (!status.ok()) { LOG(ERROR) << "vector [" << name << "] load gamma index " << index_dirs[0] << " failed, load_num: " << load_num; return -1; diff --git a/internal/engine/vector/vector_manager.h b/internal/engine/vector/vector_manager.h index 8f75ca35..392b2a24 100644 --- a/internal/engine/vector/vector_manager.h +++ b/internal/engine/vector/vector_manager.h @@ -16,6 +16,7 @@ #include "index/index_model.h" #include "util/bitmap_manager.h" #include "util/log.h" +#include "util/status.h" #include "vector/raw_vector.h" namespace vearch { @@ -27,29 +28,26 @@ class VectorManager { const std::string &root_path); ~VectorManager(); - int SetVectorStoreType(std::string &index_type, - std::string &store_type_str, + int SetVectorStoreType(std::string &index_type, std::string &store_type_str, VectorStorageType &store_type); - int CreateRawVector(struct VectorInfo &vector_info, - std::string &index_type, + int CreateRawVector(struct VectorInfo &vector_info, std::string &index_type, std::map &vec_dups, TableInfo &table, utils::JsonParser &vectors_jp, RawVector **vec); void DestroyRawVectors(); - int CreateVectorIndex( - std::string &index_type, std::string &index_params, RawVector *vec, - int training_threshold, bool destroy_vec, - std::map &vector_indexes); + int CreateVectorIndex(std::string &index_type, std::string &index_params, + RawVector *vec, int training_threshold, + bool destroy_vec, + std::map &vector_indexes); void DestroyVectorIndexes(); void DescribeVectorIndexes(); - int CreateVectorIndexes( - int training_threshold, - std::map &vector_indexes); + int CreateVectorIndexes(int training_threshold, + std::map &vector_indexes); void SetVectorIndexes( std::map &rebuild_vector_indexes); @@ -66,7 +64,7 @@ class VectorManager { int AddRTVecsToIndex(bool &index_is_dirty); // int Add(int docid, const std::vector &field_vecs); - int Search(GammaQuery &query, GammaResult *results); + Status Search(GammaQuery &query, GammaResult *results); int GetVector(const std::vector> &fields_ids, std::vector &vec, bool is_bytearray = false); @@ -95,9 +93,7 @@ class VectorManager { int Delete(int docid); std::map RawVectors() { return raw_vectors_; } - std::map IndexModels() { - return vector_indexes_; - } + std::map IndexModels() { return vector_indexes_; } int MinIndexedNum(); diff --git a/internal/entity/meta.go b/internal/entity/meta.go index baccccce..41d3d5c5 100644 --- a/internal/entity/meta.go +++ b/internal/entity/meta.go @@ -65,10 +65,6 @@ func AliasKey(aliasName string) string { return fmt.Sprintf("%s%s", PrefixAlias, aliasName) } -func AliasValue(dbName string, spaceName string) string { - return fmt.Sprintf("%s/%s", dbName, spaceName) -} - func LockAliasKey(aliasName string) string { return fmt.Sprintf("%s%s", PrefixLock, aliasName) } diff --git a/internal/master/cluster_service.go b/internal/master/cluster_service.go index e4402232..711f9c9e 100644 --- a/internal/master/cluster_service.go +++ b/internal/master/cluster_service.go @@ -20,7 +20,6 @@ import ( "fmt" "math" "sort" - "strings" "time" "github.com/cubefs/cubefs/depends/tiglabs/raft/proto" @@ -713,7 +712,7 @@ func (ms *masterService) describeSpaceService(ctx context.Context, space *entity return nil } -// createAliasService keys "/alias/alias_name:dbName/spaceName" +// createAliasService keys "/alias/alias_name:alias" func (ms *masterService) createAliasService(ctx context.Context, alias *entity.Alias) (err error) { //validate name if err = alias.Validate(); err != nil { @@ -735,7 +734,11 @@ func (ms *masterService) createAliasService(ctx context.Context, alias *entity.A if value != "" { return vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_EXIST, nil) } - stm.Put(aliasKey, entity.AliasValue(alias.DbName, alias.SpaceName)) + marshal, err := vjson.Marshal(alias) + if err != nil { + return err + } + stm.Put(aliasKey, string(marshal)) return nil }) return err @@ -759,8 +762,7 @@ func (ms *masterService) deleteAliasService(ctx context.Context, alias_name stri err = ms.Master().STM(context.Background(), func(stm concurrency.STM) error { - aliasKey := entity.AliasKey(alias.Name) - stm.Del(aliasKey) + stm.Del(entity.AliasKey(alias.Name)) return nil }) @@ -791,34 +793,32 @@ func (ms *masterService) updateAliasService(ctx context.Context, alias *entity.A } }() err = ms.Master().STM(context.Background(), func(stm concurrency.STM) error { - stm.Put(entity.AliasKey(alias.Name), entity.AliasValue(alias.DbName, alias.SpaceName)) + marshal, err := vjson.Marshal(alias) + if err != nil { + return err + } + stm.Put(entity.AliasKey(alias.Name), string(marshal)) return nil }) return nil } func (ms *masterService) queryAllAlias(ctx context.Context) ([]*entity.Alias, error) { - keys, values, err := ms.Master().PrefixScan(ctx, entity.PrefixAlias) + _, values, err := ms.Master().PrefixScan(ctx, entity.PrefixAlias) if err != nil { return nil, err } - allAlias := make([]*entity.Alias, 0, len(keys)) - for index, key := range keys { - alias_result := strings.Split(string(key), entity.PrefixAlias) - if len(alias_result) != 2 { - return nil, fmt.Errorf("get alias:%s err", string(key)) + allAlias := make([]*entity.Alias, 0, len(values)) + for _, value := range values { + if value == nil { + return nil, vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_NOT_EXIST, nil) } - result := strings.Split(string(values[index]), "/") - if len(result) != 2 { - return nil, fmt.Errorf("get alias:%s err, wrong value:%s", alias_result[1], string(values[index])) - } else { - alias := &entity.Alias{ - Name: alias_result[1], - DbName: result[0], - SpaceName: result[1], - } - allAlias = append(allAlias, alias) + alias := &entity.Alias{} + err = vjson.Unmarshal(value, alias) + if err != nil { + return nil, fmt.Errorf("get alias:%s value:%s, err:%s", alias.Name, string(value), err.Error()) } + allAlias = append(allAlias, alias) } return allAlias, err @@ -837,14 +837,11 @@ func (ms *masterService) queryAliasService(ctx context.Context, alias_name strin return nil, vearchpb.NewError(vearchpb.ErrorEnum_ALIAS_NOT_EXIST, nil) } - result := strings.Split(string(bs), "/") - if len(result) != 2 { - return nil, fmt.Errorf("get alias:%s err, wrong value:%s", alias.Name, string(bs)) - } else { - alias.DbName = result[0] - alias.SpaceName = result[1] - return alias, nil + err = vjson.Unmarshal(bs, alias) + if err != nil { + return nil, fmt.Errorf("get alias:%s value:%s, err:%s", alias.Name, string(bs), err.Error()) } + return alias, nil } func (ms *masterService) GetEngineCfg(ctx context.Context, dbName, spaceName string) (cfg *entity.EngineCfg, err error) { diff --git a/internal/proto/common.sh b/internal/proto/common.sh deleted file mode 100644 index 17aa327a..00000000 --- a/internal/proto/common.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } -function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } -function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } -function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } - -cmd_exists() { - #which "$1" 1>/dev/null 2>&1 - which "$1" -} - -check_protoc_version() { - version=$(protoc --version | awk -F"[ ]" '{print $2}') - echo "protoc current version is "$version - if version_lt $version "3.1.0"; then - echo "Error : version not match, version 3.1.0 or above is needed" - exit 1 - fi -} - -check_protoc_version diff --git a/internal/proto/data_model.proto b/internal/proto/data_model.proto index 4d7fffeb..eb1e8a60 100644 --- a/internal/proto/data_model.proto +++ b/internal/proto/data_model.proto @@ -1,22 +1,9 @@ syntax = "proto3"; import "errors.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option optimize_for = SPEED; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.gostring_all) = false; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = false; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.goproto_getters_all) = false; -option go_package = "vearchpb"; +option go_package = "./vearchpb"; enum FieldType { INT = 0; @@ -50,13 +37,11 @@ message Field { } message Document { - option (gogoproto.goproto_getters) = true; string p_key = 1; repeated Field fields = 2; } message Item { - option (gogoproto.goproto_getters) = true; Error err = 1; Document doc = 2; string msg = 3; diff --git a/internal/proto/errors.proto b/internal/proto/errors.proto index ce7cc95b..9482496f 100644 --- a/internal/proto/errors.proto +++ b/internal/proto/errors.proto @@ -1,21 +1,8 @@ syntax = "proto3"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option optimize_for = SPEED; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.gostring_all) = false; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = false; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.goproto_getters_all) = false; -option go_package = "vearchpb"; +option go_package = "./vearchpb"; enum ErrorEnum { SUCCESS = 0; diff --git a/internal/proto/generate_go.sh b/internal/proto/generate_go.sh index 863e2513..293ed23f 100755 --- a/internal/proto/generate_go.sh +++ b/internal/proto/generate_go.sh @@ -30,26 +30,10 @@ check_protoc_version() { fi } +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest check_protoc_version -# find protoc-gen-gofast -GOGO_GOPATH="" -for path in $(echo "${GOPATH}" | sed -e 's/:/ /g'); do - gogo_proto_bin="${path}/bin/protoc-gen-gofast" - if [ -e "${gogo_proto_bin}" ]; then - export PATH=$(dirname "${gogo_proto_bin}"):$PATH - GOGO_GOPATH=${path} - break - fi -done - -# protoc-gen-gofast not found -if [[ -z ${GOGO_GOPATH} ]]; then - echo >&2 "ERR: Could not find protoc-gen-gofast" - echo >&2 "Please run \`go get github.com/gogo/protobuf/protoc-gen-gofast\` first" - exit 1 -fi - gen_out_dir=./vearchpb if [ "$1" ]; then gen_out_dir=$1 @@ -61,12 +45,6 @@ if [ "$2" ]; then proto_dir=$2 fi -ret=0 -for file in $(ls ${proto_dir}/*.proto); do - name=$(echo "$file" | awk -F '/' '{print $2}') - protoc -I=$GOPATH/pkg/mod -I=$GOPATH/src -I=${proto_dir} --gofast_out=plugins=grpc,$GO_OUT_M:$gen_out_dir $name || ret=$? - pb_files=${gen_out_dir}/*.pb.go - rm -f ${gen_out_dir}/*.bak - goimports -w $pb_files -done -exit $ret +export PATH=$PATH:$GOPATH/bin +protoc --go_out=$proto_dir *.proto +exit $? diff --git a/internal/proto/raftcmd.proto b/internal/proto/raftcmd.proto index 0a8623b0..8901cbd6 100644 --- a/internal/proto/raftcmd.proto +++ b/internal/proto/raftcmd.proto @@ -3,22 +3,9 @@ syntax = "proto3"; import "errors.proto"; import "data_model.proto"; import "router_grpc.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; -option go_package = "vearchpb"; +option go_package = "./vearchpb"; option optimize_for = SPEED; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.gostring_all) = false; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = false; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.goproto_getters_all) = false; enum OpType { CREATE = 0; diff --git a/internal/proto/router_grpc.proto b/internal/proto/router_grpc.proto index 68055099..41c5071f 100644 --- a/internal/proto/router_grpc.proto +++ b/internal/proto/router_grpc.proto @@ -2,22 +2,9 @@ syntax = "proto3"; import "data_model.proto"; import "errors.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option optimize_for = SPEED; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.gostring_all) = false; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = false; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.goproto_getters_all) = false; -option go_package = "vearchpb"; +option go_package = "./vearchpb"; service RouterGRPCService { rpc Get(GetRequest) returns (GetResponse) {} @@ -50,47 +37,39 @@ message ResponseHead { //*********************** doc query *********************** // message GetRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; repeated string primary_keys = 4; } message DeleteRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; repeated string primary_keys = 4; } message AddRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; Document doc = 4; } message UpdateRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; Document doc = 4; } message BulkRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; repeated Document docs = 4; } message ForceMergeRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; } message FlushRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; } message IndexRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; int64 drop_before_rebuild = 2; int64 limit_cpu = 3; @@ -100,42 +79,35 @@ message IndexRequest { //*********************** doc result *********************** // message GetResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; repeated Item items = 2; } message AddResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; string primary_key = 4; } message UpdateResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; } message DeleteResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; repeated Item items = 2; } message BulkResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; repeated Item items = 2; } message ForceMergeResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; SearchStatus shards = 2; } message DelByQueryeResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; int32 DelNum = 2; repeated string ids_str = 3; @@ -143,13 +115,11 @@ message DelByQueryeResponse { } message FlushResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; SearchStatus shards = 2; } message IndexResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; SearchStatus shards = 2; } @@ -196,7 +166,6 @@ message IndexParameters { } message SearchRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; int32 req_num = 2; int32 topN = 3; @@ -222,9 +191,8 @@ message SearchRequest { message ResultItem { double score = 1; repeated Field fields = 2; - string extra = 3; - string p_key = 4; - bytes source = 5; + string p_key = 3; + bytes source = 4; } message SearchResult { @@ -242,7 +210,6 @@ message SearchResult { } message SearchResponse { - option (gogoproto.goproto_getters) = true; ResponseHead head = 1; repeated SearchResult results = 2; string online_log_message = 3; @@ -260,7 +227,6 @@ message SearchStatus { } message MSearchRequest { - option (gogoproto.goproto_getters) = true; RequestHead head = 1; repeated SearchRequest search_requests = 2; } diff --git a/internal/proto/snapshot.proto b/internal/proto/snapshot.proto index ac9a0b55..9d494498 100644 --- a/internal/proto/snapshot.proto +++ b/internal/proto/snapshot.proto @@ -1,21 +1,7 @@ syntax = "proto3"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - option optimize_for = SPEED; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.gostring_all) = false; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = false; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.goproto_getters_all) = false; -option go_package = "vearchpb"; +option go_package = "./vearchpb"; // snapshot msg message SnapshotMsg { diff --git a/internal/proto/vearchpb/data_model.pb.go b/internal/proto/vearchpb/data_model.pb.go index 1ccbd02e..ff1c42cb 100644 --- a/internal/proto/vearchpb/data_model.pb.go +++ b/internal/proto/vearchpb/data_model.pb.go @@ -1,33 +1,24 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.5.0 // source: data_model.proto package vearchpb import ( - bytes "bytes" - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" - - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - proto "github.com/golang/protobuf/proto" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type FieldType int32 @@ -43,36 +34,57 @@ const ( FieldType_DATE FieldType = 8 ) -var FieldType_name = map[int32]string{ - 0: "INT", - 1: "LONG", - 2: "FLOAT", - 3: "DOUBLE", - 4: "STRING", - 5: "VECTOR", - 6: "BOOL", - 7: "GEOPOINT", - 8: "DATE", -} +// Enum value maps for FieldType. +var ( + FieldType_name = map[int32]string{ + 0: "INT", + 1: "LONG", + 2: "FLOAT", + 3: "DOUBLE", + 4: "STRING", + 5: "VECTOR", + 6: "BOOL", + 7: "GEOPOINT", + 8: "DATE", + } + FieldType_value = map[string]int32{ + "INT": 0, + "LONG": 1, + "FLOAT": 2, + "DOUBLE": 3, + "STRING": 4, + "VECTOR": 5, + "BOOL": 6, + "GEOPOINT": 7, + "DATE": 8, + } +) -var FieldType_value = map[string]int32{ - "INT": 0, - "LONG": 1, - "FLOAT": 2, - "DOUBLE": 3, - "STRING": 4, - "VECTOR": 5, - "BOOL": 6, - "GEOPOINT": 7, - "DATE": 8, +func (x FieldType) Enum() *FieldType { + p := new(FieldType) + *p = x + return p } func (x FieldType) String() string { - return proto.EnumName(FieldType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (FieldType) Descriptor() protoreflect.EnumDescriptor { + return file_data_model_proto_enumTypes[0].Descriptor() +} + +func (FieldType) Type() protoreflect.EnumType { + return &file_data_model_proto_enumTypes[0] +} + +func (x FieldType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FieldType.Descriptor instead. func (FieldType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{0} + return file_data_model_proto_rawDescGZIP(), []int{0} } // Whether index this field @@ -83,47 +95,89 @@ const ( FieldOption_Index FieldOption = 1 ) -var FieldOption_name = map[int32]string{ - 0: "Null", - 1: "Index", -} +// Enum value maps for FieldOption. +var ( + FieldOption_name = map[int32]string{ + 0: "Null", + 1: "Index", + } + FieldOption_value = map[string]int32{ + "Null": 0, + "Index": 1, + } +) -var FieldOption_value = map[string]int32{ - "Null": 0, - "Index": 1, +func (x FieldOption) Enum() *FieldOption { + p := new(FieldOption) + *p = x + return p } func (x FieldOption) String() string { - return proto.EnumName(FieldOption_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FieldOption) Descriptor() protoreflect.EnumDescriptor { + return file_data_model_proto_enumTypes[1].Descriptor() +} + +func (FieldOption) Type() protoreflect.EnumType { + return &file_data_model_proto_enumTypes[1] +} + +func (x FieldOption) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use FieldOption.Descriptor instead. func (FieldOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{1} + return file_data_model_proto_rawDescGZIP(), []int{1} } type VectorMetaInfo_ValueType int32 const ( VectorMetaInfo_FLOAT VectorMetaInfo_ValueType = 0 - VectorMetaInfo_UINT8 VectorMetaInfo_ValueType = 1 + VectorMetaInfo_UINT8 VectorMetaInfo_ValueType = 1 // binary ) -var VectorMetaInfo_ValueType_name = map[int32]string{ - 0: "FLOAT", - 1: "UINT8", -} +// Enum value maps for VectorMetaInfo_ValueType. +var ( + VectorMetaInfo_ValueType_name = map[int32]string{ + 0: "FLOAT", + 1: "UINT8", + } + VectorMetaInfo_ValueType_value = map[string]int32{ + "FLOAT": 0, + "UINT8": 1, + } +) -var VectorMetaInfo_ValueType_value = map[string]int32{ - "FLOAT": 0, - "UINT8": 1, +func (x VectorMetaInfo_ValueType) Enum() *VectorMetaInfo_ValueType { + p := new(VectorMetaInfo_ValueType) + *p = x + return p } func (x VectorMetaInfo_ValueType) String() string { - return proto.EnumName(VectorMetaInfo_ValueType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VectorMetaInfo_ValueType) Descriptor() protoreflect.EnumDescriptor { + return file_data_model_proto_enumTypes[2].Descriptor() } +func (VectorMetaInfo_ValueType) Type() protoreflect.EnumType { + return &file_data_model_proto_enumTypes[2] +} + +func (x VectorMetaInfo_ValueType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use VectorMetaInfo_ValueType.Descriptor instead. func (VectorMetaInfo_ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{6, 0} + return file_data_model_proto_rawDescGZIP(), []int{6, 0} } type VectorMetaInfo_StoreType int32 @@ -134,4337 +188,1125 @@ const ( VectorMetaInfo_MMAP VectorMetaInfo_StoreType = 2 ) -var VectorMetaInfo_StoreType_name = map[int32]string{ - 0: "MEMORYONLY", - 1: "ROCKSDB", - 2: "MMAP", -} +// Enum value maps for VectorMetaInfo_StoreType. +var ( + VectorMetaInfo_StoreType_name = map[int32]string{ + 0: "MEMORYONLY", + 1: "ROCKSDB", + 2: "MMAP", + } + VectorMetaInfo_StoreType_value = map[string]int32{ + "MEMORYONLY": 0, + "ROCKSDB": 1, + "MMAP": 2, + } +) -var VectorMetaInfo_StoreType_value = map[string]int32{ - "MEMORYONLY": 0, - "ROCKSDB": 1, - "MMAP": 2, +func (x VectorMetaInfo_StoreType) Enum() *VectorMetaInfo_StoreType { + p := new(VectorMetaInfo_StoreType) + *p = x + return p } func (x VectorMetaInfo_StoreType) String() string { - return proto.EnumName(VectorMetaInfo_StoreType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VectorMetaInfo_StoreType) Descriptor() protoreflect.EnumDescriptor { + return file_data_model_proto_enumTypes[3].Descriptor() +} + +func (VectorMetaInfo_StoreType) Type() protoreflect.EnumType { + return &file_data_model_proto_enumTypes[3] +} + +func (x VectorMetaInfo_StoreType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use VectorMetaInfo_StoreType.Descriptor instead. func (VectorMetaInfo_StoreType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{6, 1} + return file_data_model_proto_rawDescGZIP(), []int{6, 1} } type Vector struct { - Feature []float32 `protobuf:"fixed32,1,rep,packed,name=feature,proto3" json:"feature,omitempty"` - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Feature []float32 `protobuf:"fixed32,1,rep,packed,name=feature,proto3" json:"feature,omitempty"` + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` } -func (m *Vector) Reset() { *m = Vector{} } -func (*Vector) ProtoMessage() {} -func (*Vector) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{0} +func (x *Vector) Reset() { + *x = Vector{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Vector) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Vector) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Vector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vector.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Vector) ProtoMessage() {} + +func (x *Vector) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Vector) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vector.Merge(m, src) -} -func (m *Vector) XXX_Size() int { - return m.Size() + +// Deprecated: Use Vector.ProtoReflect.Descriptor instead. +func (*Vector) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{0} } -func (m *Vector) XXX_DiscardUnknown() { - xxx_messageInfo_Vector.DiscardUnknown(m) + +func (x *Vector) GetFeature() []float32 { + if x != nil { + return x.Feature + } + return nil } -var xxx_messageInfo_Vector proto.InternalMessageInfo +func (x *Vector) GetSource() string { + if x != nil { + return x.Source + } + return "" +} type Field struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type FieldType `protobuf:"varint,2,opt,name=type,proto3,enum=FieldType" json:"type,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - Option FieldOption `protobuf:"varint,4,opt,name=option,proto3,enum=FieldOption" json:"option,omitempty"` - Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type FieldType `protobuf:"varint,2,opt,name=type,proto3,enum=FieldType" json:"type,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Option FieldOption `protobuf:"varint,4,opt,name=option,proto3,enum=FieldOption" json:"option,omitempty"` + Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` } -func (m *Field) Reset() { *m = Field{} } -func (*Field) ProtoMessage() {} -func (*Field) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{1} +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Field) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Field.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Field) XXX_Merge(src proto.Message) { - xxx_messageInfo_Field.Merge(m, src) + +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{1} } -func (m *Field) XXX_Size() int { - return m.Size() + +func (x *Field) GetName() string { + if x != nil { + return x.Name + } + return "" } -func (m *Field) XXX_DiscardUnknown() { - xxx_messageInfo_Field.DiscardUnknown(m) + +func (x *Field) GetType() FieldType { + if x != nil { + return x.Type + } + return FieldType_INT } -var xxx_messageInfo_Field proto.InternalMessageInfo +func (x *Field) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} -type Document struct { - PKey string `protobuf:"bytes,1,opt,name=p_key,json=pKey,proto3" json:"p_key,omitempty"` - Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Field) GetOption() FieldOption { + if x != nil { + return x.Option + } + return FieldOption_Null } -func (m *Document) Reset() { *m = Document{} } -func (*Document) ProtoMessage() {} -func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{2} +func (x *Field) GetSource() string { + if x != nil { + return x.Source + } + return "" } -func (m *Document) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PKey string `protobuf:"bytes,1,opt,name=p_key,json=pKey,proto3" json:"p_key,omitempty"` + Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` } -func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Document.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *Document) XXX_Merge(src proto.Message) { - xxx_messageInfo_Document.Merge(m, src) -} -func (m *Document) XXX_Size() int { - return m.Size() + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Document) XXX_DiscardUnknown() { - xxx_messageInfo_Document.DiscardUnknown(m) + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Document proto.InternalMessageInfo +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{2} +} -func (m *Document) GetPKey() string { - if m != nil { - return m.PKey +func (x *Document) GetPKey() string { + if x != nil { + return x.PKey } return "" } -func (m *Document) GetFields() []*Field { - if m != nil { - return m.Fields +func (x *Document) GetFields() []*Field { + if x != nil { + return x.Fields } return nil } type Item struct { - Err *Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` - Doc *Document `protobuf:"bytes,2,opt,name=doc,proto3" json:"doc,omitempty"` - Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err *Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` + Doc *Document `protobuf:"bytes,2,opt,name=doc,proto3" json:"doc,omitempty"` + Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` } -func (m *Item) Reset() { *m = Item{} } -func (*Item) ProtoMessage() {} -func (*Item) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{3} +func (x *Item) Reset() { + *x = Item{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Item) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Item) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Item.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Item) ProtoMessage() {} + +func (x *Item) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Item) XXX_Merge(src proto.Message) { - xxx_messageInfo_Item.Merge(m, src) -} -func (m *Item) XXX_Size() int { - return m.Size() -} -func (m *Item) XXX_DiscardUnknown() { - xxx_messageInfo_Item.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Item proto.InternalMessageInfo +// Deprecated: Use Item.ProtoReflect.Descriptor instead. +func (*Item) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{3} +} -func (m *Item) GetErr() *Error { - if m != nil { - return m.Err +func (x *Item) GetErr() *Error { + if x != nil { + return x.Err } return nil } -func (m *Item) GetDoc() *Document { - if m != nil { - return m.Doc +func (x *Item) GetDoc() *Document { + if x != nil { + return x.Doc } return nil } -func (m *Item) GetMsg() string { - if m != nil { - return m.Msg +func (x *Item) GetMsg() string { + if x != nil { + return x.Msg } return "" } type ModelParameters struct { - JsonParametersStr string `protobuf:"bytes,1,opt,name=json_parameters_str,json=jsonParametersStr,proto3" json:"json_parameters_str,omitempty"` - Parameters map[string]string `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + JsonParametersStr string `protobuf:"bytes,1,opt,name=json_parameters_str,json=jsonParametersStr,proto3" json:"json_parameters_str,omitempty"` + Parameters map[string]string `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ModelParameters) Reset() { *m = ModelParameters{} } -func (*ModelParameters) ProtoMessage() {} -func (*ModelParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{4} +func (x *ModelParameters) Reset() { + *x = ModelParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ModelParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *ModelParameters) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ModelParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ModelParameters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*ModelParameters) ProtoMessage() {} + +func (x *ModelParameters) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ModelParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModelParameters.Merge(m, src) -} -func (m *ModelParameters) XXX_Size() int { - return m.Size() + +// Deprecated: Use ModelParameters.ProtoReflect.Descriptor instead. +func (*ModelParameters) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{4} } -func (m *ModelParameters) XXX_DiscardUnknown() { - xxx_messageInfo_ModelParameters.DiscardUnknown(m) + +func (x *ModelParameters) GetJsonParametersStr() string { + if x != nil { + return x.JsonParametersStr + } + return "" } -var xxx_messageInfo_ModelParameters proto.InternalMessageInfo +func (x *ModelParameters) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} type Model struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ModelParameters *ModelParameters `protobuf:"bytes,2,opt,name=model_parameters,json=modelParameters,proto3" json:"model_parameters,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // IVFPQ, HNSW, BINARY, GPUIVFPQ + ModelParameters *ModelParameters `protobuf:"bytes,2,opt,name=model_parameters,json=modelParameters,proto3" json:"model_parameters,omitempty"` } -func (m *Model) Reset() { *m = Model{} } -func (*Model) ProtoMessage() {} -func (*Model) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{5} +func (x *Model) Reset() { + *x = Model{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Model) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Model) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Model.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Model) ProtoMessage() {} + +func (x *Model) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Model) XXX_Merge(src proto.Message) { - xxx_messageInfo_Model.Merge(m, src) -} -func (m *Model) XXX_Size() int { - return m.Size() + +// Deprecated: Use Model.ProtoReflect.Descriptor instead. +func (*Model) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{5} } -func (m *Model) XXX_DiscardUnknown() { - xxx_messageInfo_Model.DiscardUnknown(m) + +func (x *Model) GetName() string { + if x != nil { + return x.Name + } + return "" } -var xxx_messageInfo_Model proto.InternalMessageInfo +func (x *Model) GetModelParameters() *ModelParameters { + if x != nil { + return x.ModelParameters + } + return nil +} type VectorMetaInfo struct { - Dimension int32 `protobuf:"varint,1,opt,name=dimension,proto3" json:"dimension,omitempty"` - ValueType VectorMetaInfo_ValueType `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=VectorMetaInfo_ValueType" json:"value_type,omitempty"` - StoreType VectorMetaInfo_StoreType `protobuf:"varint,3,opt,name=store_type,json=storeType,proto3,enum=VectorMetaInfo_StoreType" json:"store_type,omitempty"` - StoreParam string `protobuf:"bytes,4,opt,name=store_param,json=storeParam,proto3" json:"store_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dimension int32 `protobuf:"varint,1,opt,name=dimension,proto3" json:"dimension,omitempty"` + ValueType VectorMetaInfo_ValueType `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=VectorMetaInfo_ValueType" json:"value_type,omitempty"` + StoreType VectorMetaInfo_StoreType `protobuf:"varint,3,opt,name=store_type,json=storeType,proto3,enum=VectorMetaInfo_StoreType" json:"store_type,omitempty"` + StoreParam string `protobuf:"bytes,4,opt,name=store_param,json=storeParam,proto3" json:"store_param,omitempty"` } -func (m *VectorMetaInfo) Reset() { *m = VectorMetaInfo{} } -func (*VectorMetaInfo) ProtoMessage() {} -func (*VectorMetaInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{6} +func (x *VectorMetaInfo) Reset() { + *x = VectorMetaInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VectorMetaInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *VectorMetaInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VectorMetaInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VectorMetaInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*VectorMetaInfo) ProtoMessage() {} + +func (x *VectorMetaInfo) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) +} + +// Deprecated: Use VectorMetaInfo.ProtoReflect.Descriptor instead. +func (*VectorMetaInfo) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{6} } -func (m *VectorMetaInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorMetaInfo.Merge(m, src) + +func (x *VectorMetaInfo) GetDimension() int32 { + if x != nil { + return x.Dimension + } + return 0 } -func (m *VectorMetaInfo) XXX_Size() int { - return m.Size() + +func (x *VectorMetaInfo) GetValueType() VectorMetaInfo_ValueType { + if x != nil { + return x.ValueType + } + return VectorMetaInfo_FLOAT } -func (m *VectorMetaInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VectorMetaInfo.DiscardUnknown(m) + +func (x *VectorMetaInfo) GetStoreType() VectorMetaInfo_StoreType { + if x != nil { + return x.StoreType + } + return VectorMetaInfo_MEMORYONLY } -var xxx_messageInfo_VectorMetaInfo proto.InternalMessageInfo +func (x *VectorMetaInfo) GetStoreParam() string { + if x != nil { + return x.StoreParam + } + return "" +} type FieldMetaInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - DataType FieldType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=FieldType" json:"data_type,omitempty"` - IsIndex bool `protobuf:"varint,3,opt,name=is_index,json=isIndex,proto3" json:"is_index,omitempty"` - IsStore bool `protobuf:"varint,4,opt,name=is_store,json=isStore,proto3" json:"is_store,omitempty"` - VectorMetaInfo *VectorMetaInfo `protobuf:"bytes,5,opt,name=vector_meta_info,json=vectorMetaInfo,proto3" json:"vector_meta_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + DataType FieldType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=FieldType" json:"data_type,omitempty"` + IsIndex bool `protobuf:"varint,3,opt,name=is_index,json=isIndex,proto3" json:"is_index,omitempty"` + IsStore bool `protobuf:"varint,4,opt,name=is_store,json=isStore,proto3" json:"is_store,omitempty"` + VectorMetaInfo *VectorMetaInfo `protobuf:"bytes,5,opt,name=vector_meta_info,json=vectorMetaInfo,proto3" json:"vector_meta_info,omitempty"` // nil if data_type is not vector } -func (m *FieldMetaInfo) Reset() { *m = FieldMetaInfo{} } -func (*FieldMetaInfo) ProtoMessage() {} -func (*FieldMetaInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{7} +func (x *FieldMetaInfo) Reset() { + *x = FieldMetaInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *FieldMetaInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *FieldMetaInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FieldMetaInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FieldMetaInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*FieldMetaInfo) ProtoMessage() {} + +func (x *FieldMetaInfo) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldMetaInfo.ProtoReflect.Descriptor instead. +func (*FieldMetaInfo) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{7} +} + +func (x *FieldMetaInfo) GetName() string { + if x != nil { + return x.Name } + return "" } -func (m *FieldMetaInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMetaInfo.Merge(m, src) + +func (x *FieldMetaInfo) GetDataType() FieldType { + if x != nil { + return x.DataType + } + return FieldType_INT } -func (m *FieldMetaInfo) XXX_Size() int { - return m.Size() + +func (x *FieldMetaInfo) GetIsIndex() bool { + if x != nil { + return x.IsIndex + } + return false } -func (m *FieldMetaInfo) XXX_DiscardUnknown() { - xxx_messageInfo_FieldMetaInfo.DiscardUnknown(m) + +func (x *FieldMetaInfo) GetIsStore() bool { + if x != nil { + return x.IsStore + } + return false } -var xxx_messageInfo_FieldMetaInfo proto.InternalMessageInfo +func (x *FieldMetaInfo) GetVectorMetaInfo() *VectorMetaInfo { + if x != nil { + return x.VectorMetaInfo + } + return nil +} type TableMetaInfo struct { - PrimaryKeyName string `protobuf:"bytes,1,opt,name=primary_key_name,json=primaryKeyName,proto3" json:"primary_key_name,omitempty"` - PrimaryKeyType FieldType `protobuf:"varint,2,opt,name=primary_key_type,json=primaryKeyType,proto3,enum=FieldType" json:"primary_key_type,omitempty"` - PartitionsNum int32 `protobuf:"varint,3,opt,name=partitions_num,json=partitionsNum,proto3" json:"partitions_num,omitempty"` - ReplicasNum int32 `protobuf:"varint,4,opt,name=replicas_num,json=replicasNum,proto3" json:"replicas_num,omitempty"` - FieldMetaInfo []*FieldMetaInfo `protobuf:"bytes,5,rep,name=field_meta_info,json=fieldMetaInfo,proto3" json:"field_meta_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrimaryKeyName string `protobuf:"bytes,1,opt,name=primary_key_name,json=primaryKeyName,proto3" json:"primary_key_name,omitempty"` + PrimaryKeyType FieldType `protobuf:"varint,2,opt,name=primary_key_type,json=primaryKeyType,proto3,enum=FieldType" json:"primary_key_type,omitempty"` + PartitionsNum int32 `protobuf:"varint,3,opt,name=partitions_num,json=partitionsNum,proto3" json:"partitions_num,omitempty"` + ReplicasNum int32 `protobuf:"varint,4,opt,name=replicas_num,json=replicasNum,proto3" json:"replicas_num,omitempty"` + FieldMetaInfo []*FieldMetaInfo `protobuf:"bytes,5,rep,name=field_meta_info,json=fieldMetaInfo,proto3" json:"field_meta_info,omitempty"` } -func (m *TableMetaInfo) Reset() { *m = TableMetaInfo{} } -func (*TableMetaInfo) ProtoMessage() {} -func (*TableMetaInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{8} +func (x *TableMetaInfo) Reset() { + *x = TableMetaInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TableMetaInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *TableMetaInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TableMetaInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TableMetaInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*TableMetaInfo) ProtoMessage() {} + +func (x *TableMetaInfo) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TableMetaInfo.ProtoReflect.Descriptor instead. +func (*TableMetaInfo) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{8} +} + +func (x *TableMetaInfo) GetPrimaryKeyName() string { + if x != nil { + return x.PrimaryKeyName } + return "" } -func (m *TableMetaInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TableMetaInfo.Merge(m, src) + +func (x *TableMetaInfo) GetPrimaryKeyType() FieldType { + if x != nil { + return x.PrimaryKeyType + } + return FieldType_INT } -func (m *TableMetaInfo) XXX_Size() int { - return m.Size() + +func (x *TableMetaInfo) GetPartitionsNum() int32 { + if x != nil { + return x.PartitionsNum + } + return 0 } -func (m *TableMetaInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TableMetaInfo.DiscardUnknown(m) + +func (x *TableMetaInfo) GetReplicasNum() int32 { + if x != nil { + return x.ReplicasNum + } + return 0 } -var xxx_messageInfo_TableMetaInfo proto.InternalMessageInfo +func (x *TableMetaInfo) GetFieldMetaInfo() []*FieldMetaInfo { + if x != nil { + return x.FieldMetaInfo + } + return nil +} type Table struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` TableMetaInfo *TableMetaInfo `protobuf:"bytes,2,opt,name=table_meta_info,json=tableMetaInfo,proto3" json:"table_meta_info,omitempty"` StartTrainingThreshold int32 `protobuf:"varint,3,opt,name=start_training_threshold,json=startTrainingThreshold,proto3" json:"start_training_threshold,omitempty"` Model *Model `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` TotalDocsSize int64 `protobuf:"varint,5,opt,name=total_docs_size,json=totalDocsSize,proto3" json:"total_docs_size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *Table) Reset() { *m = Table{} } -func (*Table) ProtoMessage() {} -func (*Table) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{9} +func (x *Table) Reset() { + *x = Table{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Table) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Table) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Table) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Table.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (*Table) ProtoMessage() {} + +func (x *Table) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *Table) XXX_Merge(src proto.Message) { - xxx_messageInfo_Table.Merge(m, src) -} -func (m *Table) XXX_Size() int { - return m.Size() -} -func (m *Table) XXX_DiscardUnknown() { - xxx_messageInfo_Table.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_Table proto.InternalMessageInfo - -type DB struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Tables []*Table `protobuf:"bytes,2,rep,name=tables,proto3" json:"tables,omitempty"` - UserPasswordPair map[string]string `protobuf:"bytes,3,rep,name=user_password_pair,json=userPasswordPair,proto3" json:"user_password_pair,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// Deprecated: Use Table.ProtoReflect.Descriptor instead. +func (*Table) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{9} } -func (m *DB) Reset() { *m = DB{} } -func (*DB) ProtoMessage() {} -func (*DB) Descriptor() ([]byte, []int) { - return fileDescriptor_3a1ecda052abe117, []int{10} +func (x *Table) GetName() string { + if x != nil { + return x.Name + } + return "" } -func (m *DB) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (x *Table) GetTableMetaInfo() *TableMetaInfo { + if x != nil { + return x.TableMetaInfo + } + return nil } -func (m *DB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DB.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + +func (x *Table) GetStartTrainingThreshold() int32 { + if x != nil { + return x.StartTrainingThreshold } + return 0 } -func (m *DB) XXX_Merge(src proto.Message) { - xxx_messageInfo_DB.Merge(m, src) + +func (x *Table) GetModel() *Model { + if x != nil { + return x.Model + } + return nil } -func (m *DB) XXX_Size() int { - return m.Size() + +func (x *Table) GetTotalDocsSize() int64 { + if x != nil { + return x.TotalDocsSize + } + return 0 } -func (m *DB) XXX_DiscardUnknown() { - xxx_messageInfo_DB.DiscardUnknown(m) + +type DB struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tables []*Table `protobuf:"bytes,2,rep,name=tables,proto3" json:"tables,omitempty"` + UserPasswordPair map[string]string `protobuf:"bytes,3,rep,name=user_password_pair,json=userPasswordPair,proto3" json:"user_password_pair,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -var xxx_messageInfo_DB proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("FieldType", FieldType_name, FieldType_value) - proto.RegisterEnum("FieldOption", FieldOption_name, FieldOption_value) - proto.RegisterEnum("VectorMetaInfo_ValueType", VectorMetaInfo_ValueType_name, VectorMetaInfo_ValueType_value) - proto.RegisterEnum("VectorMetaInfo_StoreType", VectorMetaInfo_StoreType_name, VectorMetaInfo_StoreType_value) - proto.RegisterType((*Vector)(nil), "Vector") - proto.RegisterType((*Field)(nil), "Field") - proto.RegisterType((*Document)(nil), "Document") - proto.RegisterType((*Item)(nil), "Item") - proto.RegisterType((*ModelParameters)(nil), "ModelParameters") - proto.RegisterMapType((map[string]string)(nil), "ModelParameters.ParametersEntry") - proto.RegisterType((*Model)(nil), "Model") - proto.RegisterType((*VectorMetaInfo)(nil), "VectorMetaInfo") - proto.RegisterType((*FieldMetaInfo)(nil), "FieldMetaInfo") - proto.RegisterType((*TableMetaInfo)(nil), "TableMetaInfo") - proto.RegisterType((*Table)(nil), "Table") - proto.RegisterType((*DB)(nil), "DB") - proto.RegisterMapType((map[string]string)(nil), "DB.UserPasswordPairEntry") +func (x *DB) Reset() { + *x = DB{} + if protoimpl.UnsafeEnabled { + mi := &file_data_model_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func init() { proto.RegisterFile("data_model.proto", fileDescriptor_3a1ecda052abe117) } - -var fileDescriptor_3a1ecda052abe117 = []byte{ - // 1084 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4b, 0x6f, 0x23, 0x45, - 0x10, 0x76, 0xfb, 0x15, 0xbb, 0x1c, 0xdb, 0x43, 0x2f, 0xac, 0x9c, 0x10, 0xcd, 0x66, 0x47, 0x3c, - 0xa2, 0x95, 0x98, 0x95, 0x02, 0x5a, 0x85, 0x45, 0xa0, 0x8d, 0x63, 0x6f, 0xb0, 0x12, 0x7b, 0xa2, - 0x8e, 0x13, 0xb1, 0x5c, 0x46, 0x13, 0xbb, 0x9d, 0x0c, 0x78, 0xa6, 0x47, 0xdd, 0xed, 0x80, 0xf7, - 0xc4, 0x91, 0x1b, 0x57, 0xc4, 0x89, 0x23, 0x3f, 0x81, 0x0b, 0x12, 0xe2, 0x80, 0xf6, 0x88, 0xc4, - 0x85, 0xe3, 0xc6, 0xfc, 0x01, 0xb8, 0x71, 0x44, 0xdd, 0x33, 0x7e, 0x45, 0xc9, 0x61, 0x6f, 0x55, - 0x5f, 0x3d, 0xa6, 0xbe, 0xea, 0xaa, 0x1a, 0x30, 0xfa, 0x9e, 0xf4, 0xdc, 0x80, 0xf5, 0xe9, 0xd0, - 0x8e, 0x38, 0x93, 0x6c, 0x7d, 0x95, 0x72, 0xce, 0xb8, 0x48, 0xb4, 0xf7, 0xce, 0x7d, 0x79, 0x31, - 0x3a, 0xb3, 0x7b, 0x2c, 0x78, 0x78, 0xce, 0xce, 0xd9, 0x43, 0x0d, 0x9f, 0x8d, 0x06, 0x5a, 0xd3, - 0x8a, 0x96, 0x62, 0x77, 0xeb, 0x13, 0xc8, 0x9f, 0xd2, 0x9e, 0x64, 0x1c, 0x6f, 0xc0, 0xca, 0x80, - 0x7a, 0x72, 0xc4, 0x69, 0x0d, 0x6d, 0x66, 0xb6, 0xd2, 0xf5, 0xb4, 0x81, 0xc8, 0x14, 0xc2, 0x77, - 0x21, 0x2f, 0xd8, 0x88, 0xf7, 0x68, 0x2d, 0xbd, 0x89, 0xb6, 0x8a, 0x24, 0xd1, 0xac, 0xef, 0x10, - 0xe4, 0x9e, 0xfa, 0x74, 0xd8, 0xc7, 0x18, 0xb2, 0xa1, 0x17, 0xa8, 0x60, 0x65, 0xd7, 0x32, 0x36, - 0x21, 0x2b, 0xc7, 0x51, 0x1c, 0x53, 0xd9, 0x06, 0x5b, 0x7b, 0x76, 0xc7, 0x11, 0x25, 0x1a, 0xc7, - 0xaf, 0x43, 0xee, 0xd2, 0x1b, 0x8e, 0x68, 0x2d, 0xb3, 0x89, 0xb6, 0x56, 0x49, 0xac, 0xe0, 0xb7, - 0x20, 0xcf, 0x22, 0xe9, 0xb3, 0xb0, 0x96, 0xd5, 0x71, 0xab, 0x71, 0x9c, 0xa3, 0x31, 0x92, 0xd8, - 0x16, 0x2a, 0xca, 0x2d, 0x55, 0xd4, 0x84, 0x42, 0x83, 0xf5, 0x46, 0x01, 0x0d, 0x25, 0xbe, 0x03, - 0xb9, 0xc8, 0xfd, 0x92, 0x8e, 0xa7, 0x45, 0x45, 0x07, 0x74, 0x8c, 0x4d, 0xc8, 0x0f, 0x54, 0x3e, - 0x51, 0x4b, 0x6f, 0x66, 0xb6, 0x4a, 0xdb, 0xf9, 0x38, 0x3d, 0x49, 0xd0, 0xc7, 0xd9, 0x6f, 0x7f, - 0xbc, 0x87, 0xac, 0x13, 0xc8, 0xb6, 0x24, 0x0d, 0x70, 0x0d, 0x32, 0x94, 0x73, 0x9d, 0x40, 0xb9, - 0x36, 0x55, 0xaf, 0x89, 0x82, 0xf0, 0x9b, 0x90, 0xe9, 0xb3, 0x9e, 0xe6, 0x56, 0xda, 0x2e, 0xda, - 0xd3, 0x8f, 0x12, 0x85, 0x62, 0x03, 0x32, 0x81, 0x38, 0xd7, 0xbc, 0x8a, 0x44, 0x89, 0x49, 0xda, - 0xdf, 0x10, 0x54, 0xdb, 0xea, 0xf1, 0x8e, 0x3c, 0xee, 0x05, 0x54, 0x52, 0x2e, 0xb0, 0x0d, 0x77, - 0xbe, 0x10, 0x2c, 0x74, 0xa3, 0x19, 0xe4, 0x0a, 0xc9, 0x93, 0x9a, 0x5f, 0x53, 0xa6, 0xb9, 0xf3, - 0xb1, 0xe4, 0xf8, 0x09, 0xc0, 0xdc, 0x35, 0x21, 0xb1, 0x69, 0x5f, 0xcb, 0x6a, 0xcf, 0xc5, 0x66, - 0x28, 0xf9, 0x98, 0x2c, 0xc4, 0xac, 0x7f, 0x0c, 0xd5, 0x6b, 0x66, 0x55, 0xf0, 0xbc, 0x51, 0x4a, - 0x9c, 0x3f, 0x4e, 0xfc, 0xe2, 0xb1, 0xf2, 0x38, 0xbd, 0x83, 0xac, 0xcf, 0x20, 0xa7, 0xbf, 0x76, - 0xe3, 0x9b, 0x7f, 0x04, 0x86, 0x9e, 0x4e, 0x77, 0xa9, 0x46, 0xd5, 0x23, 0xe3, 0x7a, 0x8d, 0xa4, - 0x1a, 0x2c, 0x03, 0xd6, 0x0f, 0x69, 0xa8, 0xc4, 0xf3, 0xd8, 0xa6, 0xd2, 0x6b, 0x85, 0x03, 0x86, - 0x37, 0xa0, 0xd8, 0xf7, 0x03, 0x1a, 0x0a, 0x35, 0x10, 0xea, 0x43, 0x39, 0x32, 0x07, 0xf0, 0x0e, - 0x80, 0xae, 0xcb, 0x5d, 0x98, 0xb3, 0x35, 0x7b, 0x39, 0x85, 0x7d, 0xaa, 0x3c, 0xf4, 0xd8, 0x15, - 0x2f, 0xa7, 0xa2, 0x8a, 0x14, 0x92, 0xf1, 0x24, 0x32, 0x73, 0x73, 0xe4, 0xb1, 0xf2, 0x88, 0x23, - 0xc5, 0x54, 0xc4, 0xf7, 0xa0, 0x14, 0x47, 0x6a, 0x86, 0x7a, 0x48, 0x8b, 0x24, 0x4e, 0xa6, 0xa9, - 0x58, 0xf7, 0xa1, 0x38, 0xfb, 0x24, 0x2e, 0x42, 0xee, 0xe9, 0xa1, 0xb3, 0xdb, 0x35, 0x52, 0x4a, - 0x3c, 0x69, 0x75, 0xba, 0x3b, 0x06, 0xb2, 0xb6, 0xa1, 0x38, 0xcb, 0x8d, 0x2b, 0x00, 0xed, 0x66, - 0xdb, 0x21, 0xcf, 0x9c, 0xce, 0xe1, 0x33, 0x23, 0x85, 0x4b, 0xb0, 0x42, 0x9c, 0xbd, 0x83, 0xe3, - 0x46, 0xdd, 0x40, 0xb8, 0x00, 0xd9, 0x76, 0x7b, 0xf7, 0xc8, 0x48, 0x5b, 0xbf, 0x20, 0x28, 0xeb, - 0x51, 0x9d, 0xf5, 0xe6, 0xa6, 0xfe, 0xbf, 0x0b, 0x45, 0x7d, 0x22, 0x6e, 0x59, 0xbc, 0x82, 0x32, - 0xea, 0xaf, 0xae, 0x41, 0xc1, 0x17, 0xae, 0x1f, 0xf6, 0xe9, 0xd7, 0x9a, 0x7e, 0x81, 0xac, 0xf8, - 0xa2, 0xa5, 0xd4, 0xc4, 0xa4, 0x19, 0x69, 0x7a, 0xda, 0xa4, 0xeb, 0xc5, 0x1f, 0x82, 0x71, 0xa9, - 0x7b, 0xe4, 0x06, 0x54, 0x7a, 0xae, 0x1f, 0x0e, 0x98, 0x5e, 0xc0, 0xd2, 0x76, 0xf5, 0x5a, 0xf3, - 0x48, 0xe5, 0x72, 0x49, 0xb7, 0xfe, 0x45, 0x50, 0xee, 0x7a, 0x67, 0x43, 0x3a, 0xab, 0x7f, 0x0b, - 0x8c, 0x88, 0xfb, 0x81, 0xc7, 0xc7, 0x6a, 0x4b, 0xdd, 0x05, 0x2e, 0x95, 0x04, 0x3f, 0xa0, 0xe3, - 0x8e, 0x62, 0xf5, 0xc1, 0xb2, 0xe7, 0x2d, 0xe4, 0x16, 0xa2, 0x34, 0xc5, 0xb7, 0xa1, 0x12, 0x79, - 0x5c, 0xfa, 0xea, 0x60, 0x08, 0x37, 0x1c, 0x05, 0x9a, 0x68, 0x8e, 0x94, 0xe7, 0x68, 0x67, 0x14, - 0xe0, 0xfb, 0xb0, 0xca, 0x69, 0x34, 0xf4, 0x7b, 0x5e, 0xec, 0x94, 0xd5, 0x4e, 0xa5, 0x29, 0xa6, - 0x5c, 0x1e, 0x41, 0x55, 0x9f, 0x87, 0x25, 0xd6, 0x6a, 0xf1, 0x2a, 0xf6, 0xd2, 0x93, 0x90, 0xf2, - 0x60, 0x51, 0xb5, 0xfe, 0x44, 0x90, 0xd3, 0x9c, 0x6f, 0x7c, 0xab, 0x47, 0x50, 0x95, 0xca, 0xb8, - 0x90, 0x35, 0x5e, 0x95, 0x8a, 0xbd, 0xd4, 0x28, 0x52, 0x96, 0x4b, 0x7d, 0xdb, 0x81, 0x9a, 0x90, - 0x1e, 0x97, 0xae, 0xe4, 0x9e, 0x1f, 0xfa, 0xe1, 0xb9, 0x2b, 0x2f, 0x38, 0x15, 0x17, 0x6c, 0xd8, - 0x4f, 0x18, 0xde, 0xd5, 0xf6, 0x6e, 0x62, 0xee, 0x4e, 0xad, 0x78, 0x03, 0x72, 0x7a, 0xe7, 0x34, - 0x47, 0x75, 0xd0, 0xf4, 0x4a, 0x92, 0x18, 0xc4, 0xef, 0x40, 0x55, 0x32, 0xe9, 0x0d, 0xdd, 0x3e, - 0xeb, 0x09, 0x57, 0xf8, 0xcf, 0xe3, 0xe3, 0x9a, 0x21, 0x65, 0x0d, 0x37, 0x58, 0x4f, 0x1c, 0xfb, - 0xcf, 0xa9, 0xf5, 0x3b, 0x82, 0x74, 0xa3, 0x7e, 0xcb, 0xc9, 0xcf, 0xeb, 0x5a, 0xe7, 0xd7, 0x55, - 0x33, 0x21, 0x09, 0x8a, 0xf7, 0x01, 0x8f, 0x04, 0xe5, 0x6e, 0xe4, 0x09, 0xf1, 0x15, 0xe3, 0x7d, - 0x37, 0xf2, 0x7c, 0x5e, 0xcb, 0x68, 0xdf, 0x35, 0xbb, 0x51, 0xb7, 0x4f, 0x04, 0xe5, 0x47, 0x89, - 0xf1, 0xc8, 0xf3, 0x79, 0x7c, 0xbd, 0x8c, 0xd1, 0x35, 0x78, 0x7d, 0x0f, 0xde, 0xb8, 0xd1, 0xf5, - 0x55, 0x2e, 0xd9, 0x03, 0x06, 0xc5, 0xd9, 0xf4, 0xe0, 0x15, 0xc8, 0xb4, 0x3a, 0x6a, 0x4f, 0x0b, - 0x90, 0x3d, 0x74, 0x3a, 0xfb, 0x06, 0x9a, 0x2f, 0x6f, 0x1a, 0x03, 0xe4, 0x1b, 0xce, 0x49, 0xfd, - 0xb0, 0x69, 0x64, 0x94, 0x7c, 0xdc, 0x25, 0xad, 0xce, 0xbe, 0x91, 0x55, 0xf2, 0x69, 0x73, 0xaf, - 0xeb, 0x10, 0x23, 0xa7, 0x02, 0xeb, 0x8e, 0x73, 0x68, 0xe4, 0xf1, 0x2a, 0x14, 0xf6, 0x9b, 0xce, - 0x91, 0xa3, 0x12, 0xae, 0x28, 0xbc, 0xb1, 0xdb, 0x6d, 0x1a, 0x85, 0x07, 0x16, 0x94, 0x16, 0x7e, - 0x66, 0xca, 0xd0, 0x19, 0x0d, 0x87, 0xf1, 0x6d, 0xd0, 0xbb, 0x67, 0xa0, 0xfa, 0x93, 0x17, 0x57, - 0x66, 0xea, 0xaf, 0x2b, 0x33, 0xf5, 0xf2, 0xca, 0x4c, 0xfd, 0x73, 0x65, 0xa6, 0xfe, 0xbb, 0x32, - 0xd1, 0x37, 0x13, 0x13, 0xfd, 0x34, 0x31, 0xd1, 0xcf, 0x13, 0x33, 0xf5, 0xeb, 0xc4, 0x4c, 0xbd, - 0x98, 0x98, 0xe8, 0x8f, 0x89, 0x89, 0x5e, 0x4e, 0x4c, 0xf4, 0xfd, 0xdf, 0x66, 0xea, 0x53, 0xf4, - 0x79, 0xe1, 0x92, 0x7a, 0xbc, 0x77, 0x11, 0x9d, 0x9d, 0xe5, 0xf5, 0xcf, 0xfd, 0xfd, 0xff, 0x03, - 0x00, 0x00, 0xff, 0xff, 0x6d, 0x1b, 0xa7, 0x5e, 0x2d, 0x08, 0x00, 0x00, +func (x *DB) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *Vector) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*DB) ProtoMessage() {} - that1, ok := that.(*Vector) - if !ok { - that2, ok := that.(Vector) - if ok { - that1 = &that2 - } else { - return false +func (x *DB) ProtoReflect() protoreflect.Message { + mi := &file_data_model_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false + return mi.MessageOf(x) +} + +// Deprecated: Use DB.ProtoReflect.Descriptor instead. +func (*DB) Descriptor() ([]byte, []int) { + return file_data_model_proto_rawDescGZIP(), []int{10} +} + +func (x *DB) GetName() string { + if x != nil { + return x.Name } - if len(this.Feature) != len(that1.Feature) { - return false - } - for i := range this.Feature { - if this.Feature[i] != that1.Feature[i] { - return false - } - } - if this.Source != that1.Source { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Field) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Field) - if !ok { - that2, ok := that.(Field) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Type != that1.Type { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if this.Option != that1.Option { - return false - } - if this.Source != that1.Source { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Document) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Document) - if !ok { - that2, ok := that.(Document) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.PKey != that1.PKey { - return false - } - if len(this.Fields) != len(that1.Fields) { - return false - } - for i := range this.Fields { - if !this.Fields[i].Equal(that1.Fields[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Item) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Item) - if !ok { - that2, ok := that.(Item) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Err.Equal(that1.Err) { - return false - } - if !this.Doc.Equal(that1.Doc) { - return false - } - if this.Msg != that1.Msg { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ModelParameters) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ModelParameters) - if !ok { - that2, ok := that.(ModelParameters) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.JsonParametersStr != that1.JsonParametersStr { - return false - } - if len(this.Parameters) != len(that1.Parameters) { - return false - } - for i := range this.Parameters { - if this.Parameters[i] != that1.Parameters[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Model) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Model) - if !ok { - that2, ok := that.(Model) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if !this.ModelParameters.Equal(that1.ModelParameters) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *VectorMetaInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VectorMetaInfo) - if !ok { - that2, ok := that.(VectorMetaInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Dimension != that1.Dimension { - return false - } - if this.ValueType != that1.ValueType { - return false - } - if this.StoreType != that1.StoreType { - return false - } - if this.StoreParam != that1.StoreParam { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FieldMetaInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FieldMetaInfo) - if !ok { - that2, ok := that.(FieldMetaInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.DataType != that1.DataType { - return false - } - if this.IsIndex != that1.IsIndex { - return false - } - if this.IsStore != that1.IsStore { - return false - } - if !this.VectorMetaInfo.Equal(that1.VectorMetaInfo) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TableMetaInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TableMetaInfo) - if !ok { - that2, ok := that.(TableMetaInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.PrimaryKeyName != that1.PrimaryKeyName { - return false - } - if this.PrimaryKeyType != that1.PrimaryKeyType { - return false - } - if this.PartitionsNum != that1.PartitionsNum { - return false - } - if this.ReplicasNum != that1.ReplicasNum { - return false - } - if len(this.FieldMetaInfo) != len(that1.FieldMetaInfo) { - return false - } - for i := range this.FieldMetaInfo { - if !this.FieldMetaInfo[i].Equal(that1.FieldMetaInfo[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Table) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Table) - if !ok { - that2, ok := that.(Table) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if !this.TableMetaInfo.Equal(that1.TableMetaInfo) { - return false - } - if this.StartTrainingThreshold != that1.StartTrainingThreshold { - return false - } - if !this.Model.Equal(that1.Model) { - return false - } - if this.TotalDocsSize != that1.TotalDocsSize { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *DB) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DB) - if !ok { - that2, ok := that.(DB) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Tables) != len(that1.Tables) { - return false - } - for i := range this.Tables { - if !this.Tables[i].Equal(that1.Tables[i]) { - return false - } - } - if len(this.UserPasswordPair) != len(that1.UserPasswordPair) { - return false - } - for i := range this.UserPasswordPair { - if this.UserPasswordPair[i] != that1.UserPasswordPair[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (m *Vector) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vector) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vector) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x12 - } - if len(m.Feature) > 0 { - for iNdEx := len(m.Feature) - 1; iNdEx >= 0; iNdEx-- { - f1 := math.Float32bits(float32(m.Feature[iNdEx])) - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(f1)) - } - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Feature)*4)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Field) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Field) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x2a - } - if m.Option != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x20 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if m.Type != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Document) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Document) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.PKey) > 0 { - i -= len(m.PKey) - copy(dAtA[i:], m.PKey) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.PKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Item) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Item) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Item) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x1a - } - if m.Doc != nil { - { - size, err := m.Doc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Err != nil { - { - size, err := m.Err.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ModelParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ModelParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ModelParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Parameters) > 0 { - for k := range m.Parameters { - v := m.Parameters[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintDataModel(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDataModel(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDataModel(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.JsonParametersStr) > 0 { - i -= len(m.JsonParametersStr) - copy(dAtA[i:], m.JsonParametersStr) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.JsonParametersStr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Model) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Model) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Model) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ModelParameters != nil { - { - size, err := m.ModelParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VectorMetaInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VectorMetaInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VectorMetaInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.StoreParam) > 0 { - i -= len(m.StoreParam) - copy(dAtA[i:], m.StoreParam) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.StoreParam))) - i-- - dAtA[i] = 0x22 - } - if m.StoreType != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.StoreType)) - i-- - dAtA[i] = 0x18 - } - if m.ValueType != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.ValueType)) - i-- - dAtA[i] = 0x10 - } - if m.Dimension != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.Dimension)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FieldMetaInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FieldMetaInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FieldMetaInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.VectorMetaInfo != nil { - { - size, err := m.VectorMetaInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.IsStore { - i-- - if m.IsStore { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.IsIndex { - i-- - if m.IsIndex { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.DataType != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.DataType)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TableMetaInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TableMetaInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TableMetaInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.FieldMetaInfo) > 0 { - for iNdEx := len(m.FieldMetaInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.FieldMetaInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.ReplicasNum != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.ReplicasNum)) - i-- - dAtA[i] = 0x20 - } - if m.PartitionsNum != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.PartitionsNum)) - i-- - dAtA[i] = 0x18 - } - if m.PrimaryKeyType != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.PrimaryKeyType)) - i-- - dAtA[i] = 0x10 - } - if len(m.PrimaryKeyName) > 0 { - i -= len(m.PrimaryKeyName) - copy(dAtA[i:], m.PrimaryKeyName) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.PrimaryKeyName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Table) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Table) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Table) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.TotalDocsSize != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.TotalDocsSize)) - i-- - dAtA[i] = 0x28 - } - if m.Model != nil { - { - size, err := m.Model.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.StartTrainingThreshold != 0 { - i = encodeVarintDataModel(dAtA, i, uint64(m.StartTrainingThreshold)) - i-- - dAtA[i] = 0x18 - } - if m.TableMetaInfo != nil { - { - size, err := m.TableMetaInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DB) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DB) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DB) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.UserPasswordPair) > 0 { - for k := range m.UserPasswordPair { - v := m.UserPasswordPair[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintDataModel(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintDataModel(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintDataModel(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Tables) > 0 { - for iNdEx := len(m.Tables) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tables[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDataModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDataModel(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDataModel(dAtA []byte, offset int, v uint64) int { - offset -= sovDataModel(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedVector(r randyDataModel, easy bool) *Vector { - this := &Vector{} - v1 := r.Intn(10) - this.Feature = make([]float32, v1) - for i := 0; i < v1; i++ { - this.Feature[i] = float32(r.Float32()) - if r.Intn(2) == 0 { - this.Feature[i] *= -1 - } - } - this.Source = string(randStringDataModel(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 3) - } - return this -} - -func NewPopulatedField(r randyDataModel, easy bool) *Field { - this := &Field{} - this.Name = string(randStringDataModel(r)) - this.Type = FieldType([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8}[r.Intn(9)]) - v2 := r.Intn(100) - this.Value = make([]byte, v2) - for i := 0; i < v2; i++ { - this.Value[i] = byte(r.Intn(256)) - } - this.Option = FieldOption([]int32{0, 1}[r.Intn(2)]) - this.Source = string(randStringDataModel(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 6) - } - return this -} - -func NewPopulatedDocument(r randyDataModel, easy bool) *Document { - this := &Document{} - this.PKey = string(randStringDataModel(r)) - if r.Intn(5) != 0 { - v3 := r.Intn(5) - this.Fields = make([]*Field, v3) - for i := 0; i < v3; i++ { - this.Fields[i] = NewPopulatedField(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 3) - } - return this -} - -func NewPopulatedItem(r randyDataModel, easy bool) *Item { - this := &Item{} - if r.Intn(5) != 0 { - this.Err = NewPopulatedError(r, easy) - } - if r.Intn(5) != 0 { - this.Doc = NewPopulatedDocument(r, easy) - } - this.Msg = string(randStringDataModel(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 4) - } - return this -} - -func NewPopulatedModelParameters(r randyDataModel, easy bool) *ModelParameters { - this := &ModelParameters{} - this.JsonParametersStr = string(randStringDataModel(r)) - if r.Intn(5) != 0 { - v4 := r.Intn(10) - this.Parameters = make(map[string]string) - for i := 0; i < v4; i++ { - this.Parameters[randStringDataModel(r)] = randStringDataModel(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 3) - } - return this -} - -func NewPopulatedModel(r randyDataModel, easy bool) *Model { - this := &Model{} - this.Name = string(randStringDataModel(r)) - if r.Intn(5) != 0 { - this.ModelParameters = NewPopulatedModelParameters(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 3) - } - return this -} - -func NewPopulatedVectorMetaInfo(r randyDataModel, easy bool) *VectorMetaInfo { - this := &VectorMetaInfo{} - this.Dimension = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Dimension *= -1 - } - this.ValueType = VectorMetaInfo_ValueType([]int32{0, 1}[r.Intn(2)]) - this.StoreType = VectorMetaInfo_StoreType([]int32{0, 1, 2}[r.Intn(3)]) - this.StoreParam = string(randStringDataModel(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 5) - } - return this -} - -func NewPopulatedFieldMetaInfo(r randyDataModel, easy bool) *FieldMetaInfo { - this := &FieldMetaInfo{} - this.Name = string(randStringDataModel(r)) - this.DataType = FieldType([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8}[r.Intn(9)]) - this.IsIndex = bool(bool(r.Intn(2) == 0)) - this.IsStore = bool(bool(r.Intn(2) == 0)) - if r.Intn(5) != 0 { - this.VectorMetaInfo = NewPopulatedVectorMetaInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 6) - } - return this -} - -func NewPopulatedTableMetaInfo(r randyDataModel, easy bool) *TableMetaInfo { - this := &TableMetaInfo{} - this.PrimaryKeyName = string(randStringDataModel(r)) - this.PrimaryKeyType = FieldType([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8}[r.Intn(9)]) - this.PartitionsNum = int32(r.Int31()) - if r.Intn(2) == 0 { - this.PartitionsNum *= -1 - } - this.ReplicasNum = int32(r.Int31()) - if r.Intn(2) == 0 { - this.ReplicasNum *= -1 - } - if r.Intn(5) != 0 { - v5 := r.Intn(5) - this.FieldMetaInfo = make([]*FieldMetaInfo, v5) - for i := 0; i < v5; i++ { - this.FieldMetaInfo[i] = NewPopulatedFieldMetaInfo(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 6) - } - return this -} - -func NewPopulatedTable(r randyDataModel, easy bool) *Table { - this := &Table{} - this.Name = string(randStringDataModel(r)) - if r.Intn(5) != 0 { - this.TableMetaInfo = NewPopulatedTableMetaInfo(r, easy) - } - this.StartTrainingThreshold = int32(r.Int31()) - if r.Intn(2) == 0 { - this.StartTrainingThreshold *= -1 - } - if r.Intn(5) != 0 { - this.Model = NewPopulatedModel(r, easy) - } - this.TotalDocsSize = int64(r.Int63()) - if r.Intn(2) == 0 { - this.TotalDocsSize *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 6) - } - return this -} - -func NewPopulatedDB(r randyDataModel, easy bool) *DB { - this := &DB{} - this.Name = string(randStringDataModel(r)) - if r.Intn(5) != 0 { - v6 := r.Intn(5) - this.Tables = make([]*Table, v6) - for i := 0; i < v6; i++ { - this.Tables[i] = NewPopulatedTable(r, easy) - } - } - if r.Intn(5) != 0 { - v7 := r.Intn(10) - this.UserPasswordPair = make(map[string]string) - for i := 0; i < v7; i++ { - this.UserPasswordPair[randStringDataModel(r)] = randStringDataModel(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedDataModel(r, 4) - } - return this -} - -type randyDataModel interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneDataModel(r randyDataModel) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringDataModel(r randyDataModel) string { - v8 := r.Intn(100) - tmps := make([]rune, v8) - for i := 0; i < v8; i++ { - tmps[i] = randUTF8RuneDataModel(r) - } - return string(tmps) -} -func randUnrecognizedDataModel(r randyDataModel, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldDataModel(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldDataModel(dAtA []byte, r randyDataModel, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(key)) - v9 := r.Int63() - if r.Intn(2) == 0 { - v9 *= -1 - } - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(v9)) - case 1: - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateDataModel(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateDataModel(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Vector) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Feature) > 0 { - n += 1 + sovDataModel(uint64(len(m.Feature)*4)) + len(m.Feature)*4 - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Field) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovDataModel(uint64(m.Type)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovDataModel(uint64(m.Option)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Document) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PKey) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if len(m.Fields) > 0 { - for _, e := range m.Fields { - l = e.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Item) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Err != nil { - l = m.Err.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - if m.Doc != nil { - l = m.Doc.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ModelParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.JsonParametersStr) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if len(m.Parameters) > 0 { - for k, v := range m.Parameters { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovDataModel(uint64(len(k))) + 1 + len(v) + sovDataModel(uint64(len(v))) - n += mapEntrySize + 1 + sovDataModel(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Model) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.ModelParameters != nil { - l = m.ModelParameters.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *VectorMetaInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Dimension != 0 { - n += 1 + sovDataModel(uint64(m.Dimension)) - } - if m.ValueType != 0 { - n += 1 + sovDataModel(uint64(m.ValueType)) - } - if m.StoreType != 0 { - n += 1 + sovDataModel(uint64(m.StoreType)) - } - l = len(m.StoreParam) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FieldMetaInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.DataType != 0 { - n += 1 + sovDataModel(uint64(m.DataType)) - } - if m.IsIndex { - n += 2 - } - if m.IsStore { - n += 2 - } - if m.VectorMetaInfo != nil { - l = m.VectorMetaInfo.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TableMetaInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PrimaryKeyName) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.PrimaryKeyType != 0 { - n += 1 + sovDataModel(uint64(m.PrimaryKeyType)) - } - if m.PartitionsNum != 0 { - n += 1 + sovDataModel(uint64(m.PartitionsNum)) - } - if m.ReplicasNum != 0 { - n += 1 + sovDataModel(uint64(m.ReplicasNum)) - } - if len(m.FieldMetaInfo) > 0 { - for _, e := range m.FieldMetaInfo { - l = e.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Table) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if m.TableMetaInfo != nil { - l = m.TableMetaInfo.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - if m.StartTrainingThreshold != 0 { - n += 1 + sovDataModel(uint64(m.StartTrainingThreshold)) - } - if m.Model != nil { - l = m.Model.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - if m.TotalDocsSize != 0 { - n += 1 + sovDataModel(uint64(m.TotalDocsSize)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DB) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDataModel(uint64(l)) - } - if len(m.Tables) > 0 { - for _, e := range m.Tables { - l = e.Size() - n += 1 + l + sovDataModel(uint64(l)) - } - } - if len(m.UserPasswordPair) > 0 { - for k, v := range m.UserPasswordPair { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovDataModel(uint64(len(k))) + 1 + len(v) + sovDataModel(uint64(len(v))) - n += mapEntrySize + 1 + sovDataModel(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovDataModel(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDataModel(x uint64) (n int) { - return sovDataModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Vector) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Vector{`, - `Feature:` + fmt.Sprintf("%v", this.Feature) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Field) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Field{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `Option:` + fmt.Sprintf("%v", this.Option) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Document) String() string { - if this == nil { - return "nil" - } - repeatedStringForFields := "[]*Field{" - for _, f := range this.Fields { - repeatedStringForFields += strings.Replace(f.String(), "Field", "Field", 1) + "," - } - repeatedStringForFields += "}" - s := strings.Join([]string{`&Document{`, - `PKey:` + fmt.Sprintf("%v", this.PKey) + `,`, - `Fields:` + repeatedStringForFields + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Item) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Item{`, - `Err:` + strings.Replace(fmt.Sprintf("%v", this.Err), "Error", "Error", 1) + `,`, - `Doc:` + strings.Replace(this.Doc.String(), "Document", "Document", 1) + `,`, - `Msg:` + fmt.Sprintf("%v", this.Msg) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ModelParameters) String() string { - if this == nil { - return "nil" - } - keysForParameters := make([]string, 0, len(this.Parameters)) - for k, _ := range this.Parameters { - keysForParameters = append(keysForParameters, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForParameters) - mapStringForParameters := "map[string]string{" - for _, k := range keysForParameters { - mapStringForParameters += fmt.Sprintf("%v: %v,", k, this.Parameters[k]) - } - mapStringForParameters += "}" - s := strings.Join([]string{`&ModelParameters{`, - `JsonParametersStr:` + fmt.Sprintf("%v", this.JsonParametersStr) + `,`, - `Parameters:` + mapStringForParameters + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Model) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Model{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ModelParameters:` + strings.Replace(this.ModelParameters.String(), "ModelParameters", "ModelParameters", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *VectorMetaInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VectorMetaInfo{`, - `Dimension:` + fmt.Sprintf("%v", this.Dimension) + `,`, - `ValueType:` + fmt.Sprintf("%v", this.ValueType) + `,`, - `StoreType:` + fmt.Sprintf("%v", this.StoreType) + `,`, - `StoreParam:` + fmt.Sprintf("%v", this.StoreParam) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FieldMetaInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FieldMetaInfo{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `DataType:` + fmt.Sprintf("%v", this.DataType) + `,`, - `IsIndex:` + fmt.Sprintf("%v", this.IsIndex) + `,`, - `IsStore:` + fmt.Sprintf("%v", this.IsStore) + `,`, - `VectorMetaInfo:` + strings.Replace(this.VectorMetaInfo.String(), "VectorMetaInfo", "VectorMetaInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TableMetaInfo) String() string { - if this == nil { - return "nil" - } - repeatedStringForFieldMetaInfo := "[]*FieldMetaInfo{" - for _, f := range this.FieldMetaInfo { - repeatedStringForFieldMetaInfo += strings.Replace(f.String(), "FieldMetaInfo", "FieldMetaInfo", 1) + "," - } - repeatedStringForFieldMetaInfo += "}" - s := strings.Join([]string{`&TableMetaInfo{`, - `PrimaryKeyName:` + fmt.Sprintf("%v", this.PrimaryKeyName) + `,`, - `PrimaryKeyType:` + fmt.Sprintf("%v", this.PrimaryKeyType) + `,`, - `PartitionsNum:` + fmt.Sprintf("%v", this.PartitionsNum) + `,`, - `ReplicasNum:` + fmt.Sprintf("%v", this.ReplicasNum) + `,`, - `FieldMetaInfo:` + repeatedStringForFieldMetaInfo + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Table) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Table{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `TableMetaInfo:` + strings.Replace(this.TableMetaInfo.String(), "TableMetaInfo", "TableMetaInfo", 1) + `,`, - `StartTrainingThreshold:` + fmt.Sprintf("%v", this.StartTrainingThreshold) + `,`, - `Model:` + strings.Replace(this.Model.String(), "Model", "Model", 1) + `,`, - `TotalDocsSize:` + fmt.Sprintf("%v", this.TotalDocsSize) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DB) String() string { - if this == nil { - return "nil" - } - repeatedStringForTables := "[]*Table{" - for _, f := range this.Tables { - repeatedStringForTables += strings.Replace(f.String(), "Table", "Table", 1) + "," - } - repeatedStringForTables += "}" - keysForUserPasswordPair := make([]string, 0, len(this.UserPasswordPair)) - for k, _ := range this.UserPasswordPair { - keysForUserPasswordPair = append(keysForUserPasswordPair, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForUserPasswordPair) - mapStringForUserPasswordPair := "map[string]string{" - for _, k := range keysForUserPasswordPair { - mapStringForUserPasswordPair += fmt.Sprintf("%v: %v,", k, this.UserPasswordPair[k]) - } - mapStringForUserPasswordPair += "}" - s := strings.Join([]string{`&DB{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Tables:` + repeatedStringForTables + `,`, - `UserPasswordPair:` + mapStringForUserPasswordPair + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringDataModel(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Vector) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vector: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vector: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 5 { - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - v2 := float32(math.Float32frombits(v)) - m.Feature = append(m.Feature, v2) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 4 - if elementCount != 0 && len(m.Feature) == 0 { - m.Feature = make([]float32, 0, elementCount) - } - for iNdEx < postIndex { - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - v2 := float32(math.Float32frombits(v)) - m.Feature = append(m.Feature, v2) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Feature", wireType) - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Field) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Field: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Field: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= FieldType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= FieldOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Document) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Document: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fields = append(m.Fields, &Field{}) - if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Item) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Item: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Item: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Err == nil { - m.Err = &Error{} - } - if err := m.Err.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Doc == nil { - m.Doc = &Document{} - } - if err := m.Doc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ModelParameters) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ModelParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ModelParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JsonParametersStr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.JsonParametersStr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Parameters == nil { - m.Parameters = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDataModel - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDataModel - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthDataModel - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthDataModel - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Parameters[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Model) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Model: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Model: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModelParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ModelParameters == nil { - m.ModelParameters = &ModelParameters{} - } - if err := m.ModelParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VectorMetaInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VectorMetaInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VectorMetaInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Dimension", wireType) - } - m.Dimension = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Dimension |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValueType", wireType) - } - m.ValueType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValueType |= VectorMetaInfo_ValueType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreType", wireType) - } - m.StoreType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StoreType |= VectorMetaInfo_StoreType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreParam", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoreParam = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FieldMetaInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FieldMetaInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FieldMetaInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataType", wireType) - } - m.DataType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DataType |= FieldType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsIndex", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsIndex = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsStore", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsStore = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VectorMetaInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VectorMetaInfo == nil { - m.VectorMetaInfo = &VectorMetaInfo{} - } - if err := m.VectorMetaInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil + return "" } -func (m *TableMetaInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TableMetaInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TableMetaInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryKeyName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrimaryKeyName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryKeyType", wireType) - } - m.PrimaryKeyType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrimaryKeyType |= FieldType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartitionsNum", wireType) - } - m.PartitionsNum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartitionsNum |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReplicasNum", wireType) - } - m.ReplicasNum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ReplicasNum |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldMetaInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FieldMetaInfo = append(m.FieldMetaInfo, &FieldMetaInfo{}) - if err := m.FieldMetaInfo[len(m.FieldMetaInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *DB) GetTables() []*Table { + if x != nil { + return x.Tables } return nil } -func (m *Table) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Table: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Table: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableMetaInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TableMetaInfo == nil { - m.TableMetaInfo = &TableMetaInfo{} - } - if err := m.TableMetaInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTrainingThreshold", wireType) - } - m.StartTrainingThreshold = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTrainingThreshold |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Model", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Model == nil { - m.Model = &Model{} - } - if err := m.Model.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDocsSize", wireType) - } - m.TotalDocsSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalDocsSize |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *DB) GetUserPasswordPair() map[string]string { + if x != nil { + return x.UserPasswordPair } return nil } -func (m *DB) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DB: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DB: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tables = append(m.Tables, &Table{}) - if err := m.Tables[len(m.Tables)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserPasswordPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDataModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDataModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UserPasswordPair == nil { - m.UserPasswordPair = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthDataModel - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthDataModel - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDataModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthDataModel - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthDataModel - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.UserPasswordPair[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDataModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDataModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDataModel(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDataModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDataModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDataModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDataModel - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDataModel - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDataModel - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var File_data_model_proto protoreflect.FileDescriptor + +var file_data_model_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x3e, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x07, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x02, 0x42, 0x02, 0x10, 0x01, 0x52, + 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x24, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x13, + 0x0a, 0x05, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x22, 0x4f, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x0a, 0x03, 0x65, + 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x1b, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x64, + 0x6f, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6d, 0x73, 0x67, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x53, 0x74, 0x72, 0x12, 0x40, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x58, 0x0a, 0x05, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x22, 0x9a, 0x02, 0x0a, 0x0e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, + 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x69, 0x6d, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, + 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x49, + 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x21, 0x0a, 0x09, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x01, 0x22, 0x32, 0x0a, 0x09, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x45, 0x4d, + 0x4f, 0x52, 0x59, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x4f, 0x43, + 0x4b, 0x53, 0x44, 0x42, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x4d, 0x41, 0x50, 0x10, 0x02, + 0x22, 0xbd, 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x69, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, + 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x10, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, + 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, + 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x10, + 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x0f, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x65, 0x74, + 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x65, 0x74, 0x61, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xd3, 0x01, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x18, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x16, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x02, 0x44, + 0x42, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x50, 0x61, 0x69, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x75, 0x73, + 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x50, 0x61, 0x69, 0x72, 0x1a, 0x43, + 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x50, 0x61, + 0x69, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x2a, 0x6f, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x4e, + 0x47, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, + 0x52, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x45, 0x43, 0x54, 0x4f, 0x52, + 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, + 0x47, 0x45, 0x4f, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, + 0x54, 0x45, 0x10, 0x08, 0x2a, 0x22, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x09, 0x0a, + 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x10, 0x01, 0x42, 0x0e, 0x48, 0x01, 0x5a, 0x0a, 0x2e, 0x2f, + 0x76, 0x65, 0x61, 0x72, 0x63, 0x68, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthDataModel = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDataModel = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDataModel = fmt.Errorf("proto: unexpected end of group") + file_data_model_proto_rawDescOnce sync.Once + file_data_model_proto_rawDescData = file_data_model_proto_rawDesc ) + +func file_data_model_proto_rawDescGZIP() []byte { + file_data_model_proto_rawDescOnce.Do(func() { + file_data_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_data_model_proto_rawDescData) + }) + return file_data_model_proto_rawDescData +} + +var file_data_model_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_data_model_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_data_model_proto_goTypes = []interface{}{ + (FieldType)(0), // 0: FieldType + (FieldOption)(0), // 1: FieldOption + (VectorMetaInfo_ValueType)(0), // 2: VectorMetaInfo.ValueType + (VectorMetaInfo_StoreType)(0), // 3: VectorMetaInfo.StoreType + (*Vector)(nil), // 4: Vector + (*Field)(nil), // 5: Field + (*Document)(nil), // 6: Document + (*Item)(nil), // 7: Item + (*ModelParameters)(nil), // 8: ModelParameters + (*Model)(nil), // 9: Model + (*VectorMetaInfo)(nil), // 10: VectorMetaInfo + (*FieldMetaInfo)(nil), // 11: FieldMetaInfo + (*TableMetaInfo)(nil), // 12: TableMetaInfo + (*Table)(nil), // 13: Table + (*DB)(nil), // 14: DB + nil, // 15: ModelParameters.ParametersEntry + nil, // 16: DB.UserPasswordPairEntry + (*Error)(nil), // 17: Error +} +var file_data_model_proto_depIdxs = []int32{ + 0, // 0: Field.type:type_name -> FieldType + 1, // 1: Field.option:type_name -> FieldOption + 5, // 2: Document.fields:type_name -> Field + 17, // 3: Item.err:type_name -> Error + 6, // 4: Item.doc:type_name -> Document + 15, // 5: ModelParameters.parameters:type_name -> ModelParameters.ParametersEntry + 8, // 6: Model.model_parameters:type_name -> ModelParameters + 2, // 7: VectorMetaInfo.value_type:type_name -> VectorMetaInfo.ValueType + 3, // 8: VectorMetaInfo.store_type:type_name -> VectorMetaInfo.StoreType + 0, // 9: FieldMetaInfo.data_type:type_name -> FieldType + 10, // 10: FieldMetaInfo.vector_meta_info:type_name -> VectorMetaInfo + 0, // 11: TableMetaInfo.primary_key_type:type_name -> FieldType + 11, // 12: TableMetaInfo.field_meta_info:type_name -> FieldMetaInfo + 12, // 13: Table.table_meta_info:type_name -> TableMetaInfo + 9, // 14: Table.model:type_name -> Model + 13, // 15: DB.tables:type_name -> Table + 16, // 16: DB.user_password_pair:type_name -> DB.UserPasswordPairEntry + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name +} + +func init() { file_data_model_proto_init() } +func file_data_model_proto_init() { + if File_data_model_proto != nil { + return + } + file_errors_proto_init() + if !protoimpl.UnsafeEnabled { + file_data_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModelParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Model); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VectorMetaInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldMetaInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableMetaInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Table); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_model_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DB); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_data_model_proto_rawDesc, + NumEnums: 4, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_data_model_proto_goTypes, + DependencyIndexes: file_data_model_proto_depIdxs, + EnumInfos: file_data_model_proto_enumTypes, + MessageInfos: file_data_model_proto_msgTypes, + }.Build() + File_data_model_proto = out.File + file_data_model_proto_rawDesc = nil + file_data_model_proto_goTypes = nil + file_data_model_proto_depIdxs = nil +} diff --git a/internal/proto/vearchpb/errors.pb.go b/internal/proto/vearchpb/errors.pb.go index a5f79980..186e18db 100644 --- a/internal/proto/vearchpb/errors.pb.go +++ b/internal/proto/vearchpb/errors.pb.go @@ -1,31 +1,24 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.5.0 // source: errors.proto package vearchpb import ( - bytes "bytes" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ErrorEnum int32 @@ -107,162 +100,183 @@ const ( ErrorEnum_ALIAS_EXIST ErrorEnum = 201 ) -var ErrorEnum_name = map[int32]string{ - 0: "SUCCESS", - 1: "INTERNAL_ERROR", - 2: "NAME_OR_PASSWORD", - 3: "SYSBUSY", - 4: "PARAM_ERROR", - 5: "INVALID_CFG", - 6: "TIMEOUT", - 7: "SERVICE_UNAVAILABLE", - 8: "ZONE_NOT_EXISTS", - 9: "LOCAL_ZONE_OPS_FAILED", - 10: "DUP_ZONE", - 11: "DUP_DB", - 12: "INVALID_ENGINE", - 13: "DB_NOTEXISTS", - 14: "DB_Not_Empty", - 15: "DUP_SPACE", - 16: "SPACE_NOTEXISTS", - 17: "PARTITION_HAS_TASK_NOW", - 18: "REPLICA_NOT_EXISTS", - 19: "DUP_REPLICA", - 20: "PARTITION_REPLICA_LEADER_NOT_DELETE", - 21: "PS_NOTEXISTS", - 22: "PS_Already_Exists", - 23: "LOCAL_SPACE_OPS_FAILED", - 24: "Local_PS_Ops_Failed", - 25: "GENID_FAILED", - 26: "LOCALDB_OPTFAILED", - 27: "SPACE_SCHEMA_INVALID", - 28: "RPC_GET_CLIENT_FAILED", - 29: "RPC_INVALID_RESP", - 30: "RPC_INVOKE_FAILED", - 31: "RPC_PARAM_ERROR", - 32: "METHOD_NOT_IMPLEMENT", - 33: "USER_NOT_EXISTS", - 34: "DUP_USER", - 35: "USER_OPS_FAILED", - 36: "AUTHENTICATION_FAILED", - 37: "REGION_NOT_EXISTS", - 38: "MASTER_PS_CAN_NOT_SELECT", - 39: "MASTER_PS_NOT_ENOUGH_SELECT", - 40: "PARTITION_DUPLICATE", - 41: "PARTITION_NOT_EXIST", - 42: "PARTITION_NOT_LEADER", - 43: "PARTITION_NO_LEADER", - 44: "PARTITION_REQ_PARAM", - 45: "PARTITON_ENGINENAME_INVALID", - 46: "UNKNOWN_PARTITION_RAFT_CMD_TYPE", - 47: "MASTER_SERVER_IS_NOT_RUNNING", - 48: "PARTITION_IS_INVALID", - 49: "PARTITION_IS_CLOSED", - 50: "DOCUMENT_NOT_EXIST", - 51: "DOCUMENT_EXIST", - 52: "DOCUMENT_MUST_HAS_SOURCE", - 53: "PULL_OUT_VERSION_NOT_MATCH", - 54: "FUNC_CAN_NOT_INVOKE_IN_FROZEN_ENGINE", - 55: "ROUTER_NO_PS_CLIENT", - 56: "ROUTER_CALL_PS_RPC_ERR", - 57: "GAMMA_SEARCH_QUERY_NUM_LESS_0", - 58: "GAMMA_SEARCH_NO_CREATE_INDEX", - 59: "GAMMA_SEARCH_INDEX_QUERY_ERR", - 60: "GAMMA_SEARCH_OTHER_ERR", - 61: "PRIMARY_IS_INVALID", - 62: "PARSING_RESULT_ERROR", - 63: "FORCE_MERGE_BUILD_INDEX_ERR", - 64: "DELETE_BY_QUERY_SERACH_ERR", - 65: "DELETE_BY_QUERY_SEARCH_ID_IS_0", - 66: "FLUSH_ERR", - 70: "CREATE_RPCCLIENT_FAILED", - 71: "CALL_RPCCLIENT_FAILED", - 100: "RECOVER", - 200: "ALIAS_NOT_EXIST", - 201: "ALIAS_EXIST", -} +// Enum value maps for ErrorEnum. +var ( + ErrorEnum_name = map[int32]string{ + 0: "SUCCESS", + 1: "INTERNAL_ERROR", + 2: "NAME_OR_PASSWORD", + 3: "SYSBUSY", + 4: "PARAM_ERROR", + 5: "INVALID_CFG", + 6: "TIMEOUT", + 7: "SERVICE_UNAVAILABLE", + 8: "ZONE_NOT_EXISTS", + 9: "LOCAL_ZONE_OPS_FAILED", + 10: "DUP_ZONE", + 11: "DUP_DB", + 12: "INVALID_ENGINE", + 13: "DB_NOTEXISTS", + 14: "DB_Not_Empty", + 15: "DUP_SPACE", + 16: "SPACE_NOTEXISTS", + 17: "PARTITION_HAS_TASK_NOW", + 18: "REPLICA_NOT_EXISTS", + 19: "DUP_REPLICA", + 20: "PARTITION_REPLICA_LEADER_NOT_DELETE", + 21: "PS_NOTEXISTS", + 22: "PS_Already_Exists", + 23: "LOCAL_SPACE_OPS_FAILED", + 24: "Local_PS_Ops_Failed", + 25: "GENID_FAILED", + 26: "LOCALDB_OPTFAILED", + 27: "SPACE_SCHEMA_INVALID", + 28: "RPC_GET_CLIENT_FAILED", + 29: "RPC_INVALID_RESP", + 30: "RPC_INVOKE_FAILED", + 31: "RPC_PARAM_ERROR", + 32: "METHOD_NOT_IMPLEMENT", + 33: "USER_NOT_EXISTS", + 34: "DUP_USER", + 35: "USER_OPS_FAILED", + 36: "AUTHENTICATION_FAILED", + 37: "REGION_NOT_EXISTS", + 38: "MASTER_PS_CAN_NOT_SELECT", + 39: "MASTER_PS_NOT_ENOUGH_SELECT", + 40: "PARTITION_DUPLICATE", + 41: "PARTITION_NOT_EXIST", + 42: "PARTITION_NOT_LEADER", + 43: "PARTITION_NO_LEADER", + 44: "PARTITION_REQ_PARAM", + 45: "PARTITON_ENGINENAME_INVALID", + 46: "UNKNOWN_PARTITION_RAFT_CMD_TYPE", + 47: "MASTER_SERVER_IS_NOT_RUNNING", + 48: "PARTITION_IS_INVALID", + 49: "PARTITION_IS_CLOSED", + 50: "DOCUMENT_NOT_EXIST", + 51: "DOCUMENT_EXIST", + 52: "DOCUMENT_MUST_HAS_SOURCE", + 53: "PULL_OUT_VERSION_NOT_MATCH", + 54: "FUNC_CAN_NOT_INVOKE_IN_FROZEN_ENGINE", + 55: "ROUTER_NO_PS_CLIENT", + 56: "ROUTER_CALL_PS_RPC_ERR", + 57: "GAMMA_SEARCH_QUERY_NUM_LESS_0", + 58: "GAMMA_SEARCH_NO_CREATE_INDEX", + 59: "GAMMA_SEARCH_INDEX_QUERY_ERR", + 60: "GAMMA_SEARCH_OTHER_ERR", + 61: "PRIMARY_IS_INVALID", + 62: "PARSING_RESULT_ERROR", + 63: "FORCE_MERGE_BUILD_INDEX_ERR", + 64: "DELETE_BY_QUERY_SERACH_ERR", + 65: "DELETE_BY_QUERY_SEARCH_ID_IS_0", + 66: "FLUSH_ERR", + 70: "CREATE_RPCCLIENT_FAILED", + 71: "CALL_RPCCLIENT_FAILED", + 100: "RECOVER", + 200: "ALIAS_NOT_EXIST", + 201: "ALIAS_EXIST", + } + ErrorEnum_value = map[string]int32{ + "SUCCESS": 0, + "INTERNAL_ERROR": 1, + "NAME_OR_PASSWORD": 2, + "SYSBUSY": 3, + "PARAM_ERROR": 4, + "INVALID_CFG": 5, + "TIMEOUT": 6, + "SERVICE_UNAVAILABLE": 7, + "ZONE_NOT_EXISTS": 8, + "LOCAL_ZONE_OPS_FAILED": 9, + "DUP_ZONE": 10, + "DUP_DB": 11, + "INVALID_ENGINE": 12, + "DB_NOTEXISTS": 13, + "DB_Not_Empty": 14, + "DUP_SPACE": 15, + "SPACE_NOTEXISTS": 16, + "PARTITION_HAS_TASK_NOW": 17, + "REPLICA_NOT_EXISTS": 18, + "DUP_REPLICA": 19, + "PARTITION_REPLICA_LEADER_NOT_DELETE": 20, + "PS_NOTEXISTS": 21, + "PS_Already_Exists": 22, + "LOCAL_SPACE_OPS_FAILED": 23, + "Local_PS_Ops_Failed": 24, + "GENID_FAILED": 25, + "LOCALDB_OPTFAILED": 26, + "SPACE_SCHEMA_INVALID": 27, + "RPC_GET_CLIENT_FAILED": 28, + "RPC_INVALID_RESP": 29, + "RPC_INVOKE_FAILED": 30, + "RPC_PARAM_ERROR": 31, + "METHOD_NOT_IMPLEMENT": 32, + "USER_NOT_EXISTS": 33, + "DUP_USER": 34, + "USER_OPS_FAILED": 35, + "AUTHENTICATION_FAILED": 36, + "REGION_NOT_EXISTS": 37, + "MASTER_PS_CAN_NOT_SELECT": 38, + "MASTER_PS_NOT_ENOUGH_SELECT": 39, + "PARTITION_DUPLICATE": 40, + "PARTITION_NOT_EXIST": 41, + "PARTITION_NOT_LEADER": 42, + "PARTITION_NO_LEADER": 43, + "PARTITION_REQ_PARAM": 44, + "PARTITON_ENGINENAME_INVALID": 45, + "UNKNOWN_PARTITION_RAFT_CMD_TYPE": 46, + "MASTER_SERVER_IS_NOT_RUNNING": 47, + "PARTITION_IS_INVALID": 48, + "PARTITION_IS_CLOSED": 49, + "DOCUMENT_NOT_EXIST": 50, + "DOCUMENT_EXIST": 51, + "DOCUMENT_MUST_HAS_SOURCE": 52, + "PULL_OUT_VERSION_NOT_MATCH": 53, + "FUNC_CAN_NOT_INVOKE_IN_FROZEN_ENGINE": 54, + "ROUTER_NO_PS_CLIENT": 55, + "ROUTER_CALL_PS_RPC_ERR": 56, + "GAMMA_SEARCH_QUERY_NUM_LESS_0": 57, + "GAMMA_SEARCH_NO_CREATE_INDEX": 58, + "GAMMA_SEARCH_INDEX_QUERY_ERR": 59, + "GAMMA_SEARCH_OTHER_ERR": 60, + "PRIMARY_IS_INVALID": 61, + "PARSING_RESULT_ERROR": 62, + "FORCE_MERGE_BUILD_INDEX_ERR": 63, + "DELETE_BY_QUERY_SERACH_ERR": 64, + "DELETE_BY_QUERY_SEARCH_ID_IS_0": 65, + "FLUSH_ERR": 66, + "CREATE_RPCCLIENT_FAILED": 70, + "CALL_RPCCLIENT_FAILED": 71, + "RECOVER": 100, + "ALIAS_NOT_EXIST": 200, + "ALIAS_EXIST": 201, + } +) -var ErrorEnum_value = map[string]int32{ - "SUCCESS": 0, - "INTERNAL_ERROR": 1, - "NAME_OR_PASSWORD": 2, - "SYSBUSY": 3, - "PARAM_ERROR": 4, - "INVALID_CFG": 5, - "TIMEOUT": 6, - "SERVICE_UNAVAILABLE": 7, - "ZONE_NOT_EXISTS": 8, - "LOCAL_ZONE_OPS_FAILED": 9, - "DUP_ZONE": 10, - "DUP_DB": 11, - "INVALID_ENGINE": 12, - "DB_NOTEXISTS": 13, - "DB_Not_Empty": 14, - "DUP_SPACE": 15, - "SPACE_NOTEXISTS": 16, - "PARTITION_HAS_TASK_NOW": 17, - "REPLICA_NOT_EXISTS": 18, - "DUP_REPLICA": 19, - "PARTITION_REPLICA_LEADER_NOT_DELETE": 20, - "PS_NOTEXISTS": 21, - "PS_Already_Exists": 22, - "LOCAL_SPACE_OPS_FAILED": 23, - "Local_PS_Ops_Failed": 24, - "GENID_FAILED": 25, - "LOCALDB_OPTFAILED": 26, - "SPACE_SCHEMA_INVALID": 27, - "RPC_GET_CLIENT_FAILED": 28, - "RPC_INVALID_RESP": 29, - "RPC_INVOKE_FAILED": 30, - "RPC_PARAM_ERROR": 31, - "METHOD_NOT_IMPLEMENT": 32, - "USER_NOT_EXISTS": 33, - "DUP_USER": 34, - "USER_OPS_FAILED": 35, - "AUTHENTICATION_FAILED": 36, - "REGION_NOT_EXISTS": 37, - "MASTER_PS_CAN_NOT_SELECT": 38, - "MASTER_PS_NOT_ENOUGH_SELECT": 39, - "PARTITION_DUPLICATE": 40, - "PARTITION_NOT_EXIST": 41, - "PARTITION_NOT_LEADER": 42, - "PARTITION_NO_LEADER": 43, - "PARTITION_REQ_PARAM": 44, - "PARTITON_ENGINENAME_INVALID": 45, - "UNKNOWN_PARTITION_RAFT_CMD_TYPE": 46, - "MASTER_SERVER_IS_NOT_RUNNING": 47, - "PARTITION_IS_INVALID": 48, - "PARTITION_IS_CLOSED": 49, - "DOCUMENT_NOT_EXIST": 50, - "DOCUMENT_EXIST": 51, - "DOCUMENT_MUST_HAS_SOURCE": 52, - "PULL_OUT_VERSION_NOT_MATCH": 53, - "FUNC_CAN_NOT_INVOKE_IN_FROZEN_ENGINE": 54, - "ROUTER_NO_PS_CLIENT": 55, - "ROUTER_CALL_PS_RPC_ERR": 56, - "GAMMA_SEARCH_QUERY_NUM_LESS_0": 57, - "GAMMA_SEARCH_NO_CREATE_INDEX": 58, - "GAMMA_SEARCH_INDEX_QUERY_ERR": 59, - "GAMMA_SEARCH_OTHER_ERR": 60, - "PRIMARY_IS_INVALID": 61, - "PARSING_RESULT_ERROR": 62, - "FORCE_MERGE_BUILD_INDEX_ERR": 63, - "DELETE_BY_QUERY_SERACH_ERR": 64, - "DELETE_BY_QUERY_SEARCH_ID_IS_0": 65, - "FLUSH_ERR": 66, - "CREATE_RPCCLIENT_FAILED": 70, - "CALL_RPCCLIENT_FAILED": 71, - "RECOVER": 100, - "ALIAS_NOT_EXIST": 200, - "ALIAS_EXIST": 201, +func (x ErrorEnum) Enum() *ErrorEnum { + p := new(ErrorEnum) + *p = x + return p } func (x ErrorEnum) String() string { - return proto.EnumName(ErrorEnum_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ErrorEnum) Descriptor() protoreflect.EnumDescriptor { + return file_errors_proto_enumTypes[0].Descriptor() } +func (ErrorEnum) Type() protoreflect.EnumType { + return &file_errors_proto_enumTypes[0] +} + +func (x ErrorEnum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ErrorEnum.Descriptor instead. func (ErrorEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_24fe73c7f0ddb19c, []int{0} + return file_errors_proto_rawDescGZIP(), []int{0} } type SearchResultCode int32 @@ -270,542 +284,296 @@ type SearchResultCode int32 const ( SearchResultCode_SEARCH_SUCCESS SearchResultCode = 0 SearchResultCode_INDEX_NOT_BUILDED SearchResultCode = 1 - SearchResultCode_SEARCH_ERROR SearchResultCode = 2 + SearchResultCode_SEARCH_ERROR SearchResultCode = 2 // show all kinds of errors in detail ) -var SearchResultCode_name = map[int32]string{ - 0: "SEARCH_SUCCESS", - 1: "INDEX_NOT_BUILDED", - 2: "SEARCH_ERROR", -} +// Enum value maps for SearchResultCode. +var ( + SearchResultCode_name = map[int32]string{ + 0: "SEARCH_SUCCESS", + 1: "INDEX_NOT_BUILDED", + 2: "SEARCH_ERROR", + } + SearchResultCode_value = map[string]int32{ + "SEARCH_SUCCESS": 0, + "INDEX_NOT_BUILDED": 1, + "SEARCH_ERROR": 2, + } +) -var SearchResultCode_value = map[string]int32{ - "SEARCH_SUCCESS": 0, - "INDEX_NOT_BUILDED": 1, - "SEARCH_ERROR": 2, +func (x SearchResultCode) Enum() *SearchResultCode { + p := new(SearchResultCode) + *p = x + return p } func (x SearchResultCode) String() string { - return proto.EnumName(SearchResultCode_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (SearchResultCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_24fe73c7f0ddb19c, []int{1} +func (SearchResultCode) Descriptor() protoreflect.EnumDescriptor { + return file_errors_proto_enumTypes[1].Descriptor() } -type Error struct { - Code ErrorEnum `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorEnum" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Error) Reset() { *m = Error{} } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_24fe73c7f0ddb19c, []int{0} -} -func (m *Error) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (SearchResultCode) Type() protoreflect.EnumType { + return &file_errors_proto_enumTypes[1] } -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return m.Size() -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) -} - -var xxx_messageInfo_Error proto.InternalMessageInfo -func init() { - proto.RegisterEnum("ErrorEnum", ErrorEnum_name, ErrorEnum_value) - proto.RegisterEnum("SearchResultCode", SearchResultCode_name, SearchResultCode_value) - proto.RegisterType((*Error)(nil), "Error") +func (x SearchResultCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func init() { proto.RegisterFile("errors.proto", fileDescriptor_24fe73c7f0ddb19c) } - -var fileDescriptor_24fe73c7f0ddb19c = []byte{ - // 1135 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x55, 0xcb, 0x76, 0x14, 0x37, - 0x13, 0x9e, 0xe6, 0x6e, 0xd9, 0xd8, 0x42, 0xd8, 0x60, 0x0c, 0x34, 0xe6, 0xf2, 0xff, 0x38, 0x24, - 0x18, 0x02, 0xb9, 0x91, 0x2b, 0x1a, 0x75, 0xcd, 0x8c, 0x0e, 0x6a, 0xa9, 0x91, 0xd4, 0x06, 0xb3, - 0xd1, 0xf1, 0x2d, 0x86, 0x73, 0xec, 0x8c, 0x8f, 0x2f, 0x39, 0x61, 0x97, 0xc7, 0xc8, 0x23, 0xe4, - 0x11, 0xb2, 0xcc, 0x92, 0xec, 0xb2, 0xcc, 0x12, 0x4f, 0xf2, 0x00, 0x59, 0x66, 0x99, 0x53, 0xea, - 0x9e, 0xf1, 0x4c, 0xd8, 0x75, 0xd7, 0x57, 0xf5, 0xe9, 0xd3, 0x57, 0x55, 0xdd, 0x64, 0x62, 0x63, - 0x77, 0xb7, 0xbb, 0xbb, 0xb7, 0xb8, 0xb3, 0xdb, 0xdd, 0xef, 0xce, 0xdd, 0xdd, 0x7c, 0xb5, 0xff, - 0xf2, 0x60, 0x75, 0x71, 0xad, 0xbb, 0x7d, 0x6f, 0xb3, 0xbb, 0xd9, 0xbd, 0x17, 0xc3, 0xab, 0x07, - 0xdf, 0xc6, 0xb7, 0xf8, 0x12, 0x9f, 0xaa, 0xf4, 0x1b, 0x8f, 0xc8, 0x49, 0xc0, 0x72, 0x96, 0x92, - 0x13, 0x6b, 0xdd, 0xf5, 0x8d, 0xd9, 0x64, 0x3e, 0x59, 0x98, 0x7c, 0x40, 0x16, 0x63, 0x14, 0xbe, - 0x3b, 0xd8, 0xb6, 0x31, 0xce, 0x28, 0x39, 0xbe, 0xbd, 0xb7, 0x39, 0x7b, 0x6c, 0x3e, 0x59, 0x18, - 0xb3, 0xf8, 0x78, 0xe7, 0xaf, 0xb3, 0x64, 0x6c, 0x90, 0xc5, 0xc6, 0xc9, 0x69, 0x57, 0x0a, 0x01, - 0xce, 0xd1, 0x06, 0x63, 0x64, 0x52, 0x6a, 0x0f, 0x56, 0x73, 0x15, 0xc0, 0x5a, 0x63, 0x69, 0xc2, - 0xa6, 0x09, 0xd5, 0x3c, 0x87, 0x60, 0x6c, 0x28, 0xb8, 0x73, 0xcf, 0x8c, 0xcd, 0xe8, 0xb1, 0x58, - 0xb6, 0xec, 0x9a, 0xa5, 0x5b, 0xa6, 0xc7, 0xd9, 0x14, 0x19, 0x2f, 0xb8, 0xe5, 0x79, 0x5d, 0x73, - 0x02, 0x03, 0x52, 0x2f, 0x71, 0x25, 0xb3, 0x20, 0x5a, 0x6d, 0x7a, 0x12, 0xd3, 0xbd, 0xcc, 0xc1, - 0x94, 0x9e, 0x9e, 0x62, 0x17, 0xc9, 0x79, 0x07, 0x76, 0x49, 0x0a, 0x08, 0xa5, 0xe6, 0x4b, 0x5c, - 0x2a, 0xde, 0x54, 0x40, 0x4f, 0xb3, 0xf3, 0x64, 0xea, 0x85, 0xd1, 0x10, 0xb4, 0xf1, 0x01, 0x9e, - 0x4b, 0xe7, 0x1d, 0x3d, 0xc3, 0x2e, 0x91, 0x19, 0x65, 0x04, 0x57, 0x21, 0x42, 0xa6, 0x70, 0xa1, - 0xc5, 0xa5, 0x82, 0x8c, 0x8e, 0xb1, 0x09, 0x72, 0x26, 0x2b, 0x8b, 0x08, 0x50, 0xc2, 0x08, 0x39, - 0x85, 0x6f, 0x59, 0x93, 0x8e, 0x57, 0x17, 0xa9, 0x04, 0x80, 0x6e, 0x4b, 0x0d, 0x74, 0x82, 0x51, - 0x32, 0x91, 0x35, 0x91, 0xbb, 0xa6, 0x3e, 0xdb, 0x8f, 0x74, 0xf7, 0x03, 0x6c, 0xef, 0xec, 0xbf, - 0xa6, 0x93, 0xec, 0x2c, 0x19, 0x43, 0x0e, 0x57, 0x70, 0x01, 0x74, 0x0a, 0x05, 0xc5, 0xc7, 0xa1, - 0x2a, 0xca, 0xe6, 0xc8, 0x85, 0x82, 0x5b, 0x2f, 0xbd, 0x34, 0x3a, 0x74, 0xb8, 0x0b, 0x9e, 0xbb, - 0x27, 0x41, 0x9b, 0x67, 0xf4, 0x1c, 0xbb, 0x40, 0x98, 0x85, 0x42, 0x49, 0xc1, 0x87, 0x2f, 0xc1, - 0xd0, 0x10, 0xe4, 0xad, 0x31, 0x7a, 0x9e, 0xdd, 0x26, 0x37, 0x8f, 0x48, 0xfa, 0x25, 0x0a, 0x78, - 0x06, 0x36, 0x56, 0x66, 0xa0, 0xc0, 0x03, 0x9d, 0x46, 0x8d, 0x85, 0x1b, 0x3a, 0x7f, 0x86, 0xcd, - 0x90, 0x73, 0x85, 0x0b, 0x7c, 0x6b, 0x77, 0x63, 0x65, 0xfd, 0x75, 0x80, 0x1f, 0x5e, 0xed, 0xed, - 0xef, 0xd1, 0x0b, 0x28, 0xab, 0xf2, 0xa9, 0x52, 0x3c, 0x64, 0xd4, 0x45, 0x74, 0x5c, 0x75, 0xd7, - 0x56, 0xb6, 0x42, 0xe1, 0x82, 0xd9, 0xd9, 0x0b, 0xad, 0x95, 0x57, 0x5b, 0x1b, 0xeb, 0x74, 0x16, - 0xd9, 0xdb, 0xa0, 0x65, 0xd6, 0x4f, 0xbd, 0x84, 0xec, 0x91, 0x26, 0x6b, 0x06, 0x53, 0xf8, 0x3a, - 0x3c, 0xc7, 0x66, 0xc9, 0x74, 0xc5, 0xeb, 0x44, 0x07, 0x72, 0x1e, 0x6a, 0x77, 0xe9, 0x65, 0xec, - 0x8f, 0x2d, 0x44, 0x68, 0x83, 0x0f, 0x42, 0x49, 0xd0, 0xbe, 0xcf, 0x75, 0x05, 0x47, 0x07, 0xa1, - 0x7e, 0x27, 0x2c, 0xb8, 0x82, 0x5e, 0xc5, 0x13, 0xea, 0xa8, 0x79, 0x02, 0xfd, 0xe4, 0x14, 0xbd, - 0xc6, 0xf0, 0xf0, 0x20, 0x5d, 0xc3, 0x63, 0x73, 0xf0, 0x1d, 0x93, 0x45, 0x53, 0x64, 0x5e, 0x28, - 0xc8, 0x41, 0x7b, 0x3a, 0x8f, 0xe9, 0xa5, 0xab, 0xcd, 0xaa, 0xad, 0xb9, 0xde, 0x1f, 0x08, 0x04, - 0xe8, 0x8d, 0x41, 0xca, 0x90, 0x15, 0x37, 0x51, 0x2e, 0x2f, 0x7d, 0x07, 0xb4, 0x97, 0x82, 0x47, - 0xf7, 0x6b, 0xe8, 0x56, 0x14, 0x06, 0x6d, 0x0c, 0x0d, 0x91, 0xfe, 0x8f, 0x5d, 0x21, 0xb3, 0x39, - 0x77, 0x1e, 0x2c, 0xba, 0x27, 0x78, 0x85, 0x3a, 0x50, 0x20, 0x3c, 0xfd, 0x3f, 0xbb, 0x46, 0x2e, - 0x1f, 0xa1, 0xb1, 0x4e, 0x9b, 0xb2, 0xdd, 0xe9, 0x27, 0xdc, 0x46, 0xef, 0x8f, 0x3a, 0x9d, 0x95, - 0xb1, 0xd3, 0x1e, 0xe8, 0xc2, 0x28, 0x30, 0x38, 0x91, 0xbe, 0x87, 0x97, 0x1e, 0x05, 0xaa, 0xb9, - 0xa0, 0x77, 0xfe, 0x5b, 0xd2, 0x07, 0xde, 0x1f, 0x05, 0x2c, 0x3c, 0xad, 0x6c, 0xa4, 0x1f, 0xa0, - 0xbc, 0x0a, 0x30, 0xba, 0xde, 0x84, 0xb8, 0xcc, 0xfd, 0xf6, 0xdd, 0x65, 0x37, 0xc9, 0xb5, 0x52, - 0x3f, 0xd1, 0xe6, 0x99, 0x0e, 0x43, 0x0c, 0xbc, 0xe5, 0x83, 0xc8, 0xb3, 0xe0, 0x97, 0x0b, 0xa0, - 0x8b, 0x6c, 0x9e, 0x5c, 0xa9, 0x2f, 0x89, 0x8b, 0x0b, 0x36, 0xc8, 0xea, 0xae, 0xb6, 0xd4, 0x5a, - 0xea, 0x36, 0xbd, 0x37, 0xaa, 0x59, 0xba, 0xc1, 0x01, 0xf7, 0x47, 0xa5, 0x49, 0x17, 0x84, 0x32, - 0x0e, 0x32, 0xfa, 0x21, 0xee, 0x4a, 0x66, 0x44, 0x89, 0xfd, 0x1c, 0xba, 0xfe, 0x03, 0xdc, 0xdd, - 0x41, 0xbc, 0x8a, 0x3d, 0xc4, 0x1e, 0x0c, 0x62, 0x79, 0xe9, 0x7c, 0xdc, 0x3b, 0x67, 0x4a, 0x2b, - 0x80, 0x7e, 0xc4, 0x52, 0x32, 0x57, 0x94, 0x4a, 0x05, 0x53, 0xfa, 0xb0, 0x04, 0xd6, 0xf5, 0x7d, - 0xcb, 0xb9, 0x17, 0x1d, 0xfa, 0x31, 0x5b, 0x20, 0xb7, 0x5a, 0xa5, 0x16, 0x83, 0xe6, 0xd5, 0xa3, - 0x27, 0x75, 0x68, 0x59, 0xf3, 0x02, 0xfa, 0xce, 0xd0, 0x4f, 0x50, 0xac, 0x35, 0xa5, 0x8f, 0x73, - 0x15, 0xdb, 0x1d, 0x27, 0x9a, 0x7e, 0x8a, 0xdb, 0x55, 0x03, 0x82, 0x2b, 0x85, 0x10, 0x0e, 0x2b, - 0x58, 0x4b, 0x3f, 0x63, 0xd7, 0xc9, 0xd5, 0x36, 0xcf, 0x73, 0x1e, 0x1c, 0x70, 0x2b, 0x3a, 0xe1, - 0x69, 0x09, 0x76, 0x39, 0xe8, 0x32, 0x0f, 0x0a, 0x9c, 0x0b, 0xf7, 0xe9, 0x23, 0x34, 0x70, 0x24, - 0x45, 0x9b, 0x20, 0x2c, 0x70, 0x8f, 0x22, 0x32, 0x78, 0x4e, 0x3f, 0x7f, 0x27, 0x23, 0xc6, 0x6b, - 0x2a, 0x3c, 0xe6, 0x0b, 0x94, 0x30, 0x92, 0x61, 0x7c, 0x07, 0x6c, 0xc4, 0xbe, 0x44, 0x2f, 0x0b, - 0x2b, 0x73, 0x6e, 0x97, 0x87, 0xcd, 0xff, 0xaa, 0x6e, 0x8b, 0x93, 0xba, 0x8d, 0xdb, 0x57, 0x2a, - 0x5f, 0x6f, 0xd6, 0xd7, 0x38, 0x18, 0x2d, 0x63, 0x05, 0x84, 0x1c, 0x6c, 0x1b, 0x42, 0xb3, 0x94, - 0x2a, 0xab, 0x0f, 0x45, 0xca, 0x6f, 0xd0, 0xd4, 0xea, 0x23, 0x14, 0x9a, 0xcb, 0xb5, 0x0e, 0x07, - 0x96, 0x8b, 0x4e, 0xc4, 0x1f, 0xb3, 0x1b, 0x24, 0x7d, 0x17, 0xaf, 0xa4, 0x67, 0x28, 0xe2, 0x3e, - 0xe5, 0xf8, 0x39, 0x6d, 0xa9, 0xd2, 0x55, 0x25, 0x4d, 0x76, 0x99, 0x5c, 0xac, 0x6f, 0x6d, 0x0b, - 0x31, 0xfa, 0xb1, 0x68, 0xe1, 0x62, 0x46, 0x6b, 0xdf, 0x81, 0xda, 0xf8, 0xf7, 0xb0, 0x20, 0xcc, - 0x12, 0x58, 0xba, 0xce, 0xa6, 0xc9, 0x14, 0x57, 0x92, 0xbb, 0xa1, 0x99, 0x79, 0x93, 0x30, 0x4a, - 0xc6, 0xab, 0x68, 0x15, 0xf9, 0x2d, 0xb9, 0x63, 0x08, 0x75, 0x1b, 0x2b, 0xbb, 0x6b, 0x2f, 0xed, - 0xc6, 0xde, 0xc1, 0xd6, 0xbe, 0xc0, 0x9f, 0x21, 0x23, 0x93, 0xb5, 0xc6, 0xa3, 0x7f, 0xde, 0x0c, - 0x39, 0x57, 0x5d, 0x1b, 0xf9, 0xa2, 0x0d, 0x90, 0x51, 0x24, 0x9c, 0xa8, 0x53, 0x2b, 0xc7, 0x8e, - 0x35, 0x1f, 0xbf, 0x39, 0x4c, 0x1b, 0x7f, 0x1c, 0xa6, 0x8d, 0xb7, 0x87, 0x69, 0xe3, 0xef, 0xc3, - 0xb4, 0xf1, 0xcf, 0x61, 0x9a, 0xfc, 0xd8, 0x4b, 0x93, 0x9f, 0x7b, 0x69, 0xf2, 0x4b, 0x2f, 0x6d, - 0xfc, 0xda, 0x4b, 0x1b, 0x6f, 0x7a, 0x69, 0xf2, 0x7b, 0x2f, 0x4d, 0xde, 0xf6, 0xd2, 0xe4, 0xa7, - 0x3f, 0xd3, 0x46, 0x27, 0x79, 0x71, 0xe6, 0xfb, 0x28, 0x63, 0x67, 0x75, 0xf5, 0x54, 0xfc, 0x77, - 0x3f, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x92, 0xb8, 0x1c, 0xfa, 0x07, 0x00, 0x00, +// Deprecated: Use SearchResultCode.Descriptor instead. +func (SearchResultCode) EnumDescriptor() ([]byte, []int) { + return file_errors_proto_rawDescGZIP(), []int{1} } -func (this *Error) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Error) - if !ok { - that2, ok := that.(Error) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Code != that1.Code { - return false - } - if this.Msg != that1.Msg { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (m *Error) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Error) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Code ErrorEnum `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorEnum" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` } -func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintErrors(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x12 +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_errors_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if m.Code != 0 { - i = encodeVarintErrors(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil } -func encodeVarintErrors(dAtA []byte, offset int, v uint64) int { - offset -= sovErrors(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedError(r randyErrors, easy bool) *Error { - this := &Error{} - this.Code = ErrorEnum([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 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, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 70, 71, 100, 200, 201}[r.Intn(72)]) - this.Msg = string(randStringErrors(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedErrors(r, 3) - } - return this +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) } -type randyErrors interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} +func (*Error) ProtoMessage() {} -func randUTF8RuneErrors(r randyErrors) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringErrors(r randyErrors) string { - v1 := r.Intn(100) - tmps := make([]rune, v1) - for i := 0; i < v1; i++ { - tmps[i] = randUTF8RuneErrors(r) - } - return string(tmps) -} -func randUnrecognizedErrors(r randyErrors, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldErrors(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldErrors(dAtA []byte, r randyErrors, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateErrors(dAtA, uint64(key)) - v2 := r.Int63() - if r.Intn(2) == 0 { - v2 *= -1 +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_errors_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - dAtA = encodeVarintPopulateErrors(dAtA, uint64(v2)) - case 1: - dAtA = encodeVarintPopulateErrors(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateErrors(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateErrors(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateErrors(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateErrors(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + return ms } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Error) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovErrors(uint64(m.Code)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovErrors(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return mi.MessageOf(x) } -func sovErrors(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozErrors(x uint64) (n int) { - return sovErrors(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_errors_proto_rawDescGZIP(), []int{0} } -func (this *Error) String() string { - if this == nil { - return "nil" + +func (x *Error) GetCode() ErrorEnum { + if x != nil { + return x.Code } - s := strings.Join([]string{`&Error{`, - `Code:` + fmt.Sprintf("%v", this.Code) + `,`, - `Msg:` + fmt.Sprintf("%v", this.Msg) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return ErrorEnum_SUCCESS } -func valueToStringErrors(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + +func (x *Error) GetMsg() string { + if x != nil { + return x.Msg } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return "" +} + +var File_errors_proto protoreflect.FileDescriptor + +var file_errors_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x39, + 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x6e, 0x75, + 0x6d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x2a, 0xe4, 0x0d, 0x0a, 0x09, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4e, 0x41, 0x4d, 0x45, + 0x5f, 0x4f, 0x52, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x02, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x59, 0x53, 0x42, 0x55, 0x53, 0x59, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x50, + 0x41, 0x52, 0x41, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x46, 0x47, 0x10, 0x05, 0x12, 0x0b, 0x0a, + 0x07, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, + 0x45, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x5a, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, + 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x4f, 0x43, 0x41, + 0x4c, 0x5f, 0x5a, 0x4f, 0x4e, 0x45, 0x5f, 0x4f, 0x50, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, + 0x44, 0x10, 0x09, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x55, 0x50, 0x5f, 0x5a, 0x4f, 0x4e, 0x45, 0x10, + 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x55, 0x50, 0x5f, 0x44, 0x42, 0x10, 0x0b, 0x12, 0x12, 0x0a, + 0x0e, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x10, + 0x0c, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x4e, 0x4f, 0x54, 0x45, 0x58, 0x49, 0x53, 0x54, + 0x53, 0x10, 0x0d, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x4e, 0x6f, 0x74, 0x5f, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x10, 0x0e, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x55, 0x50, 0x5f, 0x53, 0x50, 0x41, + 0x43, 0x45, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x4e, 0x4f, + 0x54, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x10, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x41, 0x52, + 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x48, 0x41, 0x53, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, + 0x4e, 0x4f, 0x57, 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, + 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x12, 0x12, 0x0f, 0x0a, + 0x0b, 0x44, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x10, 0x13, 0x12, 0x27, + 0x0a, 0x23, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x50, 0x4c, + 0x49, 0x43, 0x41, 0x5f, 0x4c, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x44, + 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x14, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x53, 0x5f, 0x4e, 0x4f, + 0x54, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x15, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x53, 0x5f, + 0x41, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x5f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x10, 0x16, + 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, + 0x4f, 0x50, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x17, 0x12, 0x17, 0x0a, 0x13, + 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x50, 0x53, 0x5f, 0x4f, 0x70, 0x73, 0x5f, 0x46, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x10, 0x18, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x4e, 0x49, 0x44, 0x5f, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x19, 0x12, 0x15, 0x0a, 0x11, 0x4c, 0x4f, 0x43, 0x41, 0x4c, + 0x44, 0x42, 0x5f, 0x4f, 0x50, 0x54, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x1a, 0x12, 0x18, + 0x0a, 0x14, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x1b, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x50, 0x43, 0x5f, + 0x47, 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, + 0x44, 0x10, 0x1c, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x50, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x10, 0x1d, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x50, 0x43, + 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x4b, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x1e, + 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x41, 0x52, 0x41, 0x4d, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x10, 0x1f, 0x12, 0x18, 0x0a, 0x14, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x20, 0x12, + 0x13, 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, + 0x54, 0x53, 0x10, 0x21, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x55, 0x50, 0x5f, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x22, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4f, 0x50, 0x53, 0x5f, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x23, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x48, 0x45, + 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x24, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x47, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x25, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x53, + 0x54, 0x45, 0x52, 0x5f, 0x50, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, + 0x45, 0x4c, 0x45, 0x43, 0x54, 0x10, 0x26, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x41, 0x53, 0x54, 0x45, + 0x52, 0x5f, 0x50, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x4e, 0x4f, 0x55, 0x47, 0x48, 0x5f, + 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x10, 0x27, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, + 0x28, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x29, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, + 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4c, 0x45, 0x41, 0x44, + 0x45, 0x52, 0x10, 0x2a, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x4c, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x2b, 0x12, 0x17, 0x0a, + 0x13, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x5f, 0x50, + 0x41, 0x52, 0x41, 0x4d, 0x10, 0x2c, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, + 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x2d, 0x12, 0x23, 0x0a, 0x1f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x5f, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x46, + 0x54, 0x5f, 0x43, 0x4d, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x2e, 0x12, 0x20, 0x0a, 0x1c, + 0x4d, 0x41, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x49, 0x53, + 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x2f, 0x12, 0x18, + 0x0a, 0x14, 0x50, 0x41, 0x52, 0x54, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x53, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x30, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x41, 0x52, 0x54, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x53, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, + 0x31, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4e, 0x4f, + 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x32, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x4f, 0x43, + 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0x33, 0x12, 0x1c, 0x0a, + 0x18, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x55, 0x53, 0x54, 0x5f, 0x48, + 0x41, 0x53, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x34, 0x12, 0x1e, 0x0a, 0x1a, 0x50, + 0x55, 0x4c, 0x4c, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, 0x35, 0x12, 0x28, 0x0a, 0x24, 0x46, + 0x55, 0x4e, 0x43, 0x5f, 0x43, 0x41, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x56, 0x4f, + 0x4b, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x52, 0x4f, 0x5a, 0x45, 0x4e, 0x5f, 0x45, 0x4e, 0x47, + 0x49, 0x4e, 0x45, 0x10, 0x36, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, + 0x4e, 0x4f, 0x5f, 0x50, 0x53, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x37, 0x12, 0x1a, + 0x0a, 0x16, 0x52, 0x4f, 0x55, 0x54, 0x45, 0x52, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x5f, 0x50, 0x53, + 0x5f, 0x52, 0x50, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x10, 0x38, 0x12, 0x21, 0x0a, 0x1d, 0x47, 0x41, + 0x4d, 0x4d, 0x41, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, + 0x5f, 0x4e, 0x55, 0x4d, 0x5f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x30, 0x10, 0x39, 0x12, 0x20, 0x0a, + 0x1c, 0x47, 0x41, 0x4d, 0x4d, 0x41, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x4e, 0x4f, + 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x10, 0x3a, 0x12, + 0x20, 0x0a, 0x1c, 0x47, 0x41, 0x4d, 0x4d, 0x41, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, + 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x45, 0x52, 0x52, 0x10, + 0x3b, 0x12, 0x1a, 0x0a, 0x16, 0x47, 0x41, 0x4d, 0x4d, 0x41, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, + 0x48, 0x5f, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x10, 0x3c, 0x12, 0x16, 0x0a, + 0x12, 0x50, 0x52, 0x49, 0x4d, 0x41, 0x52, 0x59, 0x5f, 0x49, 0x53, 0x5f, 0x49, 0x4e, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x10, 0x3d, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, 0x52, 0x53, 0x49, 0x4e, 0x47, + 0x5f, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x3e, 0x12, + 0x1f, 0x0a, 0x1b, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x5f, 0x42, + 0x55, 0x49, 0x4c, 0x44, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x45, 0x52, 0x52, 0x10, 0x3f, + 0x12, 0x1e, 0x0a, 0x1a, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x42, 0x59, 0x5f, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x52, 0x41, 0x43, 0x48, 0x5f, 0x45, 0x52, 0x52, 0x10, 0x40, + 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x42, 0x59, 0x5f, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x53, + 0x5f, 0x30, 0x10, 0x41, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4c, 0x55, 0x53, 0x48, 0x5f, 0x45, 0x52, + 0x52, 0x10, 0x42, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x50, + 0x43, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x46, + 0x12, 0x19, 0x0a, 0x15, 0x43, 0x41, 0x4c, 0x4c, 0x5f, 0x52, 0x50, 0x43, 0x43, 0x4c, 0x49, 0x45, + 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x47, 0x12, 0x0b, 0x0a, 0x07, 0x52, + 0x45, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x10, 0x64, 0x12, 0x14, 0x0a, 0x0f, 0x41, 0x4c, 0x49, 0x41, + 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0xc8, 0x01, 0x12, 0x10, + 0x0a, 0x0b, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x10, 0xc9, 0x01, + 0x2a, 0x4f, 0x0a, 0x10, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x53, + 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4e, 0x44, 0x45, + 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x10, 0x0a, 0x0c, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, + 0x02, 0x42, 0x0e, 0x48, 0x01, 0x5a, 0x0a, 0x2e, 0x2f, 0x76, 0x65, 0x61, 0x72, 0x63, 0x68, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (m *Error) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowErrors - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Error: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowErrors - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= ErrorEnum(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowErrors - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthErrors - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthErrors - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipErrors(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthErrors - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +var ( + file_errors_proto_rawDescOnce sync.Once + file_errors_proto_rawDescData = file_errors_proto_rawDesc +) + +func file_errors_proto_rawDescGZIP() []byte { + file_errors_proto_rawDescOnce.Do(func() { + file_errors_proto_rawDescData = protoimpl.X.CompressGZIP(file_errors_proto_rawDescData) + }) + return file_errors_proto_rawDescData +} + +var file_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_errors_proto_goTypes = []interface{}{ + (ErrorEnum)(0), // 0: ErrorEnum + (SearchResultCode)(0), // 1: SearchResultCode + (*Error)(nil), // 2: Error +} +var file_errors_proto_depIdxs = []int32{ + 0, // 0: Error.code:type_name -> ErrorEnum + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_errors_proto_init() } +func file_errors_proto_init() { + if File_errors_proto != nil { + return } - return nil -} -func skipErrors(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowErrors - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + if !protoimpl.UnsafeEnabled { + file_errors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowErrors - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowErrors - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthErrors - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupErrors - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthErrors - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_errors_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_errors_proto_goTypes, + DependencyIndexes: file_errors_proto_depIdxs, + EnumInfos: file_errors_proto_enumTypes, + MessageInfos: file_errors_proto_msgTypes, + }.Build() + File_errors_proto = out.File + file_errors_proto_rawDesc = nil + file_errors_proto_goTypes = nil + file_errors_proto_depIdxs = nil } - -var ( - ErrInvalidLengthErrors = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowErrors = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupErrors = fmt.Errorf("proto: unexpected end of group") -) diff --git a/internal/proto/vearchpb/raftcmd.pb.go b/internal/proto/vearchpb/raftcmd.pb.go index 3d941165..e34d0e81 100644 --- a/internal/proto/vearchpb/raftcmd.pb.go +++ b/internal/proto/vearchpb/raftcmd.pb.go @@ -1,31 +1,24 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.5.0 // source: raftcmd.proto package vearchpb import ( - bytes "bytes" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type OpType int32 @@ -38,30 +31,51 @@ const ( OpType_SEARCH OpType = 5 ) -var OpType_name = map[int32]string{ - 0: "CREATE", - 1: "DELETE", - 2: "REPLACE", - 3: "BULK", - 4: "GET", - 5: "SEARCH", -} +// Enum value maps for OpType. +var ( + OpType_name = map[int32]string{ + 0: "CREATE", + 1: "DELETE", + 2: "REPLACE", + 3: "BULK", + 4: "GET", + 5: "SEARCH", + } + OpType_value = map[string]int32{ + "CREATE": 0, + "DELETE": 1, + "REPLACE": 2, + "BULK": 3, + "GET": 4, + "SEARCH": 5, + } +) -var OpType_value = map[string]int32{ - "CREATE": 0, - "DELETE": 1, - "REPLACE": 2, - "BULK": 3, - "GET": 4, - "SEARCH": 5, +func (x OpType) Enum() *OpType { + p := new(OpType) + *p = x + return p } func (x OpType) String() string { - return proto.EnumName(OpType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (OpType) Descriptor() protoreflect.EnumDescriptor { + return file_raftcmd_proto_enumTypes[0].Descriptor() +} + +func (OpType) Type() protoreflect.EnumType { + return &file_raftcmd_proto_enumTypes[0] +} + +func (x OpType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OpType.Descriptor instead. func (OpType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{0} + return file_raftcmd_proto_rawDescGZIP(), []int{0} } type CmdType int32 @@ -73,2612 +87,699 @@ const ( CmdType_SEARCHDEL CmdType = 3 ) -var CmdType_name = map[int32]string{ - 0: "WRITE", - 1: "UPDATESPACE", - 2: "FLUSH", - 3: "SEARCHDEL", -} +// Enum value maps for CmdType. +var ( + CmdType_name = map[int32]string{ + 0: "WRITE", + 1: "UPDATESPACE", + 2: "FLUSH", + 3: "SEARCHDEL", + } + CmdType_value = map[string]int32{ + "WRITE": 0, + "UPDATESPACE": 1, + "FLUSH": 2, + "SEARCHDEL": 3, + } +) -var CmdType_value = map[string]int32{ - "WRITE": 0, - "UPDATESPACE": 1, - "FLUSH": 2, - "SEARCHDEL": 3, +func (x CmdType) Enum() *CmdType { + p := new(CmdType) + *p = x + return p } func (x CmdType) String() string { - return proto.EnumName(CmdType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (CmdType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{1} +func (CmdType) Descriptor() protoreflect.EnumDescriptor { + return file_raftcmd_proto_enumTypes[1].Descriptor() } -type PartitionData struct { - Type OpType `protobuf:"varint,1,opt,name=type,proto3,enum=OpType" json:"type,omitempty"` - PartitionID uint32 `protobuf:"varint,2,opt,name=partitionID,proto3" json:"partitionID,omitempty"` - MessageID string `protobuf:"bytes,3,opt,name=messageID,proto3" json:"messageID,omitempty"` - Items []*Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` - SearchRequest *SearchRequest `protobuf:"bytes,5,opt,name=search_request,json=searchRequest,proto3" json:"search_request,omitempty"` - SearchResponse *SearchResponse `protobuf:"bytes,6,opt,name=search_response,json=searchResponse,proto3" json:"search_response,omitempty"` - Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` - Err *Error `protobuf:"bytes,8,opt,name=err,proto3" json:"err,omitempty"` - SearchRequests []*SearchRequest `protobuf:"bytes,9,rep,name=search_requests,json=searchRequests,proto3" json:"search_requests,omitempty"` - SearchResponses []*SearchResponse `protobuf:"bytes,10,rep,name=search_responses,json=searchResponses,proto3" json:"search_responses,omitempty"` - DelNum int32 `protobuf:"varint,11,opt,name=del_num,json=delNum,proto3" json:"del_num,omitempty"` - DelByQueryResponse *DelByQueryeResponse `protobuf:"bytes,12,opt,name=del_by_query_response,json=delByQueryResponse,proto3" json:"del_by_query_response,omitempty"` - IndexRequest *IndexRequest `protobuf:"bytes,13,opt,name=index_request,json=indexRequest,proto3" json:"index_request,omitempty"` - IndexResponse *IndexResponse `protobuf:"bytes,14,opt,name=index_response,json=indexResponse,proto3" json:"index_response,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionData) Reset() { *m = PartitionData{} } -func (*PartitionData) ProtoMessage() {} -func (*PartitionData) Descriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{0} -} -func (m *PartitionData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PartitionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PartitionData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } +func (CmdType) Type() protoreflect.EnumType { + return &file_raftcmd_proto_enumTypes[1] } -func (m *PartitionData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionData.Merge(m, src) -} -func (m *PartitionData) XXX_Size() int { - return m.Size() + +func (x CmdType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *PartitionData) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionData.DiscardUnknown(m) + +// Deprecated: Use CmdType.Descriptor instead. +func (CmdType) EnumDescriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{1} } -var xxx_messageInfo_PartitionData proto.InternalMessageInfo +type PartitionData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -// *********************** Raft *********************** // -type UpdateSpace struct { - Space []byte `protobuf:"bytes,1,opt,name=Space,proto3" json:"Space,omitempty"` - Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Type OpType `protobuf:"varint,1,opt,name=type,proto3,enum=OpType" json:"type,omitempty"` + PartitionID uint32 `protobuf:"varint,2,opt,name=partitionID,proto3" json:"partitionID,omitempty"` + MessageID string `protobuf:"bytes,3,opt,name=messageID,proto3" json:"messageID,omitempty"` + Items []*Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` + SearchRequest *SearchRequest `protobuf:"bytes,5,opt,name=search_request,json=searchRequest,proto3" json:"search_request,omitempty"` + SearchResponse *SearchResponse `protobuf:"bytes,6,opt,name=search_response,json=searchResponse,proto3" json:"search_response,omitempty"` + Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + Err *Error `protobuf:"bytes,8,opt,name=err,proto3" json:"err,omitempty"` + SearchRequests []*SearchRequest `protobuf:"bytes,9,rep,name=search_requests,json=searchRequests,proto3" json:"search_requests,omitempty"` + SearchResponses []*SearchResponse `protobuf:"bytes,10,rep,name=search_responses,json=searchResponses,proto3" json:"search_responses,omitempty"` + DelNum int32 `protobuf:"varint,11,opt,name=del_num,json=delNum,proto3" json:"del_num,omitempty"` + DelByQueryResponse *DelByQueryeResponse `protobuf:"bytes,12,opt,name=del_by_query_response,json=delByQueryResponse,proto3" json:"del_by_query_response,omitempty"` + IndexRequest *IndexRequest `protobuf:"bytes,13,opt,name=index_request,json=indexRequest,proto3" json:"index_request,omitempty"` + IndexResponse *IndexResponse `protobuf:"bytes,14,opt,name=index_response,json=indexResponse,proto3" json:"index_response,omitempty"` } -func (m *UpdateSpace) Reset() { *m = UpdateSpace{} } -func (*UpdateSpace) ProtoMessage() {} -func (*UpdateSpace) Descriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{1} -} -func (m *UpdateSpace) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateSpace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateSpace.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *PartitionData) Reset() { + *x = PartitionData{} + if protoimpl.UnsafeEnabled { + mi := &file_raftcmd_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *UpdateSpace) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateSpace.Merge(m, src) -} -func (m *UpdateSpace) XXX_Size() int { - return m.Size() -} -func (m *UpdateSpace) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateSpace.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateSpace proto.InternalMessageInfo -type DocCmd struct { - Type OpType `protobuf:"varint,1,opt,name=type,proto3,enum=OpType" json:"type,omitempty"` - Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` - Slot uint32 `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty"` - Doc []byte `protobuf:"bytes,7,opt,name=doc,proto3" json:"doc,omitempty"` - Docs [][]byte `protobuf:"bytes,8,rep,name=docs,proto3" json:"docs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *PartitionData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DocCmd) Reset() { *m = DocCmd{} } -func (*DocCmd) ProtoMessage() {} -func (*DocCmd) Descriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{2} -} -func (m *DocCmd) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DocCmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DocCmd.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*PartitionData) ProtoMessage() {} + +func (x *PartitionData) ProtoReflect() protoreflect.Message { + mi := &file_raftcmd_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *DocCmd) XXX_Merge(src proto.Message) { - xxx_messageInfo_DocCmd.Merge(m, src) -} -func (m *DocCmd) XXX_Size() int { - return m.Size() -} -func (m *DocCmd) XXX_DiscardUnknown() { - xxx_messageInfo_DocCmd.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_DocCmd proto.InternalMessageInfo - -type RaftCommand struct { - Type CmdType `protobuf:"varint,1,opt,name=type,proto3,enum=CmdType" json:"type,omitempty"` - WriteCommand *DocCmd `protobuf:"bytes,2,opt,name=write_command,json=writeCommand,proto3" json:"write_command,omitempty"` - UpdateSpace *UpdateSpace `protobuf:"bytes,3,opt,name=update_space,json=updateSpace,proto3" json:"update_space,omitempty"` - SearchDelReq *SearchRequest `protobuf:"bytes,4,opt,name=search_del_req,json=searchDelReq,proto3" json:"search_del_req,omitempty"` - SearchDelResp *SearchResponse `protobuf:"bytes,5,opt,name=search_del_resp,json=searchDelResp,proto3" json:"search_del_resp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +// Deprecated: Use PartitionData.ProtoReflect.Descriptor instead. +func (*PartitionData) Descriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{0} } -func (m *RaftCommand) Reset() { *m = RaftCommand{} } -func (*RaftCommand) ProtoMessage() {} -func (*RaftCommand) Descriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{3} -} -func (m *RaftCommand) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RaftCommand) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RaftCommand.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *PartitionData) GetType() OpType { + if x != nil { + return x.Type } + return OpType_CREATE } -func (m *RaftCommand) XXX_Merge(src proto.Message) { - xxx_messageInfo_RaftCommand.Merge(m, src) -} -func (m *RaftCommand) XXX_Size() int { - return m.Size() -} -func (m *RaftCommand) XXX_DiscardUnknown() { - xxx_messageInfo_RaftCommand.DiscardUnknown(m) -} - -var xxx_messageInfo_RaftCommand proto.InternalMessageInfo -type SnapData struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *PartitionData) GetPartitionID() uint32 { + if x != nil { + return x.PartitionID + } + return 0 } -func (m *SnapData) Reset() { *m = SnapData{} } -func (*SnapData) ProtoMessage() {} -func (*SnapData) Descriptor() ([]byte, []int) { - return fileDescriptor_f60a713a5f09c5ba, []int{4} -} -func (m *SnapData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *PartitionData) GetMessageID() string { + if x != nil { + return x.MessageID } + return "" } -func (m *SnapData) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapData.Merge(m, src) -} -func (m *SnapData) XXX_Size() int { - return m.Size() -} -func (m *SnapData) XXX_DiscardUnknown() { - xxx_messageInfo_SnapData.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapData proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("OpType", OpType_name, OpType_value) - proto.RegisterEnum("CmdType", CmdType_name, CmdType_value) - proto.RegisterType((*PartitionData)(nil), "PartitionData") - proto.RegisterType((*UpdateSpace)(nil), "UpdateSpace") - proto.RegisterType((*DocCmd)(nil), "DocCmd") - proto.RegisterType((*RaftCommand)(nil), "RaftCommand") - proto.RegisterType((*SnapData)(nil), "SnapData") -} - -func init() { proto.RegisterFile("raftcmd.proto", fileDescriptor_f60a713a5f09c5ba) } - -var fileDescriptor_f60a713a5f09c5ba = []byte{ - // 816 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcd, 0x8e, 0xe3, 0x44, - 0x10, 0x4e, 0x8f, 0xf3, 0x5b, 0xb6, 0x33, 0xa6, 0xb5, 0x08, 0x8b, 0x5d, 0x59, 0x56, 0x4e, 0xd1, - 0x0a, 0x3c, 0x52, 0x00, 0x81, 0x90, 0x10, 0xcc, 0xc4, 0x66, 0x27, 0x22, 0x82, 0xa1, 0x93, 0x11, - 0x12, 0x97, 0xc8, 0xb1, 0x7b, 0xb2, 0x16, 0x71, 0xda, 0xd3, 0x6d, 0x0f, 0xe4, 0xc6, 0x63, 0xf0, - 0x08, 0x3c, 0x02, 0x47, 0x8e, 0x7b, 0xe4, 0xc8, 0x71, 0x13, 0x6e, 0x9c, 0x38, 0xc2, 0x0d, 0x75, - 0xdb, 0xc9, 0x7a, 0x76, 0x10, 0xb7, 0xfa, 0xbe, 0xae, 0xaa, 0xae, 0x9f, 0xaf, 0x1b, 0x4c, 0x1e, - 0xde, 0xe4, 0x51, 0x1a, 0x7b, 0x19, 0x67, 0x39, 0x7b, 0xdb, 0xa0, 0x9c, 0x33, 0x2e, 0x2a, 0x64, - 0xc5, 0x61, 0x1e, 0x2e, 0x52, 0x16, 0xd3, 0x75, 0xc5, 0xbc, 0xc1, 0x59, 0x91, 0x53, 0xbe, 0x58, - 0xf1, 0x2c, 0xaa, 0xa8, 0x77, 0x57, 0x49, 0xfe, 0xbc, 0x58, 0x7a, 0x11, 0x4b, 0xcf, 0x56, 0x6c, - 0xc5, 0xce, 0x14, 0xbd, 0x2c, 0x6e, 0x14, 0x52, 0x40, 0x59, 0xa5, 0xfb, 0xe0, 0xcf, 0x26, 0x98, - 0x57, 0x21, 0xcf, 0x93, 0x3c, 0x61, 0x1b, 0x3f, 0xcc, 0x43, 0xfc, 0x18, 0x9a, 0xf9, 0x36, 0xa3, - 0x36, 0x72, 0xd1, 0xb0, 0x3f, 0xea, 0x78, 0x5f, 0x65, 0xf3, 0x6d, 0x46, 0x89, 0x22, 0xb1, 0x0b, - 0x7a, 0x76, 0xf0, 0x9e, 0xf8, 0xf6, 0x89, 0x8b, 0x86, 0x26, 0xa9, 0x53, 0xf8, 0x09, 0xf4, 0x52, - 0x2a, 0x44, 0xb8, 0xa2, 0x13, 0xdf, 0xd6, 0x5c, 0x34, 0xec, 0x91, 0x57, 0x04, 0x7e, 0x0c, 0xad, - 0x24, 0xa7, 0xa9, 0xb0, 0x9b, 0xae, 0x36, 0xd4, 0x47, 0x2d, 0x6f, 0x92, 0xd3, 0x94, 0x94, 0x1c, - 0xfe, 0x00, 0xfa, 0x82, 0x86, 0x3c, 0x7a, 0xbe, 0xe0, 0xf4, 0xb6, 0xa0, 0x22, 0xb7, 0x5b, 0x2e, - 0x1a, 0xea, 0xa3, 0xbe, 0x37, 0x53, 0x34, 0x29, 0x59, 0x62, 0x8a, 0x3a, 0xc4, 0x1f, 0xc1, 0xe9, - 0x31, 0x4c, 0x64, 0x6c, 0x23, 0xa8, 0xdd, 0x56, 0x71, 0xa7, 0xc7, 0xb8, 0x92, 0x26, 0x7d, 0x71, - 0x0f, 0x63, 0x0c, 0x4d, 0x39, 0x52, 0xbb, 0xe3, 0xa2, 0xa1, 0x41, 0x94, 0x8d, 0x6d, 0xd0, 0x28, - 0xe7, 0x76, 0x57, 0x65, 0x68, 0x7b, 0x81, 0x5c, 0x00, 0x91, 0x14, 0xfe, 0xb0, 0x76, 0x8f, 0xba, - 0x59, 0xd8, 0x3d, 0xd5, 0xc5, 0xeb, 0xf5, 0xf5, 0xef, 0xd5, 0x27, 0xf0, 0xc7, 0x60, 0xbd, 0x56, - 0xa0, 0xb0, 0x41, 0x45, 0x3e, 0xa8, 0xf0, 0xf4, 0x7e, 0x85, 0x02, 0xbf, 0x05, 0x9d, 0x98, 0xae, - 0x17, 0x9b, 0x22, 0xb5, 0x75, 0x17, 0x0d, 0x5b, 0xa4, 0x1d, 0xd3, 0xf5, 0x97, 0x45, 0x8a, 0x9f, - 0xc1, 0x9b, 0xf2, 0x60, 0xb9, 0x5d, 0xdc, 0x16, 0x94, 0x6f, 0x5f, 0xf5, 0x6e, 0xa8, 0xca, 0x1f, - 0x79, 0x3e, 0x5d, 0x5f, 0x6c, 0xbf, 0x96, 0x67, 0xf4, 0x98, 0x1e, 0xc7, 0x47, 0xf2, 0x38, 0x84, - 0x11, 0x98, 0xc9, 0x26, 0xa6, 0x3f, 0x1c, 0x87, 0x6e, 0xaa, 0x04, 0xa6, 0x37, 0x91, 0xec, 0xa1, - 0x27, 0x23, 0xa9, 0x21, 0xb9, 0xa9, 0x43, 0x4c, 0x75, 0x6b, 0xbf, 0xda, 0x54, 0x15, 0x54, 0xdd, - 0x67, 0x26, 0x75, 0x38, 0xf8, 0x04, 0xf4, 0xeb, 0x2c, 0x0e, 0x73, 0x3a, 0xcb, 0xc2, 0x88, 0xe2, - 0x47, 0xd0, 0x52, 0x86, 0x92, 0x9a, 0x41, 0x4a, 0x80, 0x6d, 0xe8, 0xdc, 0x51, 0x2e, 0x12, 0xb6, - 0x51, 0xf2, 0x6a, 0x92, 0x03, 0x1c, 0x6c, 0xa1, 0xed, 0xb3, 0x68, 0x9c, 0xc6, 0xff, 0xaf, 0xd1, - 0x5a, 0x02, 0xa9, 0x3f, 0xed, 0x98, 0x40, 0xee, 0x5b, 0xac, 0x59, 0x29, 0x2b, 0x93, 0x28, 0x1b, - 0x5b, 0xa0, 0xc5, 0x2c, 0xaa, 0x24, 0x20, 0x4d, 0xa5, 0x0a, 0x16, 0x09, 0xbb, 0xeb, 0x6a, 0x4a, - 0x15, 0x2c, 0x12, 0x83, 0x7f, 0x10, 0xe8, 0x24, 0xbc, 0xc9, 0xc7, 0x2c, 0x4d, 0xc3, 0x4d, 0x8c, - 0x9f, 0xdc, 0x2b, 0xa0, 0xeb, 0x8d, 0xd3, 0xb8, 0x56, 0xc1, 0x3b, 0x60, 0x7e, 0xcf, 0x93, 0x9c, - 0x2e, 0xa2, 0xd2, 0x5d, 0x35, 0xa2, 0x8f, 0x3a, 0x5e, 0x59, 0x3e, 0x31, 0xd4, 0xe9, 0x21, 0xd7, - 0x19, 0x18, 0x85, 0x9a, 0xca, 0x42, 0xa8, 0x69, 0x68, 0xca, 0xd9, 0xf0, 0x6a, 0xa3, 0x22, 0x7a, - 0x51, 0x9b, 0xdb, 0xfb, 0xc7, 0x77, 0x22, 0x15, 0xc0, 0xe9, 0xad, 0xdd, 0xfc, 0xcf, 0x77, 0x62, - 0x94, 0x5e, 0x3e, 0x5d, 0x13, 0x7a, 0x5b, 0x93, 0x6f, 0x19, 0x25, 0xb2, 0xea, 0x79, 0x3d, 0x10, - 0xa1, 0x59, 0x8b, 0x13, 0xd9, 0x60, 0x04, 0xdd, 0xd9, 0x26, 0xcc, 0xd4, 0xe7, 0x60, 0x81, 0xf6, - 0x1d, 0xdd, 0x56, 0x0b, 0x93, 0xa6, 0x5c, 0xe2, 0x5d, 0xb8, 0x2e, 0xa8, 0xea, 0xd1, 0x20, 0x25, - 0x78, 0x3a, 0x85, 0x76, 0xb9, 0x13, 0x0c, 0xd0, 0x1e, 0x93, 0xe0, 0x7c, 0x1e, 0x58, 0x0d, 0x69, - 0xfb, 0xc1, 0x34, 0x98, 0x07, 0x16, 0xc2, 0x3a, 0x74, 0x48, 0x70, 0x35, 0x3d, 0x1f, 0x07, 0xd6, - 0x09, 0xee, 0x42, 0xf3, 0xe2, 0x7a, 0xfa, 0x85, 0xa5, 0xe1, 0x0e, 0x68, 0xcf, 0x82, 0xb9, 0xd5, - 0x94, 0xbe, 0xb3, 0xe0, 0x9c, 0x8c, 0x2f, 0xad, 0xd6, 0xd3, 0x4f, 0xa1, 0x53, 0x0d, 0x18, 0xf7, - 0xa0, 0xf5, 0x0d, 0x99, 0xa8, 0x6c, 0xa7, 0xa0, 0x5f, 0x5f, 0xf9, 0xe7, 0xf3, 0x60, 0x76, 0x25, - 0xb3, 0x20, 0x79, 0xf6, 0xf9, 0xf4, 0x7a, 0x76, 0x69, 0x9d, 0x60, 0x13, 0x7a, 0x65, 0xb4, 0x1f, - 0x4c, 0x2d, 0xed, 0xe2, 0xb3, 0x17, 0x3b, 0xa7, 0xf1, 0xfb, 0xce, 0x69, 0xbc, 0xdc, 0x39, 0x8d, - 0xbf, 0x76, 0x4e, 0xe3, 0xef, 0x9d, 0x83, 0x7e, 0xdc, 0x3b, 0xe8, 0xe7, 0xbd, 0x83, 0x7e, 0xd9, - 0x3b, 0x8d, 0x5f, 0xf7, 0x4e, 0xe3, 0xc5, 0xde, 0x41, 0xbf, 0xed, 0x1d, 0xf4, 0x72, 0xef, 0xa0, - 0x9f, 0xfe, 0x70, 0x1a, 0x97, 0xe8, 0xdb, 0xee, 0x9d, 0x9a, 0x44, 0xb6, 0x5c, 0xb6, 0xd5, 0x77, - 0xf9, 0xde, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xed, 0xf7, 0x42, 0x08, 0xa1, 0x05, 0x00, 0x00, -} - -func (this *PartitionData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*PartitionData) - if !ok { - that2, ok := that.(PartitionData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *PartitionData) GetItems() []*Item { + if x != nil { + return x.Items } - if this.Type != that1.Type { - return false - } - if this.PartitionID != that1.PartitionID { - return false - } - if this.MessageID != that1.MessageID { - return false - } - if len(this.Items) != len(that1.Items) { - return false - } - for i := range this.Items { - if !this.Items[i].Equal(that1.Items[i]) { - return false - } - } - if !this.SearchRequest.Equal(that1.SearchRequest) { - return false - } - if !this.SearchResponse.Equal(that1.SearchResponse) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.Err.Equal(that1.Err) { - return false - } - if len(this.SearchRequests) != len(that1.SearchRequests) { - return false - } - for i := range this.SearchRequests { - if !this.SearchRequests[i].Equal(that1.SearchRequests[i]) { - return false - } - } - if len(this.SearchResponses) != len(that1.SearchResponses) { - return false - } - for i := range this.SearchResponses { - if !this.SearchResponses[i].Equal(that1.SearchResponses[i]) { - return false - } - } - if this.DelNum != that1.DelNum { - return false - } - if !this.DelByQueryResponse.Equal(that1.DelByQueryResponse) { - return false - } - if !this.IndexRequest.Equal(that1.IndexRequest) { - return false - } - if !this.IndexResponse.Equal(that1.IndexResponse) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *UpdateSpace) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*UpdateSpace) - if !ok { - that2, ok := that.(UpdateSpace) - if ok { - that1 = &that2 - } else { - return false - } +func (x *PartitionData) GetSearchRequest() *SearchRequest { + if x != nil { + return x.SearchRequest } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Space, that1.Space) { - return false - } - if this.Version != that1.Version { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *DocCmd) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DocCmd) - if !ok { - that2, ok := that.(DocCmd) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *PartitionData) GetSearchResponse() *SearchResponse { + if x != nil { + return x.SearchResponse } - if this.Type != that1.Type { - return false - } - if this.Version != that1.Version { - return false - } - if this.Slot != that1.Slot { - return false - } - if !bytes.Equal(this.Doc, that1.Doc) { - return false - } - if len(this.Docs) != len(that1.Docs) { - return false - } - for i := range this.Docs { - if !bytes.Equal(this.Docs[i], that1.Docs[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *RaftCommand) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RaftCommand) - if !ok { - that2, ok := that.(RaftCommand) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if !this.WriteCommand.Equal(that1.WriteCommand) { - return false - } - if !this.UpdateSpace.Equal(that1.UpdateSpace) { - return false - } - if !this.SearchDelReq.Equal(that1.SearchDelReq) { - return false +func (x *PartitionData) GetData() []byte { + if x != nil { + return x.Data } - if !this.SearchDelResp.Equal(that1.SearchDelResp) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *SnapData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*SnapData) - if !ok { - that2, ok := that.(SnapData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Key, that1.Key) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false +func (x *PartitionData) GetErr() *Error { + if x != nil { + return x.Err } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (m *PartitionData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return nil } -func (m *PartitionData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *PartitionData) GetSearchRequests() []*SearchRequest { + if x != nil { + return x.SearchRequests + } + return nil } -func (m *PartitionData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IndexResponse != nil { - { - size, err := m.IndexResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 +func (x *PartitionData) GetSearchResponses() []*SearchResponse { + if x != nil { + return x.SearchResponses } - if m.IndexRequest != nil { - { - size, err := m.IndexRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.DelByQueryResponse != nil { - { - size, err := m.DelByQueryResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - if m.DelNum != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.DelNum)) - i-- - dAtA[i] = 0x58 - } - if len(m.SearchResponses) > 0 { - for iNdEx := len(m.SearchResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SearchResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.SearchRequests) > 0 { - for iNdEx := len(m.SearchRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SearchRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if m.Err != nil { - { - size, err := m.Err.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x3a - } - if m.SearchResponse != nil { - { - size, err := m.SearchResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.SearchRequest != nil { - { - size, err := m.SearchRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.MessageID) > 0 { - i -= len(m.MessageID) - copy(dAtA[i:], m.MessageID) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.MessageID))) - i-- - dAtA[i] = 0x1a - } - if m.PartitionID != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.PartitionID)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return nil } -func (m *UpdateSpace) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *PartitionData) GetDelNum() int32 { + if x != nil { + return x.DelNum } - return dAtA[:n], nil + return 0 } -func (m *UpdateSpace) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *PartitionData) GetDelByQueryResponse() *DelByQueryeResponse { + if x != nil { + return x.DelByQueryResponse + } + return nil } -func (m *UpdateSpace) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (x *PartitionData) GetIndexRequest() *IndexRequest { + if x != nil { + return x.IndexRequest } - if m.Version != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x10 - } - if len(m.Space) > 0 { - i -= len(m.Space) - copy(dAtA[i:], m.Space) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Space))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return nil } -func (m *DocCmd) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *PartitionData) GetIndexResponse() *IndexResponse { + if x != nil { + return x.IndexResponse } - return dAtA[:n], nil + return nil } -func (m *DocCmd) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +// *********************** Raft *********************** // +type UpdateSpace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DocCmd) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Docs) > 0 { - for iNdEx := len(m.Docs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Docs[iNdEx]) - copy(dAtA[i:], m.Docs[iNdEx]) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Docs[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if len(m.Doc) > 0 { - i -= len(m.Doc) - copy(dAtA[i:], m.Doc) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Doc))) - i-- - dAtA[i] = 0x3a - } - if m.Slot != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Slot)) - i-- - dAtA[i] = 0x28 - } - if m.Version != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x18 - } - if m.Type != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + Space []byte `protobuf:"bytes,1,opt,name=Space,proto3" json:"Space,omitempty"` + Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` } -func (m *RaftCommand) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *UpdateSpace) Reset() { + *x = UpdateSpace{} + if protoimpl.UnsafeEnabled { + mi := &file_raftcmd_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return dAtA[:n], nil } -func (m *RaftCommand) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (x *UpdateSpace) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RaftCommand) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.SearchDelResp != nil { - { - size, err := m.SearchDelResp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.SearchDelReq != nil { - { - size, err := m.SearchDelReq.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.UpdateSpace != nil { - { - size, err := m.UpdateSpace.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.WriteCommand != nil { - { - size, err := m.WriteCommand.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRaftcmd(dAtA, i, uint64(size)) +func (*UpdateSpace) ProtoMessage() {} + +func (x *UpdateSpace) ProtoReflect() protoreflect.Message { + mi := &file_raftcmd_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - i-- - dAtA[i] = 0x12 + return ms } - if m.Type != 0 { - i = encodeVarintRaftcmd(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateSpace.ProtoReflect.Descriptor instead. +func (*UpdateSpace) Descriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdateSpace) GetSpace() []byte { + if x != nil { + return x.Space } - return len(dAtA) - i, nil + return nil } -func (m *SnapData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *UpdateSpace) GetVersion() uint64 { + if x != nil { + return x.Version } - return dAtA[:n], nil + return 0 } -func (m *SnapData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type DocCmd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type OpType `protobuf:"varint,1,opt,name=type,proto3,enum=OpType" json:"type,omitempty"` + Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Slot uint32 `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty"` + Doc []byte `protobuf:"bytes,7,opt,name=doc,proto3" json:"doc,omitempty"` + Docs [][]byte `protobuf:"bytes,8,rep,name=docs,proto3" json:"docs,omitempty"` } -func (m *SnapData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 +func (x *DocCmd) Reset() { + *x = DocCmd{} + if protoimpl.UnsafeEnabled { + mi := &file_raftcmd_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintRaftcmd(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil } -func encodeVarintRaftcmd(dAtA []byte, offset int, v uint64) int { - offset -= sovRaftcmd(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedPartitionData(r randyRaftcmd, easy bool) *PartitionData { - this := &PartitionData{} - this.Type = OpType([]int32{0, 1, 2, 3, 4, 5}[r.Intn(6)]) - this.PartitionID = uint32(r.Uint32()) - this.MessageID = string(randStringRaftcmd(r)) - if r.Intn(5) != 0 { - v1 := r.Intn(5) - this.Items = make([]*Item, v1) - for i := 0; i < v1; i++ { - this.Items[i] = NewPopulatedItem(r, easy) - } - } - if r.Intn(5) != 0 { - this.SearchRequest = NewPopulatedSearchRequest(r, easy) - } - if r.Intn(5) != 0 { - this.SearchResponse = NewPopulatedSearchResponse(r, easy) - } - v2 := r.Intn(100) - this.Data = make([]byte, v2) - for i := 0; i < v2; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if r.Intn(5) != 0 { - this.Err = NewPopulatedError(r, easy) - } - if r.Intn(5) != 0 { - v3 := r.Intn(5) - this.SearchRequests = make([]*SearchRequest, v3) - for i := 0; i < v3; i++ { - this.SearchRequests[i] = NewPopulatedSearchRequest(r, easy) - } - } - if r.Intn(5) != 0 { - v4 := r.Intn(5) - this.SearchResponses = make([]*SearchResponse, v4) - for i := 0; i < v4; i++ { - this.SearchResponses[i] = NewPopulatedSearchResponse(r, easy) +func (x *DocCmd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DocCmd) ProtoMessage() {} + +func (x *DocCmd) ProtoReflect() protoreflect.Message { + mi := &file_raftcmd_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - this.DelNum = int32(r.Int31()) - if r.Intn(2) == 0 { - this.DelNum *= -1 - } - if r.Intn(5) != 0 { - this.DelByQueryResponse = NewPopulatedDelByQueryeResponse(r, easy) - } - if r.Intn(5) != 0 { - this.IndexRequest = NewPopulatedIndexRequest(r, easy) - } - if r.Intn(5) != 0 { - this.IndexResponse = NewPopulatedIndexResponse(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRaftcmd(r, 15) - } - return this + return mi.MessageOf(x) } -func NewPopulatedUpdateSpace(r randyRaftcmd, easy bool) *UpdateSpace { - this := &UpdateSpace{} - v5 := r.Intn(100) - this.Space = make([]byte, v5) - for i := 0; i < v5; i++ { - this.Space[i] = byte(r.Intn(256)) - } - this.Version = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRaftcmd(r, 3) - } - return this +// Deprecated: Use DocCmd.ProtoReflect.Descriptor instead. +func (*DocCmd) Descriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{2} } -func NewPopulatedDocCmd(r randyRaftcmd, easy bool) *DocCmd { - this := &DocCmd{} - this.Type = OpType([]int32{0, 1, 2, 3, 4, 5}[r.Intn(6)]) - this.Version = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Version *= -1 - } - this.Slot = uint32(r.Uint32()) - v6 := r.Intn(100) - this.Doc = make([]byte, v6) - for i := 0; i < v6; i++ { - this.Doc[i] = byte(r.Intn(256)) - } - v7 := r.Intn(10) - this.Docs = make([][]byte, v7) - for i := 0; i < v7; i++ { - v8 := r.Intn(100) - this.Docs[i] = make([]byte, v8) - for j := 0; j < v8; j++ { - this.Docs[i][j] = byte(r.Intn(256)) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRaftcmd(r, 9) +func (x *DocCmd) GetType() OpType { + if x != nil { + return x.Type } - return this + return OpType_CREATE } -func NewPopulatedRaftCommand(r randyRaftcmd, easy bool) *RaftCommand { - this := &RaftCommand{} - this.Type = CmdType([]int32{0, 1, 2, 3}[r.Intn(4)]) - if r.Intn(5) != 0 { - this.WriteCommand = NewPopulatedDocCmd(r, easy) - } - if r.Intn(5) != 0 { - this.UpdateSpace = NewPopulatedUpdateSpace(r, easy) - } - if r.Intn(5) != 0 { - this.SearchDelReq = NewPopulatedSearchRequest(r, easy) +func (x *DocCmd) GetVersion() int64 { + if x != nil { + return x.Version } - if r.Intn(5) != 0 { - this.SearchDelResp = NewPopulatedSearchResponse(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRaftcmd(r, 6) - } - return this + return 0 } -func NewPopulatedSnapData(r randyRaftcmd, easy bool) *SnapData { - this := &SnapData{} - v9 := r.Intn(100) - this.Key = make([]byte, v9) - for i := 0; i < v9; i++ { - this.Key[i] = byte(r.Intn(256)) +func (x *DocCmd) GetSlot() uint32 { + if x != nil { + return x.Slot } - v10 := r.Intn(100) - this.Value = make([]byte, v10) - for i := 0; i < v10; i++ { - this.Value[i] = byte(r.Intn(256)) + return 0 +} + +func (x *DocCmd) GetDoc() []byte { + if x != nil { + return x.Doc } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRaftcmd(r, 3) + return nil +} + +func (x *DocCmd) GetDocs() [][]byte { + if x != nil { + return x.Docs } - return this + return nil } -type randyRaftcmd interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int +type RaftCommand struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type CmdType `protobuf:"varint,1,opt,name=type,proto3,enum=CmdType" json:"type,omitempty"` + WriteCommand *DocCmd `protobuf:"bytes,2,opt,name=write_command,json=writeCommand,proto3" json:"write_command,omitempty"` + UpdateSpace *UpdateSpace `protobuf:"bytes,3,opt,name=update_space,json=updateSpace,proto3" json:"update_space,omitempty"` + SearchDelReq *SearchRequest `protobuf:"bytes,4,opt,name=search_del_req,json=searchDelReq,proto3" json:"search_del_req,omitempty"` + SearchDelResp *SearchResponse `protobuf:"bytes,5,opt,name=search_del_resp,json=searchDelResp,proto3" json:"search_del_resp,omitempty"` } -func randUTF8RuneRaftcmd(r randyRaftcmd) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) +func (x *RaftCommand) Reset() { + *x = RaftCommand{} + if protoimpl.UnsafeEnabled { + mi := &file_raftcmd_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return rune(ru + 61) } -func randStringRaftcmd(r randyRaftcmd) string { - v11 := r.Intn(100) - tmps := make([]rune, v11) - for i := 0; i < v11; i++ { - tmps[i] = randUTF8RuneRaftcmd(r) - } - return string(tmps) -} -func randUnrecognizedRaftcmd(r randyRaftcmd, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 + +func (x *RaftCommand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RaftCommand) ProtoMessage() {} + +func (x *RaftCommand) ProtoReflect() protoreflect.Message { + mi := &file_raftcmd_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldRaftcmd(dAtA, r, fieldNumber, wire) + return ms } - return dAtA -} -func randFieldRaftcmd(dAtA []byte, r randyRaftcmd, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(key)) - v12 := r.Int63() - if r.Intn(2) == 0 { - v12 *= -1 - } - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(v12)) - case 1: - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateRaftcmd(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + return mi.MessageOf(x) +} + +// Deprecated: Use RaftCommand.ProtoReflect.Descriptor instead. +func (*RaftCommand) Descriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{3} +} + +func (x *RaftCommand) GetType() CmdType { + if x != nil { + return x.Type } - return dAtA + return CmdType_WRITE } -func encodeVarintPopulateRaftcmd(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + +func (x *RaftCommand) GetWriteCommand() *DocCmd { + if x != nil { + return x.WriteCommand } - dAtA = append(dAtA, uint8(v)) - return dAtA + return nil } -func (m *PartitionData) Size() (n int) { - if m == nil { - return 0 + +func (x *RaftCommand) GetUpdateSpace() *UpdateSpace { + if x != nil { + return x.UpdateSpace } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovRaftcmd(uint64(m.Type)) + return nil +} + +func (x *RaftCommand) GetSearchDelReq() *SearchRequest { + if x != nil { + return x.SearchDelReq } - if m.PartitionID != 0 { - n += 1 + sovRaftcmd(uint64(m.PartitionID)) + return nil +} + +func (x *RaftCommand) GetSearchDelResp() *SearchResponse { + if x != nil { + return x.SearchDelResp } - l = len(m.MessageID) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - } - if m.SearchRequest != nil { - l = m.SearchRequest.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.SearchResponse != nil { - l = m.SearchResponse.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.Err != nil { - l = m.Err.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if len(m.SearchRequests) > 0 { - for _, e := range m.SearchRequests { - l = e.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - } - if len(m.SearchResponses) > 0 { - for _, e := range m.SearchResponses { - l = e.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - } - if m.DelNum != 0 { - n += 1 + sovRaftcmd(uint64(m.DelNum)) - } - if m.DelByQueryResponse != nil { - l = m.DelByQueryResponse.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.IndexRequest != nil { - l = m.IndexRequest.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.IndexResponse != nil { - l = m.IndexResponse.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return nil } -func (m *UpdateSpace) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Space) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.Version != 0 { - n += 1 + sovRaftcmd(uint64(m.Version)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} +type SnapData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DocCmd) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovRaftcmd(uint64(m.Type)) - } - if m.Version != 0 { - n += 1 + sovRaftcmd(uint64(m.Version)) - } - if m.Slot != 0 { - n += 1 + sovRaftcmd(uint64(m.Slot)) - } - l = len(m.Doc) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - if len(m.Docs) > 0 { - for _, b := range m.Docs { - l = len(b) - n += 1 + l + sovRaftcmd(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *RaftCommand) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovRaftcmd(uint64(m.Type)) - } - if m.WriteCommand != nil { - l = m.WriteCommand.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.UpdateSpace != nil { - l = m.UpdateSpace.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.SearchDelReq != nil { - l = m.SearchDelReq.Size() - n += 1 + l + sovRaftcmd(uint64(l)) +func (x *SnapData) Reset() { + *x = SnapData{} + if protoimpl.UnsafeEnabled { + mi := &file_raftcmd_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if m.SearchDelResp != nil { - l = m.SearchDelResp.Size() - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n } -func (m *SnapData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRaftcmd(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n +func (x *SnapData) String() string { + return protoimpl.X.MessageStringOf(x) } -func sovRaftcmd(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRaftcmd(x uint64) (n int) { - return sovRaftcmd(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PartitionData) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]*Item{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(fmt.Sprintf("%v", f), "Item", "Item", 1) + "," - } - repeatedStringForItems += "}" - repeatedStringForSearchRequests := "[]*SearchRequest{" - for _, f := range this.SearchRequests { - repeatedStringForSearchRequests += strings.Replace(fmt.Sprintf("%v", f), "SearchRequest", "SearchRequest", 1) + "," - } - repeatedStringForSearchRequests += "}" - repeatedStringForSearchResponses := "[]*SearchResponse{" - for _, f := range this.SearchResponses { - repeatedStringForSearchResponses += strings.Replace(fmt.Sprintf("%v", f), "SearchResponse", "SearchResponse", 1) + "," - } - repeatedStringForSearchResponses += "}" - s := strings.Join([]string{`&PartitionData{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `PartitionID:` + fmt.Sprintf("%v", this.PartitionID) + `,`, - `MessageID:` + fmt.Sprintf("%v", this.MessageID) + `,`, - `Items:` + repeatedStringForItems + `,`, - `SearchRequest:` + strings.Replace(fmt.Sprintf("%v", this.SearchRequest), "SearchRequest", "SearchRequest", 1) + `,`, - `SearchResponse:` + strings.Replace(fmt.Sprintf("%v", this.SearchResponse), "SearchResponse", "SearchResponse", 1) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Err:` + strings.Replace(fmt.Sprintf("%v", this.Err), "Error", "Error", 1) + `,`, - `SearchRequests:` + repeatedStringForSearchRequests + `,`, - `SearchResponses:` + repeatedStringForSearchResponses + `,`, - `DelNum:` + fmt.Sprintf("%v", this.DelNum) + `,`, - `DelByQueryResponse:` + strings.Replace(fmt.Sprintf("%v", this.DelByQueryResponse), "DelByQueryeResponse", "DelByQueryeResponse", 1) + `,`, - `IndexRequest:` + strings.Replace(fmt.Sprintf("%v", this.IndexRequest), "IndexRequest", "IndexRequest", 1) + `,`, - `IndexResponse:` + strings.Replace(fmt.Sprintf("%v", this.IndexResponse), "IndexResponse", "IndexResponse", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateSpace) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateSpace{`, - `Space:` + fmt.Sprintf("%v", this.Space) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DocCmd) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DocCmd{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`, - `Doc:` + fmt.Sprintf("%v", this.Doc) + `,`, - `Docs:` + fmt.Sprintf("%v", this.Docs) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RaftCommand) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RaftCommand{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `WriteCommand:` + strings.Replace(this.WriteCommand.String(), "DocCmd", "DocCmd", 1) + `,`, - `UpdateSpace:` + strings.Replace(this.UpdateSpace.String(), "UpdateSpace", "UpdateSpace", 1) + `,`, - `SearchDelReq:` + strings.Replace(fmt.Sprintf("%v", this.SearchDelReq), "SearchRequest", "SearchRequest", 1) + `,`, - `SearchDelResp:` + strings.Replace(fmt.Sprintf("%v", this.SearchDelResp), "SearchResponse", "SearchResponse", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SnapData) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SnapData{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringRaftcmd(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *PartitionData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PartitionData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PartitionData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= OpType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartitionID", wireType) - } - m.PartitionID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartitionID |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, &Item{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SearchRequest == nil { - m.SearchRequest = &SearchRequest{} - } - if err := m.SearchRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SearchResponse == nil { - m.SearchResponse = &SearchResponse{} - } - if err := m.SearchResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Err == nil { - m.Err = &Error{} - } - if err := m.Err.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchRequests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SearchRequests = append(m.SearchRequests, &SearchRequest{}) - if err := m.SearchRequests[len(m.SearchRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchResponses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SearchResponses = append(m.SearchResponses, &SearchResponse{}) - if err := m.SearchResponses[len(m.SearchResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DelNum", wireType) - } - m.DelNum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DelNum |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelByQueryResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DelByQueryResponse == nil { - m.DelByQueryResponse = &DelByQueryeResponse{} - } - if err := m.DelByQueryResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IndexRequest == nil { - m.IndexRequest = &IndexRequest{} - } - if err := m.IndexRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IndexResponse == nil { - m.IndexResponse = &IndexResponse{} - } - if err := m.IndexResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftcmd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftcmd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } +func (*SnapData) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateSpace) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateSpace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateSpace: illegal tag %d (wire type %d)", fieldNum, wire) +func (x *SnapData) ProtoReflect() protoreflect.Message { + mi := &file_raftcmd_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Space", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Space = append(m.Space[:0], dAtA[iNdEx:postIndex]...) - if m.Space == nil { - m.Space = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaftcmd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftcmd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *DocCmd) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DocCmd: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DocCmd: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= OpType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - m.Slot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Slot |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Doc = append(m.Doc[:0], dAtA[iNdEx:postIndex]...) - if m.Doc == nil { - m.Doc = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Docs = append(m.Docs, make([]byte, postIndex-iNdEx)) - copy(m.Docs[len(m.Docs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftcmd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftcmd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use SnapData.ProtoReflect.Descriptor instead. +func (*SnapData) Descriptor() ([]byte, []int) { + return file_raftcmd_proto_rawDescGZIP(), []int{4} } -func (m *RaftCommand) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RaftCommand: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RaftCommand: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= CmdType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WriteCommand", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.WriteCommand == nil { - m.WriteCommand = &DocCmd{} - } - if err := m.WriteCommand.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateSpace", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpdateSpace == nil { - m.UpdateSpace = &UpdateSpace{} - } - if err := m.UpdateSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchDelReq", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SearchDelReq == nil { - m.SearchDelReq = &SearchRequest{} - } - if err := m.SearchDelReq.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchDelResp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SearchDelResp == nil { - m.SearchDelResp = &SearchResponse{} - } - if err := m.SearchDelResp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftcmd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftcmd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *SnapData) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *SnapData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRaftcmd - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRaftcmd - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftcmd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRaftcmd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *SnapData) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func skipRaftcmd(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftcmd - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRaftcmd - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRaftcmd - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRaftcmd - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF + +var File_raftcmd_proto protoreflect.FileDescriptor + +var file_raftcmd_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x61, 0x66, 0x74, 0x63, 0x6d, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x11, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xea, 0x04, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, + 0x44, 0x12, 0x1b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x05, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x35, + 0x0a, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x06, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x37, 0x0a, + 0x0f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x10, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x47, 0x0a, 0x15, 0x64, + 0x65, 0x6c, 0x5f, 0x62, 0x79, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x65, 0x6c, + 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x12, 0x64, 0x65, 0x6c, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0c, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3d, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x53, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x79, + 0x0a, 0x06, 0x44, 0x6f, 0x63, 0x43, 0x6d, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x64, 0x6f, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x22, 0xf9, 0x01, 0x0a, 0x0b, 0x52, 0x61, + 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x43, 0x6d, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, + 0x2e, 0x44, 0x6f, 0x63, 0x43, 0x6d, 0x64, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2f, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x5f, 0x64, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0c, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x37, 0x0a, 0x0f, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x64, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x32, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x4c, 0x0a, 0x06, 0x4f, 0x70, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, + 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x55, 0x4c, 0x4b, + 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, + 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x05, 0x2a, 0x3f, 0x0a, 0x07, 0x43, 0x6d, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, + 0x0b, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x09, + 0x0a, 0x05, 0x46, 0x4c, 0x55, 0x53, 0x48, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x45, 0x41, + 0x52, 0x43, 0x48, 0x44, 0x45, 0x4c, 0x10, 0x03, 0x42, 0x0e, 0x48, 0x01, 0x5a, 0x0a, 0x2e, 0x2f, + 0x76, 0x65, 0x61, 0x72, 0x63, 0x68, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthRaftcmd = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaftcmd = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRaftcmd = fmt.Errorf("proto: unexpected end of group") + file_raftcmd_proto_rawDescOnce sync.Once + file_raftcmd_proto_rawDescData = file_raftcmd_proto_rawDesc ) + +func file_raftcmd_proto_rawDescGZIP() []byte { + file_raftcmd_proto_rawDescOnce.Do(func() { + file_raftcmd_proto_rawDescData = protoimpl.X.CompressGZIP(file_raftcmd_proto_rawDescData) + }) + return file_raftcmd_proto_rawDescData +} + +var file_raftcmd_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_raftcmd_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_raftcmd_proto_goTypes = []interface{}{ + (OpType)(0), // 0: OpType + (CmdType)(0), // 1: CmdType + (*PartitionData)(nil), // 2: PartitionData + (*UpdateSpace)(nil), // 3: UpdateSpace + (*DocCmd)(nil), // 4: DocCmd + (*RaftCommand)(nil), // 5: RaftCommand + (*SnapData)(nil), // 6: SnapData + (*Item)(nil), // 7: Item + (*SearchRequest)(nil), // 8: SearchRequest + (*SearchResponse)(nil), // 9: SearchResponse + (*Error)(nil), // 10: Error + (*DelByQueryeResponse)(nil), // 11: DelByQueryeResponse + (*IndexRequest)(nil), // 12: IndexRequest + (*IndexResponse)(nil), // 13: IndexResponse +} +var file_raftcmd_proto_depIdxs = []int32{ + 0, // 0: PartitionData.type:type_name -> OpType + 7, // 1: PartitionData.items:type_name -> Item + 8, // 2: PartitionData.search_request:type_name -> SearchRequest + 9, // 3: PartitionData.search_response:type_name -> SearchResponse + 10, // 4: PartitionData.err:type_name -> Error + 8, // 5: PartitionData.search_requests:type_name -> SearchRequest + 9, // 6: PartitionData.search_responses:type_name -> SearchResponse + 11, // 7: PartitionData.del_by_query_response:type_name -> DelByQueryeResponse + 12, // 8: PartitionData.index_request:type_name -> IndexRequest + 13, // 9: PartitionData.index_response:type_name -> IndexResponse + 0, // 10: DocCmd.type:type_name -> OpType + 1, // 11: RaftCommand.type:type_name -> CmdType + 4, // 12: RaftCommand.write_command:type_name -> DocCmd + 3, // 13: RaftCommand.update_space:type_name -> UpdateSpace + 8, // 14: RaftCommand.search_del_req:type_name -> SearchRequest + 9, // 15: RaftCommand.search_del_resp:type_name -> SearchResponse + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name +} + +func init() { file_raftcmd_proto_init() } +func file_raftcmd_proto_init() { + if File_raftcmd_proto != nil { + return + } + file_errors_proto_init() + file_data_model_proto_init() + file_router_grpc_proto_init() + if !protoimpl.UnsafeEnabled { + file_raftcmd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raftcmd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateSpace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raftcmd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DocCmd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raftcmd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RaftCommand); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_raftcmd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_raftcmd_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_raftcmd_proto_goTypes, + DependencyIndexes: file_raftcmd_proto_depIdxs, + EnumInfos: file_raftcmd_proto_enumTypes, + MessageInfos: file_raftcmd_proto_msgTypes, + }.Build() + File_raftcmd_proto = out.File + file_raftcmd_proto_rawDesc = nil + file_raftcmd_proto_goTypes = nil + file_raftcmd_proto_depIdxs = nil +} diff --git a/internal/proto/vearchpb/router_grpc.pb.go b/internal/proto/vearchpb/router_grpc.pb.go index 1ed27470..3e2dac80 100644 --- a/internal/proto/vearchpb/router_grpc.pb.go +++ b/internal/proto/vearchpb/router_grpc.pb.go @@ -1,37 +1,24 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.5.0 // source: router_grpc.proto package vearchpb import ( - bytes "bytes" - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" - - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type IndexParameters_DistanceMetricType int32 @@ -40,25 +27,50 @@ const ( IndexParameters_L2 IndexParameters_DistanceMetricType = 1 ) -var IndexParameters_DistanceMetricType_name = map[int32]string{ - 0: "InnerProduct", - 1: "L2", -} +// Enum value maps for IndexParameters_DistanceMetricType. +var ( + IndexParameters_DistanceMetricType_name = map[int32]string{ + 0: "InnerProduct", + 1: "L2", + } + IndexParameters_DistanceMetricType_value = map[string]int32{ + "InnerProduct": 0, + "L2": 1, + } +) -var IndexParameters_DistanceMetricType_value = map[string]int32{ - "InnerProduct": 0, - "L2": 1, +func (x IndexParameters_DistanceMetricType) Enum() *IndexParameters_DistanceMetricType { + p := new(IndexParameters_DistanceMetricType) + *p = x + return p } func (x IndexParameters_DistanceMetricType) String() string { - return proto.EnumName(IndexParameters_DistanceMetricType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (IndexParameters_DistanceMetricType) Descriptor() protoreflect.EnumDescriptor { + return file_router_grpc_proto_enumTypes[0].Descriptor() +} + +func (IndexParameters_DistanceMetricType) Type() protoreflect.EnumType { + return &file_router_grpc_proto_enumTypes[0] +} + +func (x IndexParameters_DistanceMetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IndexParameters_DistanceMetricType.Descriptor instead. func (IndexParameters_DistanceMetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{23, 0} + return file_router_grpc_proto_rawDescGZIP(), []int{23, 0} } type RequestHead struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + TimeOutMs int64 `protobuf:"varint,1,opt,name=time_out_ms,json=timeOutMs,proto3" json:"time_out_ms,omitempty"` UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` @@ -66,1221 +78,1448 @@ type RequestHead struct { SpaceName string `protobuf:"bytes,5,opt,name=space_name,json=spaceName,proto3" json:"space_name,omitempty"` ClientType string `protobuf:"bytes,6,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty"` // from, sort, request_id, partition_id - Params map[string]string `protobuf:"bytes,7,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Params map[string]string `protobuf:"bytes,7,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RequestHead) Reset() { + *x = RequestHead{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestHead) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RequestHead) Reset() { *m = RequestHead{} } func (*RequestHead) ProtoMessage() {} -func (*RequestHead) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{0} -} -func (m *RequestHead) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestHead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestHead.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *RequestHead) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestHead.ProtoReflect.Descriptor instead. +func (*RequestHead) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{0} +} + +func (x *RequestHead) GetTimeOutMs() int64 { + if x != nil { + return x.TimeOutMs + } + return 0 +} + +func (x *RequestHead) GetUserName() string { + if x != nil { + return x.UserName } + return "" +} + +func (x *RequestHead) GetPassword() string { + if x != nil { + return x.Password + } + return "" } -func (m *RequestHead) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestHead.Merge(m, src) + +func (x *RequestHead) GetDbName() string { + if x != nil { + return x.DbName + } + return "" } -func (m *RequestHead) XXX_Size() int { - return m.Size() + +func (x *RequestHead) GetSpaceName() string { + if x != nil { + return x.SpaceName + } + return "" } -func (m *RequestHead) XXX_DiscardUnknown() { - xxx_messageInfo_RequestHead.DiscardUnknown(m) + +func (x *RequestHead) GetClientType() string { + if x != nil { + return x.ClientType + } + return "" } -var xxx_messageInfo_RequestHead proto.InternalMessageInfo +func (x *RequestHead) GetParams() map[string]string { + if x != nil { + return x.Params + } + return nil +} type ResponseHead struct { - Err *Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` - Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err *Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` + Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ResponseHead) Reset() { + *x = ResponseHead{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseHead) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ResponseHead) Reset() { *m = ResponseHead{} } func (*ResponseHead) ProtoMessage() {} -func (*ResponseHead) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{1} -} -func (m *ResponseHead) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseHead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseHead.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *ResponseHead) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ResponseHead) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseHead.Merge(m, src) -} -func (m *ResponseHead) XXX_Size() int { - return m.Size() + +// Deprecated: Use ResponseHead.ProtoReflect.Descriptor instead. +func (*ResponseHead) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{1} } -func (m *ResponseHead) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseHead.DiscardUnknown(m) + +func (x *ResponseHead) GetErr() *Error { + if x != nil { + return x.Err + } + return nil } -var xxx_messageInfo_ResponseHead proto.InternalMessageInfo +func (x *ResponseHead) GetParams() map[string]string { + if x != nil { + return x.Params + } + return nil +} type GetRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - PrimaryKeys []string `protobuf:"bytes,4,rep,name=primary_keys,json=primaryKeys,proto3" json:"primary_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + PrimaryKeys []string `protobuf:"bytes,4,rep,name=primary_keys,json=primaryKeys,proto3" json:"primary_keys,omitempty"` } -func (m *GetRequest) Reset() { *m = GetRequest{} } -func (*GetRequest) ProtoMessage() {} -func (*GetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{2} -} -func (m *GetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *GetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRequest.Merge(m, src) -} -func (m *GetRequest) XXX_Size() int { - return m.Size() + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetRequest.DiscardUnknown(m) + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetRequest proto.InternalMessageInfo +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{2} +} -func (m *GetRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *GetRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *GetRequest) GetPrimaryKeys() []string { - if m != nil { - return m.PrimaryKeys +func (x *GetRequest) GetPrimaryKeys() []string { + if x != nil { + return x.PrimaryKeys } return nil } type DeleteRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - PrimaryKeys []string `protobuf:"bytes,4,rep,name=primary_keys,json=primaryKeys,proto3" json:"primary_keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + PrimaryKeys []string `protobuf:"bytes,4,rep,name=primary_keys,json=primaryKeys,proto3" json:"primary_keys,omitempty"` } -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (*DeleteRequest) ProtoMessage() {} -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{3} -} -func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *DeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRequest.Merge(m, src) -} -func (m *DeleteRequest) XXX_Size() int { - return m.Size() + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRequest.DiscardUnknown(m) + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{3} +} -func (m *DeleteRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *DeleteRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *DeleteRequest) GetPrimaryKeys() []string { - if m != nil { - return m.PrimaryKeys +func (x *DeleteRequest) GetPrimaryKeys() []string { + if x != nil { + return x.PrimaryKeys } return nil } type AddRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Doc *Document `protobuf:"bytes,4,opt,name=doc,proto3" json:"doc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Doc *Document `protobuf:"bytes,4,opt,name=doc,proto3" json:"doc,omitempty"` } -func (m *AddRequest) Reset() { *m = AddRequest{} } -func (*AddRequest) ProtoMessage() {} -func (*AddRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{4} -} -func (m *AddRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *AddRequest) Reset() { + *x = AddRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *AddRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddRequest.Merge(m, src) -} -func (m *AddRequest) XXX_Size() int { - return m.Size() + +func (x *AddRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddRequest.DiscardUnknown(m) + +func (*AddRequest) ProtoMessage() {} + +func (x *AddRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddRequest proto.InternalMessageInfo +// Deprecated: Use AddRequest.ProtoReflect.Descriptor instead. +func (*AddRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{4} +} -func (m *AddRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *AddRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *AddRequest) GetDoc() *Document { - if m != nil { - return m.Doc +func (x *AddRequest) GetDoc() *Document { + if x != nil { + return x.Doc } return nil } type UpdateRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Doc *Document `protobuf:"bytes,4,opt,name=doc,proto3" json:"doc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Doc *Document `protobuf:"bytes,4,opt,name=doc,proto3" json:"doc,omitempty"` } -func (m *UpdateRequest) Reset() { *m = UpdateRequest{} } -func (*UpdateRequest) ProtoMessage() {} -func (*UpdateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{5} -} -func (m *UpdateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *UpdateRequest) Reset() { + *x = UpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *UpdateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateRequest.Merge(m, src) -} -func (m *UpdateRequest) XXX_Size() int { - return m.Size() + +func (x *UpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *UpdateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateRequest.DiscardUnknown(m) + +func (*UpdateRequest) ProtoMessage() {} + +func (x *UpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_UpdateRequest proto.InternalMessageInfo +// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. +func (*UpdateRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{5} +} -func (m *UpdateRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *UpdateRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *UpdateRequest) GetDoc() *Document { - if m != nil { - return m.Doc +func (x *UpdateRequest) GetDoc() *Document { + if x != nil { + return x.Doc } return nil } type BulkRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Docs []*Document `protobuf:"bytes,4,rep,name=docs,proto3" json:"docs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Docs []*Document `protobuf:"bytes,4,rep,name=docs,proto3" json:"docs,omitempty"` } -func (m *BulkRequest) Reset() { *m = BulkRequest{} } -func (*BulkRequest) ProtoMessage() {} -func (*BulkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{6} -} -func (m *BulkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BulkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BulkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *BulkRequest) Reset() { + *x = BulkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *BulkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BulkRequest.Merge(m, src) -} -func (m *BulkRequest) XXX_Size() int { - return m.Size() + +func (x *BulkRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BulkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BulkRequest.DiscardUnknown(m) + +func (*BulkRequest) ProtoMessage() {} + +func (x *BulkRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BulkRequest proto.InternalMessageInfo +// Deprecated: Use BulkRequest.ProtoReflect.Descriptor instead. +func (*BulkRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{6} +} -func (m *BulkRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *BulkRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *BulkRequest) GetDocs() []*Document { - if m != nil { - return m.Docs +func (x *BulkRequest) GetDocs() []*Document { + if x != nil { + return x.Docs } return nil } type ForceMergeRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` } -func (m *ForceMergeRequest) Reset() { *m = ForceMergeRequest{} } -func (*ForceMergeRequest) ProtoMessage() {} -func (*ForceMergeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{7} -} -func (m *ForceMergeRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ForceMergeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ForceMergeRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ForceMergeRequest) Reset() { + *x = ForceMergeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *ForceMergeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ForceMergeRequest.Merge(m, src) -} -func (m *ForceMergeRequest) XXX_Size() int { - return m.Size() + +func (x *ForceMergeRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ForceMergeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ForceMergeRequest.DiscardUnknown(m) + +func (*ForceMergeRequest) ProtoMessage() {} + +func (x *ForceMergeRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ForceMergeRequest proto.InternalMessageInfo +// Deprecated: Use ForceMergeRequest.ProtoReflect.Descriptor instead. +func (*ForceMergeRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{7} +} -func (m *ForceMergeRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *ForceMergeRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } type FlushRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` } -func (m *FlushRequest) Reset() { *m = FlushRequest{} } -func (*FlushRequest) ProtoMessage() {} -func (*FlushRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{8} -} -func (m *FlushRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FlushRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *FlushRequest) Reset() { + *x = FlushRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *FlushRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushRequest.Merge(m, src) -} -func (m *FlushRequest) XXX_Size() int { - return m.Size() + +func (x *FlushRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FlushRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FlushRequest.DiscardUnknown(m) + +func (*FlushRequest) ProtoMessage() {} + +func (x *FlushRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_FlushRequest proto.InternalMessageInfo +// Deprecated: Use FlushRequest.ProtoReflect.Descriptor instead. +func (*FlushRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{8} +} -func (m *FlushRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *FlushRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } type IndexRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - DropBeforeRebuild int64 `protobuf:"varint,2,opt,name=drop_before_rebuild,json=dropBeforeRebuild,proto3" json:"drop_before_rebuild,omitempty"` - LimitCpu int64 `protobuf:"varint,3,opt,name=limit_cpu,json=limitCpu,proto3" json:"limit_cpu,omitempty"` - Describe int64 `protobuf:"varint,4,opt,name=describe,proto3" json:"describe,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + DropBeforeRebuild int64 `protobuf:"varint,2,opt,name=drop_before_rebuild,json=dropBeforeRebuild,proto3" json:"drop_before_rebuild,omitempty"` + LimitCpu int64 `protobuf:"varint,3,opt,name=limit_cpu,json=limitCpu,proto3" json:"limit_cpu,omitempty"` + Describe int64 `protobuf:"varint,4,opt,name=describe,proto3" json:"describe,omitempty"` } -func (m *IndexRequest) Reset() { *m = IndexRequest{} } -func (*IndexRequest) ProtoMessage() {} -func (*IndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{9} -} -func (m *IndexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *IndexRequest) Reset() { + *x = IndexRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *IndexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexRequest.Merge(m, src) -} -func (m *IndexRequest) XXX_Size() int { - return m.Size() + +func (x *IndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IndexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IndexRequest.DiscardUnknown(m) + +func (*IndexRequest) ProtoMessage() {} + +func (x *IndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IndexRequest proto.InternalMessageInfo +// Deprecated: Use IndexRequest.ProtoReflect.Descriptor instead. +func (*IndexRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{9} +} -func (m *IndexRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *IndexRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *IndexRequest) GetDropBeforeRebuild() int64 { - if m != nil { - return m.DropBeforeRebuild +func (x *IndexRequest) GetDropBeforeRebuild() int64 { + if x != nil { + return x.DropBeforeRebuild } return 0 } -func (m *IndexRequest) GetLimitCpu() int64 { - if m != nil { - return m.LimitCpu +func (x *IndexRequest) GetLimitCpu() int64 { + if x != nil { + return x.LimitCpu } return 0 } -func (m *IndexRequest) GetDescribe() int64 { - if m != nil { - return m.Describe +func (x *IndexRequest) GetDescribe() int64 { + if x != nil { + return x.Describe } return 0 } type GetResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` } -func (m *GetResponse) Reset() { *m = GetResponse{} } -func (*GetResponse) ProtoMessage() {} -func (*GetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{10} -} -func (m *GetResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *GetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetResponse.Merge(m, src) -} -func (m *GetResponse) XXX_Size() int { - return m.Size() + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetResponse.DiscardUnknown(m) + +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetResponse proto.InternalMessageInfo +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{10} +} -func (m *GetResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *GetResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *GetResponse) GetItems() []*Item { - if m != nil { - return m.Items +func (x *GetResponse) GetItems() []*Item { + if x != nil { + return x.Items } return nil } type AddResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - PrimaryKey string `protobuf:"bytes,4,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + PrimaryKey string `protobuf:"bytes,4,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"` } -func (m *AddResponse) Reset() { *m = AddResponse{} } -func (*AddResponse) ProtoMessage() {} -func (*AddResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{11} -} -func (m *AddResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *AddResponse) Reset() { + *x = AddResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *AddResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddResponse.Merge(m, src) -} -func (m *AddResponse) XXX_Size() int { - return m.Size() + +func (x *AddResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddResponse.DiscardUnknown(m) + +func (*AddResponse) ProtoMessage() {} + +func (x *AddResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddResponse proto.InternalMessageInfo +// Deprecated: Use AddResponse.ProtoReflect.Descriptor instead. +func (*AddResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{11} +} -func (m *AddResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *AddResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *AddResponse) GetPrimaryKey() string { - if m != nil { - return m.PrimaryKey +func (x *AddResponse) GetPrimaryKey() string { + if x != nil { + return x.PrimaryKey } return "" } type UpdateResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` } -func (m *UpdateResponse) Reset() { *m = UpdateResponse{} } -func (*UpdateResponse) ProtoMessage() {} -func (*UpdateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{12} -} -func (m *UpdateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *UpdateResponse) Reset() { + *x = UpdateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *UpdateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateResponse.Merge(m, src) -} -func (m *UpdateResponse) XXX_Size() int { - return m.Size() + +func (x *UpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *UpdateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateResponse.DiscardUnknown(m) + +func (*UpdateResponse) ProtoMessage() {} + +func (x *UpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_UpdateResponse proto.InternalMessageInfo +// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. +func (*UpdateResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{12} +} -func (m *UpdateResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *UpdateResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } type DeleteResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` } -func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } -func (*DeleteResponse) ProtoMessage() {} -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{13} -} -func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *DeleteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteResponse.Merge(m, src) -} -func (m *DeleteResponse) XXX_Size() int { - return m.Size() + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DeleteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteResponse.DiscardUnknown(m) + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{13} +} -func (m *DeleteResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *DeleteResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *DeleteResponse) GetItems() []*Item { - if m != nil { - return m.Items +func (x *DeleteResponse) GetItems() []*Item { + if x != nil { + return x.Items } return nil } type BulkResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Items []*Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` } -func (m *BulkResponse) Reset() { *m = BulkResponse{} } -func (*BulkResponse) ProtoMessage() {} -func (*BulkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{14} -} -func (m *BulkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BulkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BulkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *BulkResponse) Reset() { + *x = BulkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *BulkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BulkResponse.Merge(m, src) -} -func (m *BulkResponse) XXX_Size() int { - return m.Size() + +func (x *BulkResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BulkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BulkResponse.DiscardUnknown(m) + +func (*BulkResponse) ProtoMessage() {} + +func (x *BulkResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BulkResponse proto.InternalMessageInfo +// Deprecated: Use BulkResponse.ProtoReflect.Descriptor instead. +func (*BulkResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{14} +} -func (m *BulkResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *BulkResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *BulkResponse) GetItems() []*Item { - if m != nil { - return m.Items +func (x *BulkResponse) GetItems() []*Item { + if x != nil { + return x.Items } return nil } type ForceMergeResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` } -func (m *ForceMergeResponse) Reset() { *m = ForceMergeResponse{} } -func (*ForceMergeResponse) ProtoMessage() {} -func (*ForceMergeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{15} -} -func (m *ForceMergeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ForceMergeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ForceMergeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ForceMergeResponse) Reset() { + *x = ForceMergeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *ForceMergeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ForceMergeResponse.Merge(m, src) -} -func (m *ForceMergeResponse) XXX_Size() int { - return m.Size() + +func (x *ForceMergeResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ForceMergeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ForceMergeResponse.DiscardUnknown(m) + +func (*ForceMergeResponse) ProtoMessage() {} + +func (x *ForceMergeResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ForceMergeResponse proto.InternalMessageInfo +// Deprecated: Use ForceMergeResponse.ProtoReflect.Descriptor instead. +func (*ForceMergeResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{15} +} -func (m *ForceMergeResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *ForceMergeResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *ForceMergeResponse) GetShards() *SearchStatus { - if m != nil { - return m.Shards +func (x *ForceMergeResponse) GetShards() *SearchStatus { + if x != nil { + return x.Shards } return nil } type DelByQueryeResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - DelNum int32 `protobuf:"varint,2,opt,name=DelNum,proto3" json:"DelNum,omitempty"` - IdsStr []string `protobuf:"bytes,3,rep,name=ids_str,json=idsStr,proto3" json:"ids_str,omitempty"` - IdsLong []int64 `protobuf:"varint,4,rep,packed,name=ids_long,json=idsLong,proto3" json:"ids_long,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + DelNum int32 `protobuf:"varint,2,opt,name=DelNum,proto3" json:"DelNum,omitempty"` + IdsStr []string `protobuf:"bytes,3,rep,name=ids_str,json=idsStr,proto3" json:"ids_str,omitempty"` + IdsLong []int64 `protobuf:"varint,4,rep,packed,name=ids_long,json=idsLong,proto3" json:"ids_long,omitempty"` } -func (m *DelByQueryeResponse) Reset() { *m = DelByQueryeResponse{} } -func (*DelByQueryeResponse) ProtoMessage() {} -func (*DelByQueryeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{16} -} -func (m *DelByQueryeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelByQueryeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelByQueryeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *DelByQueryeResponse) Reset() { + *x = DelByQueryeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *DelByQueryeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelByQueryeResponse.Merge(m, src) -} -func (m *DelByQueryeResponse) XXX_Size() int { - return m.Size() -} -func (m *DelByQueryeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DelByQueryeResponse.DiscardUnknown(m) + +func (x *DelByQueryeResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_DelByQueryeResponse proto.InternalMessageInfo +func (*DelByQueryeResponse) ProtoMessage() {} -func (m *DelByQueryeResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *DelByQueryeResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DelByQueryeResponse.ProtoReflect.Descriptor instead. +func (*DelByQueryeResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{16} +} + +func (x *DelByQueryeResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *DelByQueryeResponse) GetDelNum() int32 { - if m != nil { - return m.DelNum +func (x *DelByQueryeResponse) GetDelNum() int32 { + if x != nil { + return x.DelNum } return 0 } -func (m *DelByQueryeResponse) GetIdsStr() []string { - if m != nil { - return m.IdsStr +func (x *DelByQueryeResponse) GetIdsStr() []string { + if x != nil { + return x.IdsStr } return nil } -func (m *DelByQueryeResponse) GetIdsLong() []int64 { - if m != nil { - return m.IdsLong +func (x *DelByQueryeResponse) GetIdsLong() []int64 { + if x != nil { + return x.IdsLong } return nil } type FlushResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` } -func (m *FlushResponse) Reset() { *m = FlushResponse{} } -func (*FlushResponse) ProtoMessage() {} -func (*FlushResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{17} -} -func (m *FlushResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FlushResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *FlushResponse) Reset() { + *x = FlushResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *FlushResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushResponse.Merge(m, src) -} -func (m *FlushResponse) XXX_Size() int { - return m.Size() + +func (x *FlushResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FlushResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FlushResponse.DiscardUnknown(m) + +func (*FlushResponse) ProtoMessage() {} + +func (x *FlushResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_FlushResponse proto.InternalMessageInfo +// Deprecated: Use FlushResponse.ProtoReflect.Descriptor instead. +func (*FlushResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{17} +} -func (m *FlushResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *FlushResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *FlushResponse) GetShards() *SearchStatus { - if m != nil { - return m.Shards +func (x *FlushResponse) GetShards() *SearchStatus { + if x != nil { + return x.Shards } return nil } type IndexResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Shards *SearchStatus `protobuf:"bytes,2,opt,name=shards,proto3" json:"shards,omitempty"` } -func (m *IndexResponse) Reset() { *m = IndexResponse{} } -func (*IndexResponse) ProtoMessage() {} -func (*IndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{18} -} -func (m *IndexResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *IndexResponse) Reset() { + *x = IndexResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *IndexResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexResponse.Merge(m, src) -} -func (m *IndexResponse) XXX_Size() int { - return m.Size() + +func (x *IndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IndexResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IndexResponse.DiscardUnknown(m) + +func (*IndexResponse) ProtoMessage() {} + +func (x *IndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IndexResponse proto.InternalMessageInfo +// Deprecated: Use IndexResponse.ProtoReflect.Descriptor instead. +func (*IndexResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{18} +} -func (m *IndexResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *IndexResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *IndexResponse) GetShards() *SearchStatus { - if m != nil { - return m.Shards +func (x *IndexResponse) GetShards() *SearchStatus { + if x != nil { + return x.Shards } return nil } type TermFilter struct { - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - IsUnion int32 `protobuf:"varint,3,opt,name=is_union,json=isUnion,proto3" json:"is_union,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + IsUnion int32 `protobuf:"varint,3,opt,name=is_union,json=isUnion,proto3" json:"is_union,omitempty"` +} + +func (x *TermFilter) Reset() { + *x = TermFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TermFilter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TermFilter) Reset() { *m = TermFilter{} } func (*TermFilter) ProtoMessage() {} -func (*TermFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{19} -} -func (m *TermFilter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TermFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TermFilter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *TermFilter) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *TermFilter) XXX_Merge(src proto.Message) { - xxx_messageInfo_TermFilter.Merge(m, src) + +// Deprecated: Use TermFilter.ProtoReflect.Descriptor instead. +func (*TermFilter) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{19} } -func (m *TermFilter) XXX_Size() int { - return m.Size() + +func (x *TermFilter) GetField() string { + if x != nil { + return x.Field + } + return "" } -func (m *TermFilter) XXX_DiscardUnknown() { - xxx_messageInfo_TermFilter.DiscardUnknown(m) + +func (x *TermFilter) GetValue() []byte { + if x != nil { + return x.Value + } + return nil } -var xxx_messageInfo_TermFilter proto.InternalMessageInfo +func (x *TermFilter) GetIsUnion() int32 { + if x != nil { + return x.IsUnion + } + return 0 +} type RangeFilter struct { - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - LowerValue []byte `protobuf:"bytes,2,opt,name=lower_value,json=lowerValue,proto3" json:"lower_value,omitempty"` - UpperValue []byte `protobuf:"bytes,3,opt,name=upper_value,json=upperValue,proto3" json:"upper_value,omitempty"` - IncludeLower bool `protobuf:"varint,4,opt,name=include_lower,json=includeLower,proto3" json:"include_lower,omitempty"` - IncludeUpper bool `protobuf:"varint,5,opt,name=include_upper,json=includeUpper,proto3" json:"include_upper,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + LowerValue []byte `protobuf:"bytes,2,opt,name=lower_value,json=lowerValue,proto3" json:"lower_value,omitempty"` + UpperValue []byte `protobuf:"bytes,3,opt,name=upper_value,json=upperValue,proto3" json:"upper_value,omitempty"` + IncludeLower bool `protobuf:"varint,4,opt,name=include_lower,json=includeLower,proto3" json:"include_lower,omitempty"` + IncludeUpper bool `protobuf:"varint,5,opt,name=include_upper,json=includeUpper,proto3" json:"include_upper,omitempty"` +} + +func (x *RangeFilter) Reset() { + *x = RangeFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RangeFilter) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *RangeFilter) Reset() { *m = RangeFilter{} } func (*RangeFilter) ProtoMessage() {} -func (*RangeFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{20} -} -func (m *RangeFilter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RangeFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RangeFilter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *RangeFilter) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RangeFilter.ProtoReflect.Descriptor instead. +func (*RangeFilter) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{20} +} + +func (x *RangeFilter) GetField() string { + if x != nil { + return x.Field } + return "" } -func (m *RangeFilter) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeFilter.Merge(m, src) + +func (x *RangeFilter) GetLowerValue() []byte { + if x != nil { + return x.LowerValue + } + return nil } -func (m *RangeFilter) XXX_Size() int { - return m.Size() + +func (x *RangeFilter) GetUpperValue() []byte { + if x != nil { + return x.UpperValue + } + return nil } -func (m *RangeFilter) XXX_DiscardUnknown() { - xxx_messageInfo_RangeFilter.DiscardUnknown(m) + +func (x *RangeFilter) GetIncludeLower() bool { + if x != nil { + return x.IncludeLower + } + return false } -var xxx_messageInfo_RangeFilter proto.InternalMessageInfo +func (x *RangeFilter) GetIncludeUpper() bool { + if x != nil { + return x.IncludeUpper + } + return false +} type SortField struct { - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *SortField) Reset() { + *x = SortField{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SortField) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SortField) Reset() { *m = SortField{} } func (*SortField) ProtoMessage() {} -func (*SortField) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{21} -} -func (m *SortField) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SortField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SortField.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *SortField) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *SortField) XXX_Merge(src proto.Message) { - xxx_messageInfo_SortField.Merge(m, src) -} -func (m *SortField) XXX_Size() int { - return m.Size() + +// Deprecated: Use SortField.ProtoReflect.Descriptor instead. +func (*SortField) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{21} } -func (m *SortField) XXX_DiscardUnknown() { - xxx_messageInfo_SortField.DiscardUnknown(m) + +func (x *SortField) GetField() string { + if x != nil { + return x.Field + } + return "" } -var xxx_messageInfo_SortField proto.InternalMessageInfo +func (x *SortField) GetType() bool { + if x != nil { + return x.Type + } + return false +} type VectorQuery struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - MinScore float64 `protobuf:"fixed64,3,opt,name=min_score,json=minScore,proto3" json:"min_score,omitempty"` - MaxScore float64 `protobuf:"fixed64,4,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` - Boost float64 `protobuf:"fixed64,5,opt,name=boost,proto3" json:"boost,omitempty"` - HasBoost int32 `protobuf:"varint,6,opt,name=has_boost,json=hasBoost,proto3" json:"has_boost,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - IndexType string `protobuf:"bytes,8,opt,name=index_type,json=indexType,proto3" json:"index_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorQuery) Reset() { *m = VectorQuery{} } + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + MinScore float64 `protobuf:"fixed64,3,opt,name=min_score,json=minScore,proto3" json:"min_score,omitempty"` + MaxScore float64 `protobuf:"fixed64,4,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` + Boost float64 `protobuf:"fixed64,5,opt,name=boost,proto3" json:"boost,omitempty"` + HasBoost int32 `protobuf:"varint,6,opt,name=has_boost,json=hasBoost,proto3" json:"has_boost,omitempty"` + Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` + IndexType string `protobuf:"bytes,8,opt,name=index_type,json=indexType,proto3" json:"index_type,omitempty"` +} + +func (x *VectorQuery) Reset() { + *x = VectorQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VectorQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + func (*VectorQuery) ProtoMessage() {} -func (*VectorQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{22} -} -func (m *VectorQuery) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VectorQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VectorQuery.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *VectorQuery) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VectorQuery.ProtoReflect.Descriptor instead. +func (*VectorQuery) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{22} +} + +func (x *VectorQuery) GetName() string { + if x != nil { + return x.Name } + return "" +} + +func (x *VectorQuery) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *VectorQuery) GetMinScore() float64 { + if x != nil { + return x.MinScore + } + return 0 +} + +func (x *VectorQuery) GetMaxScore() float64 { + if x != nil { + return x.MaxScore + } + return 0 } -func (m *VectorQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorQuery.Merge(m, src) + +func (x *VectorQuery) GetBoost() float64 { + if x != nil { + return x.Boost + } + return 0 } -func (m *VectorQuery) XXX_Size() int { - return m.Size() + +func (x *VectorQuery) GetHasBoost() int32 { + if x != nil { + return x.HasBoost + } + return 0 } -func (m *VectorQuery) XXX_DiscardUnknown() { - xxx_messageInfo_VectorQuery.DiscardUnknown(m) + +func (x *VectorQuery) GetFormat() string { + if x != nil { + return x.Format + } + return "" } -var xxx_messageInfo_VectorQuery proto.InternalMessageInfo +func (x *VectorQuery) GetIndexType() string { + if x != nil { + return x.IndexType + } + return "" +} type IndexParameters struct { - MetricType IndexParameters_DistanceMetricType `protobuf:"varint,1,opt,name=metric_type,json=metricType,proto3,enum=IndexParameters_DistanceMetricType" json:"metric_type,omitempty"` - Nprobe int32 `protobuf:"varint,2,opt,name=nprobe,proto3" json:"nprobe,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricType IndexParameters_DistanceMetricType `protobuf:"varint,1,opt,name=metric_type,json=metricType,proto3,enum=IndexParameters_DistanceMetricType" json:"metric_type,omitempty"` + Nprobe int32 `protobuf:"varint,2,opt,name=nprobe,proto3" json:"nprobe,omitempty"` +} + +func (x *IndexParameters) Reset() { + *x = IndexParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IndexParameters) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IndexParameters) Reset() { *m = IndexParameters{} } func (*IndexParameters) ProtoMessage() {} -func (*IndexParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{23} -} -func (m *IndexParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexParameters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *IndexParameters) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *IndexParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexParameters.Merge(m, src) -} -func (m *IndexParameters) XXX_Size() int { - return m.Size() + +// Deprecated: Use IndexParameters.ProtoReflect.Descriptor instead. +func (*IndexParameters) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{23} } -func (m *IndexParameters) XXX_DiscardUnknown() { - xxx_messageInfo_IndexParameters.DiscardUnknown(m) + +func (x *IndexParameters) GetMetricType() IndexParameters_DistanceMetricType { + if x != nil { + return x.MetricType + } + return IndexParameters_InnerProduct } -var xxx_messageInfo_IndexParameters proto.InternalMessageInfo +func (x *IndexParameters) GetNprobe() int32 { + if x != nil { + return x.Nprobe + } + return 0 +} type SearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` ReqNum int32 `protobuf:"varint,2,opt,name=req_num,json=reqNum,proto3" json:"req_num,omitempty"` TopN int32 `protobuf:"varint,3,opt,name=topN,proto3" json:"topN,omitempty"` @@ -1299,11393 +1538,1416 @@ type SearchRequest struct { IsVectorValue bool `protobuf:"varint,16,opt,name=is_vector_value,json=isVectorValue,proto3" json:"is_vector_value,omitempty"` SortFieldMap map[string]string `protobuf:"bytes,17,rep,name=sort_field_map,json=sortFieldMap,proto3" json:"sort_field_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` SortFields []*SortField `protobuf:"bytes,18,rep,name=sort_fields,json=sortFields,proto3" json:"sort_fields,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *SearchRequest) Reset() { *m = SearchRequest{} } -func (*SearchRequest) ProtoMessage() {} -func (*SearchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{24} -} -func (m *SearchRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SearchRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *SearchRequest) Reset() { + *x = SearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *SearchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchRequest.Merge(m, src) -} -func (m *SearchRequest) XXX_Size() int { - return m.Size() + +func (x *SearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SearchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SearchRequest.DiscardUnknown(m) + +func (*SearchRequest) ProtoMessage() {} + +func (x *SearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SearchRequest proto.InternalMessageInfo +// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. +func (*SearchRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{24} +} -func (m *SearchRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *SearchRequest) GetHead() *RequestHead { + if x != nil { + return x.Head } return nil } -func (m *SearchRequest) GetReqNum() int32 { - if m != nil { - return m.ReqNum +func (x *SearchRequest) GetReqNum() int32 { + if x != nil { + return x.ReqNum } return 0 } -func (m *SearchRequest) GetTopN() int32 { - if m != nil { - return m.TopN +func (x *SearchRequest) GetTopN() int32 { + if x != nil { + return x.TopN } return 0 } -func (m *SearchRequest) GetIsBruteSearch() int32 { - if m != nil { - return m.IsBruteSearch +func (x *SearchRequest) GetIsBruteSearch() int32 { + if x != nil { + return x.IsBruteSearch } return 0 } -func (m *SearchRequest) GetVecFields() []*VectorQuery { - if m != nil { - return m.VecFields +func (x *SearchRequest) GetVecFields() []*VectorQuery { + if x != nil { + return x.VecFields } return nil } -func (m *SearchRequest) GetFields() []string { - if m != nil { - return m.Fields +func (x *SearchRequest) GetFields() []string { + if x != nil { + return x.Fields } return nil } -func (m *SearchRequest) GetRangeFilters() []*RangeFilter { - if m != nil { - return m.RangeFilters +func (x *SearchRequest) GetRangeFilters() []*RangeFilter { + if x != nil { + return x.RangeFilters } return nil } -func (m *SearchRequest) GetTermFilters() []*TermFilter { - if m != nil { - return m.TermFilters +func (x *SearchRequest) GetTermFilters() []*TermFilter { + if x != nil { + return x.TermFilters } return nil } -func (m *SearchRequest) GetOnlineLogLevel() string { - if m != nil { - return m.OnlineLogLevel +func (x *SearchRequest) GetOnlineLogLevel() string { + if x != nil { + return x.OnlineLogLevel } return "" } -func (m *SearchRequest) GetIndexParams() string { - if m != nil { - return m.IndexParams +func (x *SearchRequest) GetIndexParams() string { + if x != nil { + return x.IndexParams } return "" } -func (m *SearchRequest) GetHasRank() bool { - if m != nil { - return m.HasRank +func (x *SearchRequest) GetHasRank() bool { + if x != nil { + return x.HasRank } return false } -func (m *SearchRequest) GetMultiVectorRank() int32 { - if m != nil { - return m.MultiVectorRank +func (x *SearchRequest) GetMultiVectorRank() int32 { + if x != nil { + return x.MultiVectorRank } return 0 } -func (m *SearchRequest) GetParallelBasedOnQuery() bool { - if m != nil { - return m.ParallelBasedOnQuery +func (x *SearchRequest) GetParallelBasedOnQuery() bool { + if x != nil { + return x.ParallelBasedOnQuery } return false } -func (m *SearchRequest) GetL2Sqrt() bool { - if m != nil { - return m.L2Sqrt +func (x *SearchRequest) GetL2Sqrt() bool { + if x != nil { + return x.L2Sqrt } return false } -func (m *SearchRequest) GetIvfFlat() bool { - if m != nil { - return m.IvfFlat +func (x *SearchRequest) GetIvfFlat() bool { + if x != nil { + return x.IvfFlat } return false } -func (m *SearchRequest) GetIsVectorValue() bool { - if m != nil { - return m.IsVectorValue +func (x *SearchRequest) GetIsVectorValue() bool { + if x != nil { + return x.IsVectorValue } return false } -func (m *SearchRequest) GetSortFieldMap() map[string]string { - if m != nil { - return m.SortFieldMap +func (x *SearchRequest) GetSortFieldMap() map[string]string { + if x != nil { + return x.SortFieldMap } return nil } -func (m *SearchRequest) GetSortFields() []*SortField { - if m != nil { - return m.SortFields +func (x *SearchRequest) GetSortFields() []*SortField { + if x != nil { + return x.SortFields } return nil } type ResultItem struct { - Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` - Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` - Extra string `protobuf:"bytes,3,opt,name=extra,proto3" json:"extra,omitempty"` - PKey string `protobuf:"bytes,4,opt,name=p_key,json=pKey,proto3" json:"p_key,omitempty"` - Source []byte `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Score float64 `protobuf:"fixed64,1,opt,name=score,proto3" json:"score,omitempty"` + Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` + PKey string `protobuf:"bytes,3,opt,name=p_key,json=pKey,proto3" json:"p_key,omitempty"` + Source []byte `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` +} + +func (x *ResultItem) Reset() { + *x = ResultItem{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResultItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ResultItem) Reset() { *m = ResultItem{} } func (*ResultItem) ProtoMessage() {} -func (*ResultItem) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{25} -} -func (m *ResultItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResultItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResultItem.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err + +func (x *ResultItem) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ResultItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResultItem.Merge(m, src) + +// Deprecated: Use ResultItem.ProtoReflect.Descriptor instead. +func (*ResultItem) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{25} } -func (m *ResultItem) XXX_Size() int { - return m.Size() + +func (x *ResultItem) GetScore() float64 { + if x != nil { + return x.Score + } + return 0 } -func (m *ResultItem) XXX_DiscardUnknown() { - xxx_messageInfo_ResultItem.DiscardUnknown(m) + +func (x *ResultItem) GetFields() []*Field { + if x != nil { + return x.Fields + } + return nil } -var xxx_messageInfo_ResultItem proto.InternalMessageInfo +func (x *ResultItem) GetPKey() string { + if x != nil { + return x.PKey + } + return "" +} -type SearchResult struct { - TotalHits int32 `protobuf:"varint,1,opt,name=total_hits,json=totalHits,proto3" json:"total_hits,omitempty"` - MaxScore float64 `protobuf:"fixed64,2,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` - MaxTook int64 `protobuf:"varint,3,opt,name=max_took,json=maxTook,proto3" json:"max_took,omitempty"` - MaxTookId uint32 `protobuf:"varint,4,opt,name=max_took_id,json=maxTookId,proto3" json:"max_took_id,omitempty"` - Status *SearchStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` - Msg string `protobuf:"bytes,6,opt,name=msg,proto3" json:"msg,omitempty"` - ResultItems []*ResultItem `protobuf:"bytes,7,rep,name=result_items,json=resultItems,proto3" json:"result_items,omitempty"` - PID uint32 `protobuf:"varint,8,opt,name=pID,proto3" json:"pID,omitempty"` - Explain map[uint32]string `protobuf:"bytes,9,rep,name=explain,proto3" json:"explain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Timeout bool `protobuf:"varint,10,opt,name=timeout,proto3" json:"timeout,omitempty"` - TopN int32 `protobuf:"varint,11,opt,name=topN,proto3" json:"topN,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchResult) Reset() { *m = SearchResult{} } -func (*SearchResult) ProtoMessage() {} -func (*SearchResult) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{26} -} -func (m *SearchResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SearchResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SearchResult.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ResultItem) GetSource() []byte { + if x != nil { + return x.Source } + return nil } -func (m *SearchResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchResult.Merge(m, src) + +type SearchResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalHits int32 `protobuf:"varint,1,opt,name=total_hits,json=totalHits,proto3" json:"total_hits,omitempty"` + MaxScore float64 `protobuf:"fixed64,2,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` + MaxTook int64 `protobuf:"varint,3,opt,name=max_took,json=maxTook,proto3" json:"max_took,omitempty"` + MaxTookId uint32 `protobuf:"varint,4,opt,name=max_took_id,json=maxTookId,proto3" json:"max_took_id,omitempty"` + Status *SearchStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + Msg string `protobuf:"bytes,6,opt,name=msg,proto3" json:"msg,omitempty"` + ResultItems []*ResultItem `protobuf:"bytes,7,rep,name=result_items,json=resultItems,proto3" json:"result_items,omitempty"` + PID uint32 `protobuf:"varint,8,opt,name=pID,proto3" json:"pID,omitempty"` + Explain map[uint32]string `protobuf:"bytes,9,rep,name=explain,proto3" json:"explain,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Timeout bool `protobuf:"varint,10,opt,name=timeout,proto3" json:"timeout,omitempty"` + TopN int32 `protobuf:"varint,11,opt,name=topN,proto3" json:"topN,omitempty"` } -func (m *SearchResult) XXX_Size() int { - return m.Size() + +func (x *SearchResult) Reset() { + *x = SearchResult{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SearchResult) XXX_DiscardUnknown() { - xxx_messageInfo_SearchResult.DiscardUnknown(m) + +func (x *SearchResult) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_SearchResult proto.InternalMessageInfo +func (*SearchResult) ProtoMessage() {} -type SearchResponse struct { - Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - Results []*SearchResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` - OnlineLogMessage string `protobuf:"bytes,3,opt,name=online_log_message,json=onlineLogMessage,proto3" json:"online_log_message,omitempty"` - Timeout bool `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` - FlatBytes []byte `protobuf:"bytes,5,opt,name=FlatBytes,proto3" json:"FlatBytes,omitempty"` - SortFieldMap map[string]string `protobuf:"bytes,6,rep,name=sort_field_map,json=sortFieldMap,proto3" json:"sort_field_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - TopSize int32 `protobuf:"varint,7,opt,name=top_size,json=topSize,proto3" json:"top_size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchResponse) Reset() { *m = SearchResponse{} } -func (*SearchResponse) ProtoMessage() {} -func (*SearchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{27} -} -func (m *SearchResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SearchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SearchResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *SearchResult) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *SearchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchResponse.Merge(m, src) + +// Deprecated: Use SearchResult.ProtoReflect.Descriptor instead. +func (*SearchResult) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{26} } -func (m *SearchResponse) XXX_Size() int { - return m.Size() + +func (x *SearchResult) GetTotalHits() int32 { + if x != nil { + return x.TotalHits + } + return 0 } -func (m *SearchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SearchResponse.DiscardUnknown(m) + +func (x *SearchResult) GetMaxScore() float64 { + if x != nil { + return x.MaxScore + } + return 0 } -var xxx_messageInfo_SearchResponse proto.InternalMessageInfo +func (x *SearchResult) GetMaxTook() int64 { + if x != nil { + return x.MaxTook + } + return 0 +} -func (m *SearchResponse) GetHead() *ResponseHead { - if m != nil { - return m.Head +func (x *SearchResult) GetMaxTookId() uint32 { + if x != nil { + return x.MaxTookId } - return nil + return 0 } -func (m *SearchResponse) GetResults() []*SearchResult { - if m != nil { - return m.Results +func (x *SearchResult) GetStatus() *SearchStatus { + if x != nil { + return x.Status } return nil } -func (m *SearchResponse) GetOnlineLogMessage() string { - if m != nil { - return m.OnlineLogMessage +func (x *SearchResult) GetMsg() string { + if x != nil { + return x.Msg } return "" } -func (m *SearchResponse) GetTimeout() bool { - if m != nil { - return m.Timeout +func (x *SearchResult) GetResultItems() []*ResultItem { + if x != nil { + return x.ResultItems } - return false + return nil } -func (m *SearchResponse) GetFlatBytes() []byte { - if m != nil { - return m.FlatBytes +func (x *SearchResult) GetPID() uint32 { + if x != nil { + return x.PID } - return nil + return 0 } -func (m *SearchResponse) GetSortFieldMap() map[string]string { - if m != nil { - return m.SortFieldMap +func (x *SearchResult) GetExplain() map[uint32]string { + if x != nil { + return x.Explain } return nil } -func (m *SearchResponse) GetTopSize() int32 { - if m != nil { - return m.TopSize +func (x *SearchResult) GetTimeout() bool { + if x != nil { + return x.Timeout + } + return false +} + +func (x *SearchResult) GetTopN() int32 { + if x != nil { + return x.TopN } return 0 } -type SearchStatus struct { - Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Failed int32 `protobuf:"varint,2,opt,name=failed,proto3" json:"failed,omitempty"` - Successful int32 `protobuf:"varint,3,opt,name=successful,proto3" json:"successful,omitempty"` - Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type SearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Head *ResponseHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + Results []*SearchResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` + OnlineLogMessage string `protobuf:"bytes,3,opt,name=online_log_message,json=onlineLogMessage,proto3" json:"online_log_message,omitempty"` + Timeout bool `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + FlatBytes []byte `protobuf:"bytes,5,opt,name=FlatBytes,proto3" json:"FlatBytes,omitempty"` + SortFieldMap map[string]string `protobuf:"bytes,6,rep,name=sort_field_map,json=sortFieldMap,proto3" json:"sort_field_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TopSize int32 `protobuf:"varint,7,opt,name=top_size,json=topSize,proto3" json:"top_size,omitempty"` } -func (m *SearchStatus) Reset() { *m = SearchStatus{} } -func (*SearchStatus) ProtoMessage() {} -func (*SearchStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{28} -} -func (m *SearchStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SearchStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SearchStatus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *SearchResponse) Reset() { + *x = SearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *SearchStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchStatus.Merge(m, src) -} -func (m *SearchStatus) XXX_Size() int { - return m.Size() -} -func (m *SearchStatus) XXX_DiscardUnknown() { - xxx_messageInfo_SearchStatus.DiscardUnknown(m) -} -var xxx_messageInfo_SearchStatus proto.InternalMessageInfo - -type MSearchRequest struct { - Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` - SearchRequests []*SearchRequest `protobuf:"bytes,2,rep,name=search_requests,json=searchRequests,proto3" json:"search_requests,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *SearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MSearchRequest) Reset() { *m = MSearchRequest{} } -func (*MSearchRequest) ProtoMessage() {} -func (*MSearchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_535779cc1a17303a, []int{29} -} -func (m *MSearchRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MSearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MSearchRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (*SearchResponse) ProtoMessage() {} + +func (x *SearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } -} -func (m *MSearchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MSearchRequest.Merge(m, src) -} -func (m *MSearchRequest) XXX_Size() int { - return m.Size() -} -func (m *MSearchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MSearchRequest.DiscardUnknown(m) + return mi.MessageOf(x) } -var xxx_messageInfo_MSearchRequest proto.InternalMessageInfo +// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. +func (*SearchResponse) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{27} +} -func (m *MSearchRequest) GetHead() *RequestHead { - if m != nil { - return m.Head +func (x *SearchResponse) GetHead() *ResponseHead { + if x != nil { + return x.Head } return nil } -func (m *MSearchRequest) GetSearchRequests() []*SearchRequest { - if m != nil { - return m.SearchRequests +func (x *SearchResponse) GetResults() []*SearchResult { + if x != nil { + return x.Results } return nil } -func init() { - proto.RegisterEnum("IndexParameters_DistanceMetricType", IndexParameters_DistanceMetricType_name, IndexParameters_DistanceMetricType_value) - proto.RegisterType((*RequestHead)(nil), "RequestHead") - proto.RegisterMapType((map[string]string)(nil), "RequestHead.ParamsEntry") - proto.RegisterType((*ResponseHead)(nil), "ResponseHead") - proto.RegisterMapType((map[string]string)(nil), "ResponseHead.ParamsEntry") - proto.RegisterType((*GetRequest)(nil), "GetRequest") - proto.RegisterType((*DeleteRequest)(nil), "DeleteRequest") - proto.RegisterType((*AddRequest)(nil), "AddRequest") - proto.RegisterType((*UpdateRequest)(nil), "UpdateRequest") - proto.RegisterType((*BulkRequest)(nil), "BulkRequest") - proto.RegisterType((*ForceMergeRequest)(nil), "ForceMergeRequest") - proto.RegisterType((*FlushRequest)(nil), "FlushRequest") - proto.RegisterType((*IndexRequest)(nil), "IndexRequest") - proto.RegisterType((*GetResponse)(nil), "GetResponse") - proto.RegisterType((*AddResponse)(nil), "AddResponse") - proto.RegisterType((*UpdateResponse)(nil), "UpdateResponse") - proto.RegisterType((*DeleteResponse)(nil), "DeleteResponse") - proto.RegisterType((*BulkResponse)(nil), "BulkResponse") - proto.RegisterType((*ForceMergeResponse)(nil), "ForceMergeResponse") - proto.RegisterType((*DelByQueryeResponse)(nil), "DelByQueryeResponse") - proto.RegisterType((*FlushResponse)(nil), "FlushResponse") - proto.RegisterType((*IndexResponse)(nil), "IndexResponse") - proto.RegisterType((*TermFilter)(nil), "TermFilter") - proto.RegisterType((*RangeFilter)(nil), "RangeFilter") - proto.RegisterType((*SortField)(nil), "SortField") - proto.RegisterType((*VectorQuery)(nil), "VectorQuery") - proto.RegisterType((*IndexParameters)(nil), "IndexParameters") - proto.RegisterType((*SearchRequest)(nil), "SearchRequest") - proto.RegisterMapType((map[string]string)(nil), "SearchRequest.SortFieldMapEntry") - proto.RegisterType((*ResultItem)(nil), "ResultItem") - proto.RegisterType((*SearchResult)(nil), "SearchResult") - proto.RegisterMapType((map[uint32]string)(nil), "SearchResult.ExplainEntry") - proto.RegisterType((*SearchResponse)(nil), "SearchResponse") - proto.RegisterMapType((map[string]string)(nil), "SearchResponse.SortFieldMapEntry") - proto.RegisterType((*SearchStatus)(nil), "SearchStatus") - proto.RegisterType((*MSearchRequest)(nil), "MSearchRequest") -} - -func init() { proto.RegisterFile("router_grpc.proto", fileDescriptor_535779cc1a17303a) } - -var fileDescriptor_535779cc1a17303a = []byte{ - // 2026 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x6c, 0x1b, 0xc7, - 0x15, 0xe6, 0x8a, 0xe2, 0xdf, 0x5b, 0x92, 0x92, 0xc6, 0x46, 0x4c, 0xd3, 0x0d, 0x25, 0x33, 0x48, - 0x6b, 0xd4, 0xcd, 0xba, 0x51, 0x9b, 0xb6, 0x71, 0x0f, 0x6d, 0x14, 0x59, 0xb6, 0x11, 0xcb, 0x71, - 0x46, 0xb2, 0x03, 0xe4, 0xb2, 0x58, 0xee, 0x8e, 0xa8, 0x85, 0x76, 0x77, 0x56, 0x33, 0xb3, 0x8a, - 0x98, 0x53, 0x2f, 0x05, 0x8a, 0xdc, 0x7a, 0x29, 0x7a, 0x6b, 0x8e, 0x3d, 0x14, 0xe8, 0xb5, 0xc7, - 0x1e, 0x73, 0xec, 0xb1, 0x40, 0x2f, 0xb1, 0x7a, 0x2e, 0xd0, 0x63, 0x8f, 0xc5, 0xbc, 0x19, 0x92, - 0x4b, 0x3b, 0xad, 0x69, 0xc0, 0x3e, 0x71, 0xde, 0xef, 0xbe, 0x99, 0xf9, 0xde, 0xcf, 0x10, 0x36, - 0x04, 0x2f, 0x14, 0x13, 0xfe, 0x58, 0xe4, 0xa1, 0x97, 0x0b, 0xae, 0x78, 0x7f, 0x3d, 0x0a, 0x54, - 0xe0, 0xa7, 0x3c, 0x62, 0x89, 0xe5, 0xb4, 0x99, 0x10, 0x5c, 0x48, 0x4b, 0xbd, 0x33, 0x8e, 0xd5, - 0x71, 0x31, 0xf2, 0x42, 0x9e, 0xde, 0x1a, 0xf3, 0x31, 0xbf, 0x85, 0xec, 0x51, 0x71, 0x84, 0x14, - 0x12, 0xb8, 0x32, 0xea, 0xc3, 0x3f, 0xad, 0x80, 0x4b, 0xd9, 0x69, 0xc1, 0xa4, 0xba, 0xc7, 0x82, - 0x88, 0x0c, 0xc0, 0x55, 0x71, 0xca, 0x7c, 0x5e, 0x28, 0x3f, 0x95, 0x3d, 0x67, 0xcb, 0xb9, 0x51, - 0xa5, 0x2d, 0xcd, 0xfa, 0xb8, 0x50, 0xfb, 0x92, 0x5c, 0x83, 0x56, 0x21, 0x99, 0xf0, 0xb3, 0x20, - 0x65, 0xbd, 0x95, 0x2d, 0xe7, 0x46, 0x8b, 0x36, 0x35, 0xe3, 0x61, 0x90, 0x32, 0xd2, 0x87, 0x66, - 0x1e, 0x48, 0xf9, 0x39, 0x17, 0x51, 0xaf, 0x6a, 0x64, 0x53, 0x9a, 0x5c, 0x81, 0x46, 0x34, 0x32, - 0x66, 0xab, 0x28, 0xaa, 0x47, 0x23, 0x34, 0x7a, 0x13, 0x40, 0xe6, 0x41, 0xc8, 0x8c, 0xac, 0x86, - 0xb2, 0x16, 0x72, 0x50, 0xbc, 0x09, 0x6e, 0x98, 0xc4, 0x2c, 0x53, 0xbe, 0x9a, 0xe4, 0xac, 0x57, - 0x47, 0x39, 0x18, 0xd6, 0xe1, 0x24, 0x67, 0xe4, 0x87, 0x50, 0xcf, 0x03, 0x11, 0xa4, 0xb2, 0xd7, - 0xd8, 0xaa, 0xde, 0x70, 0xb7, 0x7b, 0x5e, 0x69, 0x3f, 0xde, 0x23, 0x14, 0xdd, 0xc9, 0x94, 0x98, - 0x50, 0xab, 0xd7, 0x7f, 0x1f, 0xdc, 0x12, 0x9b, 0xac, 0x43, 0xf5, 0x84, 0x4d, 0x70, 0xab, 0x2d, - 0xaa, 0x97, 0xe4, 0x32, 0xd4, 0xce, 0x82, 0xa4, 0x98, 0x6e, 0xd0, 0x10, 0xb7, 0x57, 0x7e, 0xe6, - 0x0c, 0x7f, 0xe7, 0x40, 0x9b, 0x32, 0x99, 0xf3, 0x4c, 0x32, 0x3c, 0xaf, 0x1e, 0x54, 0x99, 0x10, - 0x68, 0xec, 0x6e, 0xd7, 0xbd, 0x3b, 0xfa, 0x2a, 0xa8, 0x66, 0x91, 0x77, 0x67, 0x71, 0x55, 0x31, - 0xae, 0xab, 0x5e, 0xd9, 0xf0, 0x55, 0x07, 0xf6, 0x29, 0xc0, 0x5d, 0xa6, 0xec, 0xce, 0xc9, 0x16, - 0xac, 0x1e, 0xb3, 0x20, 0xb2, 0x61, 0xb5, 0xcb, 0x27, 0x42, 0x51, 0x42, 0xae, 0x43, 0x3b, 0x17, - 0x71, 0x1a, 0x88, 0x89, 0x7f, 0xc2, 0x26, 0xb2, 0xb7, 0xba, 0x55, 0xbd, 0xd1, 0xa2, 0xae, 0xe5, - 0x7d, 0xc4, 0x26, 0xf2, 0xf6, 0xea, 0x6f, 0xbe, 0xda, 0x74, 0x86, 0x9f, 0x41, 0x67, 0x97, 0x25, - 0x4c, 0xb1, 0xd7, 0xe0, 0xfb, 0x13, 0x80, 0x0f, 0xa2, 0x68, 0x79, 0xc7, 0xd7, 0xa0, 0x1a, 0xf1, - 0x10, 0xf1, 0xe3, 0x6e, 0xb7, 0xbc, 0x5d, 0x1e, 0x16, 0x29, 0xcb, 0x14, 0xd5, 0x5c, 0xeb, 0xf2, - 0x10, 0x3a, 0x8f, 0xf3, 0x28, 0x78, 0x99, 0x70, 0x97, 0xf2, 0xea, 0xee, 0x14, 0xc9, 0xc9, 0xf2, - 0x3e, 0xdf, 0x84, 0xd5, 0x88, 0x87, 0x66, 0xeb, 0x0b, 0x4e, 0x91, 0x6d, 0xbd, 0xfe, 0x1c, 0x36, - 0xf6, 0xb8, 0x08, 0xd9, 0x3e, 0x13, 0xe3, 0xe5, 0xe3, 0xb5, 0xc6, 0x3f, 0x81, 0xf6, 0x5e, 0x52, - 0xc8, 0xe3, 0x97, 0xb5, 0xfb, 0x83, 0x03, 0xed, 0xfb, 0x59, 0xc4, 0xce, 0x97, 0xdf, 0x8c, 0x07, - 0x97, 0x22, 0xc1, 0x73, 0x7f, 0xc4, 0x8e, 0xb8, 0x60, 0xbe, 0x60, 0xa3, 0x22, 0x4e, 0x22, 0xc4, - 0x60, 0x95, 0x6e, 0x68, 0xd1, 0x0e, 0x4a, 0xa8, 0x11, 0xe8, 0x1a, 0x91, 0xc4, 0x69, 0xac, 0xfc, - 0x30, 0x2f, 0xb0, 0x0e, 0x54, 0x69, 0x13, 0x19, 0x1f, 0xe6, 0x85, 0xae, 0x11, 0x11, 0x93, 0xa1, - 0x88, 0x47, 0xa6, 0x10, 0x54, 0xe9, 0x8c, 0xb6, 0x11, 0x1e, 0x80, 0x8b, 0x50, 0x36, 0xc9, 0x42, - 0xae, 0x2f, 0xc4, 0xd7, 0x59, 0xc8, 0xa2, 0xd9, 0x0d, 0xd6, 0x62, 0xc5, 0x52, 0xd9, 0x5b, 0xc1, - 0xe3, 0xae, 0x79, 0xf7, 0x15, 0x4b, 0xa9, 0xe1, 0x59, 0xa7, 0x9f, 0x82, 0x8b, 0x50, 0x5b, 0xde, - 0xe9, 0x26, 0xb8, 0x25, 0x14, 0xdb, 0xa2, 0x05, 0x73, 0x10, 0x5b, 0xc7, 0xef, 0x43, 0x77, 0x0a, - 0xb8, 0xa5, 0x7d, 0x5b, 0xd3, 0x27, 0xd0, 0x9d, 0xa6, 0xd6, 0x2b, 0xdd, 0xeb, 0x21, 0xb4, 0x0d, - 0x5a, 0x5f, 0xa9, 0xd7, 0x08, 0x48, 0x19, 0xad, 0xcb, 0xfb, 0x7e, 0x1b, 0xea, 0xf2, 0x38, 0x10, - 0x91, 0x44, 0xc4, 0x68, 0xa5, 0x03, 0x16, 0x88, 0xf0, 0xf8, 0x40, 0x05, 0xaa, 0x90, 0xd4, 0x0a, - 0xed, 0x57, 0xbe, 0x74, 0xe0, 0xd2, 0x2e, 0x4b, 0x76, 0x26, 0x9f, 0x14, 0x4c, 0x4c, 0x5e, 0xea, - 0x3b, 0x6f, 0x40, 0x7d, 0x97, 0x25, 0x0f, 0x8b, 0x14, 0xbf, 0x53, 0xa3, 0x96, 0xd2, 0x9d, 0x27, - 0x8e, 0xa4, 0x2f, 0x95, 0xc0, 0x4a, 0xdc, 0xa2, 0xf5, 0x38, 0x92, 0x07, 0x4a, 0x90, 0xab, 0xd0, - 0xd4, 0x82, 0x84, 0x67, 0x63, 0x4c, 0xd4, 0x2a, 0xd5, 0x8a, 0x0f, 0x78, 0x36, 0xb6, 0xc1, 0xf8, - 0xd0, 0xb1, 0x39, 0xf6, 0x9a, 0x76, 0xeb, 0x43, 0xc7, 0xe6, 0xe2, 0x6b, 0xfa, 0xc0, 0x01, 0xc0, - 0x21, 0x13, 0xe9, 0x5e, 0x9c, 0x28, 0x26, 0x74, 0xfb, 0x38, 0x8a, 0x59, 0x12, 0xd9, 0x96, 0x62, - 0x88, 0xc5, 0xa6, 0xd2, 0xb6, 0x4d, 0x05, 0x0f, 0x47, 0xfa, 0x45, 0x16, 0xf3, 0x0c, 0x73, 0xb8, - 0x46, 0x1b, 0xb1, 0x7c, 0xac, 0xc9, 0xe1, 0x9f, 0x1d, 0x70, 0x69, 0x90, 0x8d, 0xd9, 0xff, 0x75, - 0xbb, 0x09, 0x6e, 0xc2, 0x3f, 0x67, 0xc2, 0x2f, 0x3b, 0x07, 0x64, 0x3d, 0xc1, 0x2f, 0x6c, 0x82, - 0x5b, 0xe4, 0xf9, 0x4c, 0xa1, 0x6a, 0x14, 0x90, 0x65, 0x14, 0xde, 0x82, 0x4e, 0x9c, 0x85, 0x49, - 0x11, 0x31, 0x1f, 0xcd, 0x30, 0x07, 0x9b, 0xb4, 0x6d, 0x99, 0x0f, 0x34, 0xaf, 0xac, 0x84, 0xa6, - 0x38, 0x41, 0xcc, 0x95, 0x1e, 0x6b, 0xde, 0xf0, 0x3d, 0x68, 0x1d, 0x70, 0xa1, 0xf6, 0xa6, 0xfb, - 0xfd, 0x96, 0x70, 0x09, 0xac, 0xe2, 0x80, 0xb1, 0x82, 0xe6, 0xb8, 0x1e, 0xfe, 0xc3, 0x01, 0xf7, - 0x09, 0x0b, 0x15, 0x17, 0x88, 0x46, 0xad, 0x83, 0x43, 0x8a, 0x31, 0xc4, 0xf5, 0xff, 0x38, 0xbd, - 0x6b, 0xd0, 0x4a, 0xe3, 0xcc, 0x97, 0x21, 0x17, 0x66, 0x67, 0x0e, 0x6d, 0xa6, 0x71, 0x76, 0xa0, - 0x69, 0x14, 0x06, 0xe7, 0x56, 0xb8, 0x6a, 0x85, 0xc1, 0xb9, 0x11, 0x5e, 0x86, 0xda, 0x88, 0x73, - 0xa9, 0x70, 0x1f, 0x0e, 0x35, 0x84, 0x36, 0x39, 0x0e, 0xa4, 0x6f, 0x24, 0x75, 0xbc, 0x8e, 0xe6, - 0x71, 0x20, 0x77, 0x50, 0xf8, 0x06, 0xd4, 0x8f, 0xb8, 0x48, 0x03, 0xd5, 0x6b, 0x98, 0xc9, 0xca, - 0x50, 0x7a, 0xb2, 0x8a, 0x35, 0xba, 0xcc, 0xe4, 0xd4, 0x34, 0x93, 0x15, 0x72, 0xf4, 0xe0, 0xa4, - 0x3b, 0xc1, 0x1a, 0xa2, 0x0f, 0x67, 0x0e, 0xa6, 0x98, 0x90, 0x64, 0x17, 0xdc, 0x94, 0x29, 0x11, - 0x87, 0xc6, 0x46, 0x6f, 0xb4, 0xbb, 0xfd, 0x96, 0xf7, 0x8c, 0x9a, 0xb7, 0x1b, 0x4b, 0x15, 0x64, - 0xba, 0x16, 0x68, 0x5d, 0xed, 0x8d, 0x42, 0x3a, 0x5b, 0xeb, 0x80, 0xb2, 0x5c, 0xf0, 0x11, 0x9b, - 0x66, 0xa2, 0xa1, 0x86, 0x1e, 0x90, 0xe7, 0x2d, 0xc9, 0xba, 0x6e, 0x48, 0x19, 0x13, 0x8f, 0x04, - 0x8f, 0x8a, 0x50, 0xad, 0x57, 0x48, 0x1d, 0x56, 0x1e, 0x6c, 0xaf, 0x3b, 0xc3, 0xdf, 0xd6, 0xa1, - 0x63, 0xc0, 0xbd, 0x7c, 0xb3, 0xba, 0x02, 0x0d, 0xc1, 0x4e, 0xfd, 0x6c, 0x5e, 0x06, 0x04, 0x3b, - 0xd5, 0x65, 0x40, 0x5f, 0x30, 0xcf, 0x1f, 0x5a, 0x30, 0xe3, 0x9a, 0x7c, 0x17, 0xd6, 0x62, 0xe9, - 0x8f, 0x44, 0xa1, 0x98, 0x2f, 0xf1, 0x43, 0x78, 0x1f, 0x35, 0xda, 0x89, 0xe5, 0x8e, 0xe6, 0x9a, - 0xaf, 0x93, 0x9b, 0x00, 0x67, 0x2c, 0xf4, 0x11, 0x29, 0xb2, 0x57, 0xc3, 0x1a, 0xd9, 0xf6, 0x4a, - 0xd0, 0xa0, 0xad, 0x33, 0x16, 0x22, 0xbc, 0x24, 0x5e, 0x87, 0x51, 0xac, 0x9b, 0x72, 0x63, 0x28, - 0xf2, 0x2e, 0x74, 0x84, 0xce, 0x1a, 0xff, 0x08, 0xd3, 0x66, 0x3a, 0xaf, 0xb6, 0xbd, 0x52, 0x2e, - 0xd1, 0xb6, 0x98, 0x13, 0x92, 0x78, 0xd0, 0x56, 0x4c, 0xa4, 0x33, 0x8b, 0x26, 0x5a, 0xb8, 0xde, - 0x3c, 0xa7, 0xa9, 0xab, 0x66, 0x6b, 0x49, 0x6e, 0xc0, 0x3a, 0xcf, 0x92, 0x38, 0xd3, 0x09, 0x33, - 0xf6, 0x13, 0x76, 0xc6, 0x92, 0x5e, 0x0b, 0xef, 0xbd, 0x6b, 0xf8, 0x0f, 0xf8, 0xf8, 0x81, 0xe6, - 0xea, 0x19, 0xcd, 0x60, 0xc3, 0xce, 0xa8, 0x80, 0x5a, 0x6e, 0x3c, 0xbb, 0x68, 0xa9, 0x2b, 0x80, - 0xc6, 0x9c, 0x08, 0xb2, 0x93, 0x9e, 0x8b, 0x59, 0xd1, 0x38, 0x0e, 0x24, 0x0d, 0xb2, 0x13, 0xf2, - 0x7d, 0xd8, 0x48, 0x8b, 0x44, 0xc5, 0xfe, 0x19, 0x1e, 0x81, 0xd1, 0x69, 0xe3, 0xc9, 0xad, 0xa1, - 0xc0, 0x1c, 0x0d, 0xea, 0xbe, 0x07, 0x57, 0xf4, 0x37, 0x92, 0x84, 0x25, 0xfe, 0x28, 0x90, 0x2c, - 0xf2, 0x79, 0xe6, 0x9f, 0xea, 0x43, 0xeb, 0x75, 0xd0, 0xeb, 0xe5, 0xa9, 0x78, 0x47, 0x4b, 0x3f, - 0xce, 0x4c, 0xae, 0x5d, 0x81, 0x46, 0xb2, 0xed, 0xcb, 0x53, 0xa1, 0x7a, 0x5d, 0x54, 0xab, 0x27, - 0xdb, 0x07, 0xa7, 0x42, 0x61, 0x61, 0x3a, 0x3b, 0xf2, 0x8f, 0x92, 0x40, 0xf5, 0xd6, 0x4c, 0x58, - 0xf1, 0xd9, 0xd1, 0x5e, 0x12, 0x28, 0x7b, 0x9d, 0x36, 0x26, 0x93, 0x95, 0xeb, 0xa8, 0xd1, 0x89, - 0xa5, 0x89, 0xc8, 0x14, 0x96, 0x3d, 0xe8, 0x4a, 0x2e, 0x94, 0xb9, 0x4f, 0x3f, 0x0d, 0xf2, 0xde, - 0x06, 0x1e, 0xec, 0x96, 0xb7, 0x80, 0x36, 0x6f, 0x56, 0x33, 0xf6, 0x83, 0xdc, 0x4c, 0xea, 0x6d, - 0x59, 0x62, 0x91, 0x9b, 0xe0, 0xce, 0xfd, 0xc8, 0x1e, 0x41, 0x27, 0x30, 0x37, 0xa3, 0x30, 0x53, - 0x97, 0xfd, 0x5f, 0xc0, 0xc6, 0x73, 0xfe, 0x5e, 0x66, 0xc4, 0xb7, 0x15, 0xfd, 0xd7, 0x0e, 0x00, - 0x65, 0xb2, 0x48, 0x94, 0x6e, 0xd1, 0x5a, 0xdd, 0xd4, 0x11, 0xc7, 0x94, 0x0b, 0x24, 0xc8, 0x60, - 0x06, 0x41, 0xd3, 0xcf, 0xeb, 0x9e, 0x89, 0x67, 0x0a, 0xc5, 0xcb, 0x50, 0x63, 0xe7, 0x4a, 0x04, - 0xf6, 0x95, 0x66, 0x08, 0x72, 0x09, 0x6a, 0x79, 0x69, 0xd6, 0x59, 0xcd, 0x3f, 0x62, 0x13, 0x8d, - 0x66, 0xc9, 0x0b, 0x11, 0x9a, 0xa7, 0x59, 0x9b, 0x5a, 0x6a, 0xf8, 0x55, 0x15, 0xda, 0xd3, 0xd3, - 0xd2, 0xd1, 0xe8, 0x6a, 0xa3, 0xb8, 0x0a, 0x12, 0xff, 0x38, 0x56, 0xe6, 0xe1, 0x58, 0xa3, 0x2d, - 0xe4, 0xdc, 0x8b, 0x95, 0x5c, 0x2c, 0x7a, 0x2b, 0xcf, 0x14, 0xbd, 0xab, 0xa0, 0xd7, 0xbe, 0xe2, - 0xfc, 0xc4, 0x0e, 0x8c, 0x8d, 0x34, 0x38, 0x3f, 0xe4, 0xfc, 0x44, 0x3f, 0x48, 0xa7, 0x22, 0x3f, - 0x8e, 0x30, 0xb4, 0x0e, 0x6d, 0x59, 0xe9, 0x7d, 0xd3, 0x0e, 0xb1, 0xf3, 0x61, 0x7c, 0xdf, 0xd2, - 0x0e, 0xf1, 0x57, 0x1f, 0x74, 0x2a, 0xc7, 0xf6, 0xf9, 0xa8, 0x97, 0x3a, 0xb7, 0x04, 0x46, 0xee, - 0x9b, 0xc9, 0xa7, 0x61, 0x73, 0x6b, 0x7e, 0xb8, 0xd4, 0x15, 0xb3, 0x35, 0x7a, 0xc8, 0xef, 0xef, - 0x62, 0x19, 0xed, 0x50, 0xbd, 0x24, 0x3f, 0x86, 0x06, 0x3b, 0xcf, 0x93, 0x20, 0xce, 0x7a, 0x2d, - 0x34, 0xee, 0x7b, 0xe5, 0x13, 0xf1, 0xee, 0x18, 0xa1, 0x41, 0xce, 0x54, 0x95, 0xf4, 0xa0, 0xa1, - 0x9f, 0xd3, 0xbc, 0x50, 0x98, 0x74, 0x4d, 0x3a, 0x25, 0x67, 0x15, 0xca, 0x9d, 0x57, 0xa8, 0xfe, - 0x6d, 0x68, 0x97, 0xdd, 0x94, 0x01, 0xd3, 0x79, 0xd1, 0x9b, 0xf0, 0x5f, 0x2b, 0xd0, 0x9d, 0x05, - 0xb4, 0xf4, 0x7c, 0xf1, 0x3d, 0x5d, 0x40, 0x75, 0xfc, 0x53, 0xf0, 0x74, 0x16, 0x76, 0x45, 0xa7, - 0x52, 0xf2, 0x03, 0x20, 0xa5, 0x62, 0x93, 0x32, 0x29, 0x83, 0x31, 0xb3, 0x88, 0x5a, 0x9f, 0x95, - 0x9b, 0x7d, 0xc3, 0x2f, 0x6f, 0x7b, 0x75, 0x71, 0xdb, 0xdf, 0x81, 0x96, 0xce, 0xde, 0x9d, 0x89, - 0x62, 0xd2, 0x82, 0x6c, 0xce, 0x20, 0x77, 0x9f, 0xcb, 0xd5, 0x3a, 0x46, 0x75, 0xdd, 0x5b, 0xdc, - 0xda, 0x0b, 0x93, 0xf5, 0x2a, 0x34, 0x15, 0xcf, 0x7d, 0x19, 0x7f, 0xc1, 0xb0, 0x4f, 0xd6, 0x68, - 0x43, 0xf1, 0xfc, 0x20, 0xfe, 0x82, 0xbd, 0xaa, 0xd4, 0xcc, 0xa6, 0x19, 0x61, 0xb0, 0xa7, 0xf5, - 0x11, 0xff, 0x36, 0x19, 0x0c, 0x81, 0xed, 0x21, 0x88, 0x13, 0x16, 0x4d, 0xfb, 0x93, 0xa1, 0xc8, - 0x00, 0x40, 0x16, 0x61, 0xc8, 0xa4, 0x3c, 0x2a, 0x12, 0xdb, 0xa5, 0x4a, 0x9c, 0x29, 0x82, 0x57, - 0x67, 0x08, 0x1e, 0x9e, 0x42, 0x77, 0xff, 0x65, 0xdb, 0xe3, 0x4f, 0x61, 0xcd, 0x34, 0x3a, 0x5f, - 0x18, 0xd9, 0xf4, 0x96, 0xbb, 0x8b, 0xb5, 0x8f, 0x76, 0x65, 0x99, 0xb4, 0xf3, 0xe4, 0xf6, 0x97, - 0x55, 0xd8, 0xa0, 0xf8, 0x9f, 0xd4, 0x5d, 0xfa, 0xe8, 0xc3, 0x03, 0x26, 0xce, 0xe2, 0x90, 0x91, - 0x21, 0x54, 0xef, 0x32, 0x45, 0x5c, 0x6f, 0xfe, 0x17, 0x44, 0xbf, 0xed, 0x95, 0x1e, 0x71, 0xc3, - 0x8a, 0xd6, 0xf9, 0x20, 0x8a, 0x88, 0xeb, 0xcd, 0x5f, 0xfc, 0xfd, 0xb6, 0x57, 0x7a, 0x93, 0x0d, - 0x2b, 0xe4, 0x26, 0x4e, 0xf0, 0x4c, 0x31, 0xd2, 0xf5, 0x16, 0xfe, 0x74, 0xe8, 0xaf, 0x79, 0x8b, - 0x2f, 0x25, 0xa3, 0x6c, 0x1e, 0x5e, 0xa4, 0xeb, 0x2d, 0x3c, 0xf9, 0xfb, 0x6b, 0xde, 0xe2, 0x8b, - 0xcc, 0x28, 0xdb, 0x56, 0xfe, 0xcc, 0x3e, 0xfb, 0x6b, 0xcf, 0xe0, 0x68, 0x58, 0x21, 0x6f, 0xc3, - 0xaa, 0x7e, 0x3f, 0x91, 0xb6, 0x57, 0x7a, 0xf4, 0xf7, 0x3b, 0x5e, 0xf9, 0x51, 0x35, 0xac, 0x90, - 0x77, 0xa0, 0x61, 0x8f, 0x9f, 0xac, 0x79, 0xfb, 0x2f, 0xf4, 0xba, 0x09, 0xb5, 0x83, 0x3c, 0x08, - 0x19, 0x59, 0xb8, 0x96, 0x7e, 0xdd, 0x3b, 0x0c, 0x46, 0x89, 0x56, 0xb8, 0x05, 0x60, 0x8c, 0x76, - 0x26, 0xf7, 0x77, 0x97, 0x88, 0x73, 0xe7, 0x97, 0x5f, 0x3f, 0x1d, 0x54, 0xfe, 0xfe, 0x74, 0x50, - 0xf9, 0xe6, 0xe9, 0xa0, 0xf2, 0xef, 0xa7, 0x83, 0xca, 0x7f, 0x9e, 0x0e, 0x9c, 0x5f, 0x5d, 0x0c, - 0x9c, 0x3f, 0x5e, 0x0c, 0x9c, 0xbf, 0x5c, 0x0c, 0x2a, 0x7f, 0xbd, 0x18, 0x54, 0xbe, 0xbe, 0x18, - 0x38, 0x7f, 0xbb, 0x18, 0x38, 0xdf, 0x5c, 0x0c, 0x9c, 0xdf, 0xff, 0x73, 0x50, 0xb9, 0xe7, 0x7c, - 0xd6, 0x3c, 0x43, 0x4f, 0xf9, 0x68, 0x54, 0xc7, 0x3f, 0x01, 0x7f, 0xf4, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x99, 0x15, 0x96, 0x16, 0x68, 0x14, 0x00, 0x00, -} - -func (this *RequestHead) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RequestHead) - if !ok { - that2, ok := that.(RequestHead) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TimeOutMs != that1.TimeOutMs { - return false +func (x *SearchResponse) GetOnlineLogMessage() string { + if x != nil { + return x.OnlineLogMessage } - if this.UserName != that1.UserName { - return false + return "" +} + +func (x *SearchResponse) GetTimeout() bool { + if x != nil { + return x.Timeout } - if this.Password != that1.Password { - return false + return false +} + +func (x *SearchResponse) GetFlatBytes() []byte { + if x != nil { + return x.FlatBytes } - if this.DbName != that1.DbName { - return false + return nil +} + +func (x *SearchResponse) GetSortFieldMap() map[string]string { + if x != nil { + return x.SortFieldMap } - if this.SpaceName != that1.SpaceName { - return false + return nil +} + +func (x *SearchResponse) GetTopSize() int32 { + if x != nil { + return x.TopSize } - if this.ClientType != that1.ClientType { - return false - } - if len(this.Params) != len(that1.Params) { - return false - } - for i := range this.Params { - if this.Params[i] != that1.Params[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResponseHead) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ResponseHead) - if !ok { - that2, ok := that.(ResponseHead) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Err.Equal(that1.Err) { - return false - } - if len(this.Params) != len(that1.Params) { - return false - } - for i := range this.Params { - if this.Params[i] != that1.Params[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *GetRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetRequest) - if !ok { - that2, ok := that.(GetRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.PrimaryKeys) != len(that1.PrimaryKeys) { - return false - } - for i := range this.PrimaryKeys { - if this.PrimaryKeys[i] != that1.PrimaryKeys[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *DeleteRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DeleteRequest) - if !ok { - that2, ok := that.(DeleteRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.PrimaryKeys) != len(that1.PrimaryKeys) { - return false - } - for i := range this.PrimaryKeys { - if this.PrimaryKeys[i] != that1.PrimaryKeys[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AddRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AddRequest) - if !ok { - that2, ok := that.(AddRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !this.Doc.Equal(that1.Doc) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return 0 } -func (this *UpdateRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*UpdateRequest) - if !ok { - that2, ok := that.(UpdateRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !this.Doc.Equal(that1.Doc) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *BulkRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +type SearchStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields - that1, ok := that.(*BulkRequest) - if !ok { - that2, ok := that.(BulkRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.Docs) != len(that1.Docs) { - return false - } - for i := range this.Docs { - if !this.Docs[i].Equal(that1.Docs[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Failed int32 `protobuf:"varint,2,opt,name=failed,proto3" json:"failed,omitempty"` + Successful int32 `protobuf:"varint,3,opt,name=successful,proto3" json:"successful,omitempty"` + Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` } -func (this *ForceMergeRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ForceMergeRequest) - if !ok { - that2, ok := that.(ForceMergeRequest) - if ok { - that1 = &that2 - } else { - return false - } +func (x *SearchStatus) Reset() { + *x = SearchStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true } -func (this *FlushRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*FlushRequest) - if !ok { - that2, ok := that.(FlushRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true +func (x *SearchStatus) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *IndexRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*IndexRequest) - if !ok { - that2, ok := that.(IndexRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if this.DropBeforeRebuild != that1.DropBeforeRebuild { - return false - } - if this.LimitCpu != that1.LimitCpu { - return false - } - if this.Describe != that1.Describe { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *GetResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*SearchStatus) ProtoMessage() {} - that1, ok := that.(*GetResponse) - if !ok { - that2, ok := that.(GetResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.Items) != len(that1.Items) { - return false - } - for i := range this.Items { - if !this.Items[i].Equal(that1.Items[i]) { - return false +func (x *SearchStatus) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return mi.MessageOf(x) } -func (this *AddResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*AddResponse) - if !ok { - that2, ok := that.(AddResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if this.PrimaryKey != that1.PrimaryKey { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true +// Deprecated: Use SearchStatus.ProtoReflect.Descriptor instead. +func (*SearchStatus) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{28} } -func (this *UpdateResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*UpdateResponse) - if !ok { - that2, ok := that.(UpdateResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false +func (x *SearchStatus) GetTotal() int32 { + if x != nil { + return x.Total } - return true + return 0 } -func (this *DeleteResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DeleteResponse) - if !ok { - that2, ok := that.(DeleteResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +func (x *SearchStatus) GetFailed() int32 { + if x != nil { + return x.Failed } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.Items) != len(that1.Items) { - return false - } - for i := range this.Items { - if !this.Items[i].Equal(that1.Items[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return 0 } -func (this *BulkResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*BulkResponse) - if !ok { - that2, ok := that.(BulkResponse) - if ok { - that1 = &that2 - } else { - return false - } +func (x *SearchStatus) GetSuccessful() int32 { + if x != nil { + return x.Successful } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.Items) != len(that1.Items) { - return false - } - for i := range this.Items { - if !this.Items[i].Equal(that1.Items[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return 0 } -func (this *ForceMergeResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*ForceMergeResponse) - if !ok { - that2, ok := that.(ForceMergeResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !this.Shards.Equal(that1.Shards) { - return false +func (x *SearchStatus) GetMsg() string { + if x != nil { + return x.Msg } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return "" } -func (this *DelByQueryeResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*DelByQueryeResponse) - if !ok { - that2, ok := that.(DelByQueryeResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if this.DelNum != that1.DelNum { - return false - } - if len(this.IdsStr) != len(that1.IdsStr) { - return false - } - for i := range this.IdsStr { - if this.IdsStr[i] != that1.IdsStr[i] { - return false - } - } - if len(this.IdsLong) != len(that1.IdsLong) { - return false - } - for i := range this.IdsLong { - if this.IdsLong[i] != that1.IdsLong[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FlushResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +type MSearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields - that1, ok := that.(*FlushResponse) - if !ok { - that2, ok := that.(FlushResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if !this.Shards.Equal(that1.Shards) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + Head *RequestHead `protobuf:"bytes,1,opt,name=head,proto3" json:"head,omitempty"` + SearchRequests []*SearchRequest `protobuf:"bytes,2,rep,name=search_requests,json=searchRequests,proto3" json:"search_requests,omitempty"` } -func (this *IndexResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*IndexResponse) - if !ok { - that2, ok := that.(IndexResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false +func (x *MSearchRequest) Reset() { + *x = MSearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_router_grpc_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if !this.Shards.Equal(that1.Shards) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true } -func (this *TermFilter) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*TermFilter) - if !ok { - that2, ok := that.(TermFilter) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Field != that1.Field { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if this.IsUnion != that1.IsUnion { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true +func (x *MSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (this *RangeFilter) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*RangeFilter) - if !ok { - that2, ok := that.(RangeFilter) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Field != that1.Field { - return false - } - if !bytes.Equal(this.LowerValue, that1.LowerValue) { - return false - } - if !bytes.Equal(this.UpperValue, that1.UpperValue) { - return false - } - if this.IncludeLower != that1.IncludeLower { - return false - } - if this.IncludeUpper != that1.IncludeUpper { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SortField) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*MSearchRequest) ProtoMessage() {} - that1, ok := that.(*SortField) - if !ok { - that2, ok := that.(SortField) - if ok { - that1 = &that2 - } else { - return false +func (x *MSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_router_grpc_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Field != that1.Field { - return false - } - if this.Type != that1.Type { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return mi.MessageOf(x) } -func (this *VectorQuery) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*VectorQuery) - if !ok { - that2, ok := that.(VectorQuery) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if this.MinScore != that1.MinScore { - return false - } - if this.MaxScore != that1.MaxScore { - return false - } - if this.Boost != that1.Boost { - return false - } - if this.HasBoost != that1.HasBoost { - return false - } - if this.Format != that1.Format { - return false - } - if this.IndexType != that1.IndexType { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true +// Deprecated: Use MSearchRequest.ProtoReflect.Descriptor instead. +func (*MSearchRequest) Descriptor() ([]byte, []int) { + return file_router_grpc_proto_rawDescGZIP(), []int{29} +} + +func (x *MSearchRequest) GetHead() *RequestHead { + if x != nil { + return x.Head + } + return nil +} + +func (x *MSearchRequest) GetSearchRequests() []*SearchRequest { + if x != nil { + return x.SearchRequests + } + return nil +} + +var File_router_grpc_proto protoreflect.FileDescriptor + +var file_router_grpc_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x02, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x5f, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x4f, 0x75, + 0x74, 0x4d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x64, 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, + 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x96, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x06, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x31, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x51, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, + 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x54, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x4b, 0x65, 0x79, 0x73, 0x22, 0x4b, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, + 0x68, 0x65, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x64, 0x6f, + 0x63, 0x22, 0x4e, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, + 0x68, 0x65, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x03, 0x64, 0x6f, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x64, 0x6f, + 0x63, 0x22, 0x4e, 0x0a, 0x0b, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, + 0x61, 0x64, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x09, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x64, 0x6f, 0x63, + 0x73, 0x22, 0x35, 0x0a, 0x11, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0x30, 0x0a, 0x0c, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x0c, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, + 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x2e, 0x0a, + 0x13, 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, + 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x70, 0x75, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x70, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x22, 0x4d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, + 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x51, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, + 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x22, 0x33, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, + 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0x50, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, + 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, + 0x4e, 0x0a, 0x0c, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, + 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, + 0x5e, 0x0a, 0x12, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, + 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x22, + 0x84, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x65, + 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x44, 0x65, 0x6c, 0x4e, + 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64, 0x73, 0x53, 0x74, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x64, 0x73, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x69, + 0x64, 0x73, 0x4c, 0x6f, 0x6e, 0x67, 0x22, 0x59, 0x0a, 0x0d, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, + 0x73, 0x22, 0x59, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, + 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x64, 0x73, 0x22, 0x53, 0x0a, 0x0a, + 0x54, 0x65, 0x72, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x55, 0x6e, 0x69, 0x6f, + 0x6e, 0x22, 0xaf, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, + 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x75, + 0x70, 0x70, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x55, 0x70, + 0x70, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x0b, 0x56, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x53, 0x63, 0x6f, 0x72, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x62, + 0x6f, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x73, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x73, 0x42, 0x6f, 0x6f, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x54, 0x79, 0x70, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0b, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x23, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x6e, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x69, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x32, 0x10, 0x01, 0x22, 0x8b, 0x06, 0x0a, 0x0d, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, + 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x72, 0x65, 0x71, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x12, 0x26, 0x0a, 0x0f, 0x69, + 0x73, 0x5f, 0x62, 0x72, 0x75, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x73, 0x42, 0x72, 0x75, 0x74, 0x65, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x12, 0x2b, 0x0a, 0x0a, 0x76, 0x65, 0x63, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x09, 0x76, 0x65, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x31, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0c, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x0a, 0x0c, 0x74, + 0x65, 0x72, 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0b, + 0x74, 0x65, 0x72, 0x6d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x6f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x6f, 0x67, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, + 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x52, + 0x61, 0x6e, 0x6b, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x12, + 0x35, 0x0a, 0x17, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x5f, 0x62, 0x61, 0x73, 0x65, + 0x64, 0x5f, 0x6f, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x14, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x42, 0x61, 0x73, 0x65, 0x64, 0x4f, + 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x32, 0x5f, 0x73, 0x71, 0x72, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x32, 0x53, 0x71, 0x72, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x69, 0x76, 0x66, 0x5f, 0x66, 0x6c, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x69, 0x76, 0x66, 0x46, 0x6c, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x73, + 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x6f, + 0x72, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x12, 0x2b, 0x0a, 0x0b, 0x73, 0x6f, + 0x72, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x73, 0x6f, 0x72, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x6f, 0x72, 0x74, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6f, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x06, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x13, 0x0a, 0x05, + 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x4b, 0x65, + 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xa0, 0x03, 0x0a, 0x0c, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x5f, 0x68, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x48, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, + 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6d, 0x61, + 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, + 0x6f, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6f, + 0x6b, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6f, 0x6b, 0x49, + 0x64, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x2e, 0x0a, 0x0c, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0b, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x49, + 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x49, 0x44, 0x12, 0x34, 0x0a, 0x07, + 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x45, 0x78, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x61, + 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x6f, 0x70, 0x4e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, + 0x1a, 0x3a, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe7, 0x02, 0x0a, + 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x21, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, + 0x61, 0x64, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4c, + 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x46, 0x6c, 0x61, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x46, 0x6c, 0x61, 0x74, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x6f, + 0x72, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, + 0x70, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x6f, + 0x70, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x6f, 0x72, 0x74, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x61, + 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, + 0x75, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x66, 0x75, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x6b, 0x0a, 0x0e, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x37, 0x0a, 0x0f, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x32, 0x8a, 0x03, 0x0a, 0x11, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x47, 0x52, + 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x03, 0x47, 0x65, 0x74, + 0x12, 0x0b, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x22, 0x0a, + 0x03, 0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0c, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x2b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2b, + 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x06, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x0e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x25, 0x0a, 0x04, 0x42, 0x75, 0x6c, 0x6b, + 0x12, 0x0c, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, + 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x2d, 0x0a, 0x07, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x0f, 0x2e, 0x4d, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x1f, + 0x0a, 0x05, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x1a, 0x06, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x00, 0x12, + 0x2f, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x79, 0x49, 0x44, 0x12, 0x0e, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x0e, 0x48, 0x01, 0x5a, 0x0a, 0x2e, 0x2f, 0x76, 0x65, 0x61, 0x72, 0x63, 0x68, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (this *IndexParameters) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*IndexParameters) - if !ok { - that2, ok := that.(IndexParameters) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MetricType != that1.MetricType { - return false - } - if this.Nprobe != that1.Nprobe { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SearchRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +var ( + file_router_grpc_proto_rawDescOnce sync.Once + file_router_grpc_proto_rawDescData = file_router_grpc_proto_rawDesc +) - that1, ok := that.(*SearchRequest) - if !ok { - that2, ok := that.(SearchRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if this.ReqNum != that1.ReqNum { - return false - } - if this.TopN != that1.TopN { - return false - } - if this.IsBruteSearch != that1.IsBruteSearch { - return false - } - if len(this.VecFields) != len(that1.VecFields) { - return false - } - for i := range this.VecFields { - if !this.VecFields[i].Equal(that1.VecFields[i]) { - return false - } - } - if len(this.Fields) != len(that1.Fields) { - return false - } - for i := range this.Fields { - if this.Fields[i] != that1.Fields[i] { - return false - } - } - if len(this.RangeFilters) != len(that1.RangeFilters) { - return false - } - for i := range this.RangeFilters { - if !this.RangeFilters[i].Equal(that1.RangeFilters[i]) { - return false - } - } - if len(this.TermFilters) != len(that1.TermFilters) { - return false - } - for i := range this.TermFilters { - if !this.TermFilters[i].Equal(that1.TermFilters[i]) { - return false - } - } - if this.OnlineLogLevel != that1.OnlineLogLevel { - return false - } - if this.IndexParams != that1.IndexParams { - return false - } - if this.HasRank != that1.HasRank { - return false - } - if this.MultiVectorRank != that1.MultiVectorRank { - return false - } - if this.ParallelBasedOnQuery != that1.ParallelBasedOnQuery { - return false - } - if this.L2Sqrt != that1.L2Sqrt { - return false - } - if this.IvfFlat != that1.IvfFlat { - return false - } - if this.IsVectorValue != that1.IsVectorValue { - return false - } - if len(this.SortFieldMap) != len(that1.SortFieldMap) { - return false - } - for i := range this.SortFieldMap { - if this.SortFieldMap[i] != that1.SortFieldMap[i] { - return false - } - } - if len(this.SortFields) != len(that1.SortFields) { - return false - } - for i := range this.SortFields { - if !this.SortFields[i].Equal(that1.SortFields[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true +func file_router_grpc_proto_rawDescGZIP() []byte { + file_router_grpc_proto_rawDescOnce.Do(func() { + file_router_grpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_router_grpc_proto_rawDescData) + }) + return file_router_grpc_proto_rawDescData +} + +var file_router_grpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_router_grpc_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_router_grpc_proto_goTypes = []interface{}{ + (IndexParameters_DistanceMetricType)(0), // 0: IndexParameters.DistanceMetricType + (*RequestHead)(nil), // 1: RequestHead + (*ResponseHead)(nil), // 2: ResponseHead + (*GetRequest)(nil), // 3: GetRequest + (*DeleteRequest)(nil), // 4: DeleteRequest + (*AddRequest)(nil), // 5: AddRequest + (*UpdateRequest)(nil), // 6: UpdateRequest + (*BulkRequest)(nil), // 7: BulkRequest + (*ForceMergeRequest)(nil), // 8: ForceMergeRequest + (*FlushRequest)(nil), // 9: FlushRequest + (*IndexRequest)(nil), // 10: IndexRequest + (*GetResponse)(nil), // 11: GetResponse + (*AddResponse)(nil), // 12: AddResponse + (*UpdateResponse)(nil), // 13: UpdateResponse + (*DeleteResponse)(nil), // 14: DeleteResponse + (*BulkResponse)(nil), // 15: BulkResponse + (*ForceMergeResponse)(nil), // 16: ForceMergeResponse + (*DelByQueryeResponse)(nil), // 17: DelByQueryeResponse + (*FlushResponse)(nil), // 18: FlushResponse + (*IndexResponse)(nil), // 19: IndexResponse + (*TermFilter)(nil), // 20: TermFilter + (*RangeFilter)(nil), // 21: RangeFilter + (*SortField)(nil), // 22: SortField + (*VectorQuery)(nil), // 23: VectorQuery + (*IndexParameters)(nil), // 24: IndexParameters + (*SearchRequest)(nil), // 25: SearchRequest + (*ResultItem)(nil), // 26: ResultItem + (*SearchResult)(nil), // 27: SearchResult + (*SearchResponse)(nil), // 28: SearchResponse + (*SearchStatus)(nil), // 29: SearchStatus + (*MSearchRequest)(nil), // 30: MSearchRequest + nil, // 31: RequestHead.ParamsEntry + nil, // 32: ResponseHead.ParamsEntry + nil, // 33: SearchRequest.SortFieldMapEntry + nil, // 34: SearchResult.ExplainEntry + nil, // 35: SearchResponse.SortFieldMapEntry + (*Error)(nil), // 36: Error + (*Document)(nil), // 37: Document + (*Item)(nil), // 38: Item + (*Field)(nil), // 39: Field + (*Table)(nil), // 40: Table +} +var file_router_grpc_proto_depIdxs = []int32{ + 31, // 0: RequestHead.params:type_name -> RequestHead.ParamsEntry + 36, // 1: ResponseHead.err:type_name -> Error + 32, // 2: ResponseHead.params:type_name -> ResponseHead.ParamsEntry + 1, // 3: GetRequest.head:type_name -> RequestHead + 1, // 4: DeleteRequest.head:type_name -> RequestHead + 1, // 5: AddRequest.head:type_name -> RequestHead + 37, // 6: AddRequest.doc:type_name -> Document + 1, // 7: UpdateRequest.head:type_name -> RequestHead + 37, // 8: UpdateRequest.doc:type_name -> Document + 1, // 9: BulkRequest.head:type_name -> RequestHead + 37, // 10: BulkRequest.docs:type_name -> Document + 1, // 11: ForceMergeRequest.head:type_name -> RequestHead + 1, // 12: FlushRequest.head:type_name -> RequestHead + 1, // 13: IndexRequest.head:type_name -> RequestHead + 2, // 14: GetResponse.head:type_name -> ResponseHead + 38, // 15: GetResponse.items:type_name -> Item + 2, // 16: AddResponse.head:type_name -> ResponseHead + 2, // 17: UpdateResponse.head:type_name -> ResponseHead + 2, // 18: DeleteResponse.head:type_name -> ResponseHead + 38, // 19: DeleteResponse.items:type_name -> Item + 2, // 20: BulkResponse.head:type_name -> ResponseHead + 38, // 21: BulkResponse.items:type_name -> Item + 2, // 22: ForceMergeResponse.head:type_name -> ResponseHead + 29, // 23: ForceMergeResponse.shards:type_name -> SearchStatus + 2, // 24: DelByQueryeResponse.head:type_name -> ResponseHead + 2, // 25: FlushResponse.head:type_name -> ResponseHead + 29, // 26: FlushResponse.shards:type_name -> SearchStatus + 2, // 27: IndexResponse.head:type_name -> ResponseHead + 29, // 28: IndexResponse.shards:type_name -> SearchStatus + 0, // 29: IndexParameters.metric_type:type_name -> IndexParameters.DistanceMetricType + 1, // 30: SearchRequest.head:type_name -> RequestHead + 23, // 31: SearchRequest.vec_fields:type_name -> VectorQuery + 21, // 32: SearchRequest.range_filters:type_name -> RangeFilter + 20, // 33: SearchRequest.term_filters:type_name -> TermFilter + 33, // 34: SearchRequest.sort_field_map:type_name -> SearchRequest.SortFieldMapEntry + 22, // 35: SearchRequest.sort_fields:type_name -> SortField + 39, // 36: ResultItem.fields:type_name -> Field + 29, // 37: SearchResult.status:type_name -> SearchStatus + 26, // 38: SearchResult.result_items:type_name -> ResultItem + 34, // 39: SearchResult.explain:type_name -> SearchResult.ExplainEntry + 2, // 40: SearchResponse.head:type_name -> ResponseHead + 27, // 41: SearchResponse.results:type_name -> SearchResult + 35, // 42: SearchResponse.sort_field_map:type_name -> SearchResponse.SortFieldMapEntry + 1, // 43: MSearchRequest.head:type_name -> RequestHead + 25, // 44: MSearchRequest.search_requests:type_name -> SearchRequest + 3, // 45: RouterGRPCService.Get:input_type -> GetRequest + 5, // 46: RouterGRPCService.Add:input_type -> AddRequest + 4, // 47: RouterGRPCService.Delete:input_type -> DeleteRequest + 6, // 48: RouterGRPCService.Update:input_type -> UpdateRequest + 25, // 49: RouterGRPCService.Search:input_type -> SearchRequest + 7, // 50: RouterGRPCService.Bulk:input_type -> BulkRequest + 30, // 51: RouterGRPCService.MSearch:input_type -> MSearchRequest + 1, // 52: RouterGRPCService.Space:input_type -> RequestHead + 25, // 53: RouterGRPCService.SearchByID:input_type -> SearchRequest + 11, // 54: RouterGRPCService.Get:output_type -> GetResponse + 12, // 55: RouterGRPCService.Add:output_type -> AddResponse + 14, // 56: RouterGRPCService.Delete:output_type -> DeleteResponse + 13, // 57: RouterGRPCService.Update:output_type -> UpdateResponse + 28, // 58: RouterGRPCService.Search:output_type -> SearchResponse + 15, // 59: RouterGRPCService.Bulk:output_type -> BulkResponse + 28, // 60: RouterGRPCService.MSearch:output_type -> SearchResponse + 40, // 61: RouterGRPCService.Space:output_type -> Table + 28, // 62: RouterGRPCService.SearchByID:output_type -> SearchResponse + 54, // [54:63] is the sub-list for method output_type + 45, // [45:54] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name +} + +func init() { file_router_grpc_proto_init() } +func file_router_grpc_proto_init() { + if File_router_grpc_proto != nil { + return + } + file_data_model_proto_init() + file_errors_proto_init() + if !protoimpl.UnsafeEnabled { + file_router_grpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestHead); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseHead); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ForceMergeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FlushRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ForceMergeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelByQueryeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FlushResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TermFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RangeFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SortField); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VectorQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResultItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_router_grpc_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MSearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_router_grpc_proto_rawDesc, + NumEnums: 1, + NumMessages: 35, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_router_grpc_proto_goTypes, + DependencyIndexes: file_router_grpc_proto_depIdxs, + EnumInfos: file_router_grpc_proto_enumTypes, + MessageInfos: file_router_grpc_proto_msgTypes, + }.Build() + File_router_grpc_proto = out.File + file_router_grpc_proto_rawDesc = nil + file_router_grpc_proto_goTypes = nil + file_router_grpc_proto_depIdxs = nil } -func (this *ResultItem) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ResultItem) - if !ok { - that2, ok := that.(ResultItem) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Score != that1.Score { - return false - } - if len(this.Fields) != len(that1.Fields) { - return false - } - for i := range this.Fields { - if !this.Fields[i].Equal(that1.Fields[i]) { - return false - } - } - if this.Extra != that1.Extra { - return false - } - if this.PKey != that1.PKey { - return false - } - if !bytes.Equal(this.Source, that1.Source) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SearchResult) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SearchResult) - if !ok { - that2, ok := that.(SearchResult) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TotalHits != that1.TotalHits { - return false - } - if this.MaxScore != that1.MaxScore { - return false - } - if this.MaxTook != that1.MaxTook { - return false - } - if this.MaxTookId != that1.MaxTookId { - return false - } - if !this.Status.Equal(that1.Status) { - return false - } - if this.Msg != that1.Msg { - return false - } - if len(this.ResultItems) != len(that1.ResultItems) { - return false - } - for i := range this.ResultItems { - if !this.ResultItems[i].Equal(that1.ResultItems[i]) { - return false - } - } - if this.PID != that1.PID { - return false - } - if len(this.Explain) != len(that1.Explain) { - return false - } - for i := range this.Explain { - if this.Explain[i] != that1.Explain[i] { - return false - } - } - if this.Timeout != that1.Timeout { - return false - } - if this.TopN != that1.TopN { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SearchResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SearchResponse) - if !ok { - that2, ok := that.(SearchResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.Results) != len(that1.Results) { - return false - } - for i := range this.Results { - if !this.Results[i].Equal(that1.Results[i]) { - return false - } - } - if this.OnlineLogMessage != that1.OnlineLogMessage { - return false - } - if this.Timeout != that1.Timeout { - return false - } - if !bytes.Equal(this.FlatBytes, that1.FlatBytes) { - return false - } - if len(this.SortFieldMap) != len(that1.SortFieldMap) { - return false - } - for i := range this.SortFieldMap { - if this.SortFieldMap[i] != that1.SortFieldMap[i] { - return false - } - } - if this.TopSize != that1.TopSize { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SearchStatus) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SearchStatus) - if !ok { - that2, ok := that.(SearchStatus) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Total != that1.Total { - return false - } - if this.Failed != that1.Failed { - return false - } - if this.Successful != that1.Successful { - return false - } - if this.Msg != that1.Msg { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *MSearchRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MSearchRequest) - if !ok { - that2, ok := that.(MSearchRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Head.Equal(that1.Head) { - return false - } - if len(this.SearchRequests) != len(that1.SearchRequests) { - return false - } - for i := range this.SearchRequests { - if !this.SearchRequests[i].Equal(that1.SearchRequests[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RouterGRPCServiceClient is the client API for RouterGRPCService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RouterGRPCServiceClient interface { - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) - Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) - Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*BulkResponse, error) - MSearch(ctx context.Context, in *MSearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) - Space(ctx context.Context, in *RequestHead, opts ...grpc.CallOption) (*Table, error) - SearchByID(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) -} - -type routerGRPCServiceClient struct { - cc *grpc.ClientConn -} - -func NewRouterGRPCServiceClient(cc *grpc.ClientConn) RouterGRPCServiceClient { - return &routerGRPCServiceClient{cc} -} - -func (c *routerGRPCServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) { - out := new(AddResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Add", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { - out := new(UpdateResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { - out := new(SearchResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Search", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Bulk(ctx context.Context, in *BulkRequest, opts ...grpc.CallOption) (*BulkResponse, error) { - out := new(BulkResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Bulk", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) MSearch(ctx context.Context, in *MSearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { - out := new(SearchResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/MSearch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) Space(ctx context.Context, in *RequestHead, opts ...grpc.CallOption) (*Table, error) { - out := new(Table) - err := c.cc.Invoke(ctx, "/RouterGRPCService/Space", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routerGRPCServiceClient) SearchByID(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) { - out := new(SearchResponse) - err := c.cc.Invoke(ctx, "/RouterGRPCService/SearchByID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RouterGRPCServiceServer is the server API for RouterGRPCService service. -type RouterGRPCServiceServer interface { - Get(context.Context, *GetRequest) (*GetResponse, error) - Add(context.Context, *AddRequest) (*AddResponse, error) - Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) - Search(context.Context, *SearchRequest) (*SearchResponse, error) - Bulk(context.Context, *BulkRequest) (*BulkResponse, error) - MSearch(context.Context, *MSearchRequest) (*SearchResponse, error) - Space(context.Context, *RequestHead) (*Table, error) - SearchByID(context.Context, *SearchRequest) (*SearchResponse, error) -} - -// UnimplementedRouterGRPCServiceServer can be embedded to have forward compatible implementations. -type UnimplementedRouterGRPCServiceServer struct { -} - -func (*UnimplementedRouterGRPCServiceServer) Get(ctx context.Context, req *GetRequest) (*GetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Add(ctx context.Context, req *AddRequest) (*AddResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Search(ctx context.Context, req *SearchRequest) (*SearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Search not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Bulk(ctx context.Context, req *BulkRequest) (*BulkResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Bulk not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) MSearch(ctx context.Context, req *MSearchRequest) (*SearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MSearch not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) Space(ctx context.Context, req *RequestHead) (*Table, error) { - return nil, status.Errorf(codes.Unimplemented, "method Space not implemented") -} -func (*UnimplementedRouterGRPCServiceServer) SearchByID(ctx context.Context, req *SearchRequest) (*SearchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SearchByID not implemented") -} - -func RegisterRouterGRPCServiceServer(s *grpc.Server, srv RouterGRPCServiceServer) { - s.RegisterService(&_RouterGRPCService_serviceDesc, srv) -} - -func _RouterGRPCService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Add(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Add", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Add(ctx, req.(*AddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Update(ctx, req.(*UpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Search(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Search", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Search(ctx, req.(*SearchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Bulk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BulkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Bulk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Bulk", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Bulk(ctx, req.(*BulkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_MSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MSearchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).MSearch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/MSearch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).MSearch(ctx, req.(*MSearchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_Space_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestHead) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).Space(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/Space", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).Space(ctx, req.(*RequestHead)) - } - return interceptor(ctx, in, info, handler) -} - -func _RouterGRPCService_SearchByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RouterGRPCServiceServer).SearchByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/RouterGRPCService/SearchByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RouterGRPCServiceServer).SearchByID(ctx, req.(*SearchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RouterGRPCService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "RouterGRPCService", - HandlerType: (*RouterGRPCServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _RouterGRPCService_Get_Handler, - }, - { - MethodName: "Add", - Handler: _RouterGRPCService_Add_Handler, - }, - { - MethodName: "Delete", - Handler: _RouterGRPCService_Delete_Handler, - }, - { - MethodName: "Update", - Handler: _RouterGRPCService_Update_Handler, - }, - { - MethodName: "Search", - Handler: _RouterGRPCService_Search_Handler, - }, - { - MethodName: "Bulk", - Handler: _RouterGRPCService_Bulk_Handler, - }, - { - MethodName: "MSearch", - Handler: _RouterGRPCService_MSearch_Handler, - }, - { - MethodName: "Space", - Handler: _RouterGRPCService_Space_Handler, - }, - { - MethodName: "SearchByID", - Handler: _RouterGRPCService_SearchByID_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "router_grpc.proto", -} - -func (m *RequestHead) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestHead) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RequestHead) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Params) > 0 { - for k := range m.Params { - v := m.Params[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRouterGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x3a - } - } - if len(m.ClientType) > 0 { - i -= len(m.ClientType) - copy(dAtA[i:], m.ClientType) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.ClientType))) - i-- - dAtA[i] = 0x32 - } - if len(m.SpaceName) > 0 { - i -= len(m.SpaceName) - copy(dAtA[i:], m.SpaceName) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.SpaceName))) - i-- - dAtA[i] = 0x2a - } - if len(m.DbName) > 0 { - i -= len(m.DbName) - copy(dAtA[i:], m.DbName) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.DbName))) - i-- - dAtA[i] = 0x22 - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x1a - } - if len(m.UserName) > 0 { - i -= len(m.UserName) - copy(dAtA[i:], m.UserName) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.UserName))) - i-- - dAtA[i] = 0x12 - } - if m.TimeOutMs != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.TimeOutMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ResponseHead) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseHead) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResponseHead) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Params) > 0 { - for k := range m.Params { - v := m.Params[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRouterGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if m.Err != nil { - { - size, err := m.Err.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PrimaryKeys) > 0 { - for iNdEx := len(m.PrimaryKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PrimaryKeys[iNdEx]) - copy(dAtA[i:], m.PrimaryKeys[iNdEx]) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.PrimaryKeys[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PrimaryKeys) > 0 { - for iNdEx := len(m.PrimaryKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PrimaryKeys[iNdEx]) - copy(dAtA[i:], m.PrimaryKeys[iNdEx]) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.PrimaryKeys[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Doc != nil { - { - size, err := m.Doc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Doc != nil { - { - size, err := m.Doc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BulkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BulkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BulkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Docs) > 0 { - for iNdEx := len(m.Docs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Docs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ForceMergeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ForceMergeRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ForceMergeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FlushRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FlushRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IndexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Describe != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.Describe)) - i-- - dAtA[i] = 0x20 - } - if m.LimitCpu != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.LimitCpu)) - i-- - dAtA[i] = 0x18 - } - if m.DropBeforeRebuild != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.DropBeforeRebuild)) - i-- - dAtA[i] = 0x10 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.PrimaryKey) > 0 { - i -= len(m.PrimaryKey) - copy(dAtA[i:], m.PrimaryKey) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.PrimaryKey))) - i-- - dAtA[i] = 0x22 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeleteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BulkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BulkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BulkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ForceMergeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ForceMergeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ForceMergeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Shards != nil { - { - size, err := m.Shards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DelByQueryeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DelByQueryeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelByQueryeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.IdsLong) > 0 { - dAtA20 := make([]byte, len(m.IdsLong)*10) - var j19 int - for _, num1 := range m.IdsLong { - num := uint64(num1) - for num >= 1<<7 { - dAtA20[j19] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j19++ - } - dAtA20[j19] = uint8(num) - j19++ - } - i -= j19 - copy(dAtA[i:], dAtA20[:j19]) - i = encodeVarintRouterGrpc(dAtA, i, uint64(j19)) - i-- - dAtA[i] = 0x22 - } - if len(m.IdsStr) > 0 { - for iNdEx := len(m.IdsStr) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IdsStr[iNdEx]) - copy(dAtA[i:], m.IdsStr[iNdEx]) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.IdsStr[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if m.DelNum != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.DelNum)) - i-- - dAtA[i] = 0x10 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FlushResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FlushResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Shards != nil { - { - size, err := m.Shards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IndexResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Shards != nil { - { - size, err := m.Shards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TermFilter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TermFilter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TermFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IsUnion != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.IsUnion)) - i-- - dAtA[i] = 0x18 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Field) > 0 { - i -= len(m.Field) - copy(dAtA[i:], m.Field) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Field))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RangeFilter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RangeFilter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RangeFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.IncludeUpper { - i-- - if m.IncludeUpper { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.IncludeLower { - i-- - if m.IncludeLower { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.UpperValue) > 0 { - i -= len(m.UpperValue) - copy(dAtA[i:], m.UpperValue) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.UpperValue))) - i-- - dAtA[i] = 0x1a - } - if len(m.LowerValue) > 0 { - i -= len(m.LowerValue) - copy(dAtA[i:], m.LowerValue) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.LowerValue))) - i-- - dAtA[i] = 0x12 - } - if len(m.Field) > 0 { - i -= len(m.Field) - copy(dAtA[i:], m.Field) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Field))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SortField) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SortField) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SortField) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Type { - i-- - if m.Type { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Field) > 0 { - i -= len(m.Field) - copy(dAtA[i:], m.Field) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Field))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VectorQuery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VectorQuery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VectorQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.IndexType) > 0 { - i -= len(m.IndexType) - copy(dAtA[i:], m.IndexType) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.IndexType))) - i-- - dAtA[i] = 0x42 - } - if len(m.Format) > 0 { - i -= len(m.Format) - copy(dAtA[i:], m.Format) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Format))) - i-- - dAtA[i] = 0x3a - } - if m.HasBoost != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.HasBoost)) - i-- - dAtA[i] = 0x30 - } - if m.Boost != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Boost)))) - i-- - dAtA[i] = 0x29 - } - if m.MaxScore != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxScore)))) - i-- - dAtA[i] = 0x21 - } - if m.MinScore != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MinScore)))) - i-- - dAtA[i] = 0x19 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IndexParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Nprobe != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.Nprobe)) - i-- - dAtA[i] = 0x10 - } - if m.MetricType != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.MetricType)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SearchRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SearchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SearchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SortFields) > 0 { - for iNdEx := len(m.SortFields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SortFields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - } - if len(m.SortFieldMap) > 0 { - for k := range m.SortFieldMap { - v := m.SortFieldMap[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRouterGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if m.IsVectorValue { - i-- - if m.IsVectorValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.IvfFlat { - i-- - if m.IvfFlat { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if m.L2Sqrt { - i-- - if m.L2Sqrt { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if m.ParallelBasedOnQuery { - i-- - if m.ParallelBasedOnQuery { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if m.MultiVectorRank != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.MultiVectorRank)) - i-- - dAtA[i] = 0x60 - } - if m.HasRank { - i-- - if m.HasRank { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if len(m.IndexParams) > 0 { - i -= len(m.IndexParams) - copy(dAtA[i:], m.IndexParams) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.IndexParams))) - i-- - dAtA[i] = 0x52 - } - if len(m.OnlineLogLevel) > 0 { - i -= len(m.OnlineLogLevel) - copy(dAtA[i:], m.OnlineLogLevel) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.OnlineLogLevel))) - i-- - dAtA[i] = 0x4a - } - if len(m.TermFilters) > 0 { - for iNdEx := len(m.TermFilters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TermFilters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.RangeFilters) > 0 { - for iNdEx := len(m.RangeFilters) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RangeFilters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Fields[iNdEx]) - copy(dAtA[i:], m.Fields[iNdEx]) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Fields[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.VecFields) > 0 { - for iNdEx := len(m.VecFields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VecFields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.IsBruteSearch != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.IsBruteSearch)) - i-- - dAtA[i] = 0x20 - } - if m.TopN != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.TopN)) - i-- - dAtA[i] = 0x18 - } - if m.ReqNum != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.ReqNum)) - i-- - dAtA[i] = 0x10 - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ResultItem) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResultItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResultItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x2a - } - if len(m.PKey) > 0 { - i -= len(m.PKey) - copy(dAtA[i:], m.PKey) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.PKey))) - i-- - dAtA[i] = 0x22 - } - if len(m.Extra) > 0 { - i -= len(m.Extra) - copy(dAtA[i:], m.Extra) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Extra))) - i-- - dAtA[i] = 0x1a - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Score != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Score)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *SearchResult) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SearchResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SearchResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.TopN != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.TopN)) - i-- - dAtA[i] = 0x58 - } - if m.Timeout { - i-- - if m.Timeout { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } - if len(m.Explain) > 0 { - for k := range m.Explain { - v := m.Explain[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i = encodeVarintRouterGrpc(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = encodeVarintRouterGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x4a - } - } - if m.PID != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.PID)) - i-- - dAtA[i] = 0x40 - } - if len(m.ResultItems) > 0 { - for iNdEx := len(m.ResultItems) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResultItems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x32 - } - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.MaxTookId != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.MaxTookId)) - i-- - dAtA[i] = 0x20 - } - if m.MaxTook != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.MaxTook)) - i-- - dAtA[i] = 0x18 - } - if m.MaxScore != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxScore)))) - i-- - dAtA[i] = 0x11 - } - if m.TotalHits != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.TotalHits)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SearchResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SearchResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SearchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.TopSize != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.TopSize)) - i-- - dAtA[i] = 0x38 - } - if len(m.SortFieldMap) > 0 { - for k := range m.SortFieldMap { - v := m.SortFieldMap[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRouterGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x32 - } - } - if len(m.FlatBytes) > 0 { - i -= len(m.FlatBytes) - copy(dAtA[i:], m.FlatBytes) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.FlatBytes))) - i-- - dAtA[i] = 0x2a - } - if m.Timeout { - i-- - if m.Timeout { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.OnlineLogMessage) > 0 { - i -= len(m.OnlineLogMessage) - copy(dAtA[i:], m.OnlineLogMessage) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.OnlineLogMessage))) - i-- - dAtA[i] = 0x1a - } - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SearchStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SearchStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SearchStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintRouterGrpc(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x22 - } - if m.Successful != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.Successful)) - i-- - dAtA[i] = 0x18 - } - if m.Failed != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.Failed)) - i-- - dAtA[i] = 0x10 - } - if m.Total != 0 { - i = encodeVarintRouterGrpc(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MSearchRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MSearchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MSearchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SearchRequests) > 0 { - for iNdEx := len(m.SearchRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SearchRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Head != nil { - { - size, err := m.Head.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRouterGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRouterGrpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRouterGrpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedRequestHead(r randyRouterGrpc, easy bool) *RequestHead { - this := &RequestHead{} - this.TimeOutMs = int64(r.Int63()) - if r.Intn(2) == 0 { - this.TimeOutMs *= -1 - } - this.UserName = string(randStringRouterGrpc(r)) - this.Password = string(randStringRouterGrpc(r)) - this.DbName = string(randStringRouterGrpc(r)) - this.SpaceName = string(randStringRouterGrpc(r)) - this.ClientType = string(randStringRouterGrpc(r)) - if r.Intn(5) != 0 { - v1 := r.Intn(10) - this.Params = make(map[string]string) - for i := 0; i < v1; i++ { - this.Params[randStringRouterGrpc(r)] = randStringRouterGrpc(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 8) - } - return this -} - -func NewPopulatedResponseHead(r randyRouterGrpc, easy bool) *ResponseHead { - this := &ResponseHead{} - if r.Intn(5) != 0 { - this.Err = NewPopulatedError(r, easy) - } - if r.Intn(5) != 0 { - v2 := r.Intn(10) - this.Params = make(map[string]string) - for i := 0; i < v2; i++ { - this.Params[randStringRouterGrpc(r)] = randStringRouterGrpc(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 4) - } - return this -} - -func NewPopulatedGetRequest(r randyRouterGrpc, easy bool) *GetRequest { - this := &GetRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - v3 := r.Intn(10) - this.PrimaryKeys = make([]string, v3) - for i := 0; i < v3; i++ { - this.PrimaryKeys[i] = string(randStringRouterGrpc(r)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedDeleteRequest(r randyRouterGrpc, easy bool) *DeleteRequest { - this := &DeleteRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - v4 := r.Intn(10) - this.PrimaryKeys = make([]string, v4) - for i := 0; i < v4; i++ { - this.PrimaryKeys[i] = string(randStringRouterGrpc(r)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedAddRequest(r randyRouterGrpc, easy bool) *AddRequest { - this := &AddRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if r.Intn(5) != 0 { - this.Doc = NewPopulatedDocument(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedUpdateRequest(r randyRouterGrpc, easy bool) *UpdateRequest { - this := &UpdateRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if r.Intn(5) != 0 { - this.Doc = NewPopulatedDocument(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedBulkRequest(r randyRouterGrpc, easy bool) *BulkRequest { - this := &BulkRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if r.Intn(5) != 0 { - v5 := r.Intn(5) - this.Docs = make([]*Document, v5) - for i := 0; i < v5; i++ { - this.Docs[i] = NewPopulatedDocument(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedForceMergeRequest(r randyRouterGrpc, easy bool) *ForceMergeRequest { - this := &ForceMergeRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 2) - } - return this -} - -func NewPopulatedFlushRequest(r randyRouterGrpc, easy bool) *FlushRequest { - this := &FlushRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 2) - } - return this -} - -func NewPopulatedIndexRequest(r randyRouterGrpc, easy bool) *IndexRequest { - this := &IndexRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - this.DropBeforeRebuild = int64(r.Int63()) - if r.Intn(2) == 0 { - this.DropBeforeRebuild *= -1 - } - this.LimitCpu = int64(r.Int63()) - if r.Intn(2) == 0 { - this.LimitCpu *= -1 - } - this.Describe = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Describe *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedGetResponse(r randyRouterGrpc, easy bool) *GetResponse { - this := &GetResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - v6 := r.Intn(5) - this.Items = make([]*Item, v6) - for i := 0; i < v6; i++ { - this.Items[i] = NewPopulatedItem(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedAddResponse(r randyRouterGrpc, easy bool) *AddResponse { - this := &AddResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - this.PrimaryKey = string(randStringRouterGrpc(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedUpdateResponse(r randyRouterGrpc, easy bool) *UpdateResponse { - this := &UpdateResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 2) - } - return this -} - -func NewPopulatedDeleteResponse(r randyRouterGrpc, easy bool) *DeleteResponse { - this := &DeleteResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - v7 := r.Intn(5) - this.Items = make([]*Item, v7) - for i := 0; i < v7; i++ { - this.Items[i] = NewPopulatedItem(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedBulkResponse(r randyRouterGrpc, easy bool) *BulkResponse { - this := &BulkResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - v8 := r.Intn(5) - this.Items = make([]*Item, v8) - for i := 0; i < v8; i++ { - this.Items[i] = NewPopulatedItem(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedForceMergeResponse(r randyRouterGrpc, easy bool) *ForceMergeResponse { - this := &ForceMergeResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - this.Shards = NewPopulatedSearchStatus(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedDelByQueryeResponse(r randyRouterGrpc, easy bool) *DelByQueryeResponse { - this := &DelByQueryeResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - this.DelNum = int32(r.Int31()) - if r.Intn(2) == 0 { - this.DelNum *= -1 - } - v9 := r.Intn(10) - this.IdsStr = make([]string, v9) - for i := 0; i < v9; i++ { - this.IdsStr[i] = string(randStringRouterGrpc(r)) - } - v10 := r.Intn(10) - this.IdsLong = make([]int64, v10) - for i := 0; i < v10; i++ { - this.IdsLong[i] = int64(r.Int63()) - if r.Intn(2) == 0 { - this.IdsLong[i] *= -1 - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedFlushResponse(r randyRouterGrpc, easy bool) *FlushResponse { - this := &FlushResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - this.Shards = NewPopulatedSearchStatus(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedIndexResponse(r randyRouterGrpc, easy bool) *IndexResponse { - this := &IndexResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - this.Shards = NewPopulatedSearchStatus(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedTermFilter(r randyRouterGrpc, easy bool) *TermFilter { - this := &TermFilter{} - this.Field = string(randStringRouterGrpc(r)) - v11 := r.Intn(100) - this.Value = make([]byte, v11) - for i := 0; i < v11; i++ { - this.Value[i] = byte(r.Intn(256)) - } - this.IsUnion = int32(r.Int31()) - if r.Intn(2) == 0 { - this.IsUnion *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 4) - } - return this -} - -func NewPopulatedRangeFilter(r randyRouterGrpc, easy bool) *RangeFilter { - this := &RangeFilter{} - this.Field = string(randStringRouterGrpc(r)) - v12 := r.Intn(100) - this.LowerValue = make([]byte, v12) - for i := 0; i < v12; i++ { - this.LowerValue[i] = byte(r.Intn(256)) - } - v13 := r.Intn(100) - this.UpperValue = make([]byte, v13) - for i := 0; i < v13; i++ { - this.UpperValue[i] = byte(r.Intn(256)) - } - this.IncludeLower = bool(bool(r.Intn(2) == 0)) - this.IncludeUpper = bool(bool(r.Intn(2) == 0)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 6) - } - return this -} - -func NewPopulatedSortField(r randyRouterGrpc, easy bool) *SortField { - this := &SortField{} - this.Field = string(randStringRouterGrpc(r)) - this.Type = bool(bool(r.Intn(2) == 0)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedVectorQuery(r randyRouterGrpc, easy bool) *VectorQuery { - this := &VectorQuery{} - this.Name = string(randStringRouterGrpc(r)) - v14 := r.Intn(100) - this.Value = make([]byte, v14) - for i := 0; i < v14; i++ { - this.Value[i] = byte(r.Intn(256)) - } - this.MinScore = float64(r.Float64()) - if r.Intn(2) == 0 { - this.MinScore *= -1 - } - this.MaxScore = float64(r.Float64()) - if r.Intn(2) == 0 { - this.MaxScore *= -1 - } - this.Boost = float64(r.Float64()) - if r.Intn(2) == 0 { - this.Boost *= -1 - } - this.HasBoost = int32(r.Int31()) - if r.Intn(2) == 0 { - this.HasBoost *= -1 - } - this.Format = string(randStringRouterGrpc(r)) - this.IndexType = string(randStringRouterGrpc(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 9) - } - return this -} - -func NewPopulatedIndexParameters(r randyRouterGrpc, easy bool) *IndexParameters { - this := &IndexParameters{} - this.MetricType = IndexParameters_DistanceMetricType([]int32{0, 1}[r.Intn(2)]) - this.Nprobe = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Nprobe *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -func NewPopulatedSearchRequest(r randyRouterGrpc, easy bool) *SearchRequest { - this := &SearchRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - this.ReqNum = int32(r.Int31()) - if r.Intn(2) == 0 { - this.ReqNum *= -1 - } - this.TopN = int32(r.Int31()) - if r.Intn(2) == 0 { - this.TopN *= -1 - } - this.IsBruteSearch = int32(r.Int31()) - if r.Intn(2) == 0 { - this.IsBruteSearch *= -1 - } - if r.Intn(5) != 0 { - v15 := r.Intn(5) - this.VecFields = make([]*VectorQuery, v15) - for i := 0; i < v15; i++ { - this.VecFields[i] = NewPopulatedVectorQuery(r, easy) - } - } - v16 := r.Intn(10) - this.Fields = make([]string, v16) - for i := 0; i < v16; i++ { - this.Fields[i] = string(randStringRouterGrpc(r)) - } - if r.Intn(5) != 0 { - v17 := r.Intn(5) - this.RangeFilters = make([]*RangeFilter, v17) - for i := 0; i < v17; i++ { - this.RangeFilters[i] = NewPopulatedRangeFilter(r, easy) - } - } - if r.Intn(5) != 0 { - v18 := r.Intn(5) - this.TermFilters = make([]*TermFilter, v18) - for i := 0; i < v18; i++ { - this.TermFilters[i] = NewPopulatedTermFilter(r, easy) - } - } - this.OnlineLogLevel = string(randStringRouterGrpc(r)) - this.IndexParams = string(randStringRouterGrpc(r)) - this.HasRank = bool(bool(r.Intn(2) == 0)) - this.MultiVectorRank = int32(r.Int31()) - if r.Intn(2) == 0 { - this.MultiVectorRank *= -1 - } - this.ParallelBasedOnQuery = bool(bool(r.Intn(2) == 0)) - this.L2Sqrt = bool(bool(r.Intn(2) == 0)) - this.IvfFlat = bool(bool(r.Intn(2) == 0)) - this.IsVectorValue = bool(bool(r.Intn(2) == 0)) - if r.Intn(5) != 0 { - v19 := r.Intn(10) - this.SortFieldMap = make(map[string]string) - for i := 0; i < v19; i++ { - this.SortFieldMap[randStringRouterGrpc(r)] = randStringRouterGrpc(r) - } - } - if r.Intn(5) != 0 { - v20 := r.Intn(5) - this.SortFields = make([]*SortField, v20) - for i := 0; i < v20; i++ { - this.SortFields[i] = NewPopulatedSortField(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 19) - } - return this -} - -func NewPopulatedResultItem(r randyRouterGrpc, easy bool) *ResultItem { - this := &ResultItem{} - this.Score = float64(r.Float64()) - if r.Intn(2) == 0 { - this.Score *= -1 - } - if r.Intn(5) != 0 { - v21 := r.Intn(5) - this.Fields = make([]*Field, v21) - for i := 0; i < v21; i++ { - this.Fields[i] = NewPopulatedField(r, easy) - } - } - this.Extra = string(randStringRouterGrpc(r)) - this.PKey = string(randStringRouterGrpc(r)) - v22 := r.Intn(100) - this.Source = make([]byte, v22) - for i := 0; i < v22; i++ { - this.Source[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 6) - } - return this -} - -func NewPopulatedSearchResult(r randyRouterGrpc, easy bool) *SearchResult { - this := &SearchResult{} - this.TotalHits = int32(r.Int31()) - if r.Intn(2) == 0 { - this.TotalHits *= -1 - } - this.MaxScore = float64(r.Float64()) - if r.Intn(2) == 0 { - this.MaxScore *= -1 - } - this.MaxTook = int64(r.Int63()) - if r.Intn(2) == 0 { - this.MaxTook *= -1 - } - this.MaxTookId = uint32(r.Uint32()) - if r.Intn(5) != 0 { - this.Status = NewPopulatedSearchStatus(r, easy) - } - this.Msg = string(randStringRouterGrpc(r)) - if r.Intn(5) != 0 { - v23 := r.Intn(5) - this.ResultItems = make([]*ResultItem, v23) - for i := 0; i < v23; i++ { - this.ResultItems[i] = NewPopulatedResultItem(r, easy) - } - } - this.PID = uint32(r.Uint32()) - if r.Intn(5) != 0 { - v24 := r.Intn(10) - this.Explain = make(map[uint32]string) - for i := 0; i < v24; i++ { - this.Explain[uint32(r.Uint32())] = randStringRouterGrpc(r) - } - } - this.Timeout = bool(bool(r.Intn(2) == 0)) - this.TopN = int32(r.Int31()) - if r.Intn(2) == 0 { - this.TopN *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 12) - } - return this -} - -func NewPopulatedSearchResponse(r randyRouterGrpc, easy bool) *SearchResponse { - this := &SearchResponse{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedResponseHead(r, easy) - } - if r.Intn(5) != 0 { - v25 := r.Intn(5) - this.Results = make([]*SearchResult, v25) - for i := 0; i < v25; i++ { - this.Results[i] = NewPopulatedSearchResult(r, easy) - } - } - this.OnlineLogMessage = string(randStringRouterGrpc(r)) - this.Timeout = bool(bool(r.Intn(2) == 0)) - v26 := r.Intn(100) - this.FlatBytes = make([]byte, v26) - for i := 0; i < v26; i++ { - this.FlatBytes[i] = byte(r.Intn(256)) - } - if r.Intn(5) != 0 { - v27 := r.Intn(10) - this.SortFieldMap = make(map[string]string) - for i := 0; i < v27; i++ { - this.SortFieldMap[randStringRouterGrpc(r)] = randStringRouterGrpc(r) - } - } - this.TopSize = int32(r.Int31()) - if r.Intn(2) == 0 { - this.TopSize *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 8) - } - return this -} - -func NewPopulatedSearchStatus(r randyRouterGrpc, easy bool) *SearchStatus { - this := &SearchStatus{} - this.Total = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Total *= -1 - } - this.Failed = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Failed *= -1 - } - this.Successful = int32(r.Int31()) - if r.Intn(2) == 0 { - this.Successful *= -1 - } - this.Msg = string(randStringRouterGrpc(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 5) - } - return this -} - -func NewPopulatedMSearchRequest(r randyRouterGrpc, easy bool) *MSearchRequest { - this := &MSearchRequest{} - if r.Intn(5) != 0 { - this.Head = NewPopulatedRequestHead(r, easy) - } - if r.Intn(5) != 0 { - v28 := r.Intn(5) - this.SearchRequests = make([]*SearchRequest, v28) - for i := 0; i < v28; i++ { - this.SearchRequests[i] = NewPopulatedSearchRequest(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRouterGrpc(r, 3) - } - return this -} - -type randyRouterGrpc interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneRouterGrpc(r randyRouterGrpc) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringRouterGrpc(r randyRouterGrpc) string { - v29 := r.Intn(100) - tmps := make([]rune, v29) - for i := 0; i < v29; i++ { - tmps[i] = randUTF8RuneRouterGrpc(r) - } - return string(tmps) -} -func randUnrecognizedRouterGrpc(r randyRouterGrpc, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldRouterGrpc(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldRouterGrpc(dAtA []byte, r randyRouterGrpc, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(key)) - v30 := r.Int63() - if r.Intn(2) == 0 { - v30 *= -1 - } - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(v30)) - case 1: - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateRouterGrpc(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateRouterGrpc(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *RequestHead) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TimeOutMs != 0 { - n += 1 + sovRouterGrpc(uint64(m.TimeOutMs)) - } - l = len(m.UserName) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.DbName) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.SpaceName) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.ClientType) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Params) > 0 { - for k, v := range m.Params { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovRouterGrpc(uint64(len(k))) + 1 + len(v) + sovRouterGrpc(uint64(len(v))) - n += mapEntrySize + 1 + sovRouterGrpc(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResponseHead) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Err != nil { - l = m.Err.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Params) > 0 { - for k, v := range m.Params { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovRouterGrpc(uint64(len(k))) + 1 + len(v) + sovRouterGrpc(uint64(len(v))) - n += mapEntrySize + 1 + sovRouterGrpc(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.PrimaryKeys) > 0 { - for _, s := range m.PrimaryKeys { - l = len(s) - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeleteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.PrimaryKeys) > 0 { - for _, s := range m.PrimaryKeys { - l = len(s) - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AddRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Doc != nil { - l = m.Doc.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Doc != nil { - l = m.Doc.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BulkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Docs) > 0 { - for _, e := range m.Docs { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ForceMergeRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FlushRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *IndexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.DropBeforeRebuild != 0 { - n += 1 + sovRouterGrpc(uint64(m.DropBeforeRebuild)) - } - if m.LimitCpu != 0 { - n += 1 + sovRouterGrpc(uint64(m.LimitCpu)) - } - if m.Describe != 0 { - n += 1 + sovRouterGrpc(uint64(m.Describe)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AddResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.PrimaryKey) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeleteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BulkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ForceMergeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Shards != nil { - l = m.Shards.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DelByQueryeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.DelNum != 0 { - n += 1 + sovRouterGrpc(uint64(m.DelNum)) - } - if len(m.IdsStr) > 0 { - for _, s := range m.IdsStr { - l = len(s) - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if len(m.IdsLong) > 0 { - l = 0 - for _, e := range m.IdsLong { - l += sovRouterGrpc(uint64(e)) - } - n += 1 + sovRouterGrpc(uint64(l)) + l - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FlushResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Shards != nil { - l = m.Shards.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *IndexResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Shards != nil { - l = m.Shards.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TermFilter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Field) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.IsUnion != 0 { - n += 1 + sovRouterGrpc(uint64(m.IsUnion)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RangeFilter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Field) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.LowerValue) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.UpperValue) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.IncludeLower { - n += 2 - } - if m.IncludeUpper { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SortField) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Field) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Type { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *VectorQuery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.MinScore != 0 { - n += 9 - } - if m.MaxScore != 0 { - n += 9 - } - if m.Boost != 0 { - n += 9 - } - if m.HasBoost != 0 { - n += 1 + sovRouterGrpc(uint64(m.HasBoost)) - } - l = len(m.Format) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.IndexType) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *IndexParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MetricType != 0 { - n += 1 + sovRouterGrpc(uint64(m.MetricType)) - } - if m.Nprobe != 0 { - n += 1 + sovRouterGrpc(uint64(m.Nprobe)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SearchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.ReqNum != 0 { - n += 1 + sovRouterGrpc(uint64(m.ReqNum)) - } - if m.TopN != 0 { - n += 1 + sovRouterGrpc(uint64(m.TopN)) - } - if m.IsBruteSearch != 0 { - n += 1 + sovRouterGrpc(uint64(m.IsBruteSearch)) - } - if len(m.VecFields) > 0 { - for _, e := range m.VecFields { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if len(m.Fields) > 0 { - for _, s := range m.Fields { - l = len(s) - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if len(m.RangeFilters) > 0 { - for _, e := range m.RangeFilters { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if len(m.TermFilters) > 0 { - for _, e := range m.TermFilters { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - l = len(m.OnlineLogLevel) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.IndexParams) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.HasRank { - n += 2 - } - if m.MultiVectorRank != 0 { - n += 1 + sovRouterGrpc(uint64(m.MultiVectorRank)) - } - if m.ParallelBasedOnQuery { - n += 2 - } - if m.L2Sqrt { - n += 2 - } - if m.IvfFlat { - n += 2 - } - if m.IsVectorValue { - n += 3 - } - if len(m.SortFieldMap) > 0 { - for k, v := range m.SortFieldMap { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovRouterGrpc(uint64(len(k))) + 1 + len(v) + sovRouterGrpc(uint64(len(v))) - n += mapEntrySize + 2 + sovRouterGrpc(uint64(mapEntrySize)) - } - } - if len(m.SortFields) > 0 { - for _, e := range m.SortFields { - l = e.Size() - n += 2 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResultItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Score != 0 { - n += 9 - } - if len(m.Fields) > 0 { - for _, e := range m.Fields { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - l = len(m.Extra) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.PKey) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SearchResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TotalHits != 0 { - n += 1 + sovRouterGrpc(uint64(m.TotalHits)) - } - if m.MaxScore != 0 { - n += 9 - } - if m.MaxTook != 0 { - n += 1 + sovRouterGrpc(uint64(m.MaxTook)) - } - if m.MaxTookId != 0 { - n += 1 + sovRouterGrpc(uint64(m.MaxTookId)) - } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.ResultItems) > 0 { - for _, e := range m.ResultItems { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.PID != 0 { - n += 1 + sovRouterGrpc(uint64(m.PID)) - } - if len(m.Explain) > 0 { - for k, v := range m.Explain { - _ = k - _ = v - mapEntrySize := 1 + sovRouterGrpc(uint64(k)) + 1 + len(v) + sovRouterGrpc(uint64(len(v))) - n += mapEntrySize + 1 + sovRouterGrpc(uint64(mapEntrySize)) - } - } - if m.Timeout { - n += 2 - } - if m.TopN != 0 { - n += 1 + sovRouterGrpc(uint64(m.TopN)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SearchResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - l = len(m.OnlineLogMessage) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.Timeout { - n += 2 - } - l = len(m.FlatBytes) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.SortFieldMap) > 0 { - for k, v := range m.SortFieldMap { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovRouterGrpc(uint64(len(k))) + 1 + len(v) + sovRouterGrpc(uint64(len(v))) - n += mapEntrySize + 1 + sovRouterGrpc(uint64(mapEntrySize)) - } - } - if m.TopSize != 0 { - n += 1 + sovRouterGrpc(uint64(m.TopSize)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SearchStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovRouterGrpc(uint64(m.Total)) - } - if m.Failed != 0 { - n += 1 + sovRouterGrpc(uint64(m.Failed)) - } - if m.Successful != 0 { - n += 1 + sovRouterGrpc(uint64(m.Successful)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MSearchRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Head != nil { - l = m.Head.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - if len(m.SearchRequests) > 0 { - for _, e := range m.SearchRequests { - l = e.Size() - n += 1 + l + sovRouterGrpc(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovRouterGrpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRouterGrpc(x uint64) (n int) { - return sovRouterGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *RequestHead) String() string { - if this == nil { - return "nil" - } - keysForParams := make([]string, 0, len(this.Params)) - for k, _ := range this.Params { - keysForParams = append(keysForParams, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForParams) - mapStringForParams := "map[string]string{" - for _, k := range keysForParams { - mapStringForParams += fmt.Sprintf("%v: %v,", k, this.Params[k]) - } - mapStringForParams += "}" - s := strings.Join([]string{`&RequestHead{`, - `TimeOutMs:` + fmt.Sprintf("%v", this.TimeOutMs) + `,`, - `UserName:` + fmt.Sprintf("%v", this.UserName) + `,`, - `Password:` + fmt.Sprintf("%v", this.Password) + `,`, - `DbName:` + fmt.Sprintf("%v", this.DbName) + `,`, - `SpaceName:` + fmt.Sprintf("%v", this.SpaceName) + `,`, - `ClientType:` + fmt.Sprintf("%v", this.ClientType) + `,`, - `Params:` + mapStringForParams + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResponseHead) String() string { - if this == nil { - return "nil" - } - keysForParams := make([]string, 0, len(this.Params)) - for k, _ := range this.Params { - keysForParams = append(keysForParams, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForParams) - mapStringForParams := "map[string]string{" - for _, k := range keysForParams { - mapStringForParams += fmt.Sprintf("%v: %v,", k, this.Params[k]) - } - mapStringForParams += "}" - s := strings.Join([]string{`&ResponseHead{`, - `Err:` + strings.Replace(fmt.Sprintf("%v", this.Err), "Error", "Error", 1) + `,`, - `Params:` + mapStringForParams + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *GetRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `PrimaryKeys:` + fmt.Sprintf("%v", this.PrimaryKeys) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DeleteRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DeleteRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `PrimaryKeys:` + fmt.Sprintf("%v", this.PrimaryKeys) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AddRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AddRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `Doc:` + strings.Replace(fmt.Sprintf("%v", this.Doc), "Document", "Document", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `Doc:` + strings.Replace(fmt.Sprintf("%v", this.Doc), "Document", "Document", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *BulkRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForDocs := "[]*Document{" - for _, f := range this.Docs { - repeatedStringForDocs += strings.Replace(fmt.Sprintf("%v", f), "Document", "Document", 1) + "," - } - repeatedStringForDocs += "}" - s := strings.Join([]string{`&BulkRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `Docs:` + repeatedStringForDocs + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ForceMergeRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ForceMergeRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FlushRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FlushRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *IndexRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `DropBeforeRebuild:` + fmt.Sprintf("%v", this.DropBeforeRebuild) + `,`, - `LimitCpu:` + fmt.Sprintf("%v", this.LimitCpu) + `,`, - `Describe:` + fmt.Sprintf("%v", this.Describe) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *GetResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]*Item{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(fmt.Sprintf("%v", f), "Item", "Item", 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&GetResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AddResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AddResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `PrimaryKey:` + fmt.Sprintf("%v", this.PrimaryKey) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DeleteResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]*Item{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(fmt.Sprintf("%v", f), "Item", "Item", 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&DeleteResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *BulkResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]*Item{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(fmt.Sprintf("%v", f), "Item", "Item", 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&BulkResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ForceMergeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ForceMergeResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Shards:` + strings.Replace(this.Shards.String(), "SearchStatus", "SearchStatus", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DelByQueryeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DelByQueryeResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `DelNum:` + fmt.Sprintf("%v", this.DelNum) + `,`, - `IdsStr:` + fmt.Sprintf("%v", this.IdsStr) + `,`, - `IdsLong:` + fmt.Sprintf("%v", this.IdsLong) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FlushResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FlushResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Shards:` + strings.Replace(this.Shards.String(), "SearchStatus", "SearchStatus", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *IndexResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Shards:` + strings.Replace(this.Shards.String(), "SearchStatus", "SearchStatus", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TermFilter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TermFilter{`, - `Field:` + fmt.Sprintf("%v", this.Field) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `IsUnion:` + fmt.Sprintf("%v", this.IsUnion) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RangeFilter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RangeFilter{`, - `Field:` + fmt.Sprintf("%v", this.Field) + `,`, - `LowerValue:` + fmt.Sprintf("%v", this.LowerValue) + `,`, - `UpperValue:` + fmt.Sprintf("%v", this.UpperValue) + `,`, - `IncludeLower:` + fmt.Sprintf("%v", this.IncludeLower) + `,`, - `IncludeUpper:` + fmt.Sprintf("%v", this.IncludeUpper) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SortField) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SortField{`, - `Field:` + fmt.Sprintf("%v", this.Field) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *VectorQuery) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VectorQuery{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `MinScore:` + fmt.Sprintf("%v", this.MinScore) + `,`, - `MaxScore:` + fmt.Sprintf("%v", this.MaxScore) + `,`, - `Boost:` + fmt.Sprintf("%v", this.Boost) + `,`, - `HasBoost:` + fmt.Sprintf("%v", this.HasBoost) + `,`, - `Format:` + fmt.Sprintf("%v", this.Format) + `,`, - `IndexType:` + fmt.Sprintf("%v", this.IndexType) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *IndexParameters) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexParameters{`, - `MetricType:` + fmt.Sprintf("%v", this.MetricType) + `,`, - `Nprobe:` + fmt.Sprintf("%v", this.Nprobe) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SearchRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForVecFields := "[]*VectorQuery{" - for _, f := range this.VecFields { - repeatedStringForVecFields += strings.Replace(f.String(), "VectorQuery", "VectorQuery", 1) + "," - } - repeatedStringForVecFields += "}" - repeatedStringForRangeFilters := "[]*RangeFilter{" - for _, f := range this.RangeFilters { - repeatedStringForRangeFilters += strings.Replace(f.String(), "RangeFilter", "RangeFilter", 1) + "," - } - repeatedStringForRangeFilters += "}" - repeatedStringForTermFilters := "[]*TermFilter{" - for _, f := range this.TermFilters { - repeatedStringForTermFilters += strings.Replace(f.String(), "TermFilter", "TermFilter", 1) + "," - } - repeatedStringForTermFilters += "}" - repeatedStringForSortFields := "[]*SortField{" - for _, f := range this.SortFields { - repeatedStringForSortFields += strings.Replace(f.String(), "SortField", "SortField", 1) + "," - } - repeatedStringForSortFields += "}" - keysForSortFieldMap := make([]string, 0, len(this.SortFieldMap)) - for k, _ := range this.SortFieldMap { - keysForSortFieldMap = append(keysForSortFieldMap, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForSortFieldMap) - mapStringForSortFieldMap := "map[string]string{" - for _, k := range keysForSortFieldMap { - mapStringForSortFieldMap += fmt.Sprintf("%v: %v,", k, this.SortFieldMap[k]) - } - mapStringForSortFieldMap += "}" - s := strings.Join([]string{`&SearchRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `ReqNum:` + fmt.Sprintf("%v", this.ReqNum) + `,`, - `TopN:` + fmt.Sprintf("%v", this.TopN) + `,`, - `IsBruteSearch:` + fmt.Sprintf("%v", this.IsBruteSearch) + `,`, - `VecFields:` + repeatedStringForVecFields + `,`, - `Fields:` + fmt.Sprintf("%v", this.Fields) + `,`, - `RangeFilters:` + repeatedStringForRangeFilters + `,`, - `TermFilters:` + repeatedStringForTermFilters + `,`, - `OnlineLogLevel:` + fmt.Sprintf("%v", this.OnlineLogLevel) + `,`, - `IndexParams:` + fmt.Sprintf("%v", this.IndexParams) + `,`, - `HasRank:` + fmt.Sprintf("%v", this.HasRank) + `,`, - `MultiVectorRank:` + fmt.Sprintf("%v", this.MultiVectorRank) + `,`, - `ParallelBasedOnQuery:` + fmt.Sprintf("%v", this.ParallelBasedOnQuery) + `,`, - `L2Sqrt:` + fmt.Sprintf("%v", this.L2Sqrt) + `,`, - `IvfFlat:` + fmt.Sprintf("%v", this.IvfFlat) + `,`, - `IsVectorValue:` + fmt.Sprintf("%v", this.IsVectorValue) + `,`, - `SortFieldMap:` + mapStringForSortFieldMap + `,`, - `SortFields:` + repeatedStringForSortFields + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResultItem) String() string { - if this == nil { - return "nil" - } - repeatedStringForFields := "[]*Field{" - for _, f := range this.Fields { - repeatedStringForFields += strings.Replace(fmt.Sprintf("%v", f), "Field", "Field", 1) + "," - } - repeatedStringForFields += "}" - s := strings.Join([]string{`&ResultItem{`, - `Score:` + fmt.Sprintf("%v", this.Score) + `,`, - `Fields:` + repeatedStringForFields + `,`, - `Extra:` + fmt.Sprintf("%v", this.Extra) + `,`, - `PKey:` + fmt.Sprintf("%v", this.PKey) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SearchResult) String() string { - if this == nil { - return "nil" - } - repeatedStringForResultItems := "[]*ResultItem{" - for _, f := range this.ResultItems { - repeatedStringForResultItems += strings.Replace(f.String(), "ResultItem", "ResultItem", 1) + "," - } - repeatedStringForResultItems += "}" - keysForExplain := make([]uint32, 0, len(this.Explain)) - for k, _ := range this.Explain { - keysForExplain = append(keysForExplain, k) - } - github_com_gogo_protobuf_sortkeys.Uint32s(keysForExplain) - mapStringForExplain := "map[uint32]string{" - for _, k := range keysForExplain { - mapStringForExplain += fmt.Sprintf("%v: %v,", k, this.Explain[k]) - } - mapStringForExplain += "}" - s := strings.Join([]string{`&SearchResult{`, - `TotalHits:` + fmt.Sprintf("%v", this.TotalHits) + `,`, - `MaxScore:` + fmt.Sprintf("%v", this.MaxScore) + `,`, - `MaxTook:` + fmt.Sprintf("%v", this.MaxTook) + `,`, - `MaxTookId:` + fmt.Sprintf("%v", this.MaxTookId) + `,`, - `Status:` + strings.Replace(this.Status.String(), "SearchStatus", "SearchStatus", 1) + `,`, - `Msg:` + fmt.Sprintf("%v", this.Msg) + `,`, - `ResultItems:` + repeatedStringForResultItems + `,`, - `PID:` + fmt.Sprintf("%v", this.PID) + `,`, - `Explain:` + mapStringForExplain + `,`, - `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, - `TopN:` + fmt.Sprintf("%v", this.TopN) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SearchResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForResults := "[]*SearchResult{" - for _, f := range this.Results { - repeatedStringForResults += strings.Replace(f.String(), "SearchResult", "SearchResult", 1) + "," - } - repeatedStringForResults += "}" - keysForSortFieldMap := make([]string, 0, len(this.SortFieldMap)) - for k, _ := range this.SortFieldMap { - keysForSortFieldMap = append(keysForSortFieldMap, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForSortFieldMap) - mapStringForSortFieldMap := "map[string]string{" - for _, k := range keysForSortFieldMap { - mapStringForSortFieldMap += fmt.Sprintf("%v: %v,", k, this.SortFieldMap[k]) - } - mapStringForSortFieldMap += "}" - s := strings.Join([]string{`&SearchResponse{`, - `Head:` + strings.Replace(this.Head.String(), "ResponseHead", "ResponseHead", 1) + `,`, - `Results:` + repeatedStringForResults + `,`, - `OnlineLogMessage:` + fmt.Sprintf("%v", this.OnlineLogMessage) + `,`, - `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, - `FlatBytes:` + fmt.Sprintf("%v", this.FlatBytes) + `,`, - `SortFieldMap:` + mapStringForSortFieldMap + `,`, - `TopSize:` + fmt.Sprintf("%v", this.TopSize) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SearchStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SearchStatus{`, - `Total:` + fmt.Sprintf("%v", this.Total) + `,`, - `Failed:` + fmt.Sprintf("%v", this.Failed) + `,`, - `Successful:` + fmt.Sprintf("%v", this.Successful) + `,`, - `Msg:` + fmt.Sprintf("%v", this.Msg) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MSearchRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForSearchRequests := "[]*SearchRequest{" - for _, f := range this.SearchRequests { - repeatedStringForSearchRequests += strings.Replace(f.String(), "SearchRequest", "SearchRequest", 1) + "," - } - repeatedStringForSearchRequests += "}" - s := strings.Join([]string{`&MSearchRequest{`, - `Head:` + strings.Replace(this.Head.String(), "RequestHead", "RequestHead", 1) + `,`, - `SearchRequests:` + repeatedStringForSearchRequests + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringRouterGrpc(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *RequestHead) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestHead: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestHead: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeOutMs", wireType) - } - m.TimeOutMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeOutMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DbName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DbName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpaceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpaceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Params[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseHead) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseHead: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseHead: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Err == nil { - m.Err = &Error{} - } - if err := m.Err.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Params[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryKeys", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrimaryKeys = append(m.PrimaryKeys, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryKeys", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrimaryKeys = append(m.PrimaryKeys, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Doc == nil { - m.Doc = &Document{} - } - if err := m.Doc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Doc == nil { - m.Doc = &Document{} - } - if err := m.Doc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BulkRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BulkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BulkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Docs = append(m.Docs, &Document{}) - if err := m.Docs[len(m.Docs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ForceMergeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ForceMergeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ForceMergeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FlushRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FlushRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlushRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IndexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DropBeforeRebuild", wireType) - } - m.DropBeforeRebuild = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DropBeforeRebuild |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitCpu", wireType) - } - m.LimitCpu = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LimitCpu |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Describe", wireType) - } - m.Describe = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Describe |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, &Item{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrimaryKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, &Item{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BulkResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BulkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BulkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, &Item{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ForceMergeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ForceMergeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ForceMergeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shards == nil { - m.Shards = &SearchStatus{} - } - if err := m.Shards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DelByQueryeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DelByQueryeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelByQueryeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DelNum", wireType) - } - m.DelNum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DelNum |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdsStr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IdsStr = append(m.IdsStr, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType == 0 { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IdsLong = append(m.IdsLong, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.IdsLong) == 0 { - m.IdsLong = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IdsLong = append(m.IdsLong, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field IdsLong", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FlushResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FlushResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlushResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shards == nil { - m.Shards = &SearchStatus{} - } - if err := m.Shards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IndexResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shards == nil { - m.Shards = &SearchStatus{} - } - if err := m.Shards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TermFilter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TermFilter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TermFilter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Field = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsUnion", wireType) - } - m.IsUnion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IsUnion |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RangeFilter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RangeFilter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RangeFilter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Field = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LowerValue", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LowerValue = append(m.LowerValue[:0], dAtA[iNdEx:postIndex]...) - if m.LowerValue == nil { - m.LowerValue = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpperValue", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UpperValue = append(m.UpperValue[:0], dAtA[iNdEx:postIndex]...) - if m.UpperValue == nil { - m.UpperValue = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludeLower", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncludeLower = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludeUpper", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncludeUpper = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SortField) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SortField: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SortField: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Field = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VectorQuery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VectorQuery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VectorQuery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field MinScore", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.MinScore = float64(math.Float64frombits(v)) - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxScore", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.MaxScore = float64(math.Float64frombits(v)) - case 5: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Boost", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Boost = float64(math.Float64frombits(v)) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HasBoost", wireType) - } - m.HasBoost = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HasBoost |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Format = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IndexType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexParameters) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IndexParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricType", wireType) - } - m.MetricType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MetricType |= IndexParameters_DistanceMetricType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nprobe", wireType) - } - m.Nprobe = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nprobe |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReqNum", wireType) - } - m.ReqNum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ReqNum |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TopN", wireType) - } - m.TopN = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TopN |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsBruteSearch", wireType) - } - m.IsBruteSearch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IsBruteSearch |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VecFields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VecFields = append(m.VecFields, &VectorQuery{}) - if err := m.VecFields[len(m.VecFields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fields = append(m.Fields, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeFilters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeFilters = append(m.RangeFilters, &RangeFilter{}) - if err := m.RangeFilters[len(m.RangeFilters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TermFilters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TermFilters = append(m.TermFilters, &TermFilter{}) - if err := m.TermFilters[len(m.TermFilters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OnlineLogLevel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OnlineLogLevel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexParams", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IndexParams = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HasRank", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.HasRank = bool(v != 0) - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiVectorRank", wireType) - } - m.MultiVectorRank = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MultiVectorRank |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ParallelBasedOnQuery", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ParallelBasedOnQuery = bool(v != 0) - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L2Sqrt", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.L2Sqrt = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IvfFlat", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IvfFlat = bool(v != 0) - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsVectorValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsVectorValue = bool(v != 0) - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SortFieldMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SortFieldMap == nil { - m.SortFieldMap = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.SortFieldMap[mapkey] = mapvalue - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SortFields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SortFields = append(m.SortFields, &SortField{}) - if err := m.SortFields[len(m.SortFields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResultItem) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResultItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResultItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Score = float64(math.Float64frombits(v)) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fields = append(m.Fields, &Field{}) - if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extra", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extra = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = append(m.Source[:0], dAtA[iNdEx:postIndex]...) - if m.Source == nil { - m.Source = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SearchResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalHits", wireType) - } - m.TotalHits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalHits |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxScore", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.MaxScore = float64(math.Float64frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTook", wireType) - } - m.MaxTook = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTook |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTookId", wireType) - } - m.MaxTookId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTookId |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &SearchStatus{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultItems", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultItems = append(m.ResultItems, &ResultItem{}) - if err := m.ResultItems[len(m.ResultItems)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PID", wireType) - } - m.PID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PID |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Explain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Explain == nil { - m.Explain = make(map[uint32]string) - } - var mapkey uint32 - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Explain[mapkey] = mapvalue - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Timeout = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TopN", wireType) - } - m.TopN = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TopN |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SearchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &ResponseHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Results = append(m.Results, &SearchResult{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OnlineLogMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OnlineLogMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Timeout = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FlatBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FlatBytes = append(m.FlatBytes[:0], dAtA[iNdEx:postIndex]...) - if m.FlatBytes == nil { - m.FlatBytes = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SortFieldMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SortFieldMap == nil { - m.SortFieldMap = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRouterGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.SortFieldMap[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TopSize", wireType) - } - m.TopSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TopSize |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SearchStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - m.Failed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Failed |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Successful", wireType) - } - m.Successful = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Successful |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MSearchRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MSearchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MSearchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Head == nil { - m.Head = &RequestHead{} - } - if err := m.Head.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchRequests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRouterGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRouterGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SearchRequests = append(m.SearchRequests, &SearchRequest{}) - if err := m.SearchRequests[len(m.SearchRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRouterGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRouterGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRouterGrpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRouterGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRouterGrpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRouterGrpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRouterGrpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRouterGrpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRouterGrpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRouterGrpc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/internal/proto/vearchpb/snapshot.pb.go b/internal/proto/vearchpb/snapshot.pb.go index f1db2784..a239d0a6 100644 --- a/internal/proto/vearchpb/snapshot.pb.go +++ b/internal/proto/vearchpb/snapshot.pb.go @@ -1,582 +1,227 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v3.5.0 // source: snapshot.proto package vearchpb import ( - bytes "bytes" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" - strings "strings" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/golang/protobuf/proto" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // snapshot status type SnapshotStatus int32 const ( - SnapshotStatus_UnUse SnapshotStatus = 0 - SnapshotStatus_Start SnapshotStatus = 1 - SnapshotStatus_Running SnapshotStatus = 2 - SnapshotStatus_Finish SnapshotStatus = 3 + SnapshotStatus_UnUse SnapshotStatus = 0 // + SnapshotStatus_Start SnapshotStatus = 1 // start + SnapshotStatus_Running SnapshotStatus = 2 // running + SnapshotStatus_Finish SnapshotStatus = 3 // finish ) -var SnapshotStatus_name = map[int32]string{ - 0: "UnUse", - 1: "Start", - 2: "Running", - 3: "Finish", -} +// Enum value maps for SnapshotStatus. +var ( + SnapshotStatus_name = map[int32]string{ + 0: "UnUse", + 1: "Start", + 2: "Running", + 3: "Finish", + } + SnapshotStatus_value = map[string]int32{ + "UnUse": 0, + "Start": 1, + "Running": 2, + "Finish": 3, + } +) -var SnapshotStatus_value = map[string]int32{ - "UnUse": 0, - "Start": 1, - "Running": 2, - "Finish": 3, +func (x SnapshotStatus) Enum() *SnapshotStatus { + p := new(SnapshotStatus) + *p = x + return p } func (x SnapshotStatus) String() string { - return proto.EnumName(SnapshotStatus_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SnapshotStatus) Descriptor() protoreflect.EnumDescriptor { + return file_snapshot_proto_enumTypes[0].Descriptor() +} + +func (SnapshotStatus) Type() protoreflect.EnumType { + return &file_snapshot_proto_enumTypes[0] +} + +func (x SnapshotStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use SnapshotStatus.Descriptor instead. func (SnapshotStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0c8aab8e59648e0b, []int{0} + return file_snapshot_proto_rawDescGZIP(), []int{0} } // snapshot msg type SnapshotMsg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // absolute file name FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` // file info Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // status - Status SnapshotStatus `protobuf:"varint,3,opt,name=status,proto3,enum=SnapshotStatus" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Status SnapshotStatus `protobuf:"varint,3,opt,name=status,proto3,enum=SnapshotStatus" json:"status,omitempty"` } -func (m *SnapshotMsg) Reset() { *m = SnapshotMsg{} } -func (*SnapshotMsg) ProtoMessage() {} -func (*SnapshotMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0c8aab8e59648e0b, []int{0} -} -func (m *SnapshotMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *SnapshotMsg) Reset() { + *x = SnapshotMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_snapshot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *SnapshotMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotMsg.Merge(m, src) -} -func (m *SnapshotMsg) XXX_Size() int { - return m.Size() -} -func (m *SnapshotMsg) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotMsg.DiscardUnknown(m) -} -var xxx_messageInfo_SnapshotMsg proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("SnapshotStatus", SnapshotStatus_name, SnapshotStatus_value) - proto.RegisterType((*SnapshotMsg)(nil), "SnapshotMsg") +func (x *SnapshotMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func init() { proto.RegisterFile("snapshot.proto", fileDescriptor_0c8aab8e59648e0b) } - -var fileDescriptor_0c8aab8e59648e0b = []byte{ - // 276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0xce, 0x4b, 0x2c, - 0x28, 0xce, 0xc8, 0x2f, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x97, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x0b, 0x27, 0x95, - 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x51, 0xae, 0x94, 0xce, 0xc5, 0x1d, 0x0c, 0x35, 0xc0, - 0xb7, 0x38, 0x5d, 0x48, 0x9a, 0x8b, 0x33, 0x2d, 0x33, 0x27, 0x35, 0x3e, 0x2f, 0x31, 0x37, 0x55, - 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0x03, 0x24, 0xe0, 0x97, 0x98, 0x9b, 0x2a, 0x24, 0xc4, - 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x0b, 0xa9, - 0x73, 0xb1, 0x15, 0x97, 0x24, 0x96, 0x94, 0x16, 0x4b, 0x30, 0x2b, 0x30, 0x6a, 0xf0, 0x19, 0xf1, - 0xeb, 0xc1, 0x8c, 0x0b, 0x06, 0x0b, 0x07, 0x41, 0xa5, 0xb5, 0xec, 0xb9, 0xf8, 0x50, 0x65, 0x84, - 0x38, 0xb9, 0x58, 0x43, 0xf3, 0x42, 0x8b, 0x53, 0x05, 0x18, 0x40, 0xcc, 0xe0, 0x92, 0xc4, 0xa2, - 0x12, 0x01, 0x46, 0x21, 0x6e, 0x2e, 0xf6, 0xa0, 0xd2, 0xbc, 0xbc, 0xcc, 0xbc, 0x74, 0x01, 0x26, - 0x21, 0x2e, 0x2e, 0x36, 0xb7, 0xcc, 0xbc, 0xcc, 0xe2, 0x0c, 0x01, 0x66, 0x27, 0x87, 0x13, 0x0f, - 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x78, 0xf0, 0x50, 0x8e, 0xe1, 0xc3, 0x43, 0x39, 0x86, 0x1f, - 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, 0xb8, 0xe3, 0x91, 0x1c, 0xc3, - 0x81, 0x47, 0x72, 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, - 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x1e, 0x8c, 0x51, 0x1c, 0x65, 0xa9, 0x89, 0x45, 0xc9, 0x19, 0x05, - 0x49, 0x49, 0x6c, 0x60, 0x2f, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x68, 0x84, 0xd7, 0x7b, - 0x33, 0x01, 0x00, 0x00, -} - -func (this *SnapshotMsg) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (*SnapshotMsg) ProtoMessage() {} - that1, ok := that.(*SnapshotMsg) - if !ok { - that2, ok := that.(SnapshotMsg) - if ok { - that1 = &that2 - } else { - return false +func (x *SnapshotMsg) ProtoReflect() protoreflect.Message { + mi := &file_snapshot_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FileName != that1.FileName { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if this.Status != that1.Status { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (m *SnapshotMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil + return mi.MessageOf(x) } -func (m *SnapshotMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// Deprecated: Use SnapshotMsg.ProtoReflect.Descriptor instead. +func (*SnapshotMsg) Descriptor() ([]byte, []int) { + return file_snapshot_proto_rawDescGZIP(), []int{0} } -func (m *SnapshotMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Status != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x18 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 +func (x *SnapshotMsg) GetFileName() string { + if x != nil { + return x.FileName } - if len(m.FileName) > 0 { - i -= len(m.FileName) - copy(dAtA[i:], m.FileName) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.FileName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + return "" } -func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { - offset -= sovSnapshot(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (x *SnapshotMsg) GetData() []byte { + if x != nil { + return x.Data } - dAtA[offset] = uint8(v) - return base + return nil } -func NewPopulatedSnapshotMsg(r randySnapshot, easy bool) *SnapshotMsg { - this := &SnapshotMsg{} - this.FileName = string(randStringSnapshot(r)) - v1 := r.Intn(100) - this.Data = make([]byte, v1) - for i := 0; i < v1; i++ { - this.Data[i] = byte(r.Intn(256)) - } - this.Status = SnapshotStatus([]int32{0, 1, 2, 3}[r.Intn(4)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedSnapshot(r, 4) + +func (x *SnapshotMsg) GetStatus() SnapshotStatus { + if x != nil { + return x.Status } - return this + return SnapshotStatus_UnUse } -type randySnapshot interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} +var File_snapshot_proto protoreflect.FileDescriptor -func randUTF8RuneSnapshot(r randySnapshot) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringSnapshot(r randySnapshot) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneSnapshot(r) - } - return string(tmps) -} -func randUnrecognizedSnapshot(r randySnapshot, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldSnapshot(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldSnapshot(dAtA []byte, r randySnapshot, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateSnapshot(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateSnapshot(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *SnapshotMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FileName) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - if m.Status != 0 { - n += 1 + sovSnapshot(uint64(m.Status)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n +var file_snapshot_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x67, 0x0a, 0x0b, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x73, 0x67, 0x12, + 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x27, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x0f, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x3f, 0x0a, 0x0e, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x55, + 0x6e, 0x55, 0x73, 0x65, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, 0x03, 0x42, 0x0e, 0x48, 0x01, 0x5a, 0x0a, + 0x2e, 0x2f, 0x76, 0x65, 0x61, 0x72, 0x63, 0x68, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } -func sovSnapshot(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSnapshot(x uint64) (n int) { - return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *SnapshotMsg) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SnapshotMsg{`, - `FileName:` + fmt.Sprintf("%v", this.FileName) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringSnapshot(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *SnapshotMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FileName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= SnapshotStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } +var ( + file_snapshot_proto_rawDescOnce sync.Once + file_snapshot_proto_rawDescData = file_snapshot_proto_rawDesc +) - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSnapshot(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break +func file_snapshot_proto_rawDescGZIP() []byte { + file_snapshot_proto_rawDescOnce.Do(func() { + file_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(file_snapshot_proto_rawDescData) + }) + return file_snapshot_proto_rawDescData +} + +var file_snapshot_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_snapshot_proto_goTypes = []interface{}{ + (SnapshotStatus)(0), // 0: SnapshotStatus + (*SnapshotMsg)(nil), // 1: SnapshotMsg +} +var file_snapshot_proto_depIdxs = []int32{ + 0, // 0: SnapshotMsg.status:type_name -> SnapshotStatus + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_snapshot_proto_init() } +func file_snapshot_proto_init() { + if File_snapshot_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_snapshot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapshotMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil } } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSnapshot - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSnapshot - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_snapshot_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_snapshot_proto_goTypes, + DependencyIndexes: file_snapshot_proto_depIdxs, + EnumInfos: file_snapshot_proto_enumTypes, + MessageInfos: file_snapshot_proto_msgTypes, + }.Build() + File_snapshot_proto = out.File + file_snapshot_proto_rawDesc = nil + file_snapshot_proto_goTypes = nil + file_snapshot_proto_depIdxs = nil } - -var ( - ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") -) diff --git a/internal/ps/storage/raftstore/raft_state_machine.go b/internal/ps/storage/raftstore/raft_state_machine.go index 8764f73c..fddf0597 100644 --- a/internal/ps/storage/raftstore/raft_state_machine.go +++ b/internal/ps/storage/raftstore/raft_state_machine.go @@ -82,7 +82,7 @@ func (s *Store) ReplicasStatusChange() bool { func (s *Store) Apply(command []byte, index uint64) (resp interface{}, err error) { raftCmd := vearchpb.CreateRaftCommand() - if err = raftCmd.Unmarshal(command); err != nil { + if err = vjson.Unmarshal(command, raftCmd); err != nil { panic(err) } diff --git a/internal/ps/storage/raftstore/store_writer.go b/internal/ps/storage/raftstore/store_writer.go index f9bb8d8a..5c7ff7ca 100644 --- a/internal/ps/storage/raftstore/store_writer.go +++ b/internal/ps/storage/raftstore/store_writer.go @@ -60,7 +60,7 @@ func (s *Store) UpdateSpace(ctx context.Context, space *entity.Space) error { } }() - data, err := raftCmd.Marshal() + data, err := vjson.Marshal(raftCmd) if err != nil { return err @@ -103,7 +103,7 @@ func (s *Store) Write(ctx context.Context, request *vearchpb.DocCmd) (err error) raftCmd.Type = vearchpb.CmdType_WRITE raftCmd.WriteCommand = request - data, err := raftCmd.Marshal() + data, err := vjson.Marshal(raftCmd) if err != nil { return err } @@ -147,7 +147,7 @@ func (s *Store) Flush(ctx context.Context) error { raftCmd := vearchpb.CreateRaftCommand() raftCmd.Type = vearchpb.CmdType_FLUSH - data, err := raftCmd.Marshal() + data, err := vjson.Marshal(raftCmd) if err != nil { return err } diff --git a/internal/router/document/doc_http.go b/internal/router/document/doc_http.go index a0f2c841..fb274fbd 100644 --- a/internal/router/document/doc_http.go +++ b/internal/router/document/doc_http.go @@ -253,10 +253,9 @@ func (handler *DocumentHandler) handleDocumentUpsert(c *gin.Context) { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("documentHeadParse error: %v", err)) return } - args.Head.DbName = dbName args.Head.SpaceName = spaceName - space, err := handler.client.Space(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -298,7 +297,7 @@ func (handler *DocumentHandler) handleDocumentQuery(c *gin.Context) { args.Head.DbName = searchDoc.DbName args.Head.SpaceName = searchDoc.SpaceName - space, err := handler.docService.getSpace(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -308,6 +307,8 @@ func (handler *DocumentHandler) handleDocumentQuery(c *gin.Context) { resp.SendError(c, http.StatusBadRequest, err.Error()) return } + // update space name because maybe is alias name + searchDoc.SpaceName = args.Head.SpaceName err = requestToPb(searchDoc, space, args) if err != nil { @@ -400,7 +401,7 @@ func (handler *DocumentHandler) handleDocumentSearch(c *gin.Context) { args.Head.DbName = searchDoc.DbName args.Head.SpaceName = searchDoc.SpaceName - space, err := handler.docService.getSpace(ctx, args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -409,6 +410,8 @@ func (handler *DocumentHandler) handleDocumentSearch(c *gin.Context) { resp.SendError(c, http.StatusBadRequest, err.Error()) return } + // update space name because maybe is alias name + searchDoc.SpaceName = args.Head.SpaceName err = requestToPb(searchDoc, space, args) if err != nil { @@ -509,7 +512,7 @@ func (handler *DocumentHandler) handleDocumentDelete(c *gin.Context) { args.Head.DbName = searchDoc.DbName args.Head.SpaceName = searchDoc.SpaceName - space, err := handler.docService.getSpace(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -518,6 +521,8 @@ func (handler *DocumentHandler) handleDocumentDelete(c *gin.Context) { resp.SendError(c, http.StatusBadRequest, err.Error()) return } + // update space name because maybe is alias name + searchDoc.SpaceName = args.Head.SpaceName err = requestToPb(searchDoc, space, args) if err != nil { @@ -590,7 +595,7 @@ func (handler *DocumentHandler) handleIndexFlush(c *gin.Context) { args.Head.DbName = indexRequest.DbName args.Head.SpaceName = indexRequest.SpaceName - space, err := handler.docService.getSpace(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -625,7 +630,7 @@ func (handler *DocumentHandler) handleIndexForceMerge(c *gin.Context) { args.Head.DbName = indexRequest.DbName args.Head.SpaceName = indexRequest.SpaceName - space, err := handler.docService.getSpace(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return @@ -667,7 +672,7 @@ func (handler *DocumentHandler) handleIndexRebuild(c *gin.Context) { args.LimitCpu = int64(indexRequest.LimitCPU) args.Describe = int64(indexRequest.Describe) - space, err := handler.docService.getSpace(c.Request.Context(), args.Head.DbName, args.Head.SpaceName) + space, err := handler.docService.getSpace(c.Request.Context(), args.Head) if space == nil { resp.SendError(c, http.StatusBadRequest, fmt.Sprintf("dbName:%s or spaceName:%s not exist", args.Head.DbName, args.Head.SpaceName)) return diff --git a/internal/router/document/doc_resp.go b/internal/router/document/doc_resp.go index 674cdb8a..f4347943 100644 --- a/internal/router/document/doc_resp.go +++ b/internal/router/document/doc_resp.go @@ -233,23 +233,22 @@ func documentSearchResponse(srs []*vearchpb.SearchResult, head *vearchpb.Respons var documents []json.RawMessage if len(srs) > 1 { var wg sync.WaitGroup - respChain := make(chan json.RawMessage, len(srs)) - for _, sr := range srs { + resp := make([][]byte, len(srs)) + for i, sr := range srs { wg.Add(1) - go func(sr *vearchpb.SearchResult) { + go func(sr *vearchpb.SearchResult, index int) { defer wg.Done() bytes, err := documentToContent(sr.ResultItems, response_type) if err != nil { return } - respChain <- json.RawMessage(bytes) - }(sr) + resp[index] = json.RawMessage(bytes) + }(sr, i) } wg.Wait() - close(respChain) - for msg := range respChain { + for _, msg := range resp { documents = append(documents, msg) } } else { @@ -262,7 +261,15 @@ func documentSearchResponse(srs []*vearchpb.SearchResult, head *vearchpb.Respons } } - response["documents"] = documents + if response_type == request.SearchResponse { + response["documents"] = documents + } else { + if len(documents) > 0 { + response["documents"] = documents[0] + } else { + response["documents"] = nil + } + } return vjson.Marshal(response) } @@ -278,20 +285,18 @@ func documentToContent(dh []*vearchpb.ResultItem, response_type string) ([]byte, } if u.Source != nil { - content["_source"] = u.Source + var sourceJson json.RawMessage + if err := vjson.Unmarshal(u.Source, &sourceJson); err != nil { + log.Error("DocToContent Source Unmarshal error:%v", err) + } else { + content["_source"] = sourceJson + } } contents = append(contents, content) } - if response_type == request.SearchResponse { - return vjson.Marshal(contents) - } - - if len(contents) > 0 { - return vjson.Marshal(contents[0]) - } - return vjson.Marshal(nil) + return vjson.Marshal(contents) } func documentDeleteResponse(items []*vearchpb.Item, head *vearchpb.ResponseHead, resultIds []string) ([]byte, error) { diff --git a/internal/router/document/doc_rpc.go b/internal/router/document/doc_rpc.go index 13faeb30..b20cf2b5 100644 --- a/internal/router/document/doc_rpc.go +++ b/internal/router/document/doc_rpc.go @@ -27,7 +27,6 @@ import ( "github.com/vearch/vearch/internal/monitor" "github.com/vearch/vearch/internal/pkg/log" "github.com/vearch/vearch/internal/proto/vearchpb" - "google.golang.org/grpc" ) const defaultTimeOutMs = 1 * 1000 @@ -41,16 +40,16 @@ type RpcHandler struct { docService docService } -func ExportRpcHandler(rpcServer *grpc.Server, client *client.Client) { - docService := newDocService(client) +// func ExportRpcHandler(rpcServer *grpc.Server, client *client.Client) { +// docService := newDocService(client) - rpcHandler := &RpcHandler{ - client: client, - docService: *docService, - } +// rpcHandler := &RpcHandler{ +// client: client, +// docService: *docService, +// } - vearchpb.RegisterRouterGRPCServiceServer(rpcServer, rpcHandler) -} +// vearchpb.RegisterRouterGRPCServiceServer(rpcServer, rpcHandler) +// } func (handler *RpcHandler) Space(ctx context.Context, req *vearchpb.RequestHead) (reply *vearchpb.Table, err error) { defer func() { diff --git a/internal/router/document/doc_service.go b/internal/router/document/doc_service.go index 03f7f4aa..ea75beba 100644 --- a/internal/router/document/doc_service.go +++ b/internal/router/document/doc_service.go @@ -184,8 +184,12 @@ func newOkHead() *vearchpb.ResponseHead { return &vearchpb.ResponseHead{Err: vearchpb.NewError(code, nil).GetError()} } -func (docService *docService) getSpace(ctx context.Context, dbName string, spaceName string) (*entity.Space, error) { - return docService.client.Master().Cache().SpaceByCache(ctx, dbName, spaceName) +func (docService *docService) getSpace(ctx context.Context, head *vearchpb.RequestHead) (*entity.Space, error) { + if alias, err := docService.client.Master().Cache().AliasByCache(ctx, head.SpaceName); err == nil { + head.SpaceName = alias.SpaceName + } + return docService.client.Master().Cache().SpaceByCache(ctx, head.DbName, head.SpaceName) + } func (docService *docService) search(ctx context.Context, args *vearchpb.SearchRequest) *vearchpb.SearchResponse { diff --git a/internal/router/server.go b/internal/router/server.go index 37822946..b809b008 100644 --- a/internal/router/server.go +++ b/internal/router/server.go @@ -83,7 +83,7 @@ func NewServer(ctx context.Context) (*Server, error) { panic(fmt.Errorf("start rpc server failed to start: %v", err)) } }() - document.ExportRpcHandler(rpcServer, cli) + // document.ExportRpcHandler(rpcServer, cli) } routerCtx, routerCancel := context.WithCancel(ctx) diff --git a/test/test_module_alias.py b/test/test_module_alias.py index 540be944..fef15f47 100644 --- a/test/test_module_alias.py +++ b/test/test_module_alias.py @@ -29,6 +29,9 @@ __description__ = """ test case for module alias """ +xb, xq, _, gt = get_sift10K(logger) + + class TestAlias: def setup(self): self.logger = logger @@ -49,37 +52,12 @@ def test_create_space(self, space_name): "partition_num": 1, "replica_num": 1, "fields": [ - { - "name": "field_string", - "type": "keyword" - }, { "name": "field_int", - "type": "integer" - }, - { - "name": "field_float", - "type": "float", - "index": { - "name": "field_float", - "type": "SCALAR", - }, - }, - { - "name": "field_string_array", - "type": "string", - "array": True, - "index": { - "name": "field_string_array", - "type": "SCALAR", - }, - }, - { - "name": "field_int_index", "type": "integer", "index": { - "name": "field_int_index", - "type": "SCALAR", + "name": "field_int", + "type": "SCALAR" }, }, { @@ -90,23 +68,11 @@ def test_create_space(self, space_name): "name": "gamma", "type": "FLAT", "params": { - "metric_type": "InnerProduct", - "ncentroids": 2048, - "nsubvector": 32, - "nlinks": 32, - "efConstruction": 40, - "nprobe":80, - "efSearch":64, - "training_threshold":70000 + "metric_type": "L2", } }, - }, - # { - # "name": "field_vector_normal", - # "type": "vector", - # "dimension": int(embedding_size * 2), - # "format": "normalization" - # } + #"format": "normalization" + } ] } @@ -247,6 +213,35 @@ def test_multithread(self): response = drop_alias(router_url, alias["name"]) assert response["code"] == 200 + def test_document_operation(self): + embedding_size = xb.shape[1] + batch_size = 100 + k = 100 + + total_batch = 1 + total = int(total_batch * batch_size) + + response = create_alias(router_url, "alias_name", db_name, space_name) + assert response["code"] == 200 + + add(total_batch, batch_size, xb, with_id=True, alias_name="alias_name") + + waiting_index_finish(logger, total) + + query_interface(logger, total_batch, batch_size, xb, query_type = "by_ids", alias_name="alias_name") + query_interface(logger, total_batch, batch_size, xb, query_type = "by_filter", alias_name="alias_name") + + search_interface(logger, total_batch, batch_size, xb, query_type="by_vector", alias_name="alias_name") + search_interface(logger, total_batch, batch_size, xb, query_type="by_ids", alias_name="alias_name") + + delete_interface(logger, total_batch, batch_size, delete_type="by_filter", alias_name="alias_name") + + add(total_batch, batch_size, xb, with_id=True, alias_name="alias_name") + delete_interface(logger, total_batch, batch_size, delete_type="by_ids", alias_name="alias_name") + + response = drop_alias(router_url, "alias_name") + assert response["code"] == 200 + def test_destroy_db_and_space(self): space_info = list_spaces(router_url, db_name) for space in space_info["data"]: diff --git a/test/utils/vearch_utils.py b/test/utils/vearch_utils.py index 001af948..f153eea2 100644 --- a/test/utils/vearch_utils.py +++ b/test/utils/vearch_utils.py @@ -45,6 +45,8 @@ def process_add_data(items): with_id = items[3] full_field = items[4] seed = items[5] + if items[6] != "": + data["space_name"] = items[6] for j in range(batch_size): param_dict = {} if with_id: @@ -62,7 +64,7 @@ def process_add_data(items): rs = requests.post(url, json_str) -def add(total, batch_size, xb, with_id=False, full_field=False, seed=1): +def add(total, batch_size, xb, with_id=False, full_field=False, seed=1, alias_name=""): pool = ThreadPool() total_data = [] for i in range(total): @@ -74,6 +76,7 @@ def add(total, batch_size, xb, with_id=False, full_field=False, seed=1): with_id, full_field, seed, + alias_name, ) ) results = pool.map(process_add_data, total_data) @@ -532,6 +535,8 @@ def process_get_data(items): full_field = items[4] seed = items[5] query_type = items[6] + if items[7] != "": + data["space_name"] = items[7] if query_type == "by_partition" or query_type == "by_partition_next" or query_type == "by_ids": data["query"]["document_ids"] = [] @@ -564,6 +569,7 @@ def process_get_data(items): documents = rs.json()["documents"] if len(documents) != batch_size: logger.info("len(documents) = " + str(len(documents))) + logger.info(rs.json()) logger.info(json_str) assert len(documents) == batch_size @@ -588,7 +594,7 @@ def process_get_data(items): def query_interface( - logger, total, batch_size, xb, full_field=False, seed=1, query_type="by_ids" + logger, total, batch_size, xb, full_field=False, seed=1, query_type="by_ids", alias_name="" ): if query_type == "by_partition_next" and batch_size == 1: total -= 1 @@ -602,6 +608,7 @@ def query_interface( full_field, seed, query_type, + alias_name, ) ) @@ -629,6 +636,8 @@ def process_delete_data(items): full_field = items[3] seed = items[4] delete_type = items[5] + if items[6] != "": + data["space_name"] = items[6] if delete_type == "by_ids": data["query"]["document_ids"] = [] @@ -656,17 +665,16 @@ def process_delete_data(items): ) logger.info(json_str) logger.info(rs.json()) - logger.info(document_ids) assert len(document_ids) == batch_size assert rs.text.find('"total":' + str(batch_size)) >= 0 def delete_interface( - logger, total, batch_size, full_field=False, seed=1, delete_type="by_ids" + logger, total, batch_size, full_field=False, seed=1, delete_type="by_ids", alias_name="" ): for i in range(total): - process_delete_data((logger, i, batch_size, full_field, seed, delete_type)) + process_delete_data((logger, i, batch_size, full_field, seed, delete_type, alias_name)) def process_search_data(items): @@ -685,6 +693,8 @@ def process_search_data(items): with_filter = items[5] seed = items[6] query_type = items[7] + if items[8] != "": + data["space_name"] = items[8] if query_type == "by_ids": data["query"]["document_ids"] = [] @@ -750,6 +760,7 @@ def search_interface( with_filter=False, seed=1, query_type="by_ids", + alias_name="" ): for i in range(total): process_search_data( @@ -762,6 +773,7 @@ def search_interface( with_filter, seed, query_type, + alias_name, ) )