diff --git a/Makefile b/Makefile deleted file mode 100644 index e8f9e3a8ae..0000000000 --- a/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -master-proto-gen: - protoc --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/master/master.proto - protoc --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/message/message.proto diff --git a/conf/conf.go b/conf/conf.go deleted file mode 100644 index e0c46c010c..0000000000 --- a/conf/conf.go +++ /dev/null @@ -1,74 +0,0 @@ -package conf - -import ( - "github.com/czs007/suvlim/storage/pkg/types" - yaml "gopkg.in/yaml.v2" - "io/ioutil" -) - -// yaml.MapSlice - -type MasterConfig struct { - Address string - Port int32 -} - -type EtcdConfig struct { - Address string - Port int32 - Rootpath string - Segthreshold int64 -} - -type TimeSyncConfig struct { - Interval int32 -} - -type StorageConfig struct { - Driver types.DriverType - Address string - Port int32 - Accesskey string - Secretkey string -} - -type PulsarConfig struct { - Address string - Port int32 -} - -//type ProxyConfig struct { -// Timezone string -// Address string -// Port int32 -//} - -type ServerConfig struct { - Master MasterConfig - Etcd EtcdConfig - Timesync TimeSyncConfig - Storage StorageConfig - Pulsar PulsarConfig - //Proxy ProxyConfig -} - -var Config ServerConfig - -func init() { - load_config() -} - -func load_config() { - //var config ServerConfig - filename := "conf/config.yaml" - source, err := ioutil.ReadFile(filename) - if err != nil { - panic(err) - } - err = yaml.Unmarshal(source, &Config) - if err != nil { - panic(err) - } - - //fmt.Printf("Result: %v\n", Config) -} diff --git a/conf/conf.toml b/conf/conf.toml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/conf/conf_test.go b/conf/conf_test.go deleted file mode 100644 index e133ee5e5e..0000000000 --- a/conf/conf_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package conf - -import ( - "fmt" - "testing" -) - -func TestMain(m *testing.M) { - fmt.Printf("Result: %v\n", Config) -} - diff --git a/conf/config.yaml b/conf/config.yaml deleted file mode 100644 index 22cdc53ed2..0000000000 --- a/conf/config.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. - -master: - address: localhost - port: 6000 - -etcd: - address: localhost - port: 0 - rootpath: a - segthreshold: 10000 - -timesync: - interval: 10 - -storage: - driver: MinIO - address: localhost - port: 0 - accesskey: ab - secretkey: dd - -pulsar: - address: 0.0.0.0 - port: 6650 - -proxy: - timezone: UTC+8 - - network: - address: 0.0.0.0 - port: 19530 - - logs: - level: debug - trace.enable: true - path: /tmp/logs - max_log_file_size: 1024MB - log_rotate_num: 0 - - storage: - path: /var/lib/milvus - auto_flush_interval: 1 diff --git a/conf/server_config.template b/conf/server_config.template new file mode 100644 index 0000000000..2ccab5e200 --- /dev/null +++ b/conf/server_config.template @@ -0,0 +1,188 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +version: 0.5 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cluster Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | If running with Mishards, set true, otherwise false. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# role | Milvus deployment role: rw / ro | Role | rw | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cluster: + enable: false + role: rw + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# General Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# timezone | Use UTC-x or UTC+x to specify a time zone. | Timezone | UTC+8 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# meta_uri | URI for metadata storage, using SQLite (for single server | URI | sqlite://:@:/ | +# | Milvus) or MySQL (for distributed cluster Milvus). | | | +# | Format: dialect://username:password@host:port/database | | | +# | Keep 'dialect://:@:/', 'dialect' can be either 'sqlite' or | | | +# | 'mysql', replace other texts with real values. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +general: + timezone: UTC+8 + meta_uri: sqlite://:@:/ + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Network Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.address | IP address that Milvus server monitors. | IP | 0.0.0.0 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.port | Port that Milvus server monitors. Port range (1024, 65535) | Integer | 19530 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.enable | Enable HTTP server or not. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.port | Port that Milvus HTTP server monitors. | Integer | 19121 | +# | Port range (1024, 65535) | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +network: + bind.address: 0.0.0.0 + bind.port: 19530 + http.enable: true + http.port: 19121 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Storage Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Path used to save meta data, vector data and index data. | Path | /var/lib/milvus | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# auto_flush_interval | The interval, in seconds, at which Milvus automatically | Integer | 1 (s) | +# | flushes data to disk. | | | +# | 0 means disable the regular flush. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +storage: + path: @MILVUS_DB_PATH@ + auto_flush_interval: 1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# WAL Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Whether to enable write-ahead logging (WAL) in Milvus. | Boolean | true | +# | If WAL is enabled, Milvus writes all data changes to log | | | +# | files in advance before implementing data changes. WAL | | | +# | ensures the atomicity and durability for Milvus operations.| | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# recovery_error_ignore| Whether to ignore logs with errors that happens during WAL | Boolean | false | +# | recovery. If true, when Milvus restarts for recovery and | | | +# | there are errors in WAL log files, log files with errors | | | +# | are ignored. If false, Milvus does not restart when there | | | +# | are errors in WAL log files. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# buffer_size | Sum total of the read buffer and the write buffer in Bytes.| String | 256MB | +# | buffer_size must be in range [64MB, 4096MB]. | | | +# | If the value you specified is out of range, Milvus | | | +# | automatically uses the boundary value closest to the | | | +# | specified value. It is recommended you set buffer_size to | | | +# | a value greater than the inserted data size of a single | | | +# | insert operation for better performance. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Location of WAL log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +wal: + enable: true + recovery_error_ignore: false + buffer_size: 256MB + path: @MILVUS_DB_PATH@/wal + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cache Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of CPU memory used for caching data for faster | String | 4GB | +# | query. The sum of 'cache_size' and 'insert_buffer_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# insert_buffer_size | Buffer size used for data insertion. | String | 1GB | +# | The sum of 'insert_buffer_size' and 'cache_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# preload_collection | A comma-separated list of collection names that need to | StringList | | +# | be pre-loaded when Milvus server starts up. | | | +# | '*' means preload all existing tables (single-quote or | | | +# | double-quote required). | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cache: + cache_size: 4GB + insert_buffer_size: 1GB + preload_collection: + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# GPU Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Use GPU devices or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of GPU memory per card used for cache. | String | 1GB | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# gpu_search_threshold | A Milvus performance tuning parameter. This value will be | Integer | 1000 | +# | compared with 'nq' to decide if the search computation will| | | +# | be executed on GPUs only. | | | +# | If nq >= gpu_search_threshold, the search computation will | | | +# | be executed on GPUs only; | | | +# | if nq < gpu_search_threshold, the search computation will | | | +# | be executed on both CPUs and GPUs. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# search_devices | The list of GPU devices used for search computation. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# build_index_devices | The list of GPU devices used for index building. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +gpu: + enable: @GPU_ENABLE@ + cache_size: 1GB + gpu_search_threshold: 1000 + search_devices: + - gpu0 + build_index_devices: + - gpu0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# level | Log level in Milvus. Must be one of debug, info, warning, | String | debug | +# | error, fatal | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Absolute path to the folder holding the log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | The maximum size of each log file, size range | String | 1024MB | +# | [512MB, 4096MB]. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# log_rotate_num | The maximum number of log files that Milvus keeps for each | Integer | 0 | +# | logging level, num range [0, 1024], 0 means unlimited. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +logs: + level: debug + trace.enable: true + path: @MILVUS_DB_PATH@/logs + max_log_file_size: 1024MB + log_rotate_num: 0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Metric Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Enable monitoring function or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# address | Pushgateway address | IP | 127.0.0.1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# port | Pushgateway port, port range (1024, 65535) | Integer | 9091 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +metric: + enable: false + address: 127.0.0.1 + port: 9091 + diff --git a/conf/storage.toml b/conf/storage.toml new file mode 100644 index 0000000000..08208e61da --- /dev/null +++ b/conf/storage.toml @@ -0,0 +1 @@ +driver="S3" diff --git a/core/include/segment_c.h b/core/include/segment_c.h index 937ec69578..3dcee14ae6 100644 --- a/core/include/segment_c.h +++ b/core/include/segment_c.h @@ -17,27 +17,19 @@ DeleteSegment(CSegmentBase segment); int Insert(CSegmentBase c_segment, - long int reserved_offset, signed long int size, - const long* primary_keys, + const unsigned long* primary_keys, const unsigned long* timestamps, void* raw_data, int sizeof_per_row, signed long int count); -long int -PreInsert(CSegmentBase c_segment, long int size); - int Delete(CSegmentBase c_segment, - long int reserved_offset, long size, - const long* primary_keys, + const unsigned long* primary_keys, const unsigned long* timestamps); -long int -PreDelete(CSegmentBase c_segment, long int size); - int Search(CSegmentBase c_segment, void* fake_query, @@ -61,6 +53,24 @@ GetRowCount(CSegmentBase c_segment); long int GetDeletedCount(CSegmentBase c_segment); +unsigned long +GetTimeBegin(CSegmentBase c_segment); + +void +SetTimeBegin(CSegmentBase c_segment, unsigned long time_begin); + +unsigned long +GetTimeEnd(CSegmentBase c_segment); + +void +SetTimeEnd(CSegmentBase c_segment, unsigned long time_end); + +unsigned long +GetSegmentId(CSegmentBase c_segment); + +void +SetSegmentId(CSegmentBase c_segment, unsigned long segment_id); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/core/src/dog_segment/CMakeLists.txt b/core/src/dog_segment/CMakeLists.txt index 10d770ecb3..fc1e61cddf 100644 --- a/core/src/dog_segment/CMakeLists.txt +++ b/core/src/dog_segment/CMakeLists.txt @@ -2,15 +2,15 @@ set(DOG_SEGMENT_FILES SegmentNaive.cpp IndexMeta.cpp ConcurrentVector.cpp - Collection.cpp - Partition.cpp - collection_c.cpp - partition_c.cpp - segment_c.cpp + # Collection.cpp + # Partition.cpp + # collection_c.cpp + # partition_c.cpp + # segment_c.cpp ) add_library(milvus_dog_segment SHARED - ${DOG_SEGMENT_FILES} - ) + ${DOG_SEGMENT_FILES} +) #add_dependencies( segment sqlite mysqlpp ) target_link_libraries(milvus_dog_segment tbb milvus_utils pthread) diff --git a/core/src/dog_segment/Collection.cpp b/core/src/dog_segment/Collection.cpp index 82664ed927..c7028988a8 100644 --- a/core/src/dog_segment/Collection.cpp +++ b/core/src/dog_segment/Collection.cpp @@ -3,20 +3,12 @@ namespace milvus::dog_segment { Collection::Collection(std::string &collection_name, std::string &schema): - collection_name_(collection_name), schema_json_(schema) { - parse(); -} + collection_name_(collection_name), schema_json_(schema){} void Collection::set_index() {} void -Collection::parse() { - auto schema = std::make_shared(); - schema->AddField("fakevec", DataType::VECTOR_FLOAT, 16); - schema->AddField("age", DataType::INT32); - schema_ = schema; -} +Collection::parse() {} } - diff --git a/core/src/dog_segment/Collection.h b/core/src/dog_segment/Collection.h index c0718c203b..d7973e25cc 100644 --- a/core/src/dog_segment/Collection.h +++ b/core/src/dog_segment/Collection.h @@ -1,37 +1,51 @@ #pragma once -#include "dog_segment/Partition.h" #include "SegmentDefs.h" -namespace milvus::dog_segment { +////////////////////////////////////////////////////////////////// -class Collection { +class Partition { public: - explicit Collection(std::string &collection_name, std::string &schema); - - // TODO: set index - void set_index(); - - // TODO: config to schema - void parse(); - -public: - SchemaPtr& get_schema() { - return schema_; - } - - std::string& get_collection_name() { - return collection_name_; + const std::deque& segments() const { + return segments_; } private: - // TODO: add Index ptr - // IndexPtr index_ = nullptr; - std::string collection_name_; - std::string schema_json_; - SchemaPtr schema_; + std::string name_; + std::deque segments_; }; -using CollectionPtr = std::unique_ptr; +using PartitionPtr = std::shard_ptr; -} \ No newline at end of file +////////////////////////////////////////////////////////////////// + +class Collection { +public: + explicit Collection(std::string name): name_(name){} + + // TODO: set index + set_index() {} + + set_schema(std::string config) { + // TODO: config to schema + schema_ = null; + } + +public: +// std::vector Insert() { +// for (auto partition: partitions_) { +// for (auto segment: partition.segments()) { +// if (segment.Status == Status.open) { +// segment.Insert() +// } +// } +// } +// } + +private: + // TODO: Index ptr + IndexPtr index_ = nullptr; + std::string name_; + SchemaPtr schema_; + std::vector partitions_; +}; diff --git a/core/src/dog_segment/ConcurrentVector.h b/core/src/dog_segment/ConcurrentVector.h index 82dcab3339..f87b8fee9a 100644 --- a/core/src/dog_segment/ConcurrentVector.h +++ b/core/src/dog_segment/ConcurrentVector.h @@ -115,7 +115,7 @@ class ConcurrentVector : public VectorBase { void set_data_raw(ssize_t element_offset, void* source, ssize_t element_count) override { - set_data(element_offset, static_cast(source), element_count); + set_data(element_count, static_cast(source), element_count); } void diff --git a/core/src/dog_segment/SegmentBase.h b/core/src/dog_segment/SegmentBase.h index 578239686d..c916f6e9b5 100644 --- a/core/src/dog_segment/SegmentBase.h +++ b/core/src/dog_segment/SegmentBase.h @@ -45,7 +45,7 @@ class SegmentBase { // query contains metadata of virtual Status - Query(query::QueryPtr query, Timestamp timestamp, QueryResult& results) = 0; + Query(const query::QueryPtr& query, Timestamp timestamp, QueryResult& results) = 0; // // THIS FUNCTION IS REMOVED // virtual Status diff --git a/core/src/dog_segment/SegmentDefs.h b/core/src/dog_segment/SegmentDefs.h index 20dafe8bfd..9a5600e626 100644 --- a/core/src/dog_segment/SegmentDefs.h +++ b/core/src/dog_segment/SegmentDefs.h @@ -1,8 +1,6 @@ #pragma once #include -#include -#include #include "utils/Types.h" // #include "knowhere/index/Index.h" diff --git a/core/src/dog_segment/SegmentNaive.cpp b/core/src/dog_segment/SegmentNaive.cpp index 94fdfe4f75..dcabc6efa4 100644 --- a/core/src/dog_segment/SegmentNaive.cpp +++ b/core/src/dog_segment/SegmentNaive.cpp @@ -1,9 +1,8 @@ #include -#include + #include #include #include -#include namespace milvus::dog_segment { int @@ -24,7 +23,7 @@ SegmentNaive::Record::Record(const Schema& schema) : uids_(1), timestamps_(1) { entity_vec_.emplace_back(std::make_shared>(field.get_dim())); } else { assert(field.get_data_type() == DataType::INT32); - entity_vec_.emplace_back(std::make_shared>()); + entity_vec_.emplace_back(std::make_shared>()); } } } @@ -37,75 +36,7 @@ SegmentNaive::PreInsert(int64_t size) { int64_t SegmentNaive::PreDelete(int64_t size) { - auto reserved_begin = deleted_record_.reserved.fetch_add(size); - return reserved_begin; -} - -auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_timestamp, int64_t insert_barrier) -> std::shared_ptr { - auto old = deleted_record_.get_lru_entry(); - if(old->del_barrier == del_barrier) { - return old; - } - auto current = std::make_shared(*old); - auto& vec = current->bitmap; - - if(del_barrier < old->del_barrier) { - for(auto del_index = del_barrier; del_index < old->del_barrier; ++del_index) { - // get uid in delete logs - auto uid = deleted_record_.uids_[del_index]; - // map uid to corrensponding offsets, select the max one, which should be the target - // the max one should be closest to query_timestamp, so the delete log should refer to it - int64_t the_offset = -1; - auto [iter_b, iter_e] = uid2offset_.equal_range(uid); - for(auto iter = iter_b; iter != iter_e; ++iter) { - auto offset = iter->second; - if(record_.timestamps_[offset] < query_timestamp) { - assert(offset < vec.size()); - the_offset = std::max(the_offset, offset); - } - } - // if not found, skip - if(the_offset == -1) { - continue; - } - // otherwise, clear the flag - vec[the_offset] = false; - } - return current; - } else { - vec.resize(insert_barrier); - for(auto del_index = old->del_barrier; del_index < del_barrier; ++del_index) { - // get uid in delete logs - auto uid = deleted_record_.uids_[del_index]; - // map uid to corrensponding offsets, select the max one, which should be the target - // the max one should be closest to query_timestamp, so the delete log should refer to it - int64_t the_offset = -1; - auto [iter_b, iter_e] = uid2offset_.equal_range(uid); - for(auto iter = iter_b; iter != iter_e; ++iter) { - auto offset = iter->second; - if(offset >= insert_barrier){ - continue; - } - if(offset >= vec.size()) { - continue; - } - if(record_.timestamps_[offset] < query_timestamp) { - assert(offset < vec.size()); - the_offset = std::max(the_offset, offset); - } - } - - // if not found, skip - if(the_offset == -1) { - continue; - } - - // otherwise, set the flag - vec[the_offset] = true; - } - this->deleted_record_.insert_lru_entry(current); - } - return current; + throw std::runtime_error("unimplemented"); } Status @@ -156,13 +87,7 @@ SegmentNaive::Insert(int64_t reserved_begin, int64_t size, const int64_t* uids_r record_.entity_vec_[fid]->set_data_raw(reserved_begin, entities[fid].data(), size); } - for(int i = 0; i < uids.size(); ++i) { - auto uid = uids[i]; - // NOTE: this must be the last step, cannot be put above - uid2offset_.insert(std::make_pair(uid, reserved_begin + i)); - } - - record_.ack_responder_.AddSegment(reserved_begin, reserved_begin + size); + record_.ack_responder_.AddSegment(reserved_begin, size); return Status::OK(); // std::thread go(executor, std::move(uids), std::move(timestamps), std::move(entities)); @@ -197,26 +122,8 @@ SegmentNaive::Insert(int64_t reserved_begin, int64_t size, const int64_t* uids_r } Status -SegmentNaive::Delete(int64_t reserved_begin, int64_t size, const int64_t* uids_raw, const Timestamp* timestamps_raw) { - std::vector> ordering; - ordering.resize(size); - // #pragma omp parallel for - for (int i = 0; i < size; ++i) { - ordering[i] = std::make_tuple(timestamps_raw[i], uids_raw[i]); - } - std::sort(ordering.begin(), ordering.end()); - std::vector uids(size); - std::vector timestamps(size); - // #pragma omp parallel for - for (int index = 0; index < size; ++index) { - auto [t, uid] = ordering[index]; - timestamps[index] = t; - uids[index] = uid; - } - deleted_record_.timestamps_.set_data(reserved_begin, timestamps.data(), size); - deleted_record_.uids_.set_data(reserved_begin, uids.data(), size); - deleted_record_.ack_responder_.AddSegment(reserved_begin, reserved_begin + size); - return Status::OK(); +SegmentNaive::Delete(int64_t reserved_offset, int64_t size, const int64_t* primary_keys, const Timestamp* timestamps) { + throw std::runtime_error("unimplemented"); // for (int i = 0; i < size; ++i) { // auto key = primary_keys[i]; // auto time = timestamps[i]; @@ -263,123 +170,49 @@ SegmentNaive::QueryImpl(const query::QueryPtr& query, Timestamp timestamp, Query // return Status::OK(); } -template -int64_t get_barrier(const RecordType& record, Timestamp timestamp) { - auto& vec = record.timestamps_; - int64_t beg = 0; - int64_t end = record.ack_responder_.GetAck(); - while (beg < end) { - auto mid = (beg + end) / 2; - if (vec[mid] < timestamp) { - beg = mid + 1; - } else { - end = mid; - } - } - return beg; -} - Status -SegmentNaive::Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult& result) { +SegmentNaive::Query(const query::QueryPtr& query, Timestamp timestamp, QueryResult& result) { // TODO: enable delete // TODO: enable index - - if(query_info == nullptr) { - query_info = std::make_shared(); - query_info->field_name = "fakevec"; - query_info->topK = 10; - query_info->num_queries = 1; - - auto dim = schema_->operator[]("fakevec").get_dim(); - std::default_random_engine e(42); - std::uniform_real_distribution<> dis(0.0, 1.0); - query_info->query_raw_data.resize(query_info->num_queries * dim); - for(auto& x: query_info->query_raw_data) { - x = dis(e); - } - } - - auto& field = schema_->operator[](query_info->field_name); + auto& field = schema_->operator[](0); + assert(field.get_name() == "fakevec"); assert(field.get_data_type() == DataType::VECTOR_FLOAT); - auto dim = field.get_dim(); - auto topK = query_info->topK; - auto num_queries = query_info->num_queries; + assert(query == nullptr); + int64_t barrier = [&] + { + auto& vec = record_.timestamps_; + int64_t beg = 0; + int64_t end = record_.ack_responder_.GetAck(); + while (beg < end) { + auto mid = (beg + end) / 2; + if (vec[mid] < timestamp) { + end = mid + 1; + } else { + beg = mid; + } - auto barrier = get_barrier(record_, timestamp); - auto del_barrier = get_barrier(deleted_record_, timestamp); - auto bitmap_holder = get_deleted_bitmap(del_barrier, timestamp, barrier); - - if (!bitmap_holder) { - throw std::runtime_error("fuck"); - } - - auto bitmap = &bitmap_holder->bitmap; - - if(topK > barrier) { - topK = barrier; - } - - auto get_L2_distance = [dim](const float* a, const float* b) { - float L2_distance = 0; - for(auto i = 0; i < dim; ++i) { - auto d = a[i] - b[i]; - L2_distance += d * d; } - return L2_distance; - }; - - std::vector>> records(num_queries); + return beg; + }(); + // search until barriers // TODO: optimize auto vec_ptr = std::static_pointer_cast>(record_.entity_vec_[0]); for(int64_t i = 0; i < barrier; ++i) { - if(i < bitmap->size() && bitmap->at(i)) { - continue; - } - auto element = vec_ptr->get_element(i); - for(auto query_id = 0; query_id < num_queries; ++query_id) { - auto query_blob = query_info->query_raw_data.data() + query_id * dim; - auto dis = get_L2_distance(query_blob, element); - auto& record = records[query_id]; - if(record.size() < topK) { - record.emplace(dis, i); - } else if(record.top().first > dis) { - record.emplace(dis, i); - record.pop(); - } - } - } - - - result.num_queries_ = num_queries; - result.topK_ = topK; - auto row_num = topK * num_queries; - result.row_num_ = topK * num_queries; - - result.result_ids_.resize(row_num); - result.result_distances_.resize(row_num); - - for(int q_id = 0; q_id < num_queries; ++q_id) { - // reverse - for(int i = 0; i < topK; ++i) { - auto dst_id = topK - 1 - i + q_id * topK; - auto [dis, offset] = records[q_id].top(); - records[q_id].pop(); - result.result_ids_[dst_id] = record_.uids_[offset]; - result.result_distances_[dst_id] = dis; - } +// auto element = + throw std::runtime_error("unimplemented"); } return Status::OK(); -// find end of binary -// throw std::runtime_error("unimplemented"); -// auto record_ptr = GetMutableRecord(); -// if (record_ptr) { -// return QueryImpl(*record_ptr, query, timestamp, result); -// } else { -// assert(ready_immutable_); -// return QueryImpl(*record_immutable_, query, timestamp, result); -// } + // find end of binary + // throw std::runtime_error("unimplemented"); + // auto record_ptr = GetMutableRecord(); + // if (record_ptr) { + // return QueryImpl(*record_ptr, query, timestamp, result); + // } else { + // assert(ready_immutable_); + // return QueryImpl(*record_immutable_, query, timestamp, result); + // } } Status diff --git a/core/src/dog_segment/SegmentNaive.h b/core/src/dog_segment/SegmentNaive.h index 7180c8db88..e58bfa9e18 100644 --- a/core/src/dog_segment/SegmentNaive.h +++ b/core/src/dog_segment/SegmentNaive.h @@ -58,7 +58,7 @@ class SegmentNaive : public SegmentBase { // query contains metadata of Status - Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult& results) override; + Query(const query::QueryPtr& query, Timestamp timestamp, QueryResult& results) override; // stop receive insert requests // will move data to immutable vector or something @@ -105,40 +105,6 @@ class SegmentNaive : public SegmentBase { Record(const Schema& schema); }; - tbb::concurrent_unordered_multimap uid2offset_; - - struct DeletedRecord { - std::atomic reserved = 0; - AckResponder ack_responder_; - ConcurrentVector timestamps_; - ConcurrentVector uids_; - struct TmpBitmap { - // Just for query - int64_t del_barrier = 0; - std::vector bitmap; - - - }; - std::shared_ptr lru_; - std::shared_mutex shared_mutex_; - - DeletedRecord(): lru_(std::make_shared()) {} - auto get_lru_entry() { - std::shared_lock lck(shared_mutex_); - return lru_; - } - void insert_lru_entry(std::shared_ptr new_entry) { - std::lock_guard lck(shared_mutex_); - if(new_entry->del_barrier <= lru_->del_barrier) { - // DO NOTHING - return; - } - lru_ = std::move(new_entry); - } - }; - - std::shared_ptr get_deleted_bitmap(int64_t del_barrier, Timestamp query_timestamp, int64_t insert_barrier); - Status QueryImpl(const query::QueryPtr& query, Timestamp timestamp, QueryResult& results); @@ -168,7 +134,7 @@ class SegmentNaive : public SegmentBase { IndexMetaPtr index_meta_; std::atomic state_ = SegmentState::Open; Record record_; - DeletedRecord deleted_record_; + // tbb::concurrent_unordered_map internal_indexes_; // std::shared_ptr record_mutable_; // // to determined that if immutable data if available diff --git a/core/src/dog_segment/main.go b/core/src/dog_segment/main.go new file mode 100644 index 0000000000..e0c8c1a4b4 --- /dev/null +++ b/core/src/dog_segment/main.go @@ -0,0 +1,46 @@ +package main + +/* + +#cgo CFLAGS: -I./ + +#cgo LDFLAGS: -L/home/sheep/workspace/milvus/sheep/suvlim/core/cmake-build-debug/src/dog_segment -lmilvus_dog_segment -Wl,-rpath=/home/sheep/workspace/milvus/sheep/suvlim/core/cmake-build-debug/src/dog_segment + +#include "cwrap.h" + +*/ +import "C" +import ( + "fmt" + "unsafe" +) + +func testInsert() { + const DIM = 4 + const N = 3 + + var ids = [N]uint64{1, 2, 3} + var timestamps = [N]uint64{0, 0, 0} + + var vec = [DIM]float32{1.1, 2.2, 3.3, 4.4} + var rawData []int8 + + for i := 0; i <= N; i++ { + for _, ele := range vec { + rawData=append(rawData, int8(ele)) + } + rawData=append(rawData, int8(i)) + } + + var segment = C.SegmentBaseInit() + fmt.Println(segment) + + const sizeofPerRow = 4 + DIM * 4 + var res = C.Insert(segment, N, (*C.ulong)(&ids[0]), (*C.ulong)(×tamps[0]), unsafe.Pointer(&rawData[0]), C.int(sizeofPerRow), C.long(N)) + fmt.Println(res) +} + +func main() { + fmt.Println("Test milvus segment base:") + testInsert() +} diff --git a/core/src/dog_segment/segment_c.cpp b/core/src/dog_segment/segment_c.cpp index 81fbb80d29..1b43321d11 100644 --- a/core/src/dog_segment/segment_c.cpp +++ b/core/src/dog_segment/segment_c.cpp @@ -9,8 +9,7 @@ CSegmentBase NewSegment(CPartition partition, unsigned long segment_id) { auto p = (milvus::dog_segment::Partition*)partition; - // TODO: remove hard code null index ptr - auto segment = milvus::dog_segment::CreateSegment(p->get_schema(), nullptr); + auto segment = milvus::dog_segment::CreateSegment(p->get_schema()); // TODO: delete print std::cout << "create segment " << segment_id << std::endl; @@ -46,9 +45,6 @@ Insert(CSegmentBase c_segment, dataChunk.count = count; auto res = segment->Insert(reserved_offset, size, primary_keys, timestamps, dataChunk); - - // TODO: delete print - std::cout << "do segment insert, sizeof_per_row = " << sizeof_per_row << std::endl; return res.code(); } diff --git a/core/src/query/GeneralQuery.h b/core/src/query/GeneralQuery.h index b2b070896b..622aa15f55 100644 --- a/core/src/query/GeneralQuery.h +++ b/core/src/query/GeneralQuery.h @@ -121,14 +121,9 @@ namespace query { // std::set index_fields; // std::unordered_map metric_types; // }; - struct Query{ - int64_t num_queries; // - int topK; // topK of queries - std::string field_name; // must be fakevec, whose data_type must be VEC_FLOAT(DIM) - std::vector query_raw_data; // must be size of num_queries * DIM + // TODO }; - using QueryPtr = std::shared_ptr; } // namespace query diff --git a/core/src/utils/Types.h b/core/src/utils/Types.h index f394e5b23d..8da7b795e7 100644 --- a/core/src/utils/Types.h +++ b/core/src/utils/Types.h @@ -137,10 +137,8 @@ struct AttrsData { /////////////////////////////////////////////////////////////////////////////////////////////////// struct QueryResult { - uint64_t row_num_; // row_num_ = topK * num_queries_ - uint64_t topK_; - uint64_t num_queries_; // currently must be 1 - engine::ResultIds result_ids_; // top1, top2, ..; + uint64_t row_num_; + engine::ResultIds result_ids_; engine::ResultDistances result_distances_; // engine::DataChunkPtr data_chunk_; }; diff --git a/core/unittest/CMakeLists.txt b/core/unittest/CMakeLists.txt index 0a1fb55d1b..430bb15277 100644 --- a/core/unittest/CMakeLists.txt +++ b/core/unittest/CMakeLists.txt @@ -3,7 +3,7 @@ find_package(GTest REQUIRED) set(MILVUS_TEST_FILES test_naive.cpp # test_dog_segment.cpp - test_c_api.cpp + # test_c_api.cpp ) add_executable(all_tests ${MILVUS_TEST_FILES} diff --git a/core/unittest/test_c_api.cpp b/core/unittest/test_c_api.cpp index 0e312c5ec0..55b95285fc 100644 --- a/core/unittest/test_c_api.cpp +++ b/core/unittest/test_c_api.cpp @@ -49,7 +49,7 @@ TEST(CApiTest, InsertTest) { std::vector raw_data; std::vector timestamps; - std::vector uids; + std::vector uids; int N = 10000; std::default_random_engine e(67); for(int i = 0; i < N; ++i) { @@ -67,9 +67,7 @@ TEST(CApiTest, InsertTest) { auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); - - auto res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); + auto res = Insert(segment, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); assert(res == 0); @@ -87,12 +85,10 @@ TEST(CApiTest, DeleteTest) { auto partition = NewPartition(collection, partition_name); auto segment = NewSegment(partition, 0); - long delete_primary_keys[] = {100000, 100001, 100002}; + unsigned long delete_primary_keys[] = {100000, 100001, 100002}; unsigned long delete_timestamps[] = {0, 0, 0}; - auto offset = PreDelete(segment, 3); - - auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); + auto del_res = Delete(segment, 1, delete_primary_keys, delete_timestamps); assert(del_res == 0); DeleteCollection(collection); @@ -101,7 +97,6 @@ TEST(CApiTest, DeleteTest) { } - TEST(CApiTest, SearchTest) { auto collection_name = "collection0"; auto schema_tmp_conf = "null_schema"; @@ -112,7 +107,7 @@ TEST(CApiTest, SearchTest) { std::vector raw_data; std::vector timestamps; - std::vector uids; + std::vector uids; int N = 10000; std::default_random_engine e(67); for(int i = 0; i < N; ++i) { @@ -130,15 +125,14 @@ TEST(CApiTest, SearchTest) { auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); - - auto ins_res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); + auto ins_res = Insert(segment, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); assert(ins_res == 0); - long result_ids[10]; - float result_distances[10]; - auto sea_res = Search(segment, nullptr, 0, result_ids, result_distances); + long result_ids; + float result_distances; + auto sea_res = Search(segment, nullptr, 0, &result_ids, &result_distances); assert(sea_res == 0); + assert(result_ids == 104490); DeleteCollection(collection); DeletePartition(partition); @@ -180,87 +174,43 @@ TEST(CApiTest, CloseTest) { } +TEST(CApiTest, GetRowCountTest) { + auto collection_name = "collection0"; + auto schema_tmp_conf = "null_schema"; + auto collection = NewCollection(collection_name, schema_tmp_conf); + auto partition_name = "partition0"; + auto partition = NewPartition(collection, partition_name); + auto segment = NewSegment(partition, 0); -auto generate_data(int N) { - std::vector raw_data; - std::vector timestamps; - std::vector uids; - std::default_random_engine er(42); - std::uniform_real_distribution<> distribution(0.0, 1.0); - std::default_random_engine ei(42); - for(int i = 0; i < N; ++i) { - uids.push_back(10 * N + i); - timestamps.push_back(0); - // append vec - float vec[16]; - for(auto &x: vec) { - x = distribution(er); - } - raw_data.insert(raw_data.end(), (const char*)std::begin(vec), (const char*)std::end(vec)); - int age = ei() % 100; - raw_data.insert(raw_data.end(), (const char*)&age, ((const char*)&age) + sizeof(age)); + std::vector raw_data; + std::vector timestamps; + std::vector uids; + int N = 10000; + std::default_random_engine e(67); + for(int i = 0; i < N; ++i) { + uids.push_back(100000 + i); + timestamps.push_back(0); + // append vec + float vec[16]; + for(auto &x: vec) { + x = e() % 2000 * 0.001 - 1.0; } - return std::make_tuple(raw_data, timestamps, uids); -} + raw_data.insert(raw_data.end(), (const char*)std::begin(vec), (const char*)std::end(vec)); + int age = e() % 100; + raw_data.insert(raw_data.end(), (const char*)&age, ((const char*)&age) + sizeof(age)); + } + auto line_sizeof = (sizeof(int) + sizeof(float) * 16); -TEST(CApiTest, TestQuery) { - auto collection_name = "collection0"; - auto schema_tmp_conf = "null_schema"; - auto collection = NewCollection(collection_name, schema_tmp_conf); - auto partition_name = "partition0"; - auto partition = NewPartition(collection, partition_name); - auto segment = NewSegment(partition, 0); + auto res = Insert(segment, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); + assert(res == 0); + auto row_count = GetRowCount(segment); + assert(row_count == N); - int N = 1000 * 1000; - auto [raw_data, timestamps, uids] = generate_data(N); - auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); - auto res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); - assert(res == 0); - - auto row_count = GetRowCount(segment); - assert(row_count == N); - - std::vector result_ids(10); - std::vector result_distances(10); - auto sea_res = Search(segment, nullptr, 1, result_ids.data(), result_distances.data()); - - ASSERT_EQ(sea_res, 0); - ASSERT_EQ(result_ids[0], 10 * N); - ASSERT_EQ(result_distances[0], 0); - - std::vector del_ts(N/2, 100); - auto pre_off = PreDelete(segment, N / 2); - Delete(segment, pre_off, N / 2, uids.data(), del_ts.data()); - - - std::vector result_ids2(10); - std::vector result_distances2(10); - sea_res = Search(segment, nullptr, 104, result_ids2.data(), result_distances2.data()); - - for(auto x: result_ids2) { - ASSERT_GE(x, 10 * N + N / 2); - ASSERT_LT(x, 10 * N + N); - } - - auto iter = 0; - for(int i = 0; i < result_ids.size(); ++i) { - auto uid = result_ids[i]; - auto dis = result_distances[i]; - if(uid >= 10 * N + N / 2) { - auto uid2 = result_ids2[iter]; - auto dis2 = result_distances2[iter]; - ASSERT_EQ(uid, uid2); - ASSERT_EQ(dis, dis2); - ++iter; - } - } - - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } TEST(CApiTest, GetDeletedCountTest) { @@ -271,12 +221,10 @@ TEST(CApiTest, GetDeletedCountTest) { auto partition = NewPartition(collection, partition_name); auto segment = NewSegment(partition, 0); - long delete_primary_keys[] = {100000, 100001, 100002}; + unsigned long delete_primary_keys[] = {100000, 100001, 100002}; unsigned long delete_timestamps[] = {0, 0, 0}; - auto offset = PreDelete(segment, 3); - - auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); + auto del_res = Delete(segment, 1, delete_primary_keys, delete_timestamps); assert(del_res == 0); // TODO: assert(deleted_count == len(delete_primary_keys)) @@ -288,27 +236,45 @@ TEST(CApiTest, GetDeletedCountTest) { DeleteSegment(segment); } +TEST(CApiTest, TimeGetterAndSetterTest) { + auto collection_name = "collection0"; + auto schema_tmp_conf = "null_schema"; + auto collection = NewCollection(collection_name, schema_tmp_conf); + auto partition_name = "partition0"; + auto partition = NewPartition(collection, partition_name); + auto segment = NewSegment(partition, 0); -TEST(CApiTest, GetRowCountTest) { - auto collection_name = "collection0"; - auto schema_tmp_conf = "null_schema"; - auto collection = NewCollection(collection_name, schema_tmp_conf); - auto partition_name = "partition0"; - auto partition = NewPartition(collection, partition_name); - auto segment = NewSegment(partition, 0); + uint64_t TIME_BEGIN = 100; + uint64_t TIME_END = 200; + + SetTimeBegin(segment, TIME_BEGIN); + auto time_begin = GetTimeBegin(segment); + assert(time_begin == TIME_BEGIN); + + SetTimeEnd(segment, TIME_END); + auto time_end = GetTimeEnd(segment); + assert(time_end == TIME_END); + + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); +} - int N = 10000; - auto [raw_data, timestamps, uids] = generate_data(N); - auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); - auto res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); - assert(res == 0); +TEST(CApiTest, SegmentIDTest) { + auto collection_name = "collection0"; + auto schema_tmp_conf = "null_schema"; + auto collection = NewCollection(collection_name, schema_tmp_conf); + auto partition_name = "partition0"; + auto partition = NewPartition(collection, partition_name); + auto segment = NewSegment(partition, 0); - auto row_count = GetRowCount(segment); - assert(row_count == N); + uint64_t SEGMENT_ID = 1; + SetSegmentId(segment, SEGMENT_ID); + auto segment_id = GetSegmentId(segment); + assert(segment_id == SEGMENT_ID); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); -} \ No newline at end of file + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); +} diff --git a/go.mod b/go.mod index bad3b5bc54..1a73f93763 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( github.com/danieljoos/wincred v1.1.0 // indirect github.com/docker/go-units v0.4.0 github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect - github.com/frankban/quicktest v1.10.2 // indirect github.com/gogo/protobuf v1.3.1 github.com/golang/protobuf v1.4.2 github.com/google/btree v1.0.0 @@ -36,13 +35,13 @@ require ( go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 go.uber.org/zap v1.15.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect - golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect + golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f // indirect google.golang.org/grpc v1.31.0 google.golang.org/grpc/examples v0.0.0-20200828165940-d8ef479ab79a // indirect + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 - gopkg.in/yaml.v2 v2.3.0 sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index ac8561f2d3..0098c9e92a 100644 --- a/go.sum +++ b/go.sum @@ -127,7 +127,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimfeld/httptreemux v5.0.1+incompatible h1:Qj3gVcDNoOthBAqftuD596rm4wg/adLLz5xh5CmpiCA= github.com/dimfeld/httptreemux v5.0.1+incompatible/go.mod h1:rbUlSV+CCpv/SuqUTP/8Bk2O3LyUV436/yaRGkhP6Z0= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -145,7 +144,6 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/data-plane-api v0.0.0-20200904023242-f4d8a28107ca h1:EvL1gA7uyPU2JVN93HbQwYOXyUjUJKYGStDN8eKD/Ss= -github.com/envoyproxy/data-plane-api v0.0.0-20200909004014-2bb47b2b6fb0 h1:0edaQ8F7kgXmqz/tFjjl5rW/nAKUZ5Zg0Rv5vKiE6+U= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -153,11 +151,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.10.2 h1:19ARM85nVi4xH7xPXuc5eM/udya5ieh7b/Sv+d844Tk= -github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -225,8 +220,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -249,7 +242,6 @@ github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51 github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.0 h1:tOSd0UKHQd6urX6ApfOn4XdBMY6Sh1MfxV3kmaazO+U= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= @@ -331,12 +323,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= @@ -383,9 +372,7 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -394,12 +381,10 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= @@ -412,7 +397,6 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/ozonru/etcd v3.3.20-grpc1.27-origmodule+incompatible h1:CAG0PUvo1fen+ZEfxKJjFIc8GuuN5RuaBuCAuaP2Hno= github.com/ozonru/etcd v3.3.20-grpc1.27-origmodule+incompatible/go.mod h1:iIubILNIN6Jq9h8uiSLrN9L1tuj3iSSFwz3R61skm/A= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -506,7 +490,6 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykE github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -517,14 +500,12 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2 github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -794,7 +775,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200806022845-90696ccdc692 h1:fsn47thVa7Ar/TMyXYlZgOoT7M4+kRpb+KpSAqRQx1w= golang.org/x/tools v0.0.0-20200806022845-90696ccdc692/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -897,7 +877,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -923,7 +902,6 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/master/grpc/master.pb.go b/pkg/master/grpc/master.pb.go new file mode 100644 index 0000000000..4dcbdaa3a9 --- /dev/null +++ b/pkg/master/grpc/master.pb.go @@ -0,0 +1,235 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: master.proto + +//option go_package = "github.com/czs007/suvilm/pkg/master/grpc"; + +package masterpb + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// 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 + +type CreateCollectionRequest struct { + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateCollectionRequest) Reset() { *m = CreateCollectionRequest{} } +func (m *CreateCollectionRequest) String() string { return proto.CompactTextString(m) } +func (*CreateCollectionRequest) ProtoMessage() {} +func (*CreateCollectionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f9c348dec43a6705, []int{0} +} + +func (m *CreateCollectionRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateCollectionRequest.Unmarshal(m, b) +} +func (m *CreateCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateCollectionRequest.Marshal(b, m, deterministic) +} +func (m *CreateCollectionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateCollectionRequest.Merge(m, src) +} +func (m *CreateCollectionRequest) XXX_Size() int { + return xxx_messageInfo_CreateCollectionRequest.Size(m) +} +func (m *CreateCollectionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateCollectionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateCollectionRequest proto.InternalMessageInfo + +func (m *CreateCollectionRequest) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +type CreateCollectionResponse struct { + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + CollectionId uint64 `protobuf:"varint,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + SegmentIds []uint64 `protobuf:"varint,3,rep,packed,name=segment_ids,json=segmentIds,proto3" json:"segment_ids,omitempty"` + PartitionTags []string `protobuf:"bytes,4,rep,name=partition_tags,json=partitionTags,proto3" json:"partition_tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateCollectionResponse) Reset() { *m = CreateCollectionResponse{} } +func (m *CreateCollectionResponse) String() string { return proto.CompactTextString(m) } +func (*CreateCollectionResponse) ProtoMessage() {} +func (*CreateCollectionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f9c348dec43a6705, []int{1} +} + +func (m *CreateCollectionResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateCollectionResponse.Unmarshal(m, b) +} +func (m *CreateCollectionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateCollectionResponse.Marshal(b, m, deterministic) +} +func (m *CreateCollectionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateCollectionResponse.Merge(m, src) +} +func (m *CreateCollectionResponse) XXX_Size() int { + return xxx_messageInfo_CreateCollectionResponse.Size(m) +} +func (m *CreateCollectionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateCollectionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateCollectionResponse proto.InternalMessageInfo + +func (m *CreateCollectionResponse) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *CreateCollectionResponse) GetCollectionId() uint64 { + if m != nil { + return m.CollectionId + } + return 0 +} + +func (m *CreateCollectionResponse) GetSegmentIds() []uint64 { + if m != nil { + return m.SegmentIds + } + return nil +} + +func (m *CreateCollectionResponse) GetPartitionTags() []string { + if m != nil { + return m.PartitionTags + } + return nil +} + +func init() { + proto.RegisterType((*CreateCollectionRequest)(nil), "masterpb.CreateCollectionRequest") + proto.RegisterType((*CreateCollectionResponse)(nil), "masterpb.CreateCollectionResponse") +} + +func init() { proto.RegisterFile("master.proto", fileDescriptor_f9c348dec43a6705) } + +var fileDescriptor_f9c348dec43a6705 = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xcf, 0x4a, 0x03, 0x31, + 0x10, 0x87, 0x5d, 0x77, 0x29, 0x76, 0x6c, 0xab, 0xe4, 0x62, 0xf0, 0xe2, 0x1a, 0x11, 0x73, 0xda, + 0x83, 0xbe, 0x81, 0x3d, 0xf5, 0xa0, 0x87, 0xe0, 0xcd, 0x43, 0x49, 0x9b, 0x61, 0x09, 0x34, 0x7f, + 0xcc, 0x8c, 0xef, 0xe5, 0x23, 0x0a, 0x5b, 0x6d, 0x45, 0x51, 0x3c, 0xe6, 0xe3, 0xc7, 0x47, 0xe6, + 0x83, 0x49, 0xb0, 0xc4, 0x58, 0xba, 0x5c, 0x12, 0x27, 0x71, 0xb4, 0x7d, 0xe5, 0x95, 0xba, 0x87, + 0xb3, 0x79, 0x41, 0xcb, 0x38, 0x4f, 0x9b, 0x0d, 0xae, 0xd9, 0xa7, 0x68, 0xf0, 0xe5, 0x15, 0x89, + 0xc5, 0x0d, 0x9c, 0xac, 0x77, 0x70, 0x19, 0x6d, 0x40, 0x59, 0xb5, 0x95, 0x1e, 0x9b, 0xd9, 0x1e, + 0x3f, 0xda, 0x80, 0xea, 0xad, 0x02, 0xf9, 0x53, 0x42, 0x39, 0x45, 0xc2, 0x7f, 0x5b, 0xc4, 0x15, + 0x4c, 0xbf, 0x0c, 0xbd, 0x93, 0x87, 0x6d, 0xa5, 0x1b, 0x33, 0xd9, 0xc3, 0x85, 0x13, 0x17, 0x70, + 0x4c, 0xd8, 0x07, 0x8c, 0xbc, 0xf4, 0x8e, 0x64, 0xdd, 0xd6, 0xba, 0x31, 0xf0, 0x81, 0x16, 0x8e, + 0xc4, 0x35, 0xcc, 0xb2, 0x2d, 0xec, 0x07, 0x09, 0xdb, 0x9e, 0x64, 0xd3, 0xd6, 0x7a, 0x6c, 0xa6, + 0x3b, 0xfa, 0x64, 0x7b, 0xba, 0x45, 0x18, 0x3d, 0x0c, 0x09, 0xc4, 0x33, 0x9c, 0x7e, 0xff, 0xbb, + 0xb8, 0xec, 0x3e, 0xfb, 0x74, 0xbf, 0xc4, 0x39, 0x57, 0x7f, 0x4d, 0xb6, 0xa7, 0xab, 0x83, 0xd5, + 0x68, 0xc8, 0x7d, 0xf7, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xb6, 0xf8, 0x4e, 0x7e, 0x01, 0x00, + 0x00, +} + +// 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 + +// MasterClient is the client API for Master service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MasterClient interface { + CreateCollection(ctx context.Context, in *CreateCollectionRequest, opts ...grpc.CallOption) (*CreateCollectionResponse, error) +} + +type masterClient struct { + cc *grpc.ClientConn +} + +func NewMasterClient(cc *grpc.ClientConn) MasterClient { + return &masterClient{cc} +} + +func (c *masterClient) CreateCollection(ctx context.Context, in *CreateCollectionRequest, opts ...grpc.CallOption) (*CreateCollectionResponse, error) { + out := new(CreateCollectionResponse) + err := c.cc.Invoke(ctx, "/masterpb.Master/CreateCollection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MasterServer is the server API for Master service. +type MasterServer interface { + CreateCollection(context.Context, *CreateCollectionRequest) (*CreateCollectionResponse, error) +} + +// UnimplementedMasterServer can be embedded to have forward compatible implementations. +type UnimplementedMasterServer struct { +} + +func (*UnimplementedMasterServer) CreateCollection(ctx context.Context, req *CreateCollectionRequest) (*CreateCollectionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCollection not implemented") +} + +func RegisterMasterServer(s *grpc.Server, srv MasterServer) { + s.RegisterService(&_Master_serviceDesc, srv) +} + +func _Master_CreateCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MasterServer).CreateCollection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/masterpb.Master/CreateCollection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MasterServer).CreateCollection(ctx, req.(*CreateCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Master_serviceDesc = grpc.ServiceDesc{ + ServiceName: "masterpb.Master", + HandlerType: (*MasterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateCollection", + Handler: _Master_CreateCollection_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "master.proto", +} diff --git a/pkg/master/grpc/master.proto b/pkg/master/grpc/master.proto new file mode 100644 index 0000000000..961a93f90b --- /dev/null +++ b/pkg/master/grpc/master.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +//option go_package = "github.com/czs007/suvilm/pkg/master/grpc"; +package masterpb; + +service Master { + rpc CreateCollection (CreateCollectionRequest) returns (CreateCollectionResponse) {} +} + + +message CreateCollectionRequest { + string collection_name = 1; +} + +message CreateCollectionResponse { + string collection_name = 1; + uint64 collection_id = 2; + repeated uint64 segment_ids = 3; + repeated string partition_tags = 4; +} \ No newline at end of file diff --git a/pkg/master/grpc/master/master.pb.go b/pkg/master/grpc/master/master.pb.go deleted file mode 100644 index 76447a18a7..0000000000 --- a/pkg/master/grpc/master/master.pb.go +++ /dev/null @@ -1,369 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: pkg/master/grpc/master/master.proto - -package master - -import ( - context "context" - fmt "fmt" - message "github.com/czs007/suvlim/pkg/master/grpc/message" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// 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 - -type Collection struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Schema *message.Schema `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` - CreateTime uint64 `protobuf:"varint,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - SegmentIds []uint64 `protobuf:"varint,5,rep,packed,name=segment_ids,json=segmentIds,proto3" json:"segment_ids,omitempty"` - PartitionTags []string `protobuf:"bytes,6,rep,name=partition_tags,json=partitionTags,proto3" json:"partition_tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Collection) Reset() { *m = Collection{} } -func (m *Collection) String() string { return proto.CompactTextString(m) } -func (*Collection) ProtoMessage() {} -func (*Collection) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{0} -} - -func (m *Collection) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Collection.Unmarshal(m, b) -} -func (m *Collection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Collection.Marshal(b, m, deterministic) -} -func (m *Collection) XXX_Merge(src proto.Message) { - xxx_messageInfo_Collection.Merge(m, src) -} -func (m *Collection) XXX_Size() int { - return xxx_messageInfo_Collection.Size(m) -} -func (m *Collection) XXX_DiscardUnknown() { - xxx_messageInfo_Collection.DiscardUnknown(m) -} - -var xxx_messageInfo_Collection proto.InternalMessageInfo - -func (m *Collection) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Collection) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Collection) GetSchema() *message.Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *Collection) GetCreateTime() uint64 { - if m != nil { - return m.CreateTime - } - return 0 -} - -func (m *Collection) GetSegmentIds() []uint64 { - if m != nil { - return m.SegmentIds - } - return nil -} - -func (m *Collection) GetPartitionTags() []string { - if m != nil { - return m.PartitionTags - } - return nil -} - -type Segment struct { - SegmentId uint64 `protobuf:"varint,1,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - CollectionId uint64 `protobuf:"varint,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` - PartitionTag string `protobuf:"bytes,3,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - ChannelStart int32 `protobuf:"varint,4,opt,name=channel_start,json=channelStart,proto3" json:"channel_start,omitempty"` - ChannelEnd int32 `protobuf:"varint,5,opt,name=channel_end,json=channelEnd,proto3" json:"channel_end,omitempty"` - OpenTimestamp uint64 `protobuf:"varint,6,opt,name=open_timestamp,json=openTimestamp,proto3" json:"open_timestamp,omitempty"` - CloseTimestamp uint64 `protobuf:"varint,7,opt,name=close_timestamp,json=closeTimestamp,proto3" json:"close_timestamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Segment) Reset() { *m = Segment{} } -func (m *Segment) String() string { return proto.CompactTextString(m) } -func (*Segment) ProtoMessage() {} -func (*Segment) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{1} -} - -func (m *Segment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Segment.Unmarshal(m, b) -} -func (m *Segment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Segment.Marshal(b, m, deterministic) -} -func (m *Segment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Segment.Merge(m, src) -} -func (m *Segment) XXX_Size() int { - return xxx_messageInfo_Segment.Size(m) -} -func (m *Segment) XXX_DiscardUnknown() { - xxx_messageInfo_Segment.DiscardUnknown(m) -} - -var xxx_messageInfo_Segment proto.InternalMessageInfo - -func (m *Segment) GetSegmentId() uint64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -func (m *Segment) GetCollectionId() uint64 { - if m != nil { - return m.CollectionId - } - return 0 -} - -func (m *Segment) GetPartitionTag() string { - if m != nil { - return m.PartitionTag - } - return "" -} - -func (m *Segment) GetChannelStart() int32 { - if m != nil { - return m.ChannelStart - } - return 0 -} - -func (m *Segment) GetChannelEnd() int32 { - if m != nil { - return m.ChannelEnd - } - return 0 -} - -func (m *Segment) GetOpenTimestamp() uint64 { - if m != nil { - return m.OpenTimestamp - } - return 0 -} - -func (m *Segment) GetCloseTimestamp() uint64 { - if m != nil { - return m.CloseTimestamp - } - return 0 -} - -type SegmentStat struct { - SegmentId uint64 `protobuf:"varint,1,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - MemorySize uint64 `protobuf:"varint,2,opt,name=memory_size,json=memorySize,proto3" json:"memory_size,omitempty"` - MemoryRate float32 `protobuf:"fixed32,3,opt,name=memory_rate,json=memoryRate,proto3" json:"memory_rate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SegmentStat) Reset() { *m = SegmentStat{} } -func (m *SegmentStat) String() string { return proto.CompactTextString(m) } -func (*SegmentStat) ProtoMessage() {} -func (*SegmentStat) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{2} -} - -func (m *SegmentStat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SegmentStat.Unmarshal(m, b) -} -func (m *SegmentStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SegmentStat.Marshal(b, m, deterministic) -} -func (m *SegmentStat) XXX_Merge(src proto.Message) { - xxx_messageInfo_SegmentStat.Merge(m, src) -} -func (m *SegmentStat) XXX_Size() int { - return xxx_messageInfo_SegmentStat.Size(m) -} -func (m *SegmentStat) XXX_DiscardUnknown() { - xxx_messageInfo_SegmentStat.DiscardUnknown(m) -} - -var xxx_messageInfo_SegmentStat proto.InternalMessageInfo - -func (m *SegmentStat) GetSegmentId() uint64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -func (m *SegmentStat) GetMemorySize() uint64 { - if m != nil { - return m.MemorySize - } - return 0 -} - -func (m *SegmentStat) GetMemoryRate() float32 { - if m != nil { - return m.MemoryRate - } - return 0 -} - -func init() { - proto.RegisterType((*Collection)(nil), "masterpb.Collection") - proto.RegisterType((*Segment)(nil), "masterpb.Segment") - proto.RegisterType((*SegmentStat)(nil), "masterpb.SegmentStat") -} - -func init() { - proto.RegisterFile("pkg/master/grpc/master/master.proto", fileDescriptor_64c7f42561e95429) -} - -var fileDescriptor_64c7f42561e95429 = []byte{ - // 447 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0x89, 0x93, 0xb8, 0x64, 0xf2, 0x07, 0xb4, 0x70, 0xb0, 0x2a, 0xa1, 0x5a, 0xa9, 0x2a, - 0x22, 0x21, 0xd9, 0xa5, 0x1c, 0x38, 0x22, 0x51, 0x71, 0xe8, 0xa1, 0x17, 0x3b, 0x27, 0x2e, 0xd6, - 0xc6, 0x1e, 0x39, 0x2b, 0xbc, 0xeb, 0x95, 0x77, 0x52, 0x89, 0x3c, 0x01, 0x4f, 0xc6, 0x73, 0x21, - 0x8f, 0x9d, 0x34, 0x05, 0xa4, 0x9e, 0x76, 0xfd, 0xf9, 0xb7, 0x33, 0x3b, 0xdf, 0x7e, 0x70, 0x69, - 0x7f, 0x94, 0xb1, 0x96, 0x8e, 0xb0, 0x89, 0xcb, 0xc6, 0xe6, 0x87, 0x7d, 0xb7, 0x44, 0xb6, 0xa9, - 0xa9, 0x16, 0x2f, 0xbb, 0x2f, 0xbb, 0x39, 0xbf, 0xfa, 0x07, 0x47, 0xe7, 0x64, 0x89, 0x87, 0xb5, - 0x3b, 0xb0, 0xfc, 0x3d, 0x00, 0xb8, 0xad, 0xab, 0x0a, 0x73, 0x52, 0xb5, 0x11, 0x0b, 0xf0, 0x54, - 0x11, 0x0c, 0xc2, 0xc1, 0x6a, 0x94, 0x78, 0xaa, 0x10, 0x02, 0x46, 0x46, 0x6a, 0x0c, 0xbc, 0x70, - 0xb0, 0x9a, 0x24, 0xbc, 0x17, 0x1f, 0xc0, 0x77, 0xf9, 0x16, 0xb5, 0x0c, 0x86, 0xe1, 0x60, 0x35, - 0xbd, 0x79, 0x13, 0x69, 0x55, 0x3d, 0xec, 0x5c, 0xd4, 0xb6, 0x89, 0x52, 0xfe, 0x95, 0xf4, 0x88, - 0xb8, 0x80, 0x69, 0xde, 0xa0, 0x24, 0xcc, 0x48, 0x69, 0x0c, 0x46, 0x5c, 0x19, 0x3a, 0x69, 0xad, - 0x34, 0xb6, 0x80, 0xc3, 0x52, 0xa3, 0xa1, 0x4c, 0x15, 0x2e, 0x18, 0x87, 0xc3, 0x16, 0xe8, 0xa5, - 0xbb, 0xc2, 0x89, 0x2b, 0x58, 0x58, 0xd9, 0x90, 0x6a, 0xef, 0x97, 0x91, 0x2c, 0x5d, 0xe0, 0x87, - 0xc3, 0xd5, 0x24, 0x99, 0x1f, 0xd5, 0xb5, 0x2c, 0xdd, 0xf2, 0x97, 0x07, 0x67, 0x69, 0x77, 0x4a, - 0xbc, 0x03, 0x78, 0xac, 0xd9, 0x4f, 0x33, 0x39, 0x96, 0x14, 0x97, 0x30, 0xcf, 0x8f, 0x23, 0xb7, - 0x84, 0xc7, 0xc4, 0xec, 0x51, 0xec, 0xa0, 0x27, 0x6d, 0x79, 0xd8, 0x49, 0x32, 0x3b, 0xed, 0xca, - 0x95, 0xb6, 0xd2, 0x18, 0xac, 0x32, 0x47, 0xb2, 0x21, 0x9e, 0x6f, 0x9c, 0xcc, 0x7a, 0x31, 0x6d, - 0x35, 0xb6, 0xa0, 0x87, 0xd0, 0x14, 0xc1, 0x98, 0x11, 0xe8, 0xa5, 0x6f, 0xa6, 0x68, 0x27, 0xac, - 0x2d, 0x1a, 0x76, 0xc8, 0x91, 0xd4, 0x36, 0xf0, 0xf9, 0x42, 0xf3, 0x56, 0x5d, 0x1f, 0x44, 0xf1, - 0x1e, 0x5e, 0xe5, 0x55, 0xed, 0xf0, 0x84, 0x3b, 0x63, 0x6e, 0xc1, 0xf2, 0x11, 0x5c, 0x1a, 0x98, - 0xf6, 0x4e, 0xa4, 0x24, 0x9f, 0x75, 0xe3, 0x02, 0xa6, 0x1a, 0x75, 0xdd, 0xfc, 0xcc, 0x9c, 0xda, - 0x63, 0xef, 0x05, 0x74, 0x52, 0xaa, 0xf6, 0x78, 0x02, 0x34, 0x92, 0x90, 0x7d, 0xf0, 0x0e, 0x40, - 0x22, 0x09, 0x6f, 0xee, 0xc0, 0xbf, 0xe7, 0xa0, 0x89, 0x2f, 0xf0, 0xfa, 0x96, 0x9f, 0xf6, 0x24, - 0x52, 0x6f, 0x9f, 0xc4, 0xe3, 0x5e, 0x5a, 0xab, 0x4c, 0x79, 0xfe, 0x57, 0x68, 0x48, 0xd2, 0xce, - 0x2d, 0x5f, 0x7c, 0xfd, 0xf8, 0x3d, 0x2e, 0x15, 0x6d, 0x77, 0x9b, 0x28, 0xaf, 0x75, 0x9c, 0xef, - 0xdd, 0xf5, 0xf5, 0xe7, 0xd8, 0xed, 0x1e, 0x2a, 0xa5, 0xe3, 0xff, 0xe7, 0x7f, 0xe3, 0x73, 0x90, - 0x3f, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x1d, 0xf9, 0x37, 0x20, 0x03, 0x00, 0x00, -} - -// 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 - -// MasterClient is the client API for Master service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MasterClient interface { - CreateCollection(ctx context.Context, in *message.Mapping, opts ...grpc.CallOption) (*message.Status, error) -} - -type masterClient struct { - cc *grpc.ClientConn -} - -func NewMasterClient(cc *grpc.ClientConn) MasterClient { - return &masterClient{cc} -} - -func (c *masterClient) CreateCollection(ctx context.Context, in *message.Mapping, opts ...grpc.CallOption) (*message.Status, error) { - out := new(message.Status) - err := c.cc.Invoke(ctx, "/masterpb.Master/CreateCollection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MasterServer is the server API for Master service. -type MasterServer interface { - CreateCollection(context.Context, *message.Mapping) (*message.Status, error) -} - -// UnimplementedMasterServer can be embedded to have forward compatible implementations. -type UnimplementedMasterServer struct { -} - -func (*UnimplementedMasterServer) CreateCollection(ctx context.Context, req *message.Mapping) (*message.Status, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCollection not implemented") -} - -func RegisterMasterServer(s *grpc.Server, srv MasterServer) { - s.RegisterService(&_Master_serviceDesc, srv) -} - -func _Master_CreateCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(message.Mapping) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MasterServer).CreateCollection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/masterpb.Master/CreateCollection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MasterServer).CreateCollection(ctx, req.(*message.Mapping)) - } - return interceptor(ctx, in, info, handler) -} - -var _Master_serviceDesc = grpc.ServiceDesc{ - ServiceName: "masterpb.Master", - HandlerType: (*MasterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateCollection", - Handler: _Master_CreateCollection_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/master/grpc/master/master.proto", -} diff --git a/pkg/master/grpc/master/master.proto b/pkg/master/grpc/master/master.proto deleted file mode 100644 index 1c5d3408b1..0000000000 --- a/pkg/master/grpc/master/master.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package masterpb; - -option go_package="github.com/czs007/suvlim/pkg/master/grpc/master"; - -import "pkg/master/grpc/message/message.proto"; - -message Collection { - uint64 id=1; - string name=2; - milvus.grpc.Schema schema=3; - uint64 create_time=4; - repeated uint64 segment_ids=5; - repeated string partition_tags=6; -} - -message Segment { - uint64 segment_id=1; - uint64 collection_id =2; - string partition_tag=3; - int32 channel_start=4; - int32 channel_end=5; - uint64 open_timestamp=6; - uint64 close_timestamp=7; -} - -message SegmentStat { - uint64 segment_id=1; - uint64 memory_size=2; - float memory_rate=3; -} - -service Master { - rpc CreateCollection(milvus.grpc.Mapping) returns (milvus.grpc.Status){} -} \ No newline at end of file diff --git a/pkg/master/grpc/message/message.pb.go b/pkg/master/grpc/message/message.pb.go deleted file mode 100644 index 53bf1afd39..0000000000 --- a/pkg/master/grpc/message/message.pb.go +++ /dev/null @@ -1,3292 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: message.proto - -package msgpb - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// 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 - -type ErrorCode int32 - -const ( - ErrorCode_SUCCESS ErrorCode = 0 - ErrorCode_UNEXPECTED_ERROR ErrorCode = 1 - ErrorCode_CONNECT_FAILED ErrorCode = 2 - ErrorCode_PERMISSION_DENIED ErrorCode = 3 - ErrorCode_COLLECTION_NOT_EXISTS ErrorCode = 4 - ErrorCode_ILLEGAL_ARGUMENT ErrorCode = 5 - ErrorCode_ILLEGAL_DIMENSION ErrorCode = 7 - ErrorCode_ILLEGAL_INDEX_TYPE ErrorCode = 8 - ErrorCode_ILLEGAL_COLLECTION_NAME ErrorCode = 9 - ErrorCode_ILLEGAL_TOPK ErrorCode = 10 - ErrorCode_ILLEGAL_ROWRECORD ErrorCode = 11 - ErrorCode_ILLEGAL_VECTOR_ID ErrorCode = 12 - ErrorCode_ILLEGAL_SEARCH_RESULT ErrorCode = 13 - ErrorCode_FILE_NOT_FOUND ErrorCode = 14 - ErrorCode_META_FAILED ErrorCode = 15 - ErrorCode_CACHE_FAILED ErrorCode = 16 - ErrorCode_CANNOT_CREATE_FOLDER ErrorCode = 17 - ErrorCode_CANNOT_CREATE_FILE ErrorCode = 18 - ErrorCode_CANNOT_DELETE_FOLDER ErrorCode = 19 - ErrorCode_CANNOT_DELETE_FILE ErrorCode = 20 - ErrorCode_BUILD_INDEX_ERROR ErrorCode = 21 - ErrorCode_ILLEGAL_NLIST ErrorCode = 22 - ErrorCode_ILLEGAL_METRIC_TYPE ErrorCode = 23 - ErrorCode_OUT_OF_MEMORY ErrorCode = 24 -) - -var ErrorCode_name = map[int32]string{ - 0: "SUCCESS", - 1: "UNEXPECTED_ERROR", - 2: "CONNECT_FAILED", - 3: "PERMISSION_DENIED", - 4: "COLLECTION_NOT_EXISTS", - 5: "ILLEGAL_ARGUMENT", - 7: "ILLEGAL_DIMENSION", - 8: "ILLEGAL_INDEX_TYPE", - 9: "ILLEGAL_COLLECTION_NAME", - 10: "ILLEGAL_TOPK", - 11: "ILLEGAL_ROWRECORD", - 12: "ILLEGAL_VECTOR_ID", - 13: "ILLEGAL_SEARCH_RESULT", - 14: "FILE_NOT_FOUND", - 15: "META_FAILED", - 16: "CACHE_FAILED", - 17: "CANNOT_CREATE_FOLDER", - 18: "CANNOT_CREATE_FILE", - 19: "CANNOT_DELETE_FOLDER", - 20: "CANNOT_DELETE_FILE", - 21: "BUILD_INDEX_ERROR", - 22: "ILLEGAL_NLIST", - 23: "ILLEGAL_METRIC_TYPE", - 24: "OUT_OF_MEMORY", -} - -var ErrorCode_value = map[string]int32{ - "SUCCESS": 0, - "UNEXPECTED_ERROR": 1, - "CONNECT_FAILED": 2, - "PERMISSION_DENIED": 3, - "COLLECTION_NOT_EXISTS": 4, - "ILLEGAL_ARGUMENT": 5, - "ILLEGAL_DIMENSION": 7, - "ILLEGAL_INDEX_TYPE": 8, - "ILLEGAL_COLLECTION_NAME": 9, - "ILLEGAL_TOPK": 10, - "ILLEGAL_ROWRECORD": 11, - "ILLEGAL_VECTOR_ID": 12, - "ILLEGAL_SEARCH_RESULT": 13, - "FILE_NOT_FOUND": 14, - "META_FAILED": 15, - "CACHE_FAILED": 16, - "CANNOT_CREATE_FOLDER": 17, - "CANNOT_CREATE_FILE": 18, - "CANNOT_DELETE_FOLDER": 19, - "CANNOT_DELETE_FILE": 20, - "BUILD_INDEX_ERROR": 21, - "ILLEGAL_NLIST": 22, - "ILLEGAL_METRIC_TYPE": 23, - "OUT_OF_MEMORY": 24, -} - -func (x ErrorCode) String() string { - return proto.EnumName(ErrorCode_name, int32(x)) -} - -func (ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} - -//* -// @brief Field data type -type DataType int32 - -const ( - DataType_NONE DataType = 0 - DataType_BOOL DataType = 1 - DataType_INT8 DataType = 2 - DataType_INT16 DataType = 3 - DataType_INT32 DataType = 4 - DataType_INT64 DataType = 5 - DataType_FLOAT DataType = 10 - DataType_DOUBLE DataType = 11 - DataType_STRING DataType = 20 - DataType_VECTOR_BINARY DataType = 100 - DataType_VECTOR_FLOAT DataType = 101 -) - -var DataType_name = map[int32]string{ - 0: "NONE", - 1: "BOOL", - 2: "INT8", - 3: "INT16", - 4: "INT32", - 5: "INT64", - 10: "FLOAT", - 11: "DOUBLE", - 20: "STRING", - 100: "VECTOR_BINARY", - 101: "VECTOR_FLOAT", -} - -var DataType_value = map[string]int32{ - "NONE": 0, - "BOOL": 1, - "INT8": 2, - "INT16": 3, - "INT32": 4, - "INT64": 5, - "FLOAT": 10, - "DOUBLE": 11, - "STRING": 20, - "VECTOR_BINARY": 100, - "VECTOR_FLOAT": 101, -} - -func (x DataType) String() string { - return proto.EnumName(DataType_name, int32(x)) -} - -func (DataType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} - -type CompareOperator int32 - -const ( - CompareOperator_LT CompareOperator = 0 - CompareOperator_LTE CompareOperator = 1 - CompareOperator_EQ CompareOperator = 2 - CompareOperator_GT CompareOperator = 3 - CompareOperator_GTE CompareOperator = 4 - CompareOperator_NE CompareOperator = 5 -) - -var CompareOperator_name = map[int32]string{ - 0: "LT", - 1: "LTE", - 2: "EQ", - 3: "GT", - 4: "GTE", - 5: "NE", -} - -var CompareOperator_value = map[string]int32{ - "LT": 0, - "LTE": 1, - "EQ": 2, - "GT": 3, - "GTE": 4, - "NE": 5, -} - -func (x CompareOperator) String() string { - return proto.EnumName(CompareOperator_name, int32(x)) -} - -func (CompareOperator) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{2} -} - -type Occur int32 - -const ( - Occur_INVALID Occur = 0 - Occur_MUST Occur = 1 - Occur_SHOULD Occur = 2 - Occur_MUST_NOT Occur = 3 -) - -var Occur_name = map[int32]string{ - 0: "INVALID", - 1: "MUST", - 2: "SHOULD", - 3: "MUST_NOT", -} - -var Occur_value = map[string]int32{ - "INVALID": 0, - "MUST": 1, - "SHOULD": 2, - "MUST_NOT": 3, -} - -func (x Occur) String() string { - return proto.EnumName(Occur_name, int32(x)) -} - -func (Occur) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{3} -} - -////////////////////pulsar////////////////////////////////////// -type OpType int32 - -const ( - OpType_INSERT OpType = 0 - OpType_DELETE OpType = 1 -) - -var OpType_name = map[int32]string{ - 0: "INSERT", - 1: "DELETE", -} - -var OpType_value = map[string]int32{ - "INSERT": 0, - "DELETE": 1, -} - -func (x OpType) String() string { - return proto.EnumName(OpType_name, int32(x)) -} - -func (OpType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{4} -} - -type SyncType int32 - -const ( - SyncType_READ SyncType = 0 - SyncType_WRITE SyncType = 1 -) - -var SyncType_name = map[int32]string{ - 0: "READ", - 1: "WRITE", -} - -var SyncType_value = map[string]int32{ - "READ": 0, - "WRITE": 1, -} - -func (x SyncType) String() string { - return proto.EnumName(SyncType_name, int32(x)) -} - -func (SyncType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{5} -} - -type Status struct { - ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=milvus.grpc.ErrorCode" json:"error_code,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Status) Reset() { *m = Status{} } -func (m *Status) String() string { return proto.CompactTextString(m) } -func (*Status) ProtoMessage() {} -func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} - -func (m *Status) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Status.Unmarshal(m, b) -} -func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Status.Marshal(b, m, deterministic) -} -func (m *Status) XXX_Merge(src proto.Message) { - xxx_messageInfo_Status.Merge(m, src) -} -func (m *Status) XXX_Size() int { - return xxx_messageInfo_Status.Size(m) -} -func (m *Status) XXX_DiscardUnknown() { - xxx_messageInfo_Status.DiscardUnknown(m) -} - -var xxx_messageInfo_Status proto.InternalMessageInfo - -func (m *Status) GetErrorCode() ErrorCode { - if m != nil { - return m.ErrorCode - } - return ErrorCode_SUCCESS -} - -func (m *Status) GetReason() string { - if m != nil { - return m.Reason - } - return "" -} - -//* -// @brief General usage -type KeyValuePair struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyValuePair) Reset() { *m = KeyValuePair{} } -func (m *KeyValuePair) String() string { return proto.CompactTextString(m) } -func (*KeyValuePair) ProtoMessage() {} -func (*KeyValuePair) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} - -func (m *KeyValuePair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyValuePair.Unmarshal(m, b) -} -func (m *KeyValuePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyValuePair.Marshal(b, m, deterministic) -} -func (m *KeyValuePair) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyValuePair.Merge(m, src) -} -func (m *KeyValuePair) XXX_Size() int { - return xxx_messageInfo_KeyValuePair.Size(m) -} -func (m *KeyValuePair) XXX_DiscardUnknown() { - xxx_messageInfo_KeyValuePair.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyValuePair proto.InternalMessageInfo - -func (m *KeyValuePair) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KeyValuePair) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -//* -// @brief Collection name -type CollectionName struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionName) Reset() { *m = CollectionName{} } -func (m *CollectionName) String() string { return proto.CompactTextString(m) } -func (*CollectionName) ProtoMessage() {} -func (*CollectionName) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{2} -} - -func (m *CollectionName) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionName.Unmarshal(m, b) -} -func (m *CollectionName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionName.Marshal(b, m, deterministic) -} -func (m *CollectionName) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionName.Merge(m, src) -} -func (m *CollectionName) XXX_Size() int { - return xxx_messageInfo_CollectionName.Size(m) -} -func (m *CollectionName) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionName.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionName proto.InternalMessageInfo - -func (m *CollectionName) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -//* -// @brief Collection name list -type CollectionNameList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionNames []string `protobuf:"bytes,2,rep,name=collection_names,json=collectionNames,proto3" json:"collection_names,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionNameList) Reset() { *m = CollectionNameList{} } -func (m *CollectionNameList) String() string { return proto.CompactTextString(m) } -func (*CollectionNameList) ProtoMessage() {} -func (*CollectionNameList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{3} -} - -func (m *CollectionNameList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionNameList.Unmarshal(m, b) -} -func (m *CollectionNameList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionNameList.Marshal(b, m, deterministic) -} -func (m *CollectionNameList) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionNameList.Merge(m, src) -} -func (m *CollectionNameList) XXX_Size() int { - return xxx_messageInfo_CollectionNameList.Size(m) -} -func (m *CollectionNameList) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionNameList.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionNameList proto.InternalMessageInfo - -func (m *CollectionNameList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionNameList) GetCollectionNames() []string { - if m != nil { - return m.CollectionNames - } - return nil -} - -//* -// @brief Field name -type FieldName struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - FieldName string `protobuf:"bytes,2,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldName) Reset() { *m = FieldName{} } -func (m *FieldName) String() string { return proto.CompactTextString(m) } -func (*FieldName) ProtoMessage() {} -func (*FieldName) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{4} -} - -func (m *FieldName) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldName.Unmarshal(m, b) -} -func (m *FieldName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldName.Marshal(b, m, deterministic) -} -func (m *FieldName) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldName.Merge(m, src) -} -func (m *FieldName) XXX_Size() int { - return xxx_messageInfo_FieldName.Size(m) -} -func (m *FieldName) XXX_DiscardUnknown() { - xxx_messageInfo_FieldName.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldName proto.InternalMessageInfo - -func (m *FieldName) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *FieldName) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -//* -// @brief Collection mapping -// @extra_params: key-value pair for extra parameters of the collection -// typically usage: -// extra_params["params"] = {segment_row_count: 1000000, auto_id: true} -// Note: -// the segment_row_count specify segment row count limit for merging -// the auto_id = true means entity id is auto-generated by milvus -type Mapping struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Schema *Schema `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Mapping) Reset() { *m = Mapping{} } -func (m *Mapping) String() string { return proto.CompactTextString(m) } -func (*Mapping) ProtoMessage() {} -func (*Mapping) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{5} -} - -func (m *Mapping) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Mapping.Unmarshal(m, b) -} -func (m *Mapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Mapping.Marshal(b, m, deterministic) -} -func (m *Mapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mapping.Merge(m, src) -} -func (m *Mapping) XXX_Size() int { - return xxx_messageInfo_Mapping.Size(m) -} -func (m *Mapping) XXX_DiscardUnknown() { - xxx_messageInfo_Mapping.DiscardUnknown(m) -} - -var xxx_messageInfo_Mapping proto.InternalMessageInfo - -func (m *Mapping) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *Mapping) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *Mapping) GetSchema() *Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *Mapping) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Collection mapping list -type MappingList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - MappingList []*Mapping `protobuf:"bytes,2,rep,name=mapping_list,json=mappingList,proto3" json:"mapping_list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MappingList) Reset() { *m = MappingList{} } -func (m *MappingList) String() string { return proto.CompactTextString(m) } -func (*MappingList) ProtoMessage() {} -func (*MappingList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{6} -} - -func (m *MappingList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MappingList.Unmarshal(m, b) -} -func (m *MappingList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MappingList.Marshal(b, m, deterministic) -} -func (m *MappingList) XXX_Merge(src proto.Message) { - xxx_messageInfo_MappingList.Merge(m, src) -} -func (m *MappingList) XXX_Size() int { - return xxx_messageInfo_MappingList.Size(m) -} -func (m *MappingList) XXX_DiscardUnknown() { - xxx_messageInfo_MappingList.DiscardUnknown(m) -} - -var xxx_messageInfo_MappingList proto.InternalMessageInfo - -func (m *MappingList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *MappingList) GetMappingList() []*Mapping { - if m != nil { - return m.MappingList - } - return nil -} - -//* -// @brief Parameters of partition -type PartitionParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionParam) Reset() { *m = PartitionParam{} } -func (m *PartitionParam) String() string { return proto.CompactTextString(m) } -func (*PartitionParam) ProtoMessage() {} -func (*PartitionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{7} -} - -func (m *PartitionParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionParam.Unmarshal(m, b) -} -func (m *PartitionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionParam.Marshal(b, m, deterministic) -} -func (m *PartitionParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionParam.Merge(m, src) -} -func (m *PartitionParam) XXX_Size() int { - return xxx_messageInfo_PartitionParam.Size(m) -} -func (m *PartitionParam) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionParam.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionParam proto.InternalMessageInfo - -func (m *PartitionParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *PartitionParam) GetTag() string { - if m != nil { - return m.Tag - } - return "" -} - -//* -// @brief Partition list -type PartitionList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - PartitionTagArray []string `protobuf:"bytes,2,rep,name=partition_tag_array,json=partitionTagArray,proto3" json:"partition_tag_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionList) Reset() { *m = PartitionList{} } -func (m *PartitionList) String() string { return proto.CompactTextString(m) } -func (*PartitionList) ProtoMessage() {} -func (*PartitionList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{8} -} - -func (m *PartitionList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionList.Unmarshal(m, b) -} -func (m *PartitionList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionList.Marshal(b, m, deterministic) -} -func (m *PartitionList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionList.Merge(m, src) -} -func (m *PartitionList) XXX_Size() int { - return xxx_messageInfo_PartitionList.Size(m) -} -func (m *PartitionList) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionList.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionList proto.InternalMessageInfo - -func (m *PartitionList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *PartitionList) GetPartitionTagArray() []string { - if m != nil { - return m.PartitionTagArray - } - return nil -} - -//* -// @brief Vector row record -type VectorRowRecord struct { - FloatData []float32 `protobuf:"fixed32,1,rep,packed,name=float_data,json=floatData,proto3" json:"float_data,omitempty"` - BinaryData []byte `protobuf:"bytes,2,opt,name=binary_data,json=binaryData,proto3" json:"binary_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorRowRecord) Reset() { *m = VectorRowRecord{} } -func (m *VectorRowRecord) String() string { return proto.CompactTextString(m) } -func (*VectorRowRecord) ProtoMessage() {} -func (*VectorRowRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{9} -} - -func (m *VectorRowRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorRowRecord.Unmarshal(m, b) -} -func (m *VectorRowRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorRowRecord.Marshal(b, m, deterministic) -} -func (m *VectorRowRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorRowRecord.Merge(m, src) -} -func (m *VectorRowRecord) XXX_Size() int { - return xxx_messageInfo_VectorRowRecord.Size(m) -} -func (m *VectorRowRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorRowRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorRowRecord proto.InternalMessageInfo - -func (m *VectorRowRecord) GetFloatData() []float32 { - if m != nil { - return m.FloatData - } - return nil -} - -func (m *VectorRowRecord) GetBinaryData() []byte { - if m != nil { - return m.BinaryData - } - return nil -} - -type EntityIds struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - EntityIdArray []int64 `protobuf:"varint,2,rep,packed,name=entity_id_array,json=entityIdArray,proto3" json:"entity_id_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EntityIds) Reset() { *m = EntityIds{} } -func (m *EntityIds) String() string { return proto.CompactTextString(m) } -func (*EntityIds) ProtoMessage() {} -func (*EntityIds) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{10} -} - -func (m *EntityIds) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EntityIds.Unmarshal(m, b) -} -func (m *EntityIds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EntityIds.Marshal(b, m, deterministic) -} -func (m *EntityIds) XXX_Merge(src proto.Message) { - xxx_messageInfo_EntityIds.Merge(m, src) -} -func (m *EntityIds) XXX_Size() int { - return xxx_messageInfo_EntityIds.Size(m) -} -func (m *EntityIds) XXX_DiscardUnknown() { - xxx_messageInfo_EntityIds.DiscardUnknown(m) -} - -var xxx_messageInfo_EntityIds proto.InternalMessageInfo - -func (m *EntityIds) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *EntityIds) GetEntityIdArray() []int64 { - if m != nil { - return m.EntityIdArray - } - return nil -} - -type VectorRecord struct { - Records []*VectorRowRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorRecord) Reset() { *m = VectorRecord{} } -func (m *VectorRecord) String() string { return proto.CompactTextString(m) } -func (*VectorRecord) ProtoMessage() {} -func (*VectorRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{11} -} - -func (m *VectorRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorRecord.Unmarshal(m, b) -} -func (m *VectorRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorRecord.Marshal(b, m, deterministic) -} -func (m *VectorRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorRecord.Merge(m, src) -} -func (m *VectorRecord) XXX_Size() int { - return xxx_messageInfo_VectorRecord.Size(m) -} -func (m *VectorRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorRecord proto.InternalMessageInfo - -func (m *VectorRecord) GetRecords() []*VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -type VectorParam struct { - Json string `protobuf:"bytes,1,opt,name=json,proto3" json:"json,omitempty"` - RowRecord *VectorRecord `protobuf:"bytes,2,opt,name=row_record,json=rowRecord,proto3" json:"row_record,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorParam) Reset() { *m = VectorParam{} } -func (m *VectorParam) String() string { return proto.CompactTextString(m) } -func (*VectorParam) ProtoMessage() {} -func (*VectorParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{12} -} - -func (m *VectorParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorParam.Unmarshal(m, b) -} -func (m *VectorParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorParam.Marshal(b, m, deterministic) -} -func (m *VectorParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorParam.Merge(m, src) -} -func (m *VectorParam) XXX_Size() int { - return xxx_messageInfo_VectorParam.Size(m) -} -func (m *VectorParam) XXX_DiscardUnknown() { - xxx_messageInfo_VectorParam.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorParam proto.InternalMessageInfo - -func (m *VectorParam) GetJson() string { - if m != nil { - return m.Json - } - return "" -} - -func (m *VectorParam) GetRowRecord() *VectorRecord { - if m != nil { - return m.RowRecord - } - return nil -} - -//* -// @brief schema -type FieldMeta struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - Type DataType `protobuf:"varint,2,opt,name=type,proto3,enum=milvus.grpc.DataType" json:"type,omitempty"` - Dim int64 `protobuf:"varint,3,opt,name=dim,proto3" json:"dim,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldMeta) Reset() { *m = FieldMeta{} } -func (m *FieldMeta) String() string { return proto.CompactTextString(m) } -func (*FieldMeta) ProtoMessage() {} -func (*FieldMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{13} -} - -func (m *FieldMeta) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldMeta.Unmarshal(m, b) -} -func (m *FieldMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldMeta.Marshal(b, m, deterministic) -} -func (m *FieldMeta) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMeta.Merge(m, src) -} -func (m *FieldMeta) XXX_Size() int { - return xxx_messageInfo_FieldMeta.Size(m) -} -func (m *FieldMeta) XXX_DiscardUnknown() { - xxx_messageInfo_FieldMeta.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldMeta proto.InternalMessageInfo - -func (m *FieldMeta) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *FieldMeta) GetType() DataType { - if m != nil { - return m.Type - } - return DataType_NONE -} - -func (m *FieldMeta) GetDim() int64 { - if m != nil { - return m.Dim - } - return 0 -} - -type Schema struct { - FieldMetas []*FieldMeta `protobuf:"bytes,1,rep,name=field_metas,json=fieldMetas,proto3" json:"field_metas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{14} -} - -func (m *Schema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Schema.Unmarshal(m, b) -} -func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Schema.Marshal(b, m, deterministic) -} -func (m *Schema) XXX_Merge(src proto.Message) { - xxx_messageInfo_Schema.Merge(m, src) -} -func (m *Schema) XXX_Size() int { - return xxx_messageInfo_Schema.Size(m) -} -func (m *Schema) XXX_DiscardUnknown() { - xxx_messageInfo_Schema.DiscardUnknown(m) -} - -var xxx_messageInfo_Schema proto.InternalMessageInfo - -func (m *Schema) GetFieldMetas() []*FieldMeta { - if m != nil { - return m.FieldMetas - } - return nil -} - -type RowData struct { - Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RowData) Reset() { *m = RowData{} } -func (m *RowData) String() string { return proto.CompactTextString(m) } -func (*RowData) ProtoMessage() {} -func (*RowData) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{15} -} - -func (m *RowData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RowData.Unmarshal(m, b) -} -func (m *RowData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RowData.Marshal(b, m, deterministic) -} -func (m *RowData) XXX_Merge(src proto.Message) { - xxx_messageInfo_RowData.Merge(m, src) -} -func (m *RowData) XXX_Size() int { - return xxx_messageInfo_RowData.Size(m) -} -func (m *RowData) XXX_DiscardUnknown() { - xxx_messageInfo_RowData.DiscardUnknown(m) -} - -var xxx_messageInfo_RowData proto.InternalMessageInfo - -func (m *RowData) GetBlob() []byte { - if m != nil { - return m.Blob - } - return nil -} - -//////////////////////suvlim-proxy/////////////////////////////////// -type InsertParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Schema *Schema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - RowsData []*RowData `protobuf:"bytes,3,rep,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - EntityIdArray []int64 `protobuf:"varint,4,rep,packed,name=entity_id_array,json=entityIdArray,proto3" json:"entity_id_array,omitempty"` - PartitionTag string `protobuf:"bytes,5,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertParam) Reset() { *m = InsertParam{} } -func (m *InsertParam) String() string { return proto.CompactTextString(m) } -func (*InsertParam) ProtoMessage() {} -func (*InsertParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{16} -} - -func (m *InsertParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertParam.Unmarshal(m, b) -} -func (m *InsertParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertParam.Marshal(b, m, deterministic) -} -func (m *InsertParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertParam.Merge(m, src) -} -func (m *InsertParam) XXX_Size() int { - return xxx_messageInfo_InsertParam.Size(m) -} -func (m *InsertParam) XXX_DiscardUnknown() { - xxx_messageInfo_InsertParam.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertParam proto.InternalMessageInfo - -func (m *InsertParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *InsertParam) GetSchema() *Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *InsertParam) GetRowsData() []*RowData { - if m != nil { - return m.RowsData - } - return nil -} - -func (m *InsertParam) GetEntityIdArray() []int64 { - if m != nil { - return m.EntityIdArray - } - return nil -} - -func (m *InsertParam) GetPartitionTag() string { - if m != nil { - return m.PartitionTag - } - return "" -} - -func (m *InsertParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - VectorParam []*VectorParam `protobuf:"bytes,2,rep,name=vector_param,json=vectorParam,proto3" json:"vector_param,omitempty"` - Dsl string `protobuf:"bytes,3,opt,name=dsl,proto3" json:"dsl,omitempty"` - PartitionTag []string `protobuf:"bytes,4,rep,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchParam) Reset() { *m = SearchParam{} } -func (m *SearchParam) String() string { return proto.CompactTextString(m) } -func (*SearchParam) ProtoMessage() {} -func (*SearchParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{17} -} - -func (m *SearchParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchParam.Unmarshal(m, b) -} -func (m *SearchParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchParam.Marshal(b, m, deterministic) -} -func (m *SearchParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchParam.Merge(m, src) -} -func (m *SearchParam) XXX_Size() int { - return xxx_messageInfo_SearchParam.Size(m) -} -func (m *SearchParam) XXX_DiscardUnknown() { - xxx_messageInfo_SearchParam.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchParam proto.InternalMessageInfo - -func (m *SearchParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchParam) GetVectorParam() []*VectorParam { - if m != nil { - return m.VectorParam - } - return nil -} - -func (m *SearchParam) GetDsl() string { - if m != nil { - return m.Dsl - } - return "" -} - -func (m *SearchParam) GetPartitionTag() []string { - if m != nil { - return m.PartitionTag - } - return nil -} - -func (m *SearchParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchInSegmentParam struct { - FileIdArray []string `protobuf:"bytes,1,rep,name=file_id_array,json=fileIdArray,proto3" json:"file_id_array,omitempty"` - SearchParam *SearchParam `protobuf:"bytes,2,opt,name=search_param,json=searchParam,proto3" json:"search_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchInSegmentParam) Reset() { *m = SearchInSegmentParam{} } -func (m *SearchInSegmentParam) String() string { return proto.CompactTextString(m) } -func (*SearchInSegmentParam) ProtoMessage() {} -func (*SearchInSegmentParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{18} -} - -func (m *SearchInSegmentParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchInSegmentParam.Unmarshal(m, b) -} -func (m *SearchInSegmentParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchInSegmentParam.Marshal(b, m, deterministic) -} -func (m *SearchInSegmentParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchInSegmentParam.Merge(m, src) -} -func (m *SearchInSegmentParam) XXX_Size() int { - return xxx_messageInfo_SearchInSegmentParam.Size(m) -} -func (m *SearchInSegmentParam) XXX_DiscardUnknown() { - xxx_messageInfo_SearchInSegmentParam.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchInSegmentParam proto.InternalMessageInfo - -func (m *SearchInSegmentParam) GetFileIdArray() []string { - if m != nil { - return m.FileIdArray - } - return nil -} - -func (m *SearchInSegmentParam) GetSearchParam() *SearchParam { - if m != nil { - return m.SearchParam - } - return nil -} - -type Entities struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Ids []int64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"` - ValidRow []bool `protobuf:"varint,3,rep,packed,name=valid_row,json=validRow,proto3" json:"valid_row,omitempty"` - RowsData []*RowData `protobuf:"bytes,4,rep,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Entities) Reset() { *m = Entities{} } -func (m *Entities) String() string { return proto.CompactTextString(m) } -func (*Entities) ProtoMessage() {} -func (*Entities) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{19} -} - -func (m *Entities) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Entities.Unmarshal(m, b) -} -func (m *Entities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Entities.Marshal(b, m, deterministic) -} -func (m *Entities) XXX_Merge(src proto.Message) { - xxx_messageInfo_Entities.Merge(m, src) -} -func (m *Entities) XXX_Size() int { - return xxx_messageInfo_Entities.Size(m) -} -func (m *Entities) XXX_DiscardUnknown() { - xxx_messageInfo_Entities.DiscardUnknown(m) -} - -var xxx_messageInfo_Entities proto.InternalMessageInfo - -func (m *Entities) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *Entities) GetIds() []int64 { - if m != nil { - return m.Ids - } - return nil -} - -func (m *Entities) GetValidRow() []bool { - if m != nil { - return m.ValidRow - } - return nil -} - -func (m *Entities) GetRowsData() []*RowData { - if m != nil { - return m.RowsData - } - return nil -} - -//* -// @brief Query result -type QueryResult struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Entities *Entities `protobuf:"bytes,2,opt,name=entities,proto3" json:"entities,omitempty"` - RowNum int64 `protobuf:"varint,3,opt,name=row_num,json=rowNum,proto3" json:"row_num,omitempty"` - Scores []float32 `protobuf:"fixed32,4,rep,packed,name=scores,proto3" json:"scores,omitempty"` - Distances []float32 `protobuf:"fixed32,5,rep,packed,name=distances,proto3" json:"distances,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - QueryId int64 `protobuf:"varint,7,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - ClientId int64 `protobuf:"varint,8,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{20} -} - -func (m *QueryResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResult.Unmarshal(m, b) -} -func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) -} -func (m *QueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResult.Merge(m, src) -} -func (m *QueryResult) XXX_Size() int { - return xxx_messageInfo_QueryResult.Size(m) -} -func (m *QueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResult proto.InternalMessageInfo - -func (m *QueryResult) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *QueryResult) GetEntities() *Entities { - if m != nil { - return m.Entities - } - return nil -} - -func (m *QueryResult) GetRowNum() int64 { - if m != nil { - return m.RowNum - } - return 0 -} - -func (m *QueryResult) GetScores() []float32 { - if m != nil { - return m.Scores - } - return nil -} - -func (m *QueryResult) GetDistances() []float32 { - if m != nil { - return m.Distances - } - return nil -} - -func (m *QueryResult) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -func (m *QueryResult) GetQueryId() int64 { - if m != nil { - return m.QueryId - } - return 0 -} - -func (m *QueryResult) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -//* -// @brief Server string Reply -type StringReply struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - StringReply string `protobuf:"bytes,2,opt,name=string_reply,json=stringReply,proto3" json:"string_reply,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StringReply) Reset() { *m = StringReply{} } -func (m *StringReply) String() string { return proto.CompactTextString(m) } -func (*StringReply) ProtoMessage() {} -func (*StringReply) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{21} -} - -func (m *StringReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StringReply.Unmarshal(m, b) -} -func (m *StringReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StringReply.Marshal(b, m, deterministic) -} -func (m *StringReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringReply.Merge(m, src) -} -func (m *StringReply) XXX_Size() int { - return xxx_messageInfo_StringReply.Size(m) -} -func (m *StringReply) XXX_DiscardUnknown() { - xxx_messageInfo_StringReply.DiscardUnknown(m) -} - -var xxx_messageInfo_StringReply proto.InternalMessageInfo - -func (m *StringReply) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *StringReply) GetStringReply() string { - if m != nil { - return m.StringReply - } - return "" -} - -//* -// @brief Server bool Reply -type BoolReply struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - BoolReply bool `protobuf:"varint,2,opt,name=bool_reply,json=boolReply,proto3" json:"bool_reply,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BoolReply) Reset() { *m = BoolReply{} } -func (m *BoolReply) String() string { return proto.CompactTextString(m) } -func (*BoolReply) ProtoMessage() {} -func (*BoolReply) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{22} -} - -func (m *BoolReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BoolReply.Unmarshal(m, b) -} -func (m *BoolReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BoolReply.Marshal(b, m, deterministic) -} -func (m *BoolReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_BoolReply.Merge(m, src) -} -func (m *BoolReply) XXX_Size() int { - return xxx_messageInfo_BoolReply.Size(m) -} -func (m *BoolReply) XXX_DiscardUnknown() { - xxx_messageInfo_BoolReply.DiscardUnknown(m) -} - -var xxx_messageInfo_BoolReply proto.InternalMessageInfo - -func (m *BoolReply) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *BoolReply) GetBoolReply() bool { - if m != nil { - return m.BoolReply - } - return false -} - -//* -// @brief Return collection row count -type CollectionRowCount struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionRowCount int64 `protobuf:"varint,2,opt,name=collection_row_count,json=collectionRowCount,proto3" json:"collection_row_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionRowCount) Reset() { *m = CollectionRowCount{} } -func (m *CollectionRowCount) String() string { return proto.CompactTextString(m) } -func (*CollectionRowCount) ProtoMessage() {} -func (*CollectionRowCount) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{23} -} - -func (m *CollectionRowCount) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionRowCount.Unmarshal(m, b) -} -func (m *CollectionRowCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionRowCount.Marshal(b, m, deterministic) -} -func (m *CollectionRowCount) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionRowCount.Merge(m, src) -} -func (m *CollectionRowCount) XXX_Size() int { - return xxx_messageInfo_CollectionRowCount.Size(m) -} -func (m *CollectionRowCount) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionRowCount.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionRowCount proto.InternalMessageInfo - -func (m *CollectionRowCount) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionRowCount) GetCollectionRowCount() int64 { - if m != nil { - return m.CollectionRowCount - } - return 0 -} - -//* -// @brief Server command parameters -type Command struct { - Cmd string `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Command) Reset() { *m = Command{} } -func (m *Command) String() string { return proto.CompactTextString(m) } -func (*Command) ProtoMessage() {} -func (*Command) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{24} -} - -func (m *Command) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Command.Unmarshal(m, b) -} -func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Command.Marshal(b, m, deterministic) -} -func (m *Command) XXX_Merge(src proto.Message) { - xxx_messageInfo_Command.Merge(m, src) -} -func (m *Command) XXX_Size() int { - return xxx_messageInfo_Command.Size(m) -} -func (m *Command) XXX_DiscardUnknown() { - xxx_messageInfo_Command.DiscardUnknown(m) -} - -var xxx_messageInfo_Command proto.InternalMessageInfo - -func (m *Command) GetCmd() string { - if m != nil { - return m.Cmd - } - return "" -} - -//* -// @brief Index params -// @collection_name: target collection -// @field_name: target field -// @index_name: a name for index provided by user, unique within this field -// @extra_params: index parameters in json format -// for vector field: -// extra_params["index_type"] = one of the values: FLAT, IVF_LAT, IVF_SQ8, NSGMIX, IVFSQ8H, -// PQ, HNSW, HNSW_SQ8NM, ANNOY -// extra_params["metric_type"] = one of the values: L2, IP, HAMMING, JACCARD, TANIMOTO -// SUBSTRUCTURE, SUPERSTRUCTURE -// extra_params["params"] = extra parameters for index, for example ivflat: {nlist: 2048} -// for structured field: -// extra_params["index_type"] = one of the values: SORTED -type IndexParam struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - FieldName string `protobuf:"bytes,3,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - IndexName string `protobuf:"bytes,4,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IndexParam) Reset() { *m = IndexParam{} } -func (m *IndexParam) String() string { return proto.CompactTextString(m) } -func (*IndexParam) ProtoMessage() {} -func (*IndexParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{25} -} - -func (m *IndexParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexParam.Unmarshal(m, b) -} -func (m *IndexParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexParam.Marshal(b, m, deterministic) -} -func (m *IndexParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexParam.Merge(m, src) -} -func (m *IndexParam) XXX_Size() int { - return xxx_messageInfo_IndexParam.Size(m) -} -func (m *IndexParam) XXX_DiscardUnknown() { - xxx_messageInfo_IndexParam.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexParam proto.InternalMessageInfo - -func (m *IndexParam) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *IndexParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *IndexParam) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *IndexParam) GetIndexName() string { - if m != nil { - return m.IndexName - } - return "" -} - -func (m *IndexParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Parameters for flush action -type FlushParam struct { - CollectionNameArray []string `protobuf:"bytes,1,rep,name=collection_name_array,json=collectionNameArray,proto3" json:"collection_name_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FlushParam) Reset() { *m = FlushParam{} } -func (m *FlushParam) String() string { return proto.CompactTextString(m) } -func (*FlushParam) ProtoMessage() {} -func (*FlushParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{26} -} - -func (m *FlushParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FlushParam.Unmarshal(m, b) -} -func (m *FlushParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FlushParam.Marshal(b, m, deterministic) -} -func (m *FlushParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushParam.Merge(m, src) -} -func (m *FlushParam) XXX_Size() int { - return xxx_messageInfo_FlushParam.Size(m) -} -func (m *FlushParam) XXX_DiscardUnknown() { - xxx_messageInfo_FlushParam.DiscardUnknown(m) -} - -var xxx_messageInfo_FlushParam proto.InternalMessageInfo - -func (m *FlushParam) GetCollectionNameArray() []string { - if m != nil { - return m.CollectionNameArray - } - return nil -} - -//* -// @brief Parameters for flush action -type CompactParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Threshold float64 `protobuf:"fixed64,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompactParam) Reset() { *m = CompactParam{} } -func (m *CompactParam) String() string { return proto.CompactTextString(m) } -func (*CompactParam) ProtoMessage() {} -func (*CompactParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{27} -} - -func (m *CompactParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CompactParam.Unmarshal(m, b) -} -func (m *CompactParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CompactParam.Marshal(b, m, deterministic) -} -func (m *CompactParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompactParam.Merge(m, src) -} -func (m *CompactParam) XXX_Size() int { - return xxx_messageInfo_CompactParam.Size(m) -} -func (m *CompactParam) XXX_DiscardUnknown() { - xxx_messageInfo_CompactParam.DiscardUnknown(m) -} - -var xxx_messageInfo_CompactParam proto.InternalMessageInfo - -func (m *CompactParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *CompactParam) GetThreshold() float64 { - if m != nil { - return m.Threshold - } - return 0 -} - -//* -// @brief Parameters for deleting entities by id -type DeleteByIDParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - IdArray []int64 `protobuf:"varint,2,rep,packed,name=id_array,json=idArray,proto3" json:"id_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteByIDParam) Reset() { *m = DeleteByIDParam{} } -func (m *DeleteByIDParam) String() string { return proto.CompactTextString(m) } -func (*DeleteByIDParam) ProtoMessage() {} -func (*DeleteByIDParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{28} -} - -func (m *DeleteByIDParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteByIDParam.Unmarshal(m, b) -} -func (m *DeleteByIDParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteByIDParam.Marshal(b, m, deterministic) -} -func (m *DeleteByIDParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteByIDParam.Merge(m, src) -} -func (m *DeleteByIDParam) XXX_Size() int { - return xxx_messageInfo_DeleteByIDParam.Size(m) -} -func (m *DeleteByIDParam) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteByIDParam.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteByIDParam proto.InternalMessageInfo - -func (m *DeleteByIDParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *DeleteByIDParam) GetIdArray() []int64 { - if m != nil { - return m.IdArray - } - return nil -} - -//* -// @brief Return collection stats -// @json_info: collection stats in json format, typically, the format is like: -// { -// row_count: xxx, -// data_size: xxx, -// partitions: [ -// { -// tag: xxx, -// id: xxx, -// row_count: xxx, -// data_size: xxx, -// segments: [ -// { -// id: xxx, -// row_count: xxx, -// data_size: xxx, -// files: [ -// { -// field: xxx, -// name: xxx, -// index_type: xxx, -// path: xxx, -// data_size: xxx, -// } -// ] -// } -// ] -// } -// ] -// } -type CollectionInfo struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - JsonInfo string `protobuf:"bytes,2,opt,name=json_info,json=jsonInfo,proto3" json:"json_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionInfo) Reset() { *m = CollectionInfo{} } -func (m *CollectionInfo) String() string { return proto.CompactTextString(m) } -func (*CollectionInfo) ProtoMessage() {} -func (*CollectionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{29} -} - -func (m *CollectionInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionInfo.Unmarshal(m, b) -} -func (m *CollectionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionInfo.Marshal(b, m, deterministic) -} -func (m *CollectionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionInfo.Merge(m, src) -} -func (m *CollectionInfo) XXX_Size() int { - return xxx_messageInfo_CollectionInfo.Size(m) -} -func (m *CollectionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionInfo proto.InternalMessageInfo - -func (m *CollectionInfo) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionInfo) GetJsonInfo() string { - if m != nil { - return m.JsonInfo - } - return "" -} - -//* -// @brief Parameters for returning entities id of a segment -type GetEntityIDsParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - SegmentId int64 `protobuf:"varint,2,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetEntityIDsParam) Reset() { *m = GetEntityIDsParam{} } -func (m *GetEntityIDsParam) String() string { return proto.CompactTextString(m) } -func (*GetEntityIDsParam) ProtoMessage() {} -func (*GetEntityIDsParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{30} -} - -func (m *GetEntityIDsParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetEntityIDsParam.Unmarshal(m, b) -} -func (m *GetEntityIDsParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetEntityIDsParam.Marshal(b, m, deterministic) -} -func (m *GetEntityIDsParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetEntityIDsParam.Merge(m, src) -} -func (m *GetEntityIDsParam) XXX_Size() int { - return xxx_messageInfo_GetEntityIDsParam.Size(m) -} -func (m *GetEntityIDsParam) XXX_DiscardUnknown() { - xxx_messageInfo_GetEntityIDsParam.DiscardUnknown(m) -} - -var xxx_messageInfo_GetEntityIDsParam proto.InternalMessageInfo - -func (m *GetEntityIDsParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *GetEntityIDsParam) GetSegmentId() int64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -//* -// @brief Entities identity -type EntityIdentity struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - IdArray []int64 `protobuf:"varint,2,rep,packed,name=id_array,json=idArray,proto3" json:"id_array,omitempty"` - FieldNames []string `protobuf:"bytes,3,rep,name=field_names,json=fieldNames,proto3" json:"field_names,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EntityIdentity) Reset() { *m = EntityIdentity{} } -func (m *EntityIdentity) String() string { return proto.CompactTextString(m) } -func (*EntityIdentity) ProtoMessage() {} -func (*EntityIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{31} -} - -func (m *EntityIdentity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EntityIdentity.Unmarshal(m, b) -} -func (m *EntityIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EntityIdentity.Marshal(b, m, deterministic) -} -func (m *EntityIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_EntityIdentity.Merge(m, src) -} -func (m *EntityIdentity) XXX_Size() int { - return xxx_messageInfo_EntityIdentity.Size(m) -} -func (m *EntityIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_EntityIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_EntityIdentity proto.InternalMessageInfo - -func (m *EntityIdentity) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *EntityIdentity) GetIdArray() []int64 { - if m != nil { - return m.IdArray - } - return nil -} - -func (m *EntityIdentity) GetFieldNames() []string { - if m != nil { - return m.FieldNames - } - return nil -} - -//* -// @brief Vector field parameters -type VectorFieldParam struct { - Dimension int64 `protobuf:"varint,1,opt,name=dimension,proto3" json:"dimension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorFieldParam) Reset() { *m = VectorFieldParam{} } -func (m *VectorFieldParam) String() string { return proto.CompactTextString(m) } -func (*VectorFieldParam) ProtoMessage() {} -func (*VectorFieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{32} -} - -func (m *VectorFieldParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorFieldParam.Unmarshal(m, b) -} -func (m *VectorFieldParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorFieldParam.Marshal(b, m, deterministic) -} -func (m *VectorFieldParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorFieldParam.Merge(m, src) -} -func (m *VectorFieldParam) XXX_Size() int { - return xxx_messageInfo_VectorFieldParam.Size(m) -} -func (m *VectorFieldParam) XXX_DiscardUnknown() { - xxx_messageInfo_VectorFieldParam.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorFieldParam proto.InternalMessageInfo - -func (m *VectorFieldParam) GetDimension() int64 { - if m != nil { - return m.Dimension - } - return 0 -} - -//* -// @brief Field type -type FieldType struct { - // Types that are valid to be assigned to Value: - // *FieldType_DataType - // *FieldType_VectorParam - Value isFieldType_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldType) Reset() { *m = FieldType{} } -func (m *FieldType) String() string { return proto.CompactTextString(m) } -func (*FieldType) ProtoMessage() {} -func (*FieldType) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{33} -} - -func (m *FieldType) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldType.Unmarshal(m, b) -} -func (m *FieldType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldType.Marshal(b, m, deterministic) -} -func (m *FieldType) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldType.Merge(m, src) -} -func (m *FieldType) XXX_Size() int { - return xxx_messageInfo_FieldType.Size(m) -} -func (m *FieldType) XXX_DiscardUnknown() { - xxx_messageInfo_FieldType.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldType proto.InternalMessageInfo - -type isFieldType_Value interface { - isFieldType_Value() -} - -type FieldType_DataType struct { - DataType DataType `protobuf:"varint,1,opt,name=data_type,json=dataType,proto3,enum=milvus.grpc.DataType,oneof"` -} - -type FieldType_VectorParam struct { - VectorParam *VectorFieldParam `protobuf:"bytes,2,opt,name=vector_param,json=vectorParam,proto3,oneof"` -} - -func (*FieldType_DataType) isFieldType_Value() {} - -func (*FieldType_VectorParam) isFieldType_Value() {} - -func (m *FieldType) GetValue() isFieldType_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *FieldType) GetDataType() DataType { - if x, ok := m.GetValue().(*FieldType_DataType); ok { - return x.DataType - } - return DataType_NONE -} - -func (m *FieldType) GetVectorParam() *VectorFieldParam { - if x, ok := m.GetValue().(*FieldType_VectorParam); ok { - return x.VectorParam - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*FieldType) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*FieldType_DataType)(nil), - (*FieldType_VectorParam)(nil), - } -} - -//* -// @brief Field parameters -type FieldParam struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type DataType `protobuf:"varint,3,opt,name=type,proto3,enum=milvus.grpc.DataType" json:"type,omitempty"` - IndexParams []*KeyValuePair `protobuf:"bytes,4,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldParam) Reset() { *m = FieldParam{} } -func (m *FieldParam) String() string { return proto.CompactTextString(m) } -func (*FieldParam) ProtoMessage() {} -func (*FieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{34} -} - -func (m *FieldParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldParam.Unmarshal(m, b) -} -func (m *FieldParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldParam.Marshal(b, m, deterministic) -} -func (m *FieldParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldParam.Merge(m, src) -} -func (m *FieldParam) XXX_Size() int { - return xxx_messageInfo_FieldParam.Size(m) -} -func (m *FieldParam) XXX_DiscardUnknown() { - xxx_messageInfo_FieldParam.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldParam proto.InternalMessageInfo - -func (m *FieldParam) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *FieldParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *FieldParam) GetType() DataType { - if m != nil { - return m.Type - } - return DataType_NONE -} - -func (m *FieldParam) GetIndexParams() []*KeyValuePair { - if m != nil { - return m.IndexParams - } - return nil -} - -func (m *FieldParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Vector field record -type VectorFieldRecord struct { - Value []*VectorRowRecord `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorFieldRecord) Reset() { *m = VectorFieldRecord{} } -func (m *VectorFieldRecord) String() string { return proto.CompactTextString(m) } -func (*VectorFieldRecord) ProtoMessage() {} -func (*VectorFieldRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{35} -} - -func (m *VectorFieldRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorFieldRecord.Unmarshal(m, b) -} -func (m *VectorFieldRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorFieldRecord.Marshal(b, m, deterministic) -} -func (m *VectorFieldRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorFieldRecord.Merge(m, src) -} -func (m *VectorFieldRecord) XXX_Size() int { - return xxx_messageInfo_VectorFieldRecord.Size(m) -} -func (m *VectorFieldRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorFieldRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorFieldRecord proto.InternalMessageInfo - -func (m *VectorFieldRecord) GetValue() []*VectorRowRecord { - if m != nil { - return m.Value - } - return nil -} - -type TermQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - IntValue []int64 `protobuf:"varint,2,rep,packed,name=int_value,json=intValue,proto3" json:"int_value,omitempty"` - DoubleValue []float64 `protobuf:"fixed64,3,rep,packed,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - ValueNum int64 `protobuf:"varint,4,opt,name=value_num,json=valueNum,proto3" json:"value_num,omitempty"` - Boost float32 `protobuf:"fixed32,5,opt,name=boost,proto3" json:"boost,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TermQuery) Reset() { *m = TermQuery{} } -func (m *TermQuery) String() string { return proto.CompactTextString(m) } -func (*TermQuery) ProtoMessage() {} -func (*TermQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{36} -} - -func (m *TermQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TermQuery.Unmarshal(m, b) -} -func (m *TermQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TermQuery.Marshal(b, m, deterministic) -} -func (m *TermQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_TermQuery.Merge(m, src) -} -func (m *TermQuery) XXX_Size() int { - return xxx_messageInfo_TermQuery.Size(m) -} -func (m *TermQuery) XXX_DiscardUnknown() { - xxx_messageInfo_TermQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_TermQuery proto.InternalMessageInfo - -func (m *TermQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *TermQuery) GetIntValue() []int64 { - if m != nil { - return m.IntValue - } - return nil -} - -func (m *TermQuery) GetDoubleValue() []float64 { - if m != nil { - return m.DoubleValue - } - return nil -} - -func (m *TermQuery) GetValueNum() int64 { - if m != nil { - return m.ValueNum - } - return 0 -} - -func (m *TermQuery) GetBoost() float32 { - if m != nil { - return m.Boost - } - return 0 -} - -func (m *TermQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type CompareExpr struct { - Operator CompareOperator `protobuf:"varint,1,opt,name=operator,proto3,enum=milvus.grpc.CompareOperator" json:"operator,omitempty"` - Operand string `protobuf:"bytes,2,opt,name=operand,proto3" json:"operand,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompareExpr) Reset() { *m = CompareExpr{} } -func (m *CompareExpr) String() string { return proto.CompactTextString(m) } -func (*CompareExpr) ProtoMessage() {} -func (*CompareExpr) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{37} -} - -func (m *CompareExpr) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CompareExpr.Unmarshal(m, b) -} -func (m *CompareExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CompareExpr.Marshal(b, m, deterministic) -} -func (m *CompareExpr) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompareExpr.Merge(m, src) -} -func (m *CompareExpr) XXX_Size() int { - return xxx_messageInfo_CompareExpr.Size(m) -} -func (m *CompareExpr) XXX_DiscardUnknown() { - xxx_messageInfo_CompareExpr.DiscardUnknown(m) -} - -var xxx_messageInfo_CompareExpr proto.InternalMessageInfo - -func (m *CompareExpr) GetOperator() CompareOperator { - if m != nil { - return m.Operator - } - return CompareOperator_LT -} - -func (m *CompareExpr) GetOperand() string { - if m != nil { - return m.Operand - } - return "" -} - -type RangeQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - Operand []*CompareExpr `protobuf:"bytes,2,rep,name=operand,proto3" json:"operand,omitempty"` - Boost float32 `protobuf:"fixed32,3,opt,name=boost,proto3" json:"boost,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RangeQuery) Reset() { *m = RangeQuery{} } -func (m *RangeQuery) String() string { return proto.CompactTextString(m) } -func (*RangeQuery) ProtoMessage() {} -func (*RangeQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{38} -} - -func (m *RangeQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RangeQuery.Unmarshal(m, b) -} -func (m *RangeQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RangeQuery.Marshal(b, m, deterministic) -} -func (m *RangeQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeQuery.Merge(m, src) -} -func (m *RangeQuery) XXX_Size() int { - return xxx_messageInfo_RangeQuery.Size(m) -} -func (m *RangeQuery) XXX_DiscardUnknown() { - xxx_messageInfo_RangeQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_RangeQuery proto.InternalMessageInfo - -func (m *RangeQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *RangeQuery) GetOperand() []*CompareExpr { - if m != nil { - return m.Operand - } - return nil -} - -func (m *RangeQuery) GetBoost() float32 { - if m != nil { - return m.Boost - } - return 0 -} - -func (m *RangeQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type VectorQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - QueryBoost float32 `protobuf:"fixed32,2,opt,name=query_boost,json=queryBoost,proto3" json:"query_boost,omitempty"` - Records []*VectorRowRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records,omitempty"` - Topk int64 `protobuf:"varint,4,opt,name=topk,proto3" json:"topk,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorQuery) Reset() { *m = VectorQuery{} } -func (m *VectorQuery) String() string { return proto.CompactTextString(m) } -func (*VectorQuery) ProtoMessage() {} -func (*VectorQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{39} -} - -func (m *VectorQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorQuery.Unmarshal(m, b) -} -func (m *VectorQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorQuery.Marshal(b, m, deterministic) -} -func (m *VectorQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorQuery.Merge(m, src) -} -func (m *VectorQuery) XXX_Size() int { - return xxx_messageInfo_VectorQuery.Size(m) -} -func (m *VectorQuery) XXX_DiscardUnknown() { - xxx_messageInfo_VectorQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorQuery proto.InternalMessageInfo - -func (m *VectorQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *VectorQuery) GetQueryBoost() float32 { - if m != nil { - return m.QueryBoost - } - return 0 -} - -func (m *VectorQuery) GetRecords() []*VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -func (m *VectorQuery) GetTopk() int64 { - if m != nil { - return m.Topk - } - return 0 -} - -func (m *VectorQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type BooleanQuery struct { - Occur Occur `protobuf:"varint,1,opt,name=occur,proto3,enum=milvus.grpc.Occur" json:"occur,omitempty"` - GeneralQuery []*GeneralQuery `protobuf:"bytes,2,rep,name=general_query,json=generalQuery,proto3" json:"general_query,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BooleanQuery) Reset() { *m = BooleanQuery{} } -func (m *BooleanQuery) String() string { return proto.CompactTextString(m) } -func (*BooleanQuery) ProtoMessage() {} -func (*BooleanQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{40} -} - -func (m *BooleanQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BooleanQuery.Unmarshal(m, b) -} -func (m *BooleanQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BooleanQuery.Marshal(b, m, deterministic) -} -func (m *BooleanQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_BooleanQuery.Merge(m, src) -} -func (m *BooleanQuery) XXX_Size() int { - return xxx_messageInfo_BooleanQuery.Size(m) -} -func (m *BooleanQuery) XXX_DiscardUnknown() { - xxx_messageInfo_BooleanQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_BooleanQuery proto.InternalMessageInfo - -func (m *BooleanQuery) GetOccur() Occur { - if m != nil { - return m.Occur - } - return Occur_INVALID -} - -func (m *BooleanQuery) GetGeneralQuery() []*GeneralQuery { - if m != nil { - return m.GeneralQuery - } - return nil -} - -type GeneralQuery struct { - // Types that are valid to be assigned to Query: - // *GeneralQuery_BooleanQuery - // *GeneralQuery_TermQuery - // *GeneralQuery_RangeQuery - // *GeneralQuery_VectorQuery - Query isGeneralQuery_Query `protobuf_oneof:"query"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneralQuery) Reset() { *m = GeneralQuery{} } -func (m *GeneralQuery) String() string { return proto.CompactTextString(m) } -func (*GeneralQuery) ProtoMessage() {} -func (*GeneralQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{41} -} - -func (m *GeneralQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneralQuery.Unmarshal(m, b) -} -func (m *GeneralQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneralQuery.Marshal(b, m, deterministic) -} -func (m *GeneralQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneralQuery.Merge(m, src) -} -func (m *GeneralQuery) XXX_Size() int { - return xxx_messageInfo_GeneralQuery.Size(m) -} -func (m *GeneralQuery) XXX_DiscardUnknown() { - xxx_messageInfo_GeneralQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneralQuery proto.InternalMessageInfo - -type isGeneralQuery_Query interface { - isGeneralQuery_Query() -} - -type GeneralQuery_BooleanQuery struct { - BooleanQuery *BooleanQuery `protobuf:"bytes,1,opt,name=boolean_query,json=booleanQuery,proto3,oneof"` -} - -type GeneralQuery_TermQuery struct { - TermQuery *TermQuery `protobuf:"bytes,2,opt,name=term_query,json=termQuery,proto3,oneof"` -} - -type GeneralQuery_RangeQuery struct { - RangeQuery *RangeQuery `protobuf:"bytes,3,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -type GeneralQuery_VectorQuery struct { - VectorQuery *VectorQuery `protobuf:"bytes,4,opt,name=vector_query,json=vectorQuery,proto3,oneof"` -} - -func (*GeneralQuery_BooleanQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_TermQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_RangeQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_VectorQuery) isGeneralQuery_Query() {} - -func (m *GeneralQuery) GetQuery() isGeneralQuery_Query { - if m != nil { - return m.Query - } - return nil -} - -func (m *GeneralQuery) GetBooleanQuery() *BooleanQuery { - if x, ok := m.GetQuery().(*GeneralQuery_BooleanQuery); ok { - return x.BooleanQuery - } - return nil -} - -func (m *GeneralQuery) GetTermQuery() *TermQuery { - if x, ok := m.GetQuery().(*GeneralQuery_TermQuery); ok { - return x.TermQuery - } - return nil -} - -func (m *GeneralQuery) GetRangeQuery() *RangeQuery { - if x, ok := m.GetQuery().(*GeneralQuery_RangeQuery); ok { - return x.RangeQuery - } - return nil -} - -func (m *GeneralQuery) GetVectorQuery() *VectorQuery { - if x, ok := m.GetQuery().(*GeneralQuery_VectorQuery); ok { - return x.VectorQuery - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GeneralQuery) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GeneralQuery_BooleanQuery)(nil), - (*GeneralQuery_TermQuery)(nil), - (*GeneralQuery_RangeQuery)(nil), - (*GeneralQuery_VectorQuery)(nil), - } -} - -type SearchParamPB struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - PartitionTagArray []string `protobuf:"bytes,2,rep,name=partition_tag_array,json=partitionTagArray,proto3" json:"partition_tag_array,omitempty"` - GeneralQuery *GeneralQuery `protobuf:"bytes,3,opt,name=general_query,json=generalQuery,proto3" json:"general_query,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchParamPB) Reset() { *m = SearchParamPB{} } -func (m *SearchParamPB) String() string { return proto.CompactTextString(m) } -func (*SearchParamPB) ProtoMessage() {} -func (*SearchParamPB) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{42} -} - -func (m *SearchParamPB) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchParamPB.Unmarshal(m, b) -} -func (m *SearchParamPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchParamPB.Marshal(b, m, deterministic) -} -func (m *SearchParamPB) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchParamPB.Merge(m, src) -} -func (m *SearchParamPB) XXX_Size() int { - return xxx_messageInfo_SearchParamPB.Size(m) -} -func (m *SearchParamPB) XXX_DiscardUnknown() { - xxx_messageInfo_SearchParamPB.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchParamPB proto.InternalMessageInfo - -func (m *SearchParamPB) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchParamPB) GetPartitionTagArray() []string { - if m != nil { - return m.PartitionTagArray - } - return nil -} - -func (m *SearchParamPB) GetGeneralQuery() *GeneralQuery { - if m != nil { - return m.GeneralQuery - } - return nil -} - -func (m *SearchParamPB) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type InsertOrDeleteMsg struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - RowsData *RowData `protobuf:"bytes,2,opt,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` - PartitionTag string `protobuf:"bytes,4,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - SegmentId int64 `protobuf:"varint,6,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - ChannelId int64 `protobuf:"varint,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - Op OpType `protobuf:"varint,8,opt,name=op,proto3,enum=milvus.grpc.OpType" json:"op,omitempty"` - ClientId int64 `protobuf:"varint,9,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,10,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertOrDeleteMsg) Reset() { *m = InsertOrDeleteMsg{} } -func (m *InsertOrDeleteMsg) String() string { return proto.CompactTextString(m) } -func (*InsertOrDeleteMsg) ProtoMessage() {} -func (*InsertOrDeleteMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{43} -} - -func (m *InsertOrDeleteMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertOrDeleteMsg.Unmarshal(m, b) -} -func (m *InsertOrDeleteMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertOrDeleteMsg.Marshal(b, m, deterministic) -} -func (m *InsertOrDeleteMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertOrDeleteMsg.Merge(m, src) -} -func (m *InsertOrDeleteMsg) XXX_Size() int { - return xxx_messageInfo_InsertOrDeleteMsg.Size(m) -} -func (m *InsertOrDeleteMsg) XXX_DiscardUnknown() { - xxx_messageInfo_InsertOrDeleteMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertOrDeleteMsg proto.InternalMessageInfo - -func (m *InsertOrDeleteMsg) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *InsertOrDeleteMsg) GetRowsData() *RowData { - if m != nil { - return m.RowsData - } - return nil -} - -func (m *InsertOrDeleteMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetPartitionTag() string { - if m != nil { - return m.PartitionTag - } - return "" -} - -func (m *InsertOrDeleteMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetSegmentId() int64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetChannelId() int64 { - if m != nil { - return m.ChannelId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetOp() OpType { - if m != nil { - return m.Op - } - return OpType_INSERT -} - -func (m *InsertOrDeleteMsg) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchMsg struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Records *VectorRowRecord `protobuf:"bytes,2,opt,name=records,proto3" json:"records,omitempty"` - PartitionTag []string `protobuf:"bytes,3,rep,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - Uid int64 `protobuf:"varint,4,opt,name=uid,proto3" json:"uid,omitempty"` - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ClientId int64 `protobuf:"varint,6,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,7,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - Json []string `protobuf:"bytes,8,rep,name=json,proto3" json:"json,omitempty"` - Dsl string `protobuf:"bytes,9,opt,name=dsl,proto3" json:"dsl,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchMsg) Reset() { *m = SearchMsg{} } -func (m *SearchMsg) String() string { return proto.CompactTextString(m) } -func (*SearchMsg) ProtoMessage() {} -func (*SearchMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{44} -} - -func (m *SearchMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchMsg.Unmarshal(m, b) -} -func (m *SearchMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchMsg.Marshal(b, m, deterministic) -} -func (m *SearchMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchMsg.Merge(m, src) -} -func (m *SearchMsg) XXX_Size() int { - return xxx_messageInfo_SearchMsg.Size(m) -} -func (m *SearchMsg) XXX_DiscardUnknown() { - xxx_messageInfo_SearchMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchMsg proto.InternalMessageInfo - -func (m *SearchMsg) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchMsg) GetRecords() *VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -func (m *SearchMsg) GetPartitionTag() []string { - if m != nil { - return m.PartitionTag - } - return nil -} - -func (m *SearchMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *SearchMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *SearchMsg) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -func (m *SearchMsg) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -func (m *SearchMsg) GetJson() []string { - if m != nil { - return m.Json - } - return nil -} - -func (m *SearchMsg) GetDsl() string { - if m != nil { - return m.Dsl - } - return "" -} - -type TimeSyncMsg struct { - Peer_Id int64 `protobuf:"varint,1,opt,name=peer_Id,json=peerId,proto3" json:"peer_Id,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - SyncType SyncType `protobuf:"varint,3,opt,name=sync_type,json=syncType,proto3,enum=milvus.grpc.SyncType" json:"sync_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TimeSyncMsg) Reset() { *m = TimeSyncMsg{} } -func (m *TimeSyncMsg) String() string { return proto.CompactTextString(m) } -func (*TimeSyncMsg) ProtoMessage() {} -func (*TimeSyncMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{45} -} - -func (m *TimeSyncMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TimeSyncMsg.Unmarshal(m, b) -} -func (m *TimeSyncMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TimeSyncMsg.Marshal(b, m, deterministic) -} -func (m *TimeSyncMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeSyncMsg.Merge(m, src) -} -func (m *TimeSyncMsg) XXX_Size() int { - return xxx_messageInfo_TimeSyncMsg.Size(m) -} -func (m *TimeSyncMsg) XXX_DiscardUnknown() { - xxx_messageInfo_TimeSyncMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeSyncMsg proto.InternalMessageInfo - -func (m *TimeSyncMsg) GetPeer_Id() int64 { - if m != nil { - return m.Peer_Id - } - return 0 -} - -func (m *TimeSyncMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *TimeSyncMsg) GetSyncType() SyncType { - if m != nil { - return m.SyncType - } - return SyncType_READ -} - -type Key2SegMsg struct { - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - SegmentId []int64 `protobuf:"varint,3,rep,packed,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Key2SegMsg) Reset() { *m = Key2SegMsg{} } -func (m *Key2SegMsg) String() string { return proto.CompactTextString(m) } -func (*Key2SegMsg) ProtoMessage() {} -func (*Key2SegMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{46} -} - -func (m *Key2SegMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Key2SegMsg.Unmarshal(m, b) -} -func (m *Key2SegMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Key2SegMsg.Marshal(b, m, deterministic) -} -func (m *Key2SegMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_Key2SegMsg.Merge(m, src) -} -func (m *Key2SegMsg) XXX_Size() int { - return xxx_messageInfo_Key2SegMsg.Size(m) -} -func (m *Key2SegMsg) XXX_DiscardUnknown() { - xxx_messageInfo_Key2SegMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_Key2SegMsg proto.InternalMessageInfo - -func (m *Key2SegMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *Key2SegMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *Key2SegMsg) GetSegmentId() []int64 { - if m != nil { - return m.SegmentId - } - return nil -} - -func init() { - proto.RegisterEnum("milvus.grpc.ErrorCode", ErrorCode_name, ErrorCode_value) - proto.RegisterEnum("milvus.grpc.DataType", DataType_name, DataType_value) - proto.RegisterEnum("milvus.grpc.CompareOperator", CompareOperator_name, CompareOperator_value) - proto.RegisterEnum("milvus.grpc.Occur", Occur_name, Occur_value) - proto.RegisterEnum("milvus.grpc.OpType", OpType_name, OpType_value) - proto.RegisterEnum("milvus.grpc.SyncType", SyncType_name, SyncType_value) - proto.RegisterType((*Status)(nil), "milvus.grpc.Status") - proto.RegisterType((*KeyValuePair)(nil), "milvus.grpc.KeyValuePair") - proto.RegisterType((*CollectionName)(nil), "milvus.grpc.CollectionName") - proto.RegisterType((*CollectionNameList)(nil), "milvus.grpc.CollectionNameList") - proto.RegisterType((*FieldName)(nil), "milvus.grpc.FieldName") - proto.RegisterType((*Mapping)(nil), "milvus.grpc.Mapping") - proto.RegisterType((*MappingList)(nil), "milvus.grpc.MappingList") - proto.RegisterType((*PartitionParam)(nil), "milvus.grpc.PartitionParam") - proto.RegisterType((*PartitionList)(nil), "milvus.grpc.PartitionList") - proto.RegisterType((*VectorRowRecord)(nil), "milvus.grpc.VectorRowRecord") - proto.RegisterType((*EntityIds)(nil), "milvus.grpc.EntityIds") - proto.RegisterType((*VectorRecord)(nil), "milvus.grpc.VectorRecord") - proto.RegisterType((*VectorParam)(nil), "milvus.grpc.VectorParam") - proto.RegisterType((*FieldMeta)(nil), "milvus.grpc.FieldMeta") - proto.RegisterType((*Schema)(nil), "milvus.grpc.Schema") - proto.RegisterType((*RowData)(nil), "milvus.grpc.RowData") - proto.RegisterType((*InsertParam)(nil), "milvus.grpc.InsertParam") - proto.RegisterType((*SearchParam)(nil), "milvus.grpc.SearchParam") - proto.RegisterType((*SearchInSegmentParam)(nil), "milvus.grpc.SearchInSegmentParam") - proto.RegisterType((*Entities)(nil), "milvus.grpc.Entities") - proto.RegisterType((*QueryResult)(nil), "milvus.grpc.QueryResult") - proto.RegisterType((*StringReply)(nil), "milvus.grpc.StringReply") - proto.RegisterType((*BoolReply)(nil), "milvus.grpc.BoolReply") - proto.RegisterType((*CollectionRowCount)(nil), "milvus.grpc.CollectionRowCount") - proto.RegisterType((*Command)(nil), "milvus.grpc.Command") - proto.RegisterType((*IndexParam)(nil), "milvus.grpc.IndexParam") - proto.RegisterType((*FlushParam)(nil), "milvus.grpc.FlushParam") - proto.RegisterType((*CompactParam)(nil), "milvus.grpc.CompactParam") - proto.RegisterType((*DeleteByIDParam)(nil), "milvus.grpc.DeleteByIDParam") - proto.RegisterType((*CollectionInfo)(nil), "milvus.grpc.CollectionInfo") - proto.RegisterType((*GetEntityIDsParam)(nil), "milvus.grpc.GetEntityIDsParam") - proto.RegisterType((*EntityIdentity)(nil), "milvus.grpc.EntityIdentity") - proto.RegisterType((*VectorFieldParam)(nil), "milvus.grpc.VectorFieldParam") - proto.RegisterType((*FieldType)(nil), "milvus.grpc.FieldType") - proto.RegisterType((*FieldParam)(nil), "milvus.grpc.FieldParam") - proto.RegisterType((*VectorFieldRecord)(nil), "milvus.grpc.VectorFieldRecord") - proto.RegisterType((*TermQuery)(nil), "milvus.grpc.TermQuery") - proto.RegisterType((*CompareExpr)(nil), "milvus.grpc.CompareExpr") - proto.RegisterType((*RangeQuery)(nil), "milvus.grpc.RangeQuery") - proto.RegisterType((*VectorQuery)(nil), "milvus.grpc.VectorQuery") - proto.RegisterType((*BooleanQuery)(nil), "milvus.grpc.BooleanQuery") - proto.RegisterType((*GeneralQuery)(nil), "milvus.grpc.GeneralQuery") - proto.RegisterType((*SearchParamPB)(nil), "milvus.grpc.SearchParamPB") - proto.RegisterType((*InsertOrDeleteMsg)(nil), "milvus.grpc.InsertOrDeleteMsg") - proto.RegisterType((*SearchMsg)(nil), "milvus.grpc.SearchMsg") - proto.RegisterType((*TimeSyncMsg)(nil), "milvus.grpc.TimeSyncMsg") - proto.RegisterType((*Key2SegMsg)(nil), "milvus.grpc.Key2SegMsg") -} - -func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } - -var fileDescriptor_33c57e4bae7b9afd = []byte{ - // 2878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x3a, 0xdd, 0x72, 0xdb, 0xc6, - 0xd5, 0x04, 0x41, 0x91, 0xc4, 0x01, 0x29, 0x41, 0x6b, 0xd9, 0x96, 0xed, 0xf8, 0xb3, 0x83, 0x6f, - 0xa6, 0x75, 0xdc, 0x19, 0x4f, 0xa2, 0xa4, 0xb6, 0x5b, 0x27, 0x69, 0xf8, 0x03, 0x49, 0xa8, 0x29, - 0x52, 0x5e, 0x42, 0x76, 0x7e, 0xa6, 0x83, 0x42, 0xc4, 0x9a, 0x46, 0x43, 0x02, 0x2c, 0x00, 0x5a, - 0xe6, 0x6d, 0xef, 0xdb, 0x99, 0x5e, 0xf6, 0xb2, 0x7d, 0x84, 0xf6, 0x0d, 0x7a, 0xd9, 0x17, 0xc8, - 0x45, 0x66, 0x7a, 0xd9, 0xe9, 0x63, 0x74, 0xf6, 0x07, 0x24, 0x40, 0x91, 0x12, 0x19, 0xb5, 0x57, - 0x5a, 0x9e, 0xdd, 0x73, 0xf6, 0xfc, 0xef, 0x39, 0x07, 0x82, 0xea, 0x90, 0x44, 0x91, 0xd3, 0x27, - 0x8f, 0x46, 0x61, 0x10, 0x07, 0x48, 0x1d, 0x7a, 0x83, 0xb7, 0xe3, 0xe8, 0x51, 0x3f, 0x1c, 0xf5, - 0xf4, 0x57, 0x50, 0xec, 0xc6, 0x4e, 0x3c, 0x8e, 0xd0, 0x4f, 0x01, 0x48, 0x18, 0x06, 0xa1, 0xdd, - 0x0b, 0x5c, 0xb2, 0x2b, 0xdd, 0x97, 0x1e, 0x6c, 0xee, 0xdd, 0x78, 0x94, 0x3a, 0xfb, 0xc8, 0xa0, - 0xdb, 0x8d, 0xc0, 0x25, 0x58, 0x21, 0xc9, 0x12, 0xdd, 0x80, 0x62, 0x48, 0x9c, 0x28, 0xf0, 0x77, - 0xf3, 0xf7, 0xa5, 0x07, 0x0a, 0x16, 0xbf, 0xf4, 0xc7, 0x50, 0x79, 0x4e, 0x26, 0x2f, 0x9d, 0xc1, - 0x98, 0x1c, 0x3b, 0x5e, 0x88, 0x34, 0x90, 0xbf, 0x25, 0x13, 0x46, 0x57, 0xc1, 0x74, 0x89, 0x76, - 0x60, 0xe3, 0x2d, 0xdd, 0x16, 0x88, 0xfc, 0x87, 0xfe, 0x33, 0xd8, 0x6c, 0x04, 0x83, 0x01, 0xe9, - 0xc5, 0x5e, 0xe0, 0xb7, 0x9d, 0x21, 0x41, 0x3f, 0x86, 0xad, 0xde, 0x14, 0x62, 0xfb, 0xce, 0x90, - 0x08, 0x2a, 0x9b, 0xbd, 0xcc, 0x41, 0x7d, 0x00, 0x28, 0x8b, 0xda, 0xf2, 0xa2, 0x18, 0xfd, 0x04, - 0x8a, 0x11, 0x93, 0x90, 0x61, 0xa9, 0x7b, 0xd7, 0x32, 0x32, 0x71, 0xe1, 0xb1, 0x38, 0x82, 0x3e, - 0x00, 0x6d, 0xee, 0xae, 0x68, 0x37, 0x7f, 0x5f, 0x7e, 0xa0, 0xe0, 0xad, 0xec, 0x65, 0x91, 0xde, - 0x05, 0x65, 0xdf, 0x23, 0x03, 0x77, 0x2d, 0x1e, 0xd1, 0x5d, 0x80, 0xd7, 0x14, 0x8b, 0x9f, 0xe1, - 0x92, 0x2b, 0xaf, 0x13, 0x3a, 0xfa, 0x3f, 0x24, 0x28, 0x1d, 0x39, 0xa3, 0x91, 0xe7, 0xf7, 0xd7, - 0x63, 0x7c, 0x01, 0x03, 0xf9, 0x85, 0x0c, 0x50, 0xaa, 0xbd, 0x37, 0x64, 0xe8, 0xec, 0xca, 0x8b, - 0xa8, 0xb2, 0x2d, 0x2c, 0x8e, 0xa0, 0x4f, 0xa1, 0x42, 0xde, 0xc5, 0xa1, 0x63, 0x8f, 0x9c, 0xd0, - 0x19, 0x46, 0xbb, 0x85, 0xfb, 0xf2, 0x03, 0x75, 0xef, 0x56, 0x06, 0x25, 0x6d, 0x65, 0xac, 0xb2, - 0xe3, 0xc7, 0xec, 0xb4, 0x1e, 0x81, 0x2a, 0x64, 0x59, 0xdf, 0x10, 0x4f, 0xa0, 0x32, 0xe4, 0xb8, - 0xf6, 0xc0, 0x8b, 0x62, 0x66, 0x04, 0x75, 0x6f, 0x27, 0x83, 0x22, 0x88, 0x63, 0x75, 0x38, 0xbb, - 0x45, 0x7f, 0x0e, 0x9b, 0xc7, 0x4e, 0x18, 0x7b, 0x54, 0x60, 0xc6, 0xc7, 0xea, 0xb6, 0xd1, 0x40, - 0x8e, 0x9d, 0xbe, 0xd0, 0x1b, 0x5d, 0xea, 0x03, 0xa8, 0x4e, 0x89, 0xad, 0x2f, 0xc3, 0x23, 0xb8, - 0x36, 0x4a, 0xb0, 0xed, 0xd8, 0xe9, 0xdb, 0x4e, 0x18, 0x3a, 0x13, 0xe1, 0x4f, 0xdb, 0xd3, 0x2d, - 0xcb, 0xe9, 0xd7, 0xe8, 0x86, 0xfe, 0x02, 0xb6, 0x5e, 0x92, 0x5e, 0x1c, 0x84, 0x38, 0x38, 0xc3, - 0xa4, 0x17, 0x84, 0x2e, 0x73, 0x97, 0x41, 0xe0, 0xc4, 0xb6, 0xeb, 0xc4, 0xce, 0xae, 0x74, 0x5f, - 0x7e, 0x90, 0xc7, 0x0a, 0x83, 0x34, 0x9d, 0xd8, 0x41, 0xf7, 0x40, 0x3d, 0xf5, 0x7c, 0x27, 0x9c, - 0xf0, 0x7d, 0xca, 0x79, 0x05, 0x03, 0x07, 0xd1, 0x03, 0xfa, 0xaf, 0x41, 0x31, 0xfc, 0xd8, 0x8b, - 0x27, 0xa6, 0x1b, 0xad, 0xc7, 0xfc, 0x8f, 0x60, 0x8b, 0x30, 0x4c, 0xdb, 0x73, 0x53, 0x8c, 0xcb, - 0xb8, 0x4a, 0x04, 0x41, 0xce, 0xf4, 0x3e, 0x54, 0x04, 0xd3, 0x9c, 0xe3, 0xc7, 0x50, 0x0a, 0xd9, - 0x2a, 0x62, 0xec, 0xaa, 0x7b, 0xef, 0x65, 0x6e, 0x99, 0x13, 0x10, 0x27, 0x87, 0xf5, 0x6f, 0x40, - 0xe5, 0x7b, 0xdc, 0x68, 0x08, 0x0a, 0xbf, 0xa1, 0x49, 0x85, 0x5b, 0x8a, 0xad, 0xd1, 0x53, 0x80, - 0x30, 0x38, 0xb3, 0x39, 0x06, 0x13, 0x76, 0xde, 0x17, 0xd3, 0x9c, 0x60, 0x25, 0x4c, 0x6e, 0xd1, - 0xfb, 0x22, 0x56, 0x8f, 0x48, 0xec, 0xcc, 0x85, 0xa0, 0x34, 0x17, 0x82, 0xe8, 0x03, 0x28, 0xc4, - 0x93, 0x11, 0x0f, 0x9f, 0xcd, 0xbd, 0xeb, 0x19, 0xfa, 0x54, 0xa7, 0xd6, 0x64, 0x44, 0x30, 0x3b, - 0x42, 0x1d, 0xc6, 0xf5, 0x86, 0x2c, 0x90, 0x64, 0x4c, 0x97, 0x7a, 0x0d, 0x8a, 0x3c, 0x84, 0xd0, - 0x13, 0x50, 0xf9, 0x2d, 0x43, 0x12, 0x3b, 0x89, 0x2e, 0xb2, 0xf9, 0x74, 0xca, 0x12, 0xe6, 0x0c, - 0xd1, 0x65, 0xa4, 0xdf, 0x85, 0x12, 0x0e, 0xce, 0x98, 0x79, 0x11, 0x14, 0x4e, 0x07, 0xc1, 0x29, - 0xe3, 0xb1, 0x82, 0xd9, 0x5a, 0xff, 0x73, 0x1e, 0x54, 0xd3, 0x8f, 0x48, 0x18, 0xaf, 0xe9, 0xdd, - 0xb3, 0xc0, 0xcf, 0x5f, 0x1e, 0xf8, 0x1f, 0x01, 0xd5, 0x5e, 0xc4, 0xdd, 0x4a, 0x5e, 0x10, 0x7b, - 0x82, 0x45, 0x5c, 0xa6, 0xc7, 0x18, 0xb3, 0x0b, 0x1c, 0xa6, 0xb0, 0xc0, 0x61, 0xd0, 0xff, 0x43, - 0x35, 0x13, 0x15, 0xbb, 0x1b, 0x8c, 0xdd, 0x4a, 0x3a, 0x1e, 0xce, 0x25, 0x9e, 0xe2, 0x5a, 0x89, - 0xe7, 0xdf, 0x12, 0xa8, 0x5d, 0xe2, 0x84, 0xbd, 0x37, 0x6b, 0xea, 0xe8, 0x19, 0x54, 0xde, 0x32, - 0x17, 0xe2, 0xf7, 0x8a, 0xac, 0xb3, 0xbb, 0xc0, 0xc7, 0x18, 0x61, 0xac, 0xbe, 0x4d, 0xb9, 0x2c, - 0xf5, 0x86, 0x68, 0xc0, 0xbc, 0x41, 0xc1, 0x74, 0x79, 0x5e, 0xd4, 0x02, 0x0b, 0xfd, 0x8b, 0x45, - 0xdd, 0x58, 0x4b, 0xd4, 0x33, 0xd8, 0xe1, 0x92, 0x9a, 0x7e, 0x97, 0xf4, 0x87, 0xc4, 0x17, 0x6e, - 0xa1, 0x43, 0xf5, 0xb5, 0x37, 0x20, 0x33, 0x5b, 0x48, 0xec, 0x6a, 0x95, 0x02, 0x13, 0x4b, 0x3c, - 0x83, 0x4a, 0xc4, 0x70, 0xa7, 0xd2, 0x4a, 0xe7, 0xa4, 0x4d, 0xa9, 0x11, 0xab, 0xd1, 0xec, 0x87, - 0xfe, 0x27, 0x09, 0xca, 0x2c, 0xb5, 0x78, 0x64, 0xcd, 0xcc, 0xa2, 0x81, 0xec, 0xb9, 0x91, 0xc8, - 0x26, 0x74, 0x89, 0xee, 0x80, 0xf2, 0xd6, 0x19, 0x78, 0xae, 0x1d, 0x06, 0x67, 0xcc, 0xdb, 0xca, - 0xb8, 0xcc, 0x00, 0x38, 0x38, 0xcb, 0xba, 0x62, 0x61, 0x15, 0x57, 0xd4, 0xff, 0x9a, 0x07, 0xf5, - 0xc5, 0x98, 0x84, 0x13, 0x4c, 0xa2, 0xf1, 0x60, 0xcd, 0xac, 0xfd, 0x11, 0x94, 0x89, 0x90, 0x4b, - 0x68, 0x24, 0x9b, 0x03, 0x12, 0xa1, 0xf1, 0xf4, 0x18, 0xba, 0x09, 0x25, 0x9a, 0x98, 0xfc, 0x71, - 0x92, 0x0b, 0x8a, 0x61, 0x70, 0xd6, 0x1e, 0x0f, 0x69, 0x71, 0x14, 0xf5, 0x82, 0x90, 0xf0, 0x97, - 0x33, 0x8f, 0xc5, 0x2f, 0xf4, 0x1e, 0x28, 0xae, 0x17, 0xc5, 0x8e, 0xdf, 0x23, 0xdc, 0xe0, 0x79, - 0x3c, 0x03, 0x5c, 0xcd, 0xf9, 0xd1, 0x2d, 0x28, 0xff, 0x96, 0xca, 0x6e, 0x7b, 0xee, 0x6e, 0x89, - 0x71, 0x53, 0x62, 0xbf, 0x4d, 0x97, 0xea, 0xb9, 0x37, 0xf0, 0x88, 0x1f, 0xd3, 0xbd, 0x32, 0xdb, - 0x2b, 0x73, 0x80, 0xe9, 0xea, 0xbf, 0x02, 0xb5, 0x1b, 0x87, 0xf4, 0x3d, 0x25, 0xa3, 0xc1, 0x64, - 0x3d, 0x9d, 0xbd, 0x0f, 0x95, 0x88, 0xe1, 0xda, 0x21, 0x45, 0x16, 0x4f, 0xa8, 0x1a, 0xcd, 0xe8, - 0xe9, 0xaf, 0x40, 0xa9, 0x07, 0xc1, 0xe0, 0x07, 0x10, 0xbf, 0x0b, 0x70, 0x1a, 0x04, 0x83, 0x14, - 0xe9, 0x32, 0x56, 0x4e, 0x13, 0x5a, 0x7a, 0x94, 0xae, 0xfa, 0x70, 0x70, 0xd6, 0x08, 0xc6, 0xfe, - 0x9a, 0x26, 0xff, 0x10, 0x76, 0x52, 0xf9, 0x81, 0x9a, 0xb2, 0x47, 0x89, 0xb0, 0xbb, 0x64, 0x8c, - 0x7a, 0xe7, 0xc8, 0xeb, 0x77, 0xa0, 0xd4, 0x08, 0x86, 0x43, 0xc7, 0x77, 0xa9, 0x3b, 0xf7, 0x86, - 0x6e, 0x52, 0xd8, 0xf6, 0x86, 0xae, 0xfe, 0x4f, 0x09, 0xc0, 0xf4, 0x5d, 0xf2, 0x8e, 0x87, 0xe2, - 0xff, 0xa6, 0x8e, 0xcb, 0xbe, 0x62, 0xf2, 0xfc, 0x2b, 0x76, 0x17, 0xc0, 0xa3, 0x2c, 0xf0, 0xed, - 0x02, 0xdf, 0x66, 0x10, 0xb6, 0x7d, 0xb5, 0xa4, 0xf3, 0x05, 0xc0, 0xfe, 0x60, 0x1c, 0x89, 0xec, - 0xba, 0x07, 0xd7, 0xe7, 0x58, 0xce, 0xa4, 0x9c, 0x6b, 0x59, 0xc6, 0x79, 0xd5, 0x70, 0x02, 0x95, - 0x46, 0x30, 0x1c, 0x39, 0xbd, 0x75, 0x5f, 0xb1, 0xf7, 0x40, 0x89, 0xdf, 0x84, 0x24, 0x7a, 0x13, - 0x0c, 0x78, 0x09, 0x20, 0xe1, 0x19, 0x40, 0x3f, 0x81, 0xad, 0x26, 0x19, 0x90, 0x98, 0xd4, 0x27, - 0x66, 0x73, 0x4d, 0xca, 0xb7, 0xa0, 0x3c, 0x57, 0xe9, 0x94, 0x3c, 0x51, 0xe3, 0x7c, 0x9d, 0xee, - 0x49, 0x4c, 0xff, 0x75, 0xb0, 0x9e, 0x4d, 0xef, 0x80, 0x42, 0xeb, 0x17, 0xdb, 0xf3, 0x5f, 0x07, - 0xc2, 0x9a, 0x65, 0x0a, 0xa0, 0x94, 0xf4, 0x6f, 0x60, 0xfb, 0x80, 0xc4, 0xa2, 0x48, 0x6b, 0x46, - 0x6b, 0x32, 0x7d, 0x17, 0x20, 0xe2, 0x69, 0x9f, 0x86, 0x34, 0xf7, 0x57, 0x45, 0x40, 0x4c, 0x57, - 0x1f, 0xc3, 0x66, 0x52, 0xfe, 0xf1, 0x47, 0xf8, 0xbf, 0xa1, 0x0e, 0x5a, 0x75, 0xce, 0x5c, 0x2f, - 0x62, 0x09, 0x5b, 0x11, 0x25, 0x0c, 0x6f, 0x8d, 0x3e, 0x04, 0x8d, 0xbf, 0x92, 0xac, 0xc2, 0xe1, - 0x22, 0xb1, 0x94, 0x37, 0x24, 0x7e, 0xe4, 0x89, 0xaa, 0x4e, 0xc6, 0x33, 0x80, 0xfe, 0x07, 0x49, - 0x54, 0x68, 0xb4, 0xba, 0x42, 0x9f, 0x80, 0x42, 0xb3, 0xbd, 0xcd, 0xea, 0x30, 0xe9, 0x82, 0x3a, - 0xec, 0x30, 0x87, 0xcb, 0xae, 0x58, 0xa3, 0xfa, 0xb9, 0xc7, 0x9b, 0x5a, 0xe6, 0xee, 0x82, 0xc7, - 0x7b, 0xc6, 0xd6, 0x61, 0x2e, 0xf3, 0x86, 0xd7, 0x4b, 0xa2, 0x27, 0xd5, 0xbf, 0x93, 0x00, 0x52, - 0xdc, 0x6f, 0x42, 0xde, 0xe3, 0x31, 0x5e, 0xc0, 0x79, 0xcf, 0xa5, 0x95, 0x59, 0x2a, 0x36, 0xd9, - 0x7a, 0x5a, 0x38, 0xca, 0x97, 0x17, 0x8e, 0x9f, 0x42, 0x85, 0x47, 0xe7, 0xca, 0x7d, 0x95, 0x37, - 0xcd, 0x27, 0xd1, 0x15, 0x83, 0xf7, 0x00, 0xb6, 0x53, 0x5a, 0x10, 0x55, 0xfb, 0x5e, 0xd2, 0x8b, - 0xaf, 0x52, 0xb3, 0x0b, 0x15, 0x7d, 0x2f, 0x81, 0x62, 0x91, 0x70, 0xc8, 0x5e, 0xda, 0xcb, 0xaa, - 0xea, 0x3b, 0xa0, 0x78, 0x7e, 0x6c, 0x27, 0x0d, 0x3f, 0xf5, 0xa7, 0xb2, 0xe7, 0xc7, 0x8c, 0x47, - 0xfa, 0x7c, 0xb8, 0xc1, 0xf8, 0x74, 0x40, 0xc4, 0x3e, 0xf5, 0x28, 0x09, 0xab, 0x1c, 0xc6, 0x8f, - 0xf0, 0x12, 0x61, 0x4c, 0xd8, 0x23, 0x5b, 0xe0, 0x4f, 0x17, 0x03, 0xd0, 0x67, 0x76, 0x07, 0x36, - 0x4e, 0x83, 0x20, 0x8a, 0x59, 0x29, 0x99, 0xc7, 0xfc, 0xc7, 0x15, 0x6b, 0x48, 0x07, 0x54, 0x96, - 0xa1, 0x42, 0x62, 0xbc, 0x1b, 0x85, 0xe8, 0x29, 0x94, 0x83, 0x11, 0x09, 0x9d, 0x38, 0x08, 0x85, - 0x47, 0x66, 0x75, 0x24, 0xce, 0x76, 0xc4, 0x19, 0x3c, 0x3d, 0x8d, 0x76, 0xa1, 0xc4, 0xd6, 0xbe, - 0x2b, 0xbc, 0x25, 0xf9, 0xa9, 0xff, 0x4d, 0x02, 0xc0, 0x8e, 0xdf, 0x27, 0x2b, 0x69, 0x70, 0x2f, - 0x4d, 0xe7, 0x7c, 0x59, 0x9a, 0x62, 0x76, 0x7a, 0xc3, 0x4c, 0x31, 0xf2, 0x45, 0x8a, 0x59, 0xaf, - 0xab, 0xff, 0x4e, 0x4a, 0x3a, 0xb5, 0x95, 0xd8, 0xbe, 0x07, 0x2a, 0x2f, 0x47, 0x38, 0x23, 0x79, - 0xc6, 0x08, 0x30, 0x50, 0x9d, 0x71, 0x93, 0x6a, 0x18, 0xe5, 0x35, 0x1a, 0x46, 0x1a, 0x82, 0x71, - 0x30, 0xfa, 0x56, 0x38, 0x03, 0x5b, 0x5f, 0x31, 0x32, 0xde, 0x41, 0x85, 0x96, 0x28, 0xc4, 0xf1, - 0xb9, 0x64, 0x0f, 0x60, 0x23, 0xe8, 0xf5, 0xc6, 0x89, 0xc1, 0x51, 0x86, 0x4c, 0x87, 0xee, 0x60, - 0x7e, 0x00, 0x7d, 0x0e, 0xd5, 0x3e, 0xf1, 0x49, 0xe8, 0x0c, 0x6c, 0x26, 0x99, 0xb0, 0x50, 0xf6, - 0xe2, 0x03, 0x7e, 0x82, 0x17, 0xa6, 0x95, 0x7e, 0xea, 0x97, 0xfe, 0xfb, 0x3c, 0x54, 0xd2, 0xdb, - 0xe8, 0x0b, 0xa8, 0x9e, 0x72, 0x56, 0x04, 0x41, 0x69, 0x41, 0xb7, 0x9b, 0x66, 0xf6, 0x30, 0x87, - 0x2b, 0xa7, 0x69, 0xe6, 0x9f, 0x00, 0xc4, 0x24, 0x1c, 0x4e, 0xf9, 0x91, 0xce, 0xb5, 0x9f, 0xd3, - 0xd8, 0x3d, 0xcc, 0x61, 0x25, 0x9e, 0x06, 0xf2, 0xcf, 0x41, 0x0d, 0xa9, 0x53, 0x0a, 0x4c, 0x3e, - 0x25, 0xba, 0x99, 0xad, 0xb8, 0xa7, 0x4e, 0x7b, 0x98, 0xc3, 0x10, 0xce, 0x5c, 0xf8, 0xb3, 0x69, - 0x0a, 0xe6, 0xc8, 0x85, 0x05, 0x1d, 0x45, 0xca, 0x77, 0x66, 0xd9, 0x97, 0xfd, 0xa4, 0xd9, 0x97, - 0xe1, 0xe9, 0xff, 0x92, 0xa0, 0x9a, 0xea, 0x3c, 0x8e, 0xeb, 0xab, 0xbf, 0x5b, 0x6b, 0x0e, 0x5d, - 0xce, 0x9b, 0x4e, 0x5e, 0xa0, 0xe9, 0xe5, 0xa6, 0xbb, 0x62, 0x30, 0xfd, 0x4e, 0x86, 0x6d, 0xde, - 0xcd, 0x77, 0x42, 0x5e, 0xb9, 0x1c, 0x45, 0xfd, 0xd5, 0x85, 0xcd, 0xf4, 0x46, 0xdc, 0xc6, 0x97, - 0xb5, 0xe9, 0x1a, 0xc8, 0x63, 0xcf, 0x4d, 0x66, 0x16, 0x63, 0xcf, 0x5d, 0xd4, 0xa5, 0x9e, 0x6f, - 0xc8, 0x69, 0xdd, 0xe5, 0x0d, 0x49, 0x14, 0x3b, 0xc3, 0x11, 0x4b, 0xb3, 0x05, 0x3c, 0x03, 0xcc, - 0x95, 0x21, 0xc5, 0xb9, 0x32, 0x84, 0x6e, 0xf7, 0xde, 0x38, 0xbe, 0x4f, 0x06, 0xb3, 0xa6, 0x44, - 0x11, 0x10, 0x93, 0x32, 0x90, 0x0f, 0x46, 0xac, 0x1f, 0xd9, 0x9c, 0x2b, 0xa4, 0x3a, 0x23, 0xf6, - 0x68, 0xe6, 0x83, 0x51, 0xb6, 0x77, 0x51, 0xb2, 0xbd, 0xcb, 0x39, 0x23, 0xc0, 0x5a, 0x46, 0xf8, - 0x7b, 0x1e, 0x14, 0xee, 0x6d, 0x6b, 0x29, 0x3f, 0x95, 0xb8, 0xb8, 0xea, 0x57, 0x4c, 0x5c, 0xe7, - 0xf4, 0x2d, 0x2f, 0x98, 0x0a, 0x08, 0x33, 0x15, 0x66, 0x66, 0xba, 0xd8, 0x02, 0x19, 0xf5, 0x14, - 0x2f, 0x51, 0x4f, 0x69, 0xad, 0x86, 0x32, 0x19, 0xc5, 0x95, 0x19, 0x9b, 0x7c, 0x14, 0x27, 0x66, - 0x1d, 0xca, 0x74, 0xd6, 0xa1, 0xbf, 0x03, 0xd5, 0xf2, 0x86, 0xa4, 0x3b, 0xf1, 0x7b, 0x54, 0x8b, - 0x37, 0xa1, 0x34, 0x22, 0x24, 0xb4, 0x4d, 0x57, 0x14, 0x7b, 0x45, 0xfa, 0xd3, 0x64, 0x62, 0x58, - 0x53, 0x31, 0xf2, 0x5c, 0x8c, 0x29, 0x00, 0xed, 0x81, 0x12, 0x4d, 0xfc, 0x9e, 0xbd, 0xb4, 0x90, - 0xa2, 0xf4, 0x99, 0x4f, 0x94, 0x23, 0xb1, 0xd2, 0xbf, 0x01, 0x78, 0x4e, 0x26, 0x7b, 0x5d, 0xd2, - 0xa7, 0x17, 0x0b, 0xc5, 0x49, 0x4b, 0x14, 0x97, 0xbf, 0xd8, 0x75, 0x65, 0x56, 0x99, 0xcc, 0x5c, - 0xf7, 0xe1, 0x5f, 0x0a, 0xa0, 0x4c, 0xbf, 0x7b, 0x20, 0x15, 0x4a, 0xdd, 0x93, 0x46, 0xc3, 0xe8, - 0x76, 0xb5, 0x1c, 0xda, 0x01, 0xed, 0xa4, 0x6d, 0x7c, 0x79, 0x6c, 0x34, 0x2c, 0xa3, 0x69, 0x1b, - 0x18, 0x77, 0xb0, 0x26, 0x21, 0x04, 0x9b, 0x8d, 0x4e, 0xbb, 0x6d, 0x34, 0x2c, 0x7b, 0xbf, 0x66, - 0xb6, 0x8c, 0xa6, 0x96, 0x47, 0xd7, 0x61, 0xfb, 0xd8, 0xc0, 0x47, 0x66, 0xb7, 0x6b, 0x76, 0xda, - 0x76, 0xd3, 0x68, 0x9b, 0x46, 0x53, 0x93, 0xd1, 0x2d, 0xb8, 0xde, 0xe8, 0xb4, 0x5a, 0x46, 0xc3, - 0xa2, 0xe0, 0x76, 0xc7, 0xb2, 0x8d, 0x2f, 0xcd, 0xae, 0xd5, 0xd5, 0x0a, 0x94, 0xb6, 0xd9, 0x6a, - 0x19, 0x07, 0xb5, 0x96, 0x5d, 0xc3, 0x07, 0x27, 0x47, 0x46, 0xdb, 0xd2, 0x36, 0x28, 0x9d, 0x04, - 0xda, 0x34, 0x8f, 0x8c, 0x36, 0x25, 0xa7, 0x95, 0xd0, 0x0d, 0x40, 0x09, 0xd8, 0x6c, 0x37, 0x8d, - 0x2f, 0x6d, 0xeb, 0xab, 0x63, 0x43, 0x2b, 0xa3, 0x3b, 0x70, 0x33, 0x81, 0xa7, 0xef, 0xa9, 0x1d, - 0x19, 0x9a, 0x82, 0x34, 0xa8, 0x24, 0x9b, 0x56, 0xe7, 0xf8, 0xb9, 0x06, 0x69, 0xea, 0xb8, 0xf3, - 0x0a, 0x1b, 0x8d, 0x0e, 0x6e, 0x6a, 0x6a, 0x1a, 0xfc, 0xd2, 0x68, 0x58, 0x1d, 0x6c, 0x9b, 0x4d, - 0xad, 0x42, 0x99, 0x4f, 0xc0, 0x5d, 0xa3, 0x86, 0x1b, 0x87, 0x36, 0x36, 0xba, 0x27, 0x2d, 0x4b, - 0xab, 0x52, 0x15, 0xec, 0x9b, 0x2d, 0x83, 0x49, 0xb4, 0xdf, 0x39, 0x69, 0x37, 0xb5, 0x4d, 0xb4, - 0x05, 0xea, 0x91, 0x61, 0xd5, 0x12, 0x9d, 0x6c, 0xd1, 0xfb, 0x1b, 0xb5, 0xc6, 0xa1, 0x91, 0x40, - 0x34, 0xb4, 0x0b, 0x3b, 0x8d, 0x5a, 0x9b, 0x22, 0x35, 0xb0, 0x51, 0xb3, 0x0c, 0x7b, 0xbf, 0xd3, - 0x6a, 0x1a, 0x58, 0xdb, 0xa6, 0x02, 0xce, 0xed, 0x98, 0x2d, 0x43, 0x43, 0x29, 0x8c, 0xa6, 0xd1, - 0x32, 0x66, 0x18, 0xd7, 0x52, 0x18, 0xc9, 0x0e, 0xc5, 0xd8, 0xa1, 0xc2, 0xd4, 0x4f, 0xcc, 0x56, - 0x53, 0x28, 0x8a, 0x1b, 0xed, 0x3a, 0xda, 0x86, 0x6a, 0x22, 0x4c, 0xbb, 0x65, 0x76, 0x2d, 0xed, - 0x06, 0xba, 0x09, 0xd7, 0x12, 0xd0, 0x91, 0x61, 0x61, 0xb3, 0xc1, 0xb5, 0x7a, 0x93, 0x9e, 0xed, - 0x9c, 0x58, 0x76, 0x67, 0xdf, 0x3e, 0x32, 0x8e, 0x3a, 0xf8, 0x2b, 0x6d, 0xf7, 0xe1, 0x1f, 0x25, - 0x28, 0x27, 0x15, 0x3e, 0x2a, 0x43, 0xa1, 0xdd, 0x69, 0x1b, 0x5a, 0x8e, 0xae, 0xea, 0x9d, 0x4e, - 0x4b, 0x93, 0xe8, 0xca, 0x6c, 0x5b, 0x4f, 0xb5, 0x3c, 0x52, 0x60, 0xc3, 0x6c, 0x5b, 0x1f, 0x3d, - 0xd6, 0x64, 0xb1, 0xfc, 0x78, 0x4f, 0x2b, 0x88, 0xe5, 0xe3, 0x4f, 0xb4, 0x0d, 0xba, 0xdc, 0x6f, - 0x75, 0x6a, 0x96, 0x06, 0x08, 0xa0, 0xd8, 0xec, 0x9c, 0xd4, 0x5b, 0x86, 0xa6, 0xd2, 0x75, 0xd7, - 0xc2, 0x66, 0xfb, 0x40, 0xdb, 0xa1, 0x1c, 0x08, 0x4b, 0xd4, 0xcd, 0x76, 0x0d, 0x7f, 0xa5, 0xb9, - 0x54, 0x9b, 0x02, 0xc4, 0x91, 0xc9, 0xc3, 0x06, 0x6c, 0xcd, 0xd5, 0xa4, 0xa8, 0x08, 0xf9, 0x96, - 0xa5, 0xe5, 0x50, 0x09, 0xe4, 0x96, 0x65, 0x68, 0x12, 0x05, 0x18, 0x2f, 0xb4, 0x3c, 0xfd, 0x7b, - 0x60, 0x69, 0x32, 0xdd, 0x38, 0xb0, 0x0c, 0xad, 0x40, 0x01, 0x6d, 0x43, 0xdb, 0x78, 0xf8, 0x14, - 0x36, 0x58, 0x9d, 0x43, 0x1d, 0xdf, 0x6c, 0xbf, 0xac, 0xb5, 0xcc, 0x26, 0x97, 0xeb, 0xe8, 0xa4, - 0x6b, 0x69, 0x12, 0xe3, 0xea, 0xb0, 0x73, 0xd2, 0xa2, 0x4e, 0x5e, 0x81, 0x32, 0x85, 0x52, 0xab, - 0x6b, 0xf2, 0xc3, 0xfb, 0x50, 0xe4, 0xc9, 0x9b, 0x9e, 0x31, 0xdb, 0x5d, 0x03, 0xd3, 0x9b, 0xa9, - 0x44, 0xcc, 0x1e, 0x9a, 0xf4, 0xf0, 0x1e, 0x94, 0x93, 0x60, 0xa6, 0x14, 0xb1, 0x51, 0xa3, 0xb4, - 0x15, 0xd8, 0x78, 0x85, 0x4d, 0x7a, 0x60, 0xef, 0xfb, 0x2a, 0x54, 0x8f, 0x58, 0xe8, 0x77, 0x49, - 0xf8, 0xd6, 0xeb, 0x11, 0xf4, 0x0b, 0xd0, 0x1a, 0x21, 0x71, 0x62, 0x32, 0xeb, 0xc6, 0xd1, 0xc2, - 0x4f, 0x42, 0xb7, 0x17, 0xf5, 0xe3, 0x7a, 0x0e, 0xed, 0x43, 0xf5, 0xd0, 0x89, 0x52, 0xd8, 0x77, - 0xe6, 0x6a, 0xe8, 0x74, 0x82, 0xbf, 0x7d, 0xe3, 0x5c, 0xb5, 0xc5, 0x27, 0x4e, 0x39, 0x64, 0x02, - 0x6a, 0x92, 0xa8, 0x17, 0x7a, 0xa7, 0x64, 0x55, 0x62, 0x0b, 0xf9, 0xd4, 0x73, 0xe8, 0x05, 0xb5, - 0xd3, 0xd8, 0x8f, 0x57, 0xa5, 0x73, 0x6f, 0xc9, 0xe6, 0x74, 0x34, 0x95, 0x43, 0xbf, 0x84, 0xad, - 0xee, 0x1b, 0xfa, 0x33, 0xd9, 0x8b, 0xe6, 0xb4, 0x24, 0x46, 0x57, 0x4b, 0x69, 0x25, 0xdf, 0x4e, - 0xf5, 0x1c, 0x3a, 0x06, 0x94, 0xa5, 0xc5, 0xc6, 0x1f, 0x17, 0x72, 0xb8, 0x6c, 0x93, 0x8d, 0x3b, - 0x72, 0xa8, 0x09, 0x9b, 0xcd, 0x30, 0x18, 0xad, 0x2a, 0xef, 0x12, 0x4b, 0x7e, 0x06, 0x2a, 0x77, - 0x05, 0x36, 0x68, 0x43, 0xd9, 0xfa, 0x74, 0x36, 0x7c, 0x5b, 0x86, 0xde, 0x80, 0x6a, 0x62, 0xc0, - 0x4b, 0x08, 0x2c, 0xdb, 0xd0, 0x73, 0xe8, 0x19, 0x28, 0x54, 0x92, 0x1f, 0xc6, 0x81, 0x01, 0x5b, - 0x5c, 0x80, 0xe9, 0x07, 0xc6, 0x39, 0x3d, 0x64, 0xbf, 0x62, 0x2e, 0x27, 0x53, 0x39, 0x74, 0xa2, - 0x15, 0x69, 0x2c, 0x77, 0xe8, 0xe7, 0xb0, 0x49, 0xcd, 0x3c, 0x3d, 0x1f, 0x5d, 0x6c, 0x94, 0xdb, - 0x8b, 0x6f, 0x11, 0x3e, 0x43, 0x95, 0x1b, 0x06, 0xa3, 0xab, 0x09, 0xf6, 0x29, 0x14, 0x79, 0x61, - 0x8c, 0x76, 0xe7, 0x34, 0x3b, 0xfd, 0xf6, 0x35, 0x27, 0xcf, 0xf4, 0x43, 0x27, 0x53, 0x4b, 0x75, - 0x3a, 0x55, 0xab, 0x4f, 0xcc, 0xe6, 0x1c, 0x0b, 0xd9, 0xa1, 0xd8, 0xed, 0xc5, 0x03, 0x7e, 0x3d, - 0x87, 0x0e, 0x69, 0x5b, 0x36, 0x1b, 0xce, 0xa1, 0xff, 0x9b, 0xeb, 0x0a, 0xe6, 0xe6, 0x76, 0x17, - 0x30, 0xf4, 0x39, 0x14, 0x79, 0x89, 0x89, 0x96, 0x7e, 0x5f, 0xb9, 0x9d, 0xdd, 0x49, 0x7d, 0xc0, - 0x60, 0x71, 0xb8, 0x35, 0xf7, 0x9d, 0x07, 0xbd, 0xbf, 0x80, 0x50, 0xf6, 0x2b, 0xd0, 0x85, 0x14, - 0x9f, 0x80, 0xdc, 0x18, 0xba, 0x4b, 0x32, 0xc3, 0x1c, 0x93, 0xa9, 0x39, 0x7e, 0x0e, 0xd5, 0x00, - 0x66, 0x43, 0x56, 0x94, 0x2d, 0x7a, 0xe7, 0xa6, 0xaf, 0xcb, 0x8c, 0x7b, 0x00, 0xdb, 0xc7, 0x21, - 0x19, 0x04, 0x8e, 0x7b, 0xc5, 0x34, 0xf0, 0x04, 0x36, 0xd8, 0x24, 0x7a, 0x2e, 0xfc, 0x66, 0xd3, - 0xe9, 0x65, 0x88, 0xcf, 0xd8, 0x00, 0x7f, 0xe4, 0xf4, 0x62, 0x74, 0xeb, 0xfc, 0x1c, 0x45, 0x8c, - 0xa5, 0x97, 0x21, 0xd7, 0xa1, 0x2c, 0xec, 0x56, 0x47, 0xb7, 0x97, 0x99, 0xf3, 0xb8, 0x7e, 0x91, - 0xfa, 0xeb, 0xa5, 0xaf, 0x37, 0x86, 0x51, 0x7f, 0x74, 0x7a, 0x5a, 0x64, 0xff, 0x95, 0xf3, 0xf1, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xef, 0x73, 0xf9, 0x2c, 0xa6, 0x23, 0x00, 0x00, -} diff --git a/pkg/master/grpc/message/message.proto b/pkg/master/grpc/message/message.proto deleted file mode 100644 index 4bea26acc5..0000000000 --- a/pkg/master/grpc/message/message.proto +++ /dev/null @@ -1,715 +0,0 @@ -syntax = "proto3"; - -package milvus.grpc; -option go_package="github.com/czs007/suvlim/pkg/master/grpc/message"; - -enum ErrorCode { - SUCCESS = 0; - UNEXPECTED_ERROR = 1; - CONNECT_FAILED = 2; - PERMISSION_DENIED = 3; - COLLECTION_NOT_EXISTS = 4; - ILLEGAL_ARGUMENT = 5; - ILLEGAL_DIMENSION = 7; - ILLEGAL_INDEX_TYPE = 8; - ILLEGAL_COLLECTION_NAME = 9; - ILLEGAL_TOPK = 10; - ILLEGAL_ROWRECORD = 11; - ILLEGAL_VECTOR_ID = 12; - ILLEGAL_SEARCH_RESULT = 13; - FILE_NOT_FOUND = 14; - META_FAILED = 15; - CACHE_FAILED = 16; - CANNOT_CREATE_FOLDER = 17; - CANNOT_CREATE_FILE = 18; - CANNOT_DELETE_FOLDER = 19; - CANNOT_DELETE_FILE = 20; - BUILD_INDEX_ERROR = 21; - ILLEGAL_NLIST = 22; - ILLEGAL_METRIC_TYPE = 23; - OUT_OF_MEMORY = 24; -} - -message Status { - ErrorCode error_code = 1; - string reason = 2; -} - -/** - * @brief Field data type - */ -enum DataType { - NONE = 0; - BOOL = 1; - INT8 = 2; - INT16 = 3; - INT32 = 4; - INT64 = 5; - - FLOAT = 10; - DOUBLE = 11; - - STRING = 20; - - VECTOR_BINARY = 100; - VECTOR_FLOAT = 101; -} - -/** - * @brief General usage - */ -message KeyValuePair { - string key = 1; - string value = 2; -} - -/** - * @brief Collection name - */ -message CollectionName { - string collection_name = 1; -} - -/** - * @brief Collection name list - */ -message CollectionNameList { - Status status = 1; - repeated string collection_names = 2; -} - -/** - * @brief Field name - */ -message FieldName { - string collection_name = 1; - string field_name = 2; -} - -/** - * @brief Collection mapping - * @extra_params: key-value pair for extra parameters of the collection - * typically usage: - * extra_params["params"] = {segment_row_count: 1000000, auto_id: true} - * Note: - * the segment_row_count specify segment row count limit for merging - * the auto_id = true means entity id is auto-generated by milvus - */ -message Mapping { - Status status = 1; - string collection_name = 2; - Schema schema = 3; - repeated KeyValuePair extra_params = 4; -} - -/** - * @brief Collection mapping list - */ -message MappingList { - Status status = 1; - repeated Mapping mapping_list = 2; -} - -/** - * @brief Parameters of partition - */ -message PartitionParam { - string collection_name = 1; - string tag = 2; -} - -/** - * @brief Partition list - */ -message PartitionList { - Status status = 1; - repeated string partition_tag_array = 2; -} - -/** - * @brief Vector row record - */ -message VectorRowRecord { - repeated float float_data = 1; //float vector data - bytes binary_data = 2; //binary vector data -} - -message EntityIds { - Status status = 1; - repeated int64 entity_id_array = 2; -} - -message VectorRecord { - repeated VectorRowRecord records = 1; -} - -message VectorParam { - string json = 1; - VectorRecord row_record = 2; -} - -//////////////////////////row schema and data/////////////////////////////////// -/** - * @brief schema - */ -message FieldMeta { - string field_name = 1; - DataType type = 2; - int64 dim = 3; -} - -message Schema { - repeated FieldMeta field_metas = 1; -} - -message RowData { - bytes blob = 1; -} - -//////////////////////suvlim-proxy/////////////////////////////////// -message InsertParam { - string collection_name = 1; - Schema schema = 2; - repeated RowData rows_data = 3; - repeated int64 entity_id_array = 4; //optional - string partition_tag = 5; - repeated KeyValuePair extra_params = 6; -} - -message SearchParam { - string collection_name = 1; - repeated VectorParam vector_param = 2; - string dsl = 3; //optional - repeated string partition_tag = 4; //why - repeated KeyValuePair extra_params = 5; -} - -message SearchInSegmentParam { - repeated string file_id_array = 1; - SearchParam search_param = 2; -} - -message Entities { - Status status = 1; - repeated int64 ids = 2; - repeated bool valid_row = 3; - repeated RowData rows_data = 4; -} - - -///////////////////////////milvus-server/////////////////////////// -/** - * @brief Query result - */ -message QueryResult { - Status status = 1; - Entities entities = 2; - int64 row_num = 3; - repeated float scores = 4; - repeated float distances = 5; - repeated KeyValuePair extra_params = 6; - int64 query_id = 7; - int64 client_id = 8; -} - -/** - * @brief Server string Reply - */ -message StringReply { - Status status = 1; - string string_reply = 2; -} - -/** - * @brief Server bool Reply - */ -message BoolReply { - Status status = 1; - bool bool_reply = 2; -} - -/** - * @brief Return collection row count - */ -message CollectionRowCount { - Status status = 1; - int64 collection_row_count = 2; -} - -/** - * @brief Server command parameters - */ -message Command { - string cmd = 1; -} - -/** - * @brief Index params - * @collection_name: target collection - * @field_name: target field - * @index_name: a name for index provided by user, unique within this field - * @extra_params: index parameters in json format - * for vector field: - * extra_params["index_type"] = one of the values: FLAT, IVF_LAT, IVF_SQ8, NSGMIX, IVFSQ8H, - * PQ, HNSW, HNSW_SQ8NM, ANNOY - * extra_params["metric_type"] = one of the values: L2, IP, HAMMING, JACCARD, TANIMOTO - * SUBSTRUCTURE, SUPERSTRUCTURE - * extra_params["params"] = extra parameters for index, for example ivflat: {nlist: 2048} - * for structured field: - * extra_params["index_type"] = one of the values: SORTED - */ -message IndexParam { - Status status = 1; - string collection_name = 2; - string field_name = 3; - string index_name = 4; - repeated KeyValuePair extra_params = 5; -} - -/** - * @brief Parameters for flush action - */ -message FlushParam { - repeated string collection_name_array = 1; -} - -/** - * @brief Parameters for flush action - */ -message CompactParam { - string collection_name = 1; - double threshold = 2; -} - -/** - * @brief Parameters for deleting entities by id - */ -message DeleteByIDParam { - string collection_name = 1; - repeated int64 id_array = 2; -} - -/** - * @brief Return collection stats - * @json_info: collection stats in json format, typically, the format is like: - * { - * row_count: xxx, - * data_size: xxx, - * partitions: [ - * { - * tag: xxx, - * id: xxx, - * row_count: xxx, - * data_size: xxx, - * segments: [ - * { - * id: xxx, - * row_count: xxx, - * data_size: xxx, - * files: [ - * { - * field: xxx, - * name: xxx, - * index_type: xxx, - * path: xxx, - * data_size: xxx, - * } - * ] - * } - * ] - * } - * ] - * } - */ -message CollectionInfo { - Status status = 1; - string json_info = 2; -} - -/** - * @brief Parameters for returning entities id of a segment - */ -message GetEntityIDsParam { - string collection_name = 1; - int64 segment_id = 2; -} - -/** - * @brief Entities identity - */ -message EntityIdentity { - string collection_name = 1; - repeated int64 id_array = 2; - repeated string field_names = 3; -} - -/********************************************SearchPB interface***************************************************/ -/** - * @brief Vector field parameters - */ -message VectorFieldParam { - int64 dimension = 1; -} - -/** - * @brief Field type - */ -message FieldType { - oneof value { - DataType data_type = 1; - VectorFieldParam vector_param = 2; - } -} - -/** - * @brief Field parameters - */ -message FieldParam { - uint64 id = 1; - string name = 2; - DataType type = 3; - repeated KeyValuePair index_params = 4; - repeated KeyValuePair extra_params = 5; -} - -/** - * @brief Vector field record - */ -message VectorFieldRecord { - repeated VectorRowRecord value = 1; -} - -/////////////////////////////////////////////////////////////////// - -message TermQuery { - string field_name = 1; - repeated int64 int_value = 2; - repeated double double_value = 3; - int64 value_num = 4; - float boost = 5; - repeated KeyValuePair extra_params = 6; -} - -enum CompareOperator { - LT = 0; - LTE = 1; - EQ = 2; - GT = 3; - GTE = 4; - NE = 5; -} - -message CompareExpr { - CompareOperator operator = 1; - string operand = 2; -} - -message RangeQuery { - string field_name = 1; - repeated CompareExpr operand = 2; - float boost = 3; - repeated KeyValuePair extra_params = 4; -} - -message VectorQuery { - string field_name = 1; - float query_boost = 2; - repeated VectorRowRecord records = 3; - int64 topk = 4; - repeated KeyValuePair extra_params = 5; -} - -enum Occur { - INVALID = 0; - MUST = 1; - SHOULD = 2; - MUST_NOT = 3; -} - -message BooleanQuery { - Occur occur = 1; - repeated GeneralQuery general_query = 2; -} - -message GeneralQuery { - oneof query { - BooleanQuery boolean_query = 1; - TermQuery term_query = 2; - RangeQuery range_query = 3; - VectorQuery vector_query = 4; - } -} - -message SearchParamPB { - string collection_name = 1; - repeated string partition_tag_array = 2; - GeneralQuery general_query = 3; - repeated KeyValuePair extra_params = 4; -} - -service MilvusService { - /** - * @brief This method is used to create collection - * - * @param CollectionSchema, use to provide collection information to be created. - * - * @return Status - */ - rpc CreateCollection(Mapping) returns (Status){} - - /** - * @brief This method is used to test collection existence. - * - * @param CollectionName, collection name is going to be tested. - * - * @return BoolReply - */ - rpc HasCollection(CollectionName) returns (BoolReply) {} - - /** - * @brief This method is used to get collection schema. - * - * @param CollectionName, target collection name. - * - * @return CollectionSchema - */ - rpc DescribeCollection(CollectionName) returns (Mapping) {} - - /** - * @brief This method is used to get collection schema. - * - * @param CollectionName, target collection name. - * - * @return CollectionRowCount - */ - rpc CountCollection(CollectionName) returns (CollectionRowCount) {} - - /** - * @brief This method is used to list all collections. - * - * @param Command, dummy parameter. - * - * @return CollectionNameList - */ - rpc ShowCollections(Command) returns (CollectionNameList) {} - - /** - * @brief This method is used to get collection detail information. - * - * @param CollectionName, target collection name. - * - * @return CollectionInfo - */ - rpc ShowCollectionInfo(CollectionName) returns (CollectionInfo) {} - - /** - * @brief This method is used to delete collection. - * - * @param CollectionName, collection name is going to be deleted. - * - * @return Status - */ - rpc DropCollection(CollectionName) returns (Status) {} - - /** - * @brief This method is used to build index by collection in sync mode. - * - * @param IndexParam, index paramters. - * - * @return Status - */ - rpc CreateIndex(IndexParam) returns (Status) {} - - /** - * @brief This method is used to describe index - * - * @param IndexParam, target index. - * - * @return IndexParam - */ - rpc DescribeIndex(IndexParam) returns (IndexParam) {} - - /** - * @brief This method is used to drop index - * - * @param IndexParam, target field. if the IndexParam.field_name is empty, will drop all index of the collection - * - * @return Status - */ - rpc DropIndex(IndexParam) returns (Status) {} - - /** - * @brief This method is used to create partition - * - * @param PartitionParam, partition parameters. - * - * @return Status - */ - rpc CreatePartition(PartitionParam) returns (Status) {} - - /** - * @brief This method is used to test partition existence. - * - * @param PartitionParam, target partition. - * - * @return BoolReply - */ - rpc HasPartition(PartitionParam) returns (BoolReply) {} - - /** - * @brief This method is used to show partition information - * - * @param CollectionName, target collection name. - * - * @return PartitionList - */ - rpc ShowPartitions(CollectionName) returns (PartitionList) {} - - /** - * @brief This method is used to drop partition - * - * @param PartitionParam, target partition. - * - * @return Status - */ - rpc DropPartition(PartitionParam) returns (Status) {} - - /** - * @brief This method is used to add vector array to collection. - * - * @param InsertParam, insert parameters. - * - * @return VectorIds - */ - rpc Insert(InsertParam) returns (EntityIds) {} - - /** - * @brief This method is used to get entities data by id array. - * - * @param EntitiesIdentity, target entity id array. - * - * @return EntitiesData - */ - rpc GetEntityByID(EntityIdentity) returns (Entities) {} - - /** - * @brief This method is used to get vector ids from a segment - * - * @param GetVectorIDsParam, target collection and segment - * - * @return VectorIds - */ - rpc GetEntityIDs(GetEntityIDsParam) returns (EntityIds) {} - - /** - * @brief This method is used to query vector in collection. - * - * @param SearchParam, search parameters. - * - * @return KQueryResult - */ - rpc Search(SearchParam) returns (QueryResult) {} - - /** - * @brief This method is used to query vector in specified files. - * - * @param SearchInSegmentParam, target segments to search. - * - * @return TopKQueryResult - */ - rpc SearchInSegment(SearchInSegmentParam) returns (QueryResult) {} - - /** - * @brief This method is used to give the server status. - * - * @param Command, command string - * - * @return StringReply - */ - rpc Cmd(Command) returns (StringReply) {} - - /** - * @brief This method is used to delete vector by id - * - * @param DeleteByIDParam, delete parameters. - * - * @return status - */ - rpc DeleteByID(DeleteByIDParam) returns (Status) {} - - /** - * @brief This method is used to preload collection - * - * @param CollectionName, target collection name. - * - * @return Status - */ - rpc PreloadCollection(CollectionName) returns (Status) {} - - /** - * @brief This method is used to flush buffer into storage. - * - * @param FlushParam, flush parameters - * - * @return Status - */ - rpc Flush(FlushParam) returns (Status) {} - - /** - * @brief This method is used to compact collection - * - * @param CompactParam, compact parameters - * - * @return Status - */ - rpc Compact(CompactParam) returns (Status) {} - - /********************************New Interface********************************************/ - - rpc SearchPB(SearchParamPB) returns (QueryResult) {} -} - -////////////////////pulsar////////////////////////////////////// -enum OpType { - INSERT = 0; - DELETE = 1; -} - -message InsertOrDeleteMsg { - string collection_name = 1; - RowData rows_data = 2; - int64 uid = 3; //optional - string partition_tag = 4; - uint64 timestamp =5; - int64 segment_id = 6; - int64 channel_id = 7; - OpType op = 8; - int64 client_id = 9; - repeated KeyValuePair extra_params = 10; -} - -message SearchMsg { - string collection_name = 1; - VectorRowRecord records = 2; - string partition_tag = 3; - int64 uid = 4; - uint64 timestamp =5; - int64 client_id = 6; - repeated KeyValuePair extra_params = 7; -} - -enum SyncType { - READ = 0; - WRITE = 1; -} -message TimeSyncMsg{ - int64 peer_Id = 1; - uint64 Timestamp = 2; - SyncType sync_type = 3; -} - -message Key2SegMsg { - int64 uid = 1; - uint64 timestamp = 2; - repeated int64 segment_id = 3; -} diff --git a/pkg/master/informer/pulsar.go b/pkg/master/informer/pulsar.go index 2a3a5ca85a..d46485829b 100644 --- a/pkg/master/informer/pulsar.go +++ b/pkg/master/informer/pulsar.go @@ -39,7 +39,7 @@ func (pc PulsarClient) Listener(ssChan chan mock.SegmentStats) error { if err != nil { log.Fatal(err) } - for { + for i := 0; i < 10; i++ { msg, err := consumer.Receive(context.TODO()) if err != nil { log.Fatal(err) diff --git a/pkg/master/mock/grpc_client.go b/pkg/master/mock/grpc_client.go index 3412241214..579b170315 100644 --- a/pkg/master/mock/grpc_client.go +++ b/pkg/master/mock/grpc_client.go @@ -5,8 +5,7 @@ import ( "log" "time" - pb "github.com/czs007/suvlim/pkg/master/grpc/master" - msgpb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/pkg/master/grpc" "google.golang.org/grpc" ) @@ -50,14 +49,11 @@ func FakeCreateCollectionByGRPC() (string, uint64) { defer cancel() - r, err := c.CreateCollection(ctx, &msgpb.Mapping{ - CollectionName: "test-collection", - }) + r, err := c.CreateCollection(ctx, &pb.CreateCollectionRequest{CollectionName: "grpc-client-test"}) if err != nil { log.Fatalf("could not greet: %v", err) } - // log.Printf("CreateCollection: %s, id: %d", r.GetCollectionName(), r.GetCollectionId()) - // return r.GetCollectionName(), r.GetCollectionId() - return r.GetReason(), 0 + log.Printf("CreateCollection: %s, id: %d", r.GetCollectionName(), r.GetCollectionId()) + return r.GetCollectionName(), r.GetCollectionId() } diff --git a/pkg/master/mock/grpc_client_test.go b/pkg/master/mock/grpc_client_test.go index a4d015a514..4ba4385f18 100644 --- a/pkg/master/mock/grpc_client_test.go +++ b/pkg/master/mock/grpc_client_test.go @@ -6,9 +6,9 @@ import ( ) func TestFakeCreateCollectionByGRPC(t *testing.T) { - reason, segmentID := FakeCreateCollectionByGRPC() - if reason != "" { - t.Error(reason) + collectionName, segmentID := FakeCreateCollectionByGRPC() + if collectionName != "grpc-client-test" { + t.Error("Collection name wrong") } fmt.Println(collectionName) fmt.Println(segmentID) diff --git a/pkg/master/server.go b/pkg/master/server.go index 7e0c257648..c659748a44 100644 --- a/pkg/master/server.go +++ b/pkg/master/server.go @@ -9,8 +9,7 @@ import ( "time" "github.com/czs007/suvlim/pkg/master/common" - pb "github.com/czs007/suvlim/pkg/master/grpc/master" - messagepb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/pkg/master/grpc" "github.com/czs007/suvlim/pkg/master/informer" "github.com/czs007/suvlim/pkg/master/kv" "github.com/czs007/suvlim/pkg/master/mock" @@ -91,19 +90,12 @@ func GRPCServer() error { type GRPCMasterServer struct{} -func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *messagepb.Mapping) (*messagepb.Status, error) { - return &messagepb.Status{ - ErrorCode: 0, - Reason: "", +func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *pb.CreateCollectionRequest) (*pb.CreateCollectionResponse, error) { + return &pb.CreateCollectionResponse{ + CollectionName: in.CollectionName, }, nil } -// func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *pb.CreateCollectionRequest) (*pb.CreateCollectionResponse, error) { -// return &pb.CreateCollectionResponse{ -// CollectionName: in.CollectionName, -// }, nil -// } - func CollectionController() { cli, _ := clientv3.New(clientv3.Config{ Endpoints: []string{"127.0.0.1:12379"}, diff --git a/pkg/message/message.pb.go b/pkg/message/message.pb.go index 53bf1afd39..90fd5be0c7 100644 --- a/pkg/message/message.pb.go +++ b/pkg/message/message.pb.go @@ -2839,13 +2839,11 @@ func (m *InsertOrDeleteMsg) GetExtraParams() []*KeyValuePair { type SearchMsg struct { CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` Records *VectorRowRecord `protobuf:"bytes,2,opt,name=records,proto3" json:"records,omitempty"` - PartitionTag []string `protobuf:"bytes,3,rep,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` + PartitionTag string `protobuf:"bytes,3,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` Uid int64 `protobuf:"varint,4,opt,name=uid,proto3" json:"uid,omitempty"` Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` ClientId int64 `protobuf:"varint,6,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` ExtraParams []*KeyValuePair `protobuf:"bytes,7,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - Json []string `protobuf:"bytes,8,rep,name=json,proto3" json:"json,omitempty"` - Dsl string `protobuf:"bytes,9,opt,name=dsl,proto3" json:"dsl,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2890,11 +2888,11 @@ func (m *SearchMsg) GetRecords() *VectorRowRecord { return nil } -func (m *SearchMsg) GetPartitionTag() []string { +func (m *SearchMsg) GetPartitionTag() string { if m != nil { return m.PartitionTag } - return nil + return "" } func (m *SearchMsg) GetUid() int64 { @@ -2925,23 +2923,9 @@ func (m *SearchMsg) GetExtraParams() []*KeyValuePair { return nil } -func (m *SearchMsg) GetJson() []string { - if m != nil { - return m.Json - } - return nil -} - -func (m *SearchMsg) GetDsl() string { - if m != nil { - return m.Dsl - } - return "" -} - type TimeSyncMsg struct { Peer_Id int64 `protobuf:"varint,1,opt,name=peer_Id,json=peerId,proto3" json:"peer_Id,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=Timestamp,json=timestamp,proto3" json:"Timestamp,omitempty"` SyncType SyncType `protobuf:"varint,3,opt,name=sync_type,json=syncType,proto3,enum=milvus.grpc.SyncType" json:"sync_type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -3108,185 +3092,184 @@ func init() { func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } var fileDescriptor_33c57e4bae7b9afd = []byte{ - // 2878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x3a, 0xdd, 0x72, 0xdb, 0xc6, - 0xd5, 0x04, 0x41, 0x91, 0xc4, 0x01, 0x29, 0x41, 0x6b, 0xd9, 0x96, 0xed, 0xf8, 0xb3, 0x83, 0x6f, - 0xa6, 0x75, 0xdc, 0x19, 0x4f, 0xa2, 0xa4, 0xb6, 0x5b, 0x27, 0x69, 0xf8, 0x03, 0x49, 0xa8, 0x29, - 0x52, 0x5e, 0x42, 0x76, 0x7e, 0xa6, 0x83, 0x42, 0xc4, 0x9a, 0x46, 0x43, 0x02, 0x2c, 0x00, 0x5a, - 0xe6, 0x6d, 0xef, 0xdb, 0x99, 0x5e, 0xf6, 0xb2, 0x7d, 0x84, 0xf6, 0x0d, 0x7a, 0xd9, 0x17, 0xc8, - 0x45, 0x66, 0x7a, 0xd9, 0xe9, 0x63, 0x74, 0xf6, 0x07, 0x24, 0x40, 0x91, 0x12, 0x19, 0xb5, 0x57, - 0x5a, 0x9e, 0xdd, 0x73, 0xf6, 0xfc, 0xef, 0x39, 0x07, 0x82, 0xea, 0x90, 0x44, 0x91, 0xd3, 0x27, - 0x8f, 0x46, 0x61, 0x10, 0x07, 0x48, 0x1d, 0x7a, 0x83, 0xb7, 0xe3, 0xe8, 0x51, 0x3f, 0x1c, 0xf5, - 0xf4, 0x57, 0x50, 0xec, 0xc6, 0x4e, 0x3c, 0x8e, 0xd0, 0x4f, 0x01, 0x48, 0x18, 0x06, 0xa1, 0xdd, - 0x0b, 0x5c, 0xb2, 0x2b, 0xdd, 0x97, 0x1e, 0x6c, 0xee, 0xdd, 0x78, 0x94, 0x3a, 0xfb, 0xc8, 0xa0, - 0xdb, 0x8d, 0xc0, 0x25, 0x58, 0x21, 0xc9, 0x12, 0xdd, 0x80, 0x62, 0x48, 0x9c, 0x28, 0xf0, 0x77, - 0xf3, 0xf7, 0xa5, 0x07, 0x0a, 0x16, 0xbf, 0xf4, 0xc7, 0x50, 0x79, 0x4e, 0x26, 0x2f, 0x9d, 0xc1, - 0x98, 0x1c, 0x3b, 0x5e, 0x88, 0x34, 0x90, 0xbf, 0x25, 0x13, 0x46, 0x57, 0xc1, 0x74, 0x89, 0x76, - 0x60, 0xe3, 0x2d, 0xdd, 0x16, 0x88, 0xfc, 0x87, 0xfe, 0x33, 0xd8, 0x6c, 0x04, 0x83, 0x01, 0xe9, - 0xc5, 0x5e, 0xe0, 0xb7, 0x9d, 0x21, 0x41, 0x3f, 0x86, 0xad, 0xde, 0x14, 0x62, 0xfb, 0xce, 0x90, - 0x08, 0x2a, 0x9b, 0xbd, 0xcc, 0x41, 0x7d, 0x00, 0x28, 0x8b, 0xda, 0xf2, 0xa2, 0x18, 0xfd, 0x04, - 0x8a, 0x11, 0x93, 0x90, 0x61, 0xa9, 0x7b, 0xd7, 0x32, 0x32, 0x71, 0xe1, 0xb1, 0x38, 0x82, 0x3e, - 0x00, 0x6d, 0xee, 0xae, 0x68, 0x37, 0x7f, 0x5f, 0x7e, 0xa0, 0xe0, 0xad, 0xec, 0x65, 0x91, 0xde, - 0x05, 0x65, 0xdf, 0x23, 0x03, 0x77, 0x2d, 0x1e, 0xd1, 0x5d, 0x80, 0xd7, 0x14, 0x8b, 0x9f, 0xe1, - 0x92, 0x2b, 0xaf, 0x13, 0x3a, 0xfa, 0x3f, 0x24, 0x28, 0x1d, 0x39, 0xa3, 0x91, 0xe7, 0xf7, 0xd7, - 0x63, 0x7c, 0x01, 0x03, 0xf9, 0x85, 0x0c, 0x50, 0xaa, 0xbd, 0x37, 0x64, 0xe8, 0xec, 0xca, 0x8b, - 0xa8, 0xb2, 0x2d, 0x2c, 0x8e, 0xa0, 0x4f, 0xa1, 0x42, 0xde, 0xc5, 0xa1, 0x63, 0x8f, 0x9c, 0xd0, - 0x19, 0x46, 0xbb, 0x85, 0xfb, 0xf2, 0x03, 0x75, 0xef, 0x56, 0x06, 0x25, 0x6d, 0x65, 0xac, 0xb2, - 0xe3, 0xc7, 0xec, 0xb4, 0x1e, 0x81, 0x2a, 0x64, 0x59, 0xdf, 0x10, 0x4f, 0xa0, 0x32, 0xe4, 0xb8, - 0xf6, 0xc0, 0x8b, 0x62, 0x66, 0x04, 0x75, 0x6f, 0x27, 0x83, 0x22, 0x88, 0x63, 0x75, 0x38, 0xbb, - 0x45, 0x7f, 0x0e, 0x9b, 0xc7, 0x4e, 0x18, 0x7b, 0x54, 0x60, 0xc6, 0xc7, 0xea, 0xb6, 0xd1, 0x40, - 0x8e, 0x9d, 0xbe, 0xd0, 0x1b, 0x5d, 0xea, 0x03, 0xa8, 0x4e, 0x89, 0xad, 0x2f, 0xc3, 0x23, 0xb8, - 0x36, 0x4a, 0xb0, 0xed, 0xd8, 0xe9, 0xdb, 0x4e, 0x18, 0x3a, 0x13, 0xe1, 0x4f, 0xdb, 0xd3, 0x2d, - 0xcb, 0xe9, 0xd7, 0xe8, 0x86, 0xfe, 0x02, 0xb6, 0x5e, 0x92, 0x5e, 0x1c, 0x84, 0x38, 0x38, 0xc3, - 0xa4, 0x17, 0x84, 0x2e, 0x73, 0x97, 0x41, 0xe0, 0xc4, 0xb6, 0xeb, 0xc4, 0xce, 0xae, 0x74, 0x5f, - 0x7e, 0x90, 0xc7, 0x0a, 0x83, 0x34, 0x9d, 0xd8, 0x41, 0xf7, 0x40, 0x3d, 0xf5, 0x7c, 0x27, 0x9c, - 0xf0, 0x7d, 0xca, 0x79, 0x05, 0x03, 0x07, 0xd1, 0x03, 0xfa, 0xaf, 0x41, 0x31, 0xfc, 0xd8, 0x8b, - 0x27, 0xa6, 0x1b, 0xad, 0xc7, 0xfc, 0x8f, 0x60, 0x8b, 0x30, 0x4c, 0xdb, 0x73, 0x53, 0x8c, 0xcb, - 0xb8, 0x4a, 0x04, 0x41, 0xce, 0xf4, 0x3e, 0x54, 0x04, 0xd3, 0x9c, 0xe3, 0xc7, 0x50, 0x0a, 0xd9, - 0x2a, 0x62, 0xec, 0xaa, 0x7b, 0xef, 0x65, 0x6e, 0x99, 0x13, 0x10, 0x27, 0x87, 0xf5, 0x6f, 0x40, - 0xe5, 0x7b, 0xdc, 0x68, 0x08, 0x0a, 0xbf, 0xa1, 0x49, 0x85, 0x5b, 0x8a, 0xad, 0xd1, 0x53, 0x80, - 0x30, 0x38, 0xb3, 0x39, 0x06, 0x13, 0x76, 0xde, 0x17, 0xd3, 0x9c, 0x60, 0x25, 0x4c, 0x6e, 0xd1, - 0xfb, 0x22, 0x56, 0x8f, 0x48, 0xec, 0xcc, 0x85, 0xa0, 0x34, 0x17, 0x82, 0xe8, 0x03, 0x28, 0xc4, - 0x93, 0x11, 0x0f, 0x9f, 0xcd, 0xbd, 0xeb, 0x19, 0xfa, 0x54, 0xa7, 0xd6, 0x64, 0x44, 0x30, 0x3b, - 0x42, 0x1d, 0xc6, 0xf5, 0x86, 0x2c, 0x90, 0x64, 0x4c, 0x97, 0x7a, 0x0d, 0x8a, 0x3c, 0x84, 0xd0, - 0x13, 0x50, 0xf9, 0x2d, 0x43, 0x12, 0x3b, 0x89, 0x2e, 0xb2, 0xf9, 0x74, 0xca, 0x12, 0xe6, 0x0c, - 0xd1, 0x65, 0xa4, 0xdf, 0x85, 0x12, 0x0e, 0xce, 0x98, 0x79, 0x11, 0x14, 0x4e, 0x07, 0xc1, 0x29, - 0xe3, 0xb1, 0x82, 0xd9, 0x5a, 0xff, 0x73, 0x1e, 0x54, 0xd3, 0x8f, 0x48, 0x18, 0xaf, 0xe9, 0xdd, - 0xb3, 0xc0, 0xcf, 0x5f, 0x1e, 0xf8, 0x1f, 0x01, 0xd5, 0x5e, 0xc4, 0xdd, 0x4a, 0x5e, 0x10, 0x7b, - 0x82, 0x45, 0x5c, 0xa6, 0xc7, 0x18, 0xb3, 0x0b, 0x1c, 0xa6, 0xb0, 0xc0, 0x61, 0xd0, 0xff, 0x43, - 0x35, 0x13, 0x15, 0xbb, 0x1b, 0x8c, 0xdd, 0x4a, 0x3a, 0x1e, 0xce, 0x25, 0x9e, 0xe2, 0x5a, 0x89, - 0xe7, 0xdf, 0x12, 0xa8, 0x5d, 0xe2, 0x84, 0xbd, 0x37, 0x6b, 0xea, 0xe8, 0x19, 0x54, 0xde, 0x32, - 0x17, 0xe2, 0xf7, 0x8a, 0xac, 0xb3, 0xbb, 0xc0, 0xc7, 0x18, 0x61, 0xac, 0xbe, 0x4d, 0xb9, 0x2c, - 0xf5, 0x86, 0x68, 0xc0, 0xbc, 0x41, 0xc1, 0x74, 0x79, 0x5e, 0xd4, 0x02, 0x0b, 0xfd, 0x8b, 0x45, - 0xdd, 0x58, 0x4b, 0xd4, 0x33, 0xd8, 0xe1, 0x92, 0x9a, 0x7e, 0x97, 0xf4, 0x87, 0xc4, 0x17, 0x6e, - 0xa1, 0x43, 0xf5, 0xb5, 0x37, 0x20, 0x33, 0x5b, 0x48, 0xec, 0x6a, 0x95, 0x02, 0x13, 0x4b, 0x3c, - 0x83, 0x4a, 0xc4, 0x70, 0xa7, 0xd2, 0x4a, 0xe7, 0xa4, 0x4d, 0xa9, 0x11, 0xab, 0xd1, 0xec, 0x87, - 0xfe, 0x27, 0x09, 0xca, 0x2c, 0xb5, 0x78, 0x64, 0xcd, 0xcc, 0xa2, 0x81, 0xec, 0xb9, 0x91, 0xc8, - 0x26, 0x74, 0x89, 0xee, 0x80, 0xf2, 0xd6, 0x19, 0x78, 0xae, 0x1d, 0x06, 0x67, 0xcc, 0xdb, 0xca, - 0xb8, 0xcc, 0x00, 0x38, 0x38, 0xcb, 0xba, 0x62, 0x61, 0x15, 0x57, 0xd4, 0xff, 0x9a, 0x07, 0xf5, - 0xc5, 0x98, 0x84, 0x13, 0x4c, 0xa2, 0xf1, 0x60, 0xcd, 0xac, 0xfd, 0x11, 0x94, 0x89, 0x90, 0x4b, - 0x68, 0x24, 0x9b, 0x03, 0x12, 0xa1, 0xf1, 0xf4, 0x18, 0xba, 0x09, 0x25, 0x9a, 0x98, 0xfc, 0x71, - 0x92, 0x0b, 0x8a, 0x61, 0x70, 0xd6, 0x1e, 0x0f, 0x69, 0x71, 0x14, 0xf5, 0x82, 0x90, 0xf0, 0x97, - 0x33, 0x8f, 0xc5, 0x2f, 0xf4, 0x1e, 0x28, 0xae, 0x17, 0xc5, 0x8e, 0xdf, 0x23, 0xdc, 0xe0, 0x79, - 0x3c, 0x03, 0x5c, 0xcd, 0xf9, 0xd1, 0x2d, 0x28, 0xff, 0x96, 0xca, 0x6e, 0x7b, 0xee, 0x6e, 0x89, - 0x71, 0x53, 0x62, 0xbf, 0x4d, 0x97, 0xea, 0xb9, 0x37, 0xf0, 0x88, 0x1f, 0xd3, 0xbd, 0x32, 0xdb, - 0x2b, 0x73, 0x80, 0xe9, 0xea, 0xbf, 0x02, 0xb5, 0x1b, 0x87, 0xf4, 0x3d, 0x25, 0xa3, 0xc1, 0x64, - 0x3d, 0x9d, 0xbd, 0x0f, 0x95, 0x88, 0xe1, 0xda, 0x21, 0x45, 0x16, 0x4f, 0xa8, 0x1a, 0xcd, 0xe8, - 0xe9, 0xaf, 0x40, 0xa9, 0x07, 0xc1, 0xe0, 0x07, 0x10, 0xbf, 0x0b, 0x70, 0x1a, 0x04, 0x83, 0x14, - 0xe9, 0x32, 0x56, 0x4e, 0x13, 0x5a, 0x7a, 0x94, 0xae, 0xfa, 0x70, 0x70, 0xd6, 0x08, 0xc6, 0xfe, - 0x9a, 0x26, 0xff, 0x10, 0x76, 0x52, 0xf9, 0x81, 0x9a, 0xb2, 0x47, 0x89, 0xb0, 0xbb, 0x64, 0x8c, - 0x7a, 0xe7, 0xc8, 0xeb, 0x77, 0xa0, 0xd4, 0x08, 0x86, 0x43, 0xc7, 0x77, 0xa9, 0x3b, 0xf7, 0x86, - 0x6e, 0x52, 0xd8, 0xf6, 0x86, 0xae, 0xfe, 0x4f, 0x09, 0xc0, 0xf4, 0x5d, 0xf2, 0x8e, 0x87, 0xe2, - 0xff, 0xa6, 0x8e, 0xcb, 0xbe, 0x62, 0xf2, 0xfc, 0x2b, 0x76, 0x17, 0xc0, 0xa3, 0x2c, 0xf0, 0xed, - 0x02, 0xdf, 0x66, 0x10, 0xb6, 0x7d, 0xb5, 0xa4, 0xf3, 0x05, 0xc0, 0xfe, 0x60, 0x1c, 0x89, 0xec, - 0xba, 0x07, 0xd7, 0xe7, 0x58, 0xce, 0xa4, 0x9c, 0x6b, 0x59, 0xc6, 0x79, 0xd5, 0x70, 0x02, 0x95, - 0x46, 0x30, 0x1c, 0x39, 0xbd, 0x75, 0x5f, 0xb1, 0xf7, 0x40, 0x89, 0xdf, 0x84, 0x24, 0x7a, 0x13, - 0x0c, 0x78, 0x09, 0x20, 0xe1, 0x19, 0x40, 0x3f, 0x81, 0xad, 0x26, 0x19, 0x90, 0x98, 0xd4, 0x27, - 0x66, 0x73, 0x4d, 0xca, 0xb7, 0xa0, 0x3c, 0x57, 0xe9, 0x94, 0x3c, 0x51, 0xe3, 0x7c, 0x9d, 0xee, - 0x49, 0x4c, 0xff, 0x75, 0xb0, 0x9e, 0x4d, 0xef, 0x80, 0x42, 0xeb, 0x17, 0xdb, 0xf3, 0x5f, 0x07, - 0xc2, 0x9a, 0x65, 0x0a, 0xa0, 0x94, 0xf4, 0x6f, 0x60, 0xfb, 0x80, 0xc4, 0xa2, 0x48, 0x6b, 0x46, - 0x6b, 0x32, 0x7d, 0x17, 0x20, 0xe2, 0x69, 0x9f, 0x86, 0x34, 0xf7, 0x57, 0x45, 0x40, 0x4c, 0x57, - 0x1f, 0xc3, 0x66, 0x52, 0xfe, 0xf1, 0x47, 0xf8, 0xbf, 0xa1, 0x0e, 0x5a, 0x75, 0xce, 0x5c, 0x2f, - 0x62, 0x09, 0x5b, 0x11, 0x25, 0x0c, 0x6f, 0x8d, 0x3e, 0x04, 0x8d, 0xbf, 0x92, 0xac, 0xc2, 0xe1, - 0x22, 0xb1, 0x94, 0x37, 0x24, 0x7e, 0xe4, 0x89, 0xaa, 0x4e, 0xc6, 0x33, 0x80, 0xfe, 0x07, 0x49, - 0x54, 0x68, 0xb4, 0xba, 0x42, 0x9f, 0x80, 0x42, 0xb3, 0xbd, 0xcd, 0xea, 0x30, 0xe9, 0x82, 0x3a, - 0xec, 0x30, 0x87, 0xcb, 0xae, 0x58, 0xa3, 0xfa, 0xb9, 0xc7, 0x9b, 0x5a, 0xe6, 0xee, 0x82, 0xc7, - 0x7b, 0xc6, 0xd6, 0x61, 0x2e, 0xf3, 0x86, 0xd7, 0x4b, 0xa2, 0x27, 0xd5, 0xbf, 0x93, 0x00, 0x52, - 0xdc, 0x6f, 0x42, 0xde, 0xe3, 0x31, 0x5e, 0xc0, 0x79, 0xcf, 0xa5, 0x95, 0x59, 0x2a, 0x36, 0xd9, - 0x7a, 0x5a, 0x38, 0xca, 0x97, 0x17, 0x8e, 0x9f, 0x42, 0x85, 0x47, 0xe7, 0xca, 0x7d, 0x95, 0x37, - 0xcd, 0x27, 0xd1, 0x15, 0x83, 0xf7, 0x00, 0xb6, 0x53, 0x5a, 0x10, 0x55, 0xfb, 0x5e, 0xd2, 0x8b, - 0xaf, 0x52, 0xb3, 0x0b, 0x15, 0x7d, 0x2f, 0x81, 0x62, 0x91, 0x70, 0xc8, 0x5e, 0xda, 0xcb, 0xaa, - 0xea, 0x3b, 0xa0, 0x78, 0x7e, 0x6c, 0x27, 0x0d, 0x3f, 0xf5, 0xa7, 0xb2, 0xe7, 0xc7, 0x8c, 0x47, - 0xfa, 0x7c, 0xb8, 0xc1, 0xf8, 0x74, 0x40, 0xc4, 0x3e, 0xf5, 0x28, 0x09, 0xab, 0x1c, 0xc6, 0x8f, - 0xf0, 0x12, 0x61, 0x4c, 0xd8, 0x23, 0x5b, 0xe0, 0x4f, 0x17, 0x03, 0xd0, 0x67, 0x76, 0x07, 0x36, - 0x4e, 0x83, 0x20, 0x8a, 0x59, 0x29, 0x99, 0xc7, 0xfc, 0xc7, 0x15, 0x6b, 0x48, 0x07, 0x54, 0x96, - 0xa1, 0x42, 0x62, 0xbc, 0x1b, 0x85, 0xe8, 0x29, 0x94, 0x83, 0x11, 0x09, 0x9d, 0x38, 0x08, 0x85, - 0x47, 0x66, 0x75, 0x24, 0xce, 0x76, 0xc4, 0x19, 0x3c, 0x3d, 0x8d, 0x76, 0xa1, 0xc4, 0xd6, 0xbe, - 0x2b, 0xbc, 0x25, 0xf9, 0xa9, 0xff, 0x4d, 0x02, 0xc0, 0x8e, 0xdf, 0x27, 0x2b, 0x69, 0x70, 0x2f, - 0x4d, 0xe7, 0x7c, 0x59, 0x9a, 0x62, 0x76, 0x7a, 0xc3, 0x4c, 0x31, 0xf2, 0x45, 0x8a, 0x59, 0xaf, - 0xab, 0xff, 0x4e, 0x4a, 0x3a, 0xb5, 0x95, 0xd8, 0xbe, 0x07, 0x2a, 0x2f, 0x47, 0x38, 0x23, 0x79, - 0xc6, 0x08, 0x30, 0x50, 0x9d, 0x71, 0x93, 0x6a, 0x18, 0xe5, 0x35, 0x1a, 0x46, 0x1a, 0x82, 0x71, - 0x30, 0xfa, 0x56, 0x38, 0x03, 0x5b, 0x5f, 0x31, 0x32, 0xde, 0x41, 0x85, 0x96, 0x28, 0xc4, 0xf1, - 0xb9, 0x64, 0x0f, 0x60, 0x23, 0xe8, 0xf5, 0xc6, 0x89, 0xc1, 0x51, 0x86, 0x4c, 0x87, 0xee, 0x60, - 0x7e, 0x00, 0x7d, 0x0e, 0xd5, 0x3e, 0xf1, 0x49, 0xe8, 0x0c, 0x6c, 0x26, 0x99, 0xb0, 0x50, 0xf6, - 0xe2, 0x03, 0x7e, 0x82, 0x17, 0xa6, 0x95, 0x7e, 0xea, 0x97, 0xfe, 0xfb, 0x3c, 0x54, 0xd2, 0xdb, - 0xe8, 0x0b, 0xa8, 0x9e, 0x72, 0x56, 0x04, 0x41, 0x69, 0x41, 0xb7, 0x9b, 0x66, 0xf6, 0x30, 0x87, - 0x2b, 0xa7, 0x69, 0xe6, 0x9f, 0x00, 0xc4, 0x24, 0x1c, 0x4e, 0xf9, 0x91, 0xce, 0xb5, 0x9f, 0xd3, - 0xd8, 0x3d, 0xcc, 0x61, 0x25, 0x9e, 0x06, 0xf2, 0xcf, 0x41, 0x0d, 0xa9, 0x53, 0x0a, 0x4c, 0x3e, - 0x25, 0xba, 0x99, 0xad, 0xb8, 0xa7, 0x4e, 0x7b, 0x98, 0xc3, 0x10, 0xce, 0x5c, 0xf8, 0xb3, 0x69, - 0x0a, 0xe6, 0xc8, 0x85, 0x05, 0x1d, 0x45, 0xca, 0x77, 0x66, 0xd9, 0x97, 0xfd, 0xa4, 0xd9, 0x97, - 0xe1, 0xe9, 0xff, 0x92, 0xa0, 0x9a, 0xea, 0x3c, 0x8e, 0xeb, 0xab, 0xbf, 0x5b, 0x6b, 0x0e, 0x5d, - 0xce, 0x9b, 0x4e, 0x5e, 0xa0, 0xe9, 0xe5, 0xa6, 0xbb, 0x62, 0x30, 0xfd, 0x4e, 0x86, 0x6d, 0xde, - 0xcd, 0x77, 0x42, 0x5e, 0xb9, 0x1c, 0x45, 0xfd, 0xd5, 0x85, 0xcd, 0xf4, 0x46, 0xdc, 0xc6, 0x97, - 0xb5, 0xe9, 0x1a, 0xc8, 0x63, 0xcf, 0x4d, 0x66, 0x16, 0x63, 0xcf, 0x5d, 0xd4, 0xa5, 0x9e, 0x6f, - 0xc8, 0x69, 0xdd, 0xe5, 0x0d, 0x49, 0x14, 0x3b, 0xc3, 0x11, 0x4b, 0xb3, 0x05, 0x3c, 0x03, 0xcc, - 0x95, 0x21, 0xc5, 0xb9, 0x32, 0x84, 0x6e, 0xf7, 0xde, 0x38, 0xbe, 0x4f, 0x06, 0xb3, 0xa6, 0x44, - 0x11, 0x10, 0x93, 0x32, 0x90, 0x0f, 0x46, 0xac, 0x1f, 0xd9, 0x9c, 0x2b, 0xa4, 0x3a, 0x23, 0xf6, - 0x68, 0xe6, 0x83, 0x51, 0xb6, 0x77, 0x51, 0xb2, 0xbd, 0xcb, 0x39, 0x23, 0xc0, 0x5a, 0x46, 0xf8, - 0x7b, 0x1e, 0x14, 0xee, 0x6d, 0x6b, 0x29, 0x3f, 0x95, 0xb8, 0xb8, 0xea, 0x57, 0x4c, 0x5c, 0xe7, - 0xf4, 0x2d, 0x2f, 0x98, 0x0a, 0x08, 0x33, 0x15, 0x66, 0x66, 0xba, 0xd8, 0x02, 0x19, 0xf5, 0x14, - 0x2f, 0x51, 0x4f, 0x69, 0xad, 0x86, 0x32, 0x19, 0xc5, 0x95, 0x19, 0x9b, 0x7c, 0x14, 0x27, 0x66, - 0x1d, 0xca, 0x74, 0xd6, 0xa1, 0xbf, 0x03, 0xd5, 0xf2, 0x86, 0xa4, 0x3b, 0xf1, 0x7b, 0x54, 0x8b, - 0x37, 0xa1, 0x34, 0x22, 0x24, 0xb4, 0x4d, 0x57, 0x14, 0x7b, 0x45, 0xfa, 0xd3, 0x64, 0x62, 0x58, - 0x53, 0x31, 0xf2, 0x5c, 0x8c, 0x29, 0x00, 0xed, 0x81, 0x12, 0x4d, 0xfc, 0x9e, 0xbd, 0xb4, 0x90, - 0xa2, 0xf4, 0x99, 0x4f, 0x94, 0x23, 0xb1, 0xd2, 0xbf, 0x01, 0x78, 0x4e, 0x26, 0x7b, 0x5d, 0xd2, - 0xa7, 0x17, 0x0b, 0xc5, 0x49, 0x4b, 0x14, 0x97, 0xbf, 0xd8, 0x75, 0x65, 0x56, 0x99, 0xcc, 0x5c, - 0xf7, 0xe1, 0x5f, 0x0a, 0xa0, 0x4c, 0xbf, 0x7b, 0x20, 0x15, 0x4a, 0xdd, 0x93, 0x46, 0xc3, 0xe8, - 0x76, 0xb5, 0x1c, 0xda, 0x01, 0xed, 0xa4, 0x6d, 0x7c, 0x79, 0x6c, 0x34, 0x2c, 0xa3, 0x69, 0x1b, - 0x18, 0x77, 0xb0, 0x26, 0x21, 0x04, 0x9b, 0x8d, 0x4e, 0xbb, 0x6d, 0x34, 0x2c, 0x7b, 0xbf, 0x66, - 0xb6, 0x8c, 0xa6, 0x96, 0x47, 0xd7, 0x61, 0xfb, 0xd8, 0xc0, 0x47, 0x66, 0xb7, 0x6b, 0x76, 0xda, - 0x76, 0xd3, 0x68, 0x9b, 0x46, 0x53, 0x93, 0xd1, 0x2d, 0xb8, 0xde, 0xe8, 0xb4, 0x5a, 0x46, 0xc3, - 0xa2, 0xe0, 0x76, 0xc7, 0xb2, 0x8d, 0x2f, 0xcd, 0xae, 0xd5, 0xd5, 0x0a, 0x94, 0xb6, 0xd9, 0x6a, - 0x19, 0x07, 0xb5, 0x96, 0x5d, 0xc3, 0x07, 0x27, 0x47, 0x46, 0xdb, 0xd2, 0x36, 0x28, 0x9d, 0x04, - 0xda, 0x34, 0x8f, 0x8c, 0x36, 0x25, 0xa7, 0x95, 0xd0, 0x0d, 0x40, 0x09, 0xd8, 0x6c, 0x37, 0x8d, - 0x2f, 0x6d, 0xeb, 0xab, 0x63, 0x43, 0x2b, 0xa3, 0x3b, 0x70, 0x33, 0x81, 0xa7, 0xef, 0xa9, 0x1d, - 0x19, 0x9a, 0x82, 0x34, 0xa8, 0x24, 0x9b, 0x56, 0xe7, 0xf8, 0xb9, 0x06, 0x69, 0xea, 0xb8, 0xf3, - 0x0a, 0x1b, 0x8d, 0x0e, 0x6e, 0x6a, 0x6a, 0x1a, 0xfc, 0xd2, 0x68, 0x58, 0x1d, 0x6c, 0x9b, 0x4d, - 0xad, 0x42, 0x99, 0x4f, 0xc0, 0x5d, 0xa3, 0x86, 0x1b, 0x87, 0x36, 0x36, 0xba, 0x27, 0x2d, 0x4b, - 0xab, 0x52, 0x15, 0xec, 0x9b, 0x2d, 0x83, 0x49, 0xb4, 0xdf, 0x39, 0x69, 0x37, 0xb5, 0x4d, 0xb4, - 0x05, 0xea, 0x91, 0x61, 0xd5, 0x12, 0x9d, 0x6c, 0xd1, 0xfb, 0x1b, 0xb5, 0xc6, 0xa1, 0x91, 0x40, - 0x34, 0xb4, 0x0b, 0x3b, 0x8d, 0x5a, 0x9b, 0x22, 0x35, 0xb0, 0x51, 0xb3, 0x0c, 0x7b, 0xbf, 0xd3, - 0x6a, 0x1a, 0x58, 0xdb, 0xa6, 0x02, 0xce, 0xed, 0x98, 0x2d, 0x43, 0x43, 0x29, 0x8c, 0xa6, 0xd1, - 0x32, 0x66, 0x18, 0xd7, 0x52, 0x18, 0xc9, 0x0e, 0xc5, 0xd8, 0xa1, 0xc2, 0xd4, 0x4f, 0xcc, 0x56, - 0x53, 0x28, 0x8a, 0x1b, 0xed, 0x3a, 0xda, 0x86, 0x6a, 0x22, 0x4c, 0xbb, 0x65, 0x76, 0x2d, 0xed, - 0x06, 0xba, 0x09, 0xd7, 0x12, 0xd0, 0x91, 0x61, 0x61, 0xb3, 0xc1, 0xb5, 0x7a, 0x93, 0x9e, 0xed, - 0x9c, 0x58, 0x76, 0x67, 0xdf, 0x3e, 0x32, 0x8e, 0x3a, 0xf8, 0x2b, 0x6d, 0xf7, 0xe1, 0x1f, 0x25, - 0x28, 0x27, 0x15, 0x3e, 0x2a, 0x43, 0xa1, 0xdd, 0x69, 0x1b, 0x5a, 0x8e, 0xae, 0xea, 0x9d, 0x4e, - 0x4b, 0x93, 0xe8, 0xca, 0x6c, 0x5b, 0x4f, 0xb5, 0x3c, 0x52, 0x60, 0xc3, 0x6c, 0x5b, 0x1f, 0x3d, - 0xd6, 0x64, 0xb1, 0xfc, 0x78, 0x4f, 0x2b, 0x88, 0xe5, 0xe3, 0x4f, 0xb4, 0x0d, 0xba, 0xdc, 0x6f, - 0x75, 0x6a, 0x96, 0x06, 0x08, 0xa0, 0xd8, 0xec, 0x9c, 0xd4, 0x5b, 0x86, 0xa6, 0xd2, 0x75, 0xd7, - 0xc2, 0x66, 0xfb, 0x40, 0xdb, 0xa1, 0x1c, 0x08, 0x4b, 0xd4, 0xcd, 0x76, 0x0d, 0x7f, 0xa5, 0xb9, - 0x54, 0x9b, 0x02, 0xc4, 0x91, 0xc9, 0xc3, 0x06, 0x6c, 0xcd, 0xd5, 0xa4, 0xa8, 0x08, 0xf9, 0x96, - 0xa5, 0xe5, 0x50, 0x09, 0xe4, 0x96, 0x65, 0x68, 0x12, 0x05, 0x18, 0x2f, 0xb4, 0x3c, 0xfd, 0x7b, - 0x60, 0x69, 0x32, 0xdd, 0x38, 0xb0, 0x0c, 0xad, 0x40, 0x01, 0x6d, 0x43, 0xdb, 0x78, 0xf8, 0x14, - 0x36, 0x58, 0x9d, 0x43, 0x1d, 0xdf, 0x6c, 0xbf, 0xac, 0xb5, 0xcc, 0x26, 0x97, 0xeb, 0xe8, 0xa4, - 0x6b, 0x69, 0x12, 0xe3, 0xea, 0xb0, 0x73, 0xd2, 0xa2, 0x4e, 0x5e, 0x81, 0x32, 0x85, 0x52, 0xab, - 0x6b, 0xf2, 0xc3, 0xfb, 0x50, 0xe4, 0xc9, 0x9b, 0x9e, 0x31, 0xdb, 0x5d, 0x03, 0xd3, 0x9b, 0xa9, - 0x44, 0xcc, 0x1e, 0x9a, 0xf4, 0xf0, 0x1e, 0x94, 0x93, 0x60, 0xa6, 0x14, 0xb1, 0x51, 0xa3, 0xb4, - 0x15, 0xd8, 0x78, 0x85, 0x4d, 0x7a, 0x60, 0xef, 0xfb, 0x2a, 0x54, 0x8f, 0x58, 0xe8, 0x77, 0x49, - 0xf8, 0xd6, 0xeb, 0x11, 0xf4, 0x0b, 0xd0, 0x1a, 0x21, 0x71, 0x62, 0x32, 0xeb, 0xc6, 0xd1, 0xc2, - 0x4f, 0x42, 0xb7, 0x17, 0xf5, 0xe3, 0x7a, 0x0e, 0xed, 0x43, 0xf5, 0xd0, 0x89, 0x52, 0xd8, 0x77, - 0xe6, 0x6a, 0xe8, 0x74, 0x82, 0xbf, 0x7d, 0xe3, 0x5c, 0xb5, 0xc5, 0x27, 0x4e, 0x39, 0x64, 0x02, - 0x6a, 0x92, 0xa8, 0x17, 0x7a, 0xa7, 0x64, 0x55, 0x62, 0x0b, 0xf9, 0xd4, 0x73, 0xe8, 0x05, 0xb5, - 0xd3, 0xd8, 0x8f, 0x57, 0xa5, 0x73, 0x6f, 0xc9, 0xe6, 0x74, 0x34, 0x95, 0x43, 0xbf, 0x84, 0xad, - 0xee, 0x1b, 0xfa, 0x33, 0xd9, 0x8b, 0xe6, 0xb4, 0x24, 0x46, 0x57, 0x4b, 0x69, 0x25, 0xdf, 0x4e, - 0xf5, 0x1c, 0x3a, 0x06, 0x94, 0xa5, 0xc5, 0xc6, 0x1f, 0x17, 0x72, 0xb8, 0x6c, 0x93, 0x8d, 0x3b, - 0x72, 0xa8, 0x09, 0x9b, 0xcd, 0x30, 0x18, 0xad, 0x2a, 0xef, 0x12, 0x4b, 0x7e, 0x06, 0x2a, 0x77, - 0x05, 0x36, 0x68, 0x43, 0xd9, 0xfa, 0x74, 0x36, 0x7c, 0x5b, 0x86, 0xde, 0x80, 0x6a, 0x62, 0xc0, - 0x4b, 0x08, 0x2c, 0xdb, 0xd0, 0x73, 0xe8, 0x19, 0x28, 0x54, 0x92, 0x1f, 0xc6, 0x81, 0x01, 0x5b, - 0x5c, 0x80, 0xe9, 0x07, 0xc6, 0x39, 0x3d, 0x64, 0xbf, 0x62, 0x2e, 0x27, 0x53, 0x39, 0x74, 0xa2, - 0x15, 0x69, 0x2c, 0x77, 0xe8, 0xe7, 0xb0, 0x49, 0xcd, 0x3c, 0x3d, 0x1f, 0x5d, 0x6c, 0x94, 0xdb, - 0x8b, 0x6f, 0x11, 0x3e, 0x43, 0x95, 0x1b, 0x06, 0xa3, 0xab, 0x09, 0xf6, 0x29, 0x14, 0x79, 0x61, - 0x8c, 0x76, 0xe7, 0x34, 0x3b, 0xfd, 0xf6, 0x35, 0x27, 0xcf, 0xf4, 0x43, 0x27, 0x53, 0x4b, 0x75, - 0x3a, 0x55, 0xab, 0x4f, 0xcc, 0xe6, 0x1c, 0x0b, 0xd9, 0xa1, 0xd8, 0xed, 0xc5, 0x03, 0x7e, 0x3d, - 0x87, 0x0e, 0x69, 0x5b, 0x36, 0x1b, 0xce, 0xa1, 0xff, 0x9b, 0xeb, 0x0a, 0xe6, 0xe6, 0x76, 0x17, - 0x30, 0xf4, 0x39, 0x14, 0x79, 0x89, 0x89, 0x96, 0x7e, 0x5f, 0xb9, 0x9d, 0xdd, 0x49, 0x7d, 0xc0, - 0x60, 0x71, 0xb8, 0x35, 0xf7, 0x9d, 0x07, 0xbd, 0xbf, 0x80, 0x50, 0xf6, 0x2b, 0xd0, 0x85, 0x14, - 0x9f, 0x80, 0xdc, 0x18, 0xba, 0x4b, 0x32, 0xc3, 0x1c, 0x93, 0xa9, 0x39, 0x7e, 0x0e, 0xd5, 0x00, - 0x66, 0x43, 0x56, 0x94, 0x2d, 0x7a, 0xe7, 0xa6, 0xaf, 0xcb, 0x8c, 0x7b, 0x00, 0xdb, 0xc7, 0x21, - 0x19, 0x04, 0x8e, 0x7b, 0xc5, 0x34, 0xf0, 0x04, 0x36, 0xd8, 0x24, 0x7a, 0x2e, 0xfc, 0x66, 0xd3, - 0xe9, 0x65, 0x88, 0xcf, 0xd8, 0x00, 0x7f, 0xe4, 0xf4, 0x62, 0x74, 0xeb, 0xfc, 0x1c, 0x45, 0x8c, - 0xa5, 0x97, 0x21, 0xd7, 0xa1, 0x2c, 0xec, 0x56, 0x47, 0xb7, 0x97, 0x99, 0xf3, 0xb8, 0x7e, 0x91, - 0xfa, 0xeb, 0xa5, 0xaf, 0x37, 0x86, 0x51, 0x7f, 0x74, 0x7a, 0x5a, 0x64, 0xff, 0x95, 0xf3, 0xf1, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xef, 0x73, 0xf9, 0x2c, 0xa6, 0x23, 0x00, 0x00, + // 2859 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xdd, 0x72, 0xdb, 0xc6, + 0xf5, 0x27, 0x08, 0x8a, 0x24, 0x0e, 0x48, 0x09, 0x5a, 0xcb, 0xb6, 0x6c, 0xc7, 0x7f, 0x3b, 0xf8, + 0xcf, 0xb4, 0x8e, 0x3b, 0xe3, 0x49, 0x94, 0xd4, 0x76, 0xeb, 0x24, 0x0d, 0x3f, 0x20, 0x09, 0x35, + 0x45, 0xca, 0x4b, 0xc8, 0xce, 0xc7, 0x74, 0x50, 0x88, 0x58, 0xd3, 0x68, 0x48, 0x80, 0x05, 0x40, + 0xcb, 0xbc, 0xed, 0x7d, 0x3b, 0xd3, 0xcb, 0xce, 0xf4, 0xa6, 0x7d, 0x84, 0xf6, 0x2d, 0xfa, 0x02, + 0xb9, 0xc8, 0x4c, 0x2f, 0x3b, 0x7d, 0x8c, 0xce, 0x7e, 0x80, 0x04, 0x28, 0x52, 0x22, 0xa3, 0xf6, + 0x4a, 0xcb, 0xb3, 0xbb, 0x67, 0xcf, 0xf7, 0xfe, 0xce, 0x42, 0x50, 0x1d, 0x92, 0x28, 0x72, 0xfa, + 0xe4, 0xd1, 0x28, 0x0c, 0xe2, 0x00, 0xa9, 0x43, 0x6f, 0xf0, 0x76, 0x1c, 0x3d, 0xea, 0x87, 0xa3, + 0x9e, 0xfe, 0x0a, 0x8a, 0xdd, 0xd8, 0x89, 0xc7, 0x11, 0xfa, 0x29, 0x00, 0x09, 0xc3, 0x20, 0xb4, + 0x7b, 0x81, 0x4b, 0x76, 0xa5, 0xfb, 0xd2, 0x83, 0xcd, 0xbd, 0x1b, 0x8f, 0x52, 0x6b, 0x1f, 0x19, + 0x74, 0xba, 0x11, 0xb8, 0x04, 0x2b, 0x24, 0x19, 0xa2, 0x1b, 0x50, 0x0c, 0x89, 0x13, 0x05, 0xfe, + 0x6e, 0xfe, 0xbe, 0xf4, 0x40, 0xc1, 0xe2, 0x97, 0xfe, 0x18, 0x2a, 0xcf, 0xc9, 0xe4, 0xa5, 0x33, + 0x18, 0x93, 0x63, 0xc7, 0x0b, 0x91, 0x06, 0xf2, 0xb7, 0x64, 0xc2, 0xf8, 0x2a, 0x98, 0x0e, 0xd1, + 0x0e, 0x6c, 0xbc, 0xa5, 0xd3, 0x62, 0x23, 0xff, 0xa1, 0xff, 0x0c, 0x36, 0x1b, 0xc1, 0x60, 0x40, + 0x7a, 0xb1, 0x17, 0xf8, 0x6d, 0x67, 0x48, 0xd0, 0x8f, 0x61, 0xab, 0x37, 0xa5, 0xd8, 0xbe, 0x33, + 0x24, 0x82, 0xcb, 0x66, 0x2f, 0xb3, 0x50, 0x1f, 0x00, 0xca, 0x6e, 0x6d, 0x79, 0x51, 0x8c, 0x7e, + 0x02, 0xc5, 0x88, 0x69, 0xc8, 0x76, 0xa9, 0x7b, 0xd7, 0x32, 0x3a, 0x71, 0xe5, 0xb1, 0x58, 0x82, + 0x3e, 0x00, 0x6d, 0xee, 0xac, 0x68, 0x37, 0x7f, 0x5f, 0x7e, 0xa0, 0xe0, 0xad, 0xec, 0x61, 0x91, + 0xde, 0x05, 0x65, 0xdf, 0x23, 0x03, 0x77, 0x2d, 0x19, 0xd1, 0x5d, 0x80, 0xd7, 0x74, 0x17, 0x5f, + 0xc3, 0x35, 0x57, 0x5e, 0x27, 0x7c, 0xf4, 0x7f, 0x48, 0x50, 0x3a, 0x72, 0x46, 0x23, 0xcf, 0xef, + 0xaf, 0x27, 0xf8, 0x02, 0x01, 0xf2, 0x0b, 0x05, 0xa0, 0x5c, 0x7b, 0x6f, 0xc8, 0xd0, 0xd9, 0x95, + 0x17, 0x71, 0x65, 0x53, 0x58, 0x2c, 0x41, 0x9f, 0x42, 0x85, 0xbc, 0x8b, 0x43, 0xc7, 0x1e, 0x39, + 0xa1, 0x33, 0x8c, 0x76, 0x0b, 0xf7, 0xe5, 0x07, 0xea, 0xde, 0xad, 0xcc, 0x96, 0xb4, 0x97, 0xb1, + 0xca, 0x96, 0x1f, 0xb3, 0xd5, 0x7a, 0x04, 0xaa, 0xd0, 0x65, 0x7d, 0x47, 0x3c, 0x81, 0xca, 0x90, + 0xef, 0xb5, 0x07, 0x5e, 0x14, 0x33, 0x27, 0xa8, 0x7b, 0x3b, 0x99, 0x2d, 0x82, 0x39, 0x56, 0x87, + 0xb3, 0x53, 0xf4, 0xe7, 0xb0, 0x79, 0xec, 0x84, 0xb1, 0x47, 0x15, 0x66, 0x72, 0xac, 0xee, 0x1b, + 0x0d, 0xe4, 0xd8, 0xe9, 0x0b, 0xbb, 0xd1, 0xa1, 0x3e, 0x80, 0xea, 0x94, 0xd9, 0xfa, 0x3a, 0x3c, + 0x82, 0x6b, 0xa3, 0x64, 0xb7, 0x1d, 0x3b, 0x7d, 0xdb, 0x09, 0x43, 0x67, 0x22, 0xe2, 0x69, 0x7b, + 0x3a, 0x65, 0x39, 0xfd, 0x1a, 0x9d, 0xd0, 0x5f, 0xc0, 0xd6, 0x4b, 0xd2, 0x8b, 0x83, 0x10, 0x07, + 0x67, 0x98, 0xf4, 0x82, 0xd0, 0x65, 0xe1, 0x32, 0x08, 0x9c, 0xd8, 0x76, 0x9d, 0xd8, 0xd9, 0x95, + 0xee, 0xcb, 0x0f, 0xf2, 0x58, 0x61, 0x94, 0xa6, 0x13, 0x3b, 0xe8, 0x1e, 0xa8, 0xa7, 0x9e, 0xef, + 0x84, 0x13, 0x3e, 0x4f, 0x25, 0xaf, 0x60, 0xe0, 0x24, 0xba, 0x40, 0xff, 0x35, 0x28, 0x86, 0x1f, + 0x7b, 0xf1, 0xc4, 0x74, 0xa3, 0xf5, 0x84, 0xff, 0x11, 0x6c, 0x11, 0xb6, 0xd3, 0xf6, 0xdc, 0x94, + 0xe0, 0x32, 0xae, 0x12, 0xc1, 0x90, 0x0b, 0xbd, 0x0f, 0x15, 0x21, 0x34, 0x97, 0xf8, 0x31, 0x94, + 0x42, 0x36, 0x8a, 0x98, 0xb8, 0xea, 0xde, 0x7b, 0x99, 0x53, 0xe6, 0x14, 0xc4, 0xc9, 0x62, 0xfd, + 0x1b, 0x50, 0xf9, 0x1c, 0x77, 0x1a, 0x82, 0xc2, 0x6f, 0x68, 0x51, 0xe1, 0x9e, 0x62, 0x63, 0xf4, + 0x14, 0x20, 0x0c, 0xce, 0x6c, 0xbe, 0x83, 0x29, 0x3b, 0x1f, 0x8b, 0x69, 0x49, 0xb0, 0x12, 0x26, + 0xa7, 0xe8, 0x7d, 0x91, 0xab, 0x47, 0x24, 0x76, 0xe6, 0x52, 0x50, 0x9a, 0x4b, 0x41, 0xf4, 0x01, + 0x14, 0xe2, 0xc9, 0x88, 0xa7, 0xcf, 0xe6, 0xde, 0xf5, 0x0c, 0x7f, 0x6a, 0x53, 0x6b, 0x32, 0x22, + 0x98, 0x2d, 0xa1, 0x01, 0xe3, 0x7a, 0x43, 0x96, 0x48, 0x32, 0xa6, 0x43, 0xbd, 0x06, 0x45, 0x9e, + 0x42, 0xe8, 0x09, 0xa8, 0xfc, 0x94, 0x21, 0x89, 0x9d, 0xc4, 0x16, 0xd9, 0x7a, 0x3a, 0x15, 0x09, + 0x73, 0x81, 0xe8, 0x30, 0xd2, 0xef, 0x42, 0x09, 0x07, 0x67, 0xcc, 0xbd, 0x08, 0x0a, 0xa7, 0x83, + 0xe0, 0x94, 0xc9, 0x58, 0xc1, 0x6c, 0xac, 0xff, 0x25, 0x0f, 0xaa, 0xe9, 0x47, 0x24, 0x8c, 0xd7, + 0x8c, 0xee, 0x59, 0xe2, 0xe7, 0x2f, 0x4f, 0xfc, 0x8f, 0x80, 0x5a, 0x2f, 0xe2, 0x61, 0x25, 0x2f, + 0xc8, 0x3d, 0x21, 0x22, 0x2e, 0xd3, 0x65, 0x4c, 0xd8, 0x05, 0x01, 0x53, 0x58, 0x10, 0x30, 0xe8, + 0xff, 0xa1, 0x9a, 0xc9, 0x8a, 0xdd, 0x0d, 0x26, 0x6e, 0x25, 0x9d, 0x0f, 0xe7, 0x0a, 0x4f, 0x71, + 0xad, 0xc2, 0xf3, 0x6f, 0x09, 0xd4, 0x2e, 0x71, 0xc2, 0xde, 0x9b, 0x35, 0x6d, 0xf4, 0x0c, 0x2a, + 0x6f, 0x59, 0x08, 0xf1, 0x73, 0x45, 0xd5, 0xd9, 0x5d, 0x10, 0x63, 0x8c, 0x31, 0x56, 0xdf, 0xa6, + 0x42, 0x96, 0x46, 0x43, 0x34, 0x60, 0xd1, 0xa0, 0x60, 0x3a, 0x3c, 0xaf, 0x6a, 0x81, 0xa5, 0xfe, + 0xc5, 0xaa, 0x6e, 0xac, 0xa5, 0xea, 0x19, 0xec, 0x70, 0x4d, 0x4d, 0xbf, 0x4b, 0xfa, 0x43, 0xe2, + 0x8b, 0xb0, 0xd0, 0xa1, 0xfa, 0xda, 0x1b, 0x90, 0x99, 0x2f, 0x24, 0x76, 0xb4, 0x4a, 0x89, 0x89, + 0x27, 0x9e, 0x41, 0x25, 0x62, 0x7b, 0xa7, 0xda, 0x4a, 0xe7, 0xb4, 0x4d, 0x99, 0x11, 0xab, 0xd1, + 0xec, 0x87, 0xfe, 0x27, 0x09, 0xca, 0xac, 0xb4, 0x78, 0x64, 0xcd, 0xca, 0xa2, 0x81, 0xec, 0xb9, + 0x91, 0xa8, 0x26, 0x74, 0x88, 0xee, 0x80, 0xf2, 0xd6, 0x19, 0x78, 0xae, 0x1d, 0x06, 0x67, 0x2c, + 0xda, 0xca, 0xb8, 0xcc, 0x08, 0x38, 0x38, 0xcb, 0x86, 0x62, 0x61, 0x95, 0x50, 0xd4, 0xff, 0x96, + 0x07, 0xf5, 0xc5, 0x98, 0x84, 0x13, 0x4c, 0xa2, 0xf1, 0x60, 0xcd, 0xaa, 0xfd, 0x11, 0x94, 0x89, + 0xd0, 0x4b, 0x58, 0x24, 0x5b, 0x03, 0x12, 0xa5, 0xf1, 0x74, 0x19, 0xba, 0x09, 0x25, 0x5a, 0x98, + 0xfc, 0x71, 0x52, 0x0b, 0x8a, 0x61, 0x70, 0xd6, 0x1e, 0x0f, 0x29, 0x38, 0x8a, 0x7a, 0x41, 0x48, + 0xf8, 0xcd, 0x99, 0xc7, 0xe2, 0x17, 0x7a, 0x0f, 0x14, 0xd7, 0x8b, 0x62, 0xc7, 0xef, 0x11, 0xee, + 0xf0, 0x3c, 0x9e, 0x11, 0xae, 0x16, 0xfc, 0xe8, 0x16, 0x94, 0x7f, 0x4b, 0x75, 0xb7, 0x3d, 0x77, + 0xb7, 0xc4, 0xa4, 0x29, 0xb1, 0xdf, 0xa6, 0x4b, 0xed, 0xdc, 0x1b, 0x78, 0xc4, 0x8f, 0xe9, 0x5c, + 0x99, 0xcd, 0x95, 0x39, 0xc1, 0x74, 0xf5, 0x5f, 0x81, 0xda, 0x8d, 0x43, 0x7a, 0x9f, 0x92, 0xd1, + 0x60, 0xb2, 0x9e, 0xcd, 0xde, 0x87, 0x4a, 0xc4, 0xf6, 0xda, 0x21, 0xdd, 0x2c, 0xae, 0x50, 0x35, + 0x9a, 0xf1, 0xd3, 0x5f, 0x81, 0x52, 0x0f, 0x82, 0xc1, 0x0f, 0x60, 0x7e, 0x17, 0xe0, 0x34, 0x08, + 0x06, 0x29, 0xd6, 0x65, 0xac, 0x9c, 0x26, 0xbc, 0xf4, 0x28, 0x8d, 0xfa, 0x70, 0x70, 0xd6, 0x08, + 0xc6, 0xfe, 0x9a, 0x2e, 0xff, 0x10, 0x76, 0x52, 0xf5, 0x81, 0xba, 0xb2, 0x47, 0x99, 0xb0, 0xb3, + 0x64, 0x8c, 0x7a, 0xe7, 0xd8, 0xeb, 0x77, 0xa0, 0xd4, 0x08, 0x86, 0x43, 0xc7, 0x77, 0x69, 0x38, + 0xf7, 0x86, 0x6e, 0x02, 0x6c, 0x7b, 0x43, 0x57, 0xff, 0xa7, 0x04, 0x60, 0xfa, 0x2e, 0x79, 0xc7, + 0x53, 0xf1, 0x7f, 0x83, 0xe3, 0xb2, 0xb7, 0x98, 0x3c, 0x7f, 0x8b, 0xdd, 0x05, 0xf0, 0xa8, 0x08, + 0x7c, 0xba, 0xc0, 0xa7, 0x19, 0x85, 0x4d, 0x5f, 0xad, 0xe8, 0x7c, 0x01, 0xb0, 0x3f, 0x18, 0x47, + 0xa2, 0xba, 0xee, 0xc1, 0xf5, 0x39, 0x91, 0x33, 0x25, 0xe7, 0x5a, 0x56, 0x70, 0x8e, 0x1a, 0x4e, + 0xa0, 0xd2, 0x08, 0x86, 0x23, 0xa7, 0xb7, 0xee, 0x2d, 0xf6, 0x1e, 0x28, 0xf1, 0x9b, 0x90, 0x44, + 0x6f, 0x82, 0x01, 0x87, 0x00, 0x12, 0x9e, 0x11, 0xf4, 0x13, 0xd8, 0x6a, 0x92, 0x01, 0x89, 0x49, + 0x7d, 0x62, 0x36, 0xd7, 0xe4, 0x7c, 0x0b, 0xca, 0x73, 0x48, 0xa7, 0xe4, 0x09, 0x8c, 0xf3, 0x75, + 0xba, 0x27, 0x31, 0xfd, 0xd7, 0xc1, 0x7a, 0x3e, 0xbd, 0x03, 0x0a, 0xc5, 0x2f, 0xb6, 0xe7, 0xbf, + 0x0e, 0x84, 0x37, 0xcb, 0x94, 0x40, 0x39, 0xe9, 0xdf, 0xc0, 0xf6, 0x01, 0x89, 0x05, 0x48, 0x6b, + 0x46, 0x6b, 0x0a, 0x7d, 0x17, 0x20, 0xe2, 0x65, 0x9f, 0xa6, 0x34, 0x8f, 0x57, 0x45, 0x50, 0x4c, + 0x57, 0x1f, 0xc3, 0x66, 0x02, 0xff, 0xf8, 0x25, 0xfc, 0xdf, 0x30, 0x07, 0x45, 0x9d, 0xb3, 0xd0, + 0x8b, 0x58, 0xc1, 0x56, 0x04, 0x84, 0xe1, 0xad, 0xd1, 0x87, 0xa0, 0xf1, 0x5b, 0x92, 0x21, 0x1c, + 0xae, 0x12, 0x2b, 0x79, 0x43, 0xe2, 0x47, 0x9e, 0x40, 0x75, 0x32, 0x9e, 0x11, 0xf4, 0x3f, 0x48, + 0x02, 0xa1, 0x51, 0x74, 0x85, 0x3e, 0x01, 0x85, 0x56, 0x7b, 0x9b, 0xe1, 0x30, 0xe9, 0x02, 0x1c, + 0x76, 0x98, 0xc3, 0x65, 0x57, 0x8c, 0x51, 0xfd, 0xdc, 0xe5, 0x4d, 0x3d, 0x73, 0x77, 0xc1, 0xe5, + 0x3d, 0x13, 0xeb, 0x30, 0x97, 0xb9, 0xc3, 0xeb, 0x25, 0xd1, 0x93, 0xea, 0xdf, 0x49, 0x00, 0x29, + 0xe9, 0x37, 0x21, 0xef, 0xf1, 0x1c, 0x2f, 0xe0, 0xbc, 0xe7, 0x52, 0x64, 0x96, 0xca, 0x4d, 0x36, + 0x9e, 0x02, 0x47, 0xf9, 0x72, 0xe0, 0xf8, 0x29, 0x54, 0x78, 0x76, 0xae, 0xdc, 0x57, 0x79, 0xd3, + 0x7a, 0x12, 0x5d, 0x31, 0x79, 0x0f, 0x60, 0x3b, 0x65, 0x05, 0x81, 0xda, 0xf7, 0x92, 0x5e, 0x7c, + 0x15, 0xcc, 0x2e, 0x4c, 0xf4, 0xbd, 0x04, 0x8a, 0x45, 0xc2, 0x21, 0xbb, 0x69, 0x2f, 0x43, 0xd5, + 0x77, 0x40, 0xf1, 0xfc, 0xd8, 0x4e, 0x1a, 0x7e, 0x1a, 0x4f, 0x65, 0xcf, 0x8f, 0x99, 0x8c, 0xf4, + 0xfa, 0x70, 0x83, 0xf1, 0xe9, 0x80, 0x88, 0x79, 0x1a, 0x51, 0x12, 0x56, 0x39, 0x8d, 0x2f, 0xe1, + 0x10, 0x61, 0x4c, 0xd8, 0x25, 0x5b, 0xe0, 0x57, 0x17, 0x23, 0xd0, 0x6b, 0x76, 0x07, 0x36, 0x4e, + 0x83, 0x20, 0x8a, 0x19, 0x94, 0xcc, 0x63, 0xfe, 0xe3, 0x8a, 0x18, 0xd2, 0x01, 0x95, 0x55, 0xa8, + 0x90, 0x18, 0xef, 0x46, 0x21, 0x7a, 0x0a, 0xe5, 0x60, 0x44, 0x42, 0x27, 0x0e, 0x42, 0x11, 0x91, + 0x59, 0x1b, 0x89, 0xb5, 0x1d, 0xb1, 0x06, 0x4f, 0x57, 0xa3, 0x5d, 0x28, 0xb1, 0xb1, 0xef, 0x8a, + 0x68, 0x49, 0x7e, 0xea, 0x7f, 0x97, 0x00, 0xb0, 0xe3, 0xf7, 0xc9, 0x4a, 0x16, 0xdc, 0x4b, 0xf3, + 0x39, 0x0f, 0x4b, 0x53, 0xc2, 0x4e, 0x4f, 0x98, 0x19, 0x46, 0xbe, 0xc8, 0x30, 0xeb, 0x75, 0xf5, + 0xdf, 0x49, 0x49, 0xa7, 0xb6, 0x92, 0xd8, 0xf7, 0x40, 0xe5, 0x70, 0x84, 0x0b, 0x92, 0x67, 0x82, + 0x00, 0x23, 0xd5, 0x99, 0x34, 0xa9, 0x86, 0x51, 0x5e, 0xa3, 0x61, 0xa4, 0x29, 0x18, 0x07, 0xa3, + 0x6f, 0x45, 0x30, 0xb0, 0xf1, 0x15, 0x33, 0xe3, 0x1d, 0x54, 0x28, 0x44, 0x21, 0x8e, 0xcf, 0x35, + 0x7b, 0x00, 0x1b, 0x41, 0xaf, 0x37, 0x4e, 0x1c, 0x8e, 0x32, 0x6c, 0x3a, 0x74, 0x06, 0xf3, 0x05, + 0xe8, 0x73, 0xa8, 0xf6, 0x89, 0x4f, 0x42, 0x67, 0x60, 0x33, 0xcd, 0x84, 0x87, 0xb2, 0x07, 0x1f, + 0xf0, 0x15, 0x1c, 0x98, 0x56, 0xfa, 0xa9, 0x5f, 0xfa, 0xef, 0xf3, 0x50, 0x49, 0x4f, 0xa3, 0x2f, + 0xa0, 0x7a, 0xca, 0x45, 0x11, 0x0c, 0xa5, 0x05, 0xdd, 0x6e, 0x5a, 0xd8, 0xc3, 0x1c, 0xae, 0x9c, + 0xa6, 0x85, 0x7f, 0x02, 0x10, 0x93, 0x70, 0x38, 0x95, 0x47, 0x3a, 0xd7, 0x7e, 0x4e, 0x73, 0xf7, + 0x30, 0x87, 0x95, 0x78, 0x9a, 0xc8, 0x3f, 0x07, 0x35, 0xa4, 0x41, 0x29, 0x76, 0xf2, 0x57, 0xa2, + 0x9b, 0x59, 0xc4, 0x3d, 0x0d, 0xda, 0xc3, 0x1c, 0x86, 0x70, 0x16, 0xc2, 0x9f, 0x4d, 0x4b, 0x30, + 0xdf, 0x5c, 0x58, 0xd0, 0x51, 0xa4, 0x62, 0x67, 0x56, 0x7d, 0xd9, 0x4f, 0x5a, 0x7d, 0xd9, 0x3e, + 0xfd, 0x5f, 0x12, 0x54, 0x53, 0x9d, 0xc7, 0x71, 0x7d, 0xf5, 0x7b, 0x6b, 0xcd, 0x47, 0x97, 0xf3, + 0xae, 0x93, 0x17, 0x58, 0x7a, 0xb9, 0xeb, 0xae, 0x98, 0x4c, 0xbf, 0x93, 0x61, 0x9b, 0x77, 0xf3, + 0x9d, 0x90, 0x23, 0x97, 0xa3, 0xa8, 0xbf, 0xba, 0xb2, 0x99, 0xde, 0x88, 0xfb, 0xf8, 0xb2, 0x36, + 0x5d, 0x03, 0x79, 0xec, 0xb9, 0xc9, 0x9b, 0xc5, 0xd8, 0x73, 0x17, 0x75, 0xa9, 0xe7, 0x1b, 0x72, + 0x8a, 0xbb, 0xbc, 0x21, 0x89, 0x62, 0x67, 0x38, 0x62, 0x65, 0xb6, 0x80, 0x67, 0x84, 0x39, 0x18, + 0x52, 0x9c, 0x83, 0x21, 0x74, 0xba, 0xf7, 0xc6, 0xf1, 0x7d, 0x32, 0x98, 0x35, 0x25, 0x8a, 0xa0, + 0x98, 0x54, 0x80, 0x7c, 0x30, 0x62, 0xfd, 0xc8, 0xe6, 0x1c, 0x90, 0xea, 0x8c, 0xd8, 0xa5, 0x99, + 0x0f, 0x46, 0xd9, 0xde, 0x45, 0xc9, 0xf6, 0x2e, 0xe7, 0x9c, 0x00, 0x6b, 0x39, 0xe1, 0xcf, 0x79, + 0x50, 0x78, 0xb4, 0xad, 0x65, 0xfc, 0x54, 0xe1, 0xe2, 0xa6, 0x5f, 0xb1, 0x70, 0x9d, 0xb3, 0xb7, + 0xbc, 0xc0, 0xde, 0xc2, 0x4d, 0x85, 0x99, 0x9b, 0x2e, 0xf6, 0x40, 0xc6, 0x3c, 0xc5, 0x4b, 0xcc, + 0x53, 0x5a, 0xb3, 0x2c, 0xaa, 0x96, 0x37, 0x24, 0xdd, 0x89, 0xdf, 0xa3, 0xf6, 0xb9, 0x09, 0xa5, + 0x11, 0x21, 0xa1, 0x6d, 0xba, 0x02, 0xc6, 0x15, 0xe9, 0x4f, 0x93, 0x09, 0x68, 0x4d, 0x05, 0xcc, + 0xcf, 0x0b, 0xb8, 0x07, 0x4a, 0x34, 0xf1, 0x7b, 0xf6, 0x52, 0x88, 0x44, 0xf9, 0x33, 0x6f, 0x97, + 0x23, 0x31, 0xd2, 0xbf, 0x01, 0x78, 0x4e, 0x26, 0x7b, 0x5d, 0xd2, 0xa7, 0x07, 0x0b, 0x93, 0x48, + 0x4b, 0x4c, 0x92, 0xbf, 0x38, 0x28, 0x65, 0x86, 0x39, 0x66, 0x41, 0xf9, 0xf0, 0xaf, 0x05, 0x50, + 0xa6, 0x5f, 0x34, 0x90, 0x0a, 0xa5, 0xee, 0x49, 0xa3, 0x61, 0x74, 0xbb, 0x5a, 0x0e, 0xed, 0x80, + 0x76, 0xd2, 0x36, 0xbe, 0x3c, 0x36, 0x1a, 0x96, 0xd1, 0xb4, 0x0d, 0x8c, 0x3b, 0x58, 0x93, 0x10, + 0x82, 0xcd, 0x46, 0xa7, 0xdd, 0x36, 0x1a, 0x96, 0xbd, 0x5f, 0x33, 0x5b, 0x46, 0x53, 0xcb, 0xa3, + 0xeb, 0xb0, 0x7d, 0x6c, 0xe0, 0x23, 0xb3, 0xdb, 0x35, 0x3b, 0x6d, 0xbb, 0x69, 0xb4, 0x4d, 0xa3, + 0xa9, 0xc9, 0xe8, 0x16, 0x5c, 0x6f, 0x74, 0x5a, 0x2d, 0xa3, 0x61, 0x51, 0x72, 0xbb, 0x63, 0xd9, + 0xc6, 0x97, 0x66, 0xd7, 0xea, 0x6a, 0x05, 0xca, 0xdb, 0x6c, 0xb5, 0x8c, 0x83, 0x5a, 0xcb, 0xae, + 0xe1, 0x83, 0x93, 0x23, 0xa3, 0x6d, 0x69, 0x1b, 0x94, 0x4f, 0x42, 0x6d, 0x9a, 0x47, 0x46, 0x9b, + 0xb2, 0xd3, 0x4a, 0xe8, 0x06, 0xa0, 0x84, 0x6c, 0xb6, 0x9b, 0xc6, 0x97, 0xb6, 0xf5, 0xd5, 0xb1, + 0xa1, 0x95, 0xd1, 0x1d, 0xb8, 0x99, 0xd0, 0xd3, 0xe7, 0xd4, 0x8e, 0x0c, 0x4d, 0x41, 0x1a, 0x54, + 0x92, 0x49, 0xab, 0x73, 0xfc, 0x5c, 0x83, 0x34, 0x77, 0xdc, 0x79, 0x85, 0x8d, 0x46, 0x07, 0x37, + 0x35, 0x35, 0x4d, 0x7e, 0x69, 0x34, 0xac, 0x0e, 0xb6, 0xcd, 0xa6, 0x56, 0xa1, 0xc2, 0x27, 0xe4, + 0xae, 0x51, 0xc3, 0x8d, 0x43, 0x1b, 0x1b, 0xdd, 0x93, 0x96, 0xa5, 0x55, 0xa9, 0x09, 0xf6, 0xcd, + 0x96, 0xc1, 0x34, 0xda, 0xef, 0x9c, 0xb4, 0x9b, 0xda, 0x26, 0xda, 0x02, 0xf5, 0xc8, 0xb0, 0x6a, + 0x89, 0x4d, 0xb6, 0xe8, 0xf9, 0x8d, 0x5a, 0xe3, 0xd0, 0x48, 0x28, 0x1a, 0xda, 0x85, 0x9d, 0x46, + 0xad, 0x4d, 0x37, 0x35, 0xb0, 0x51, 0xb3, 0x0c, 0x7b, 0xbf, 0xd3, 0x6a, 0x1a, 0x58, 0xdb, 0xa6, + 0x0a, 0xce, 0xcd, 0x98, 0x2d, 0x43, 0x43, 0xa9, 0x1d, 0x4d, 0xa3, 0x65, 0xcc, 0x76, 0x5c, 0x4b, + 0xed, 0x48, 0x66, 0xe8, 0x8e, 0x1d, 0xaa, 0x4c, 0xfd, 0xc4, 0x6c, 0x35, 0x85, 0xa1, 0xb8, 0xd3, + 0xae, 0xa3, 0x6d, 0xa8, 0x26, 0xca, 0xb4, 0x5b, 0x66, 0xd7, 0xd2, 0x6e, 0xa0, 0x9b, 0x70, 0x2d, + 0x21, 0x1d, 0x19, 0x16, 0x36, 0x1b, 0xdc, 0xaa, 0x37, 0xe9, 0xda, 0xce, 0x89, 0x65, 0x77, 0xf6, + 0xed, 0x23, 0xe3, 0xa8, 0x83, 0xbf, 0xd2, 0x76, 0x1f, 0xfe, 0x51, 0x82, 0x72, 0x82, 0xdd, 0x51, + 0x19, 0x0a, 0xed, 0x4e, 0xdb, 0xd0, 0x72, 0x74, 0x54, 0xef, 0x74, 0x5a, 0x9a, 0x44, 0x47, 0x66, + 0xdb, 0x7a, 0xaa, 0xe5, 0x91, 0x02, 0x1b, 0x66, 0xdb, 0xfa, 0xe8, 0xb1, 0x26, 0x8b, 0xe1, 0xc7, + 0x7b, 0x5a, 0x41, 0x0c, 0x1f, 0x7f, 0xa2, 0x6d, 0xd0, 0xe1, 0x7e, 0xab, 0x53, 0xb3, 0x34, 0x40, + 0x00, 0xc5, 0x66, 0xe7, 0xa4, 0xde, 0x32, 0x34, 0x95, 0x8e, 0xbb, 0x16, 0x36, 0xdb, 0x07, 0xda, + 0x0e, 0x95, 0x40, 0x78, 0xa2, 0x6e, 0xb6, 0x6b, 0xf8, 0x2b, 0xcd, 0xa5, 0xd6, 0x14, 0x24, 0xbe, + 0x99, 0x3c, 0x6c, 0xc0, 0xd6, 0x1c, 0xda, 0x44, 0x45, 0xc8, 0xb7, 0x2c, 0x2d, 0x87, 0x4a, 0x20, + 0xb7, 0x2c, 0x43, 0x93, 0x28, 0xc1, 0x78, 0xa1, 0xe5, 0xe9, 0xdf, 0x03, 0x4b, 0x93, 0xe9, 0xc4, + 0x81, 0x65, 0x68, 0x05, 0x4a, 0x68, 0x1b, 0xda, 0xc6, 0xc3, 0xa7, 0xb0, 0xc1, 0x10, 0x0c, 0x0d, + 0x7c, 0xb3, 0xfd, 0xb2, 0xd6, 0x32, 0x9b, 0x5c, 0xaf, 0xa3, 0x93, 0xae, 0xa5, 0x49, 0x4c, 0xaa, + 0xc3, 0xce, 0x49, 0x8b, 0x06, 0x79, 0x05, 0xca, 0x94, 0x4a, 0xbd, 0xae, 0xc9, 0x0f, 0xef, 0x43, + 0x91, 0x97, 0x65, 0xba, 0xc6, 0x6c, 0x77, 0x0d, 0x4c, 0x4f, 0xa6, 0x1a, 0x31, 0x7f, 0x68, 0xd2, + 0xc3, 0x7b, 0x50, 0x4e, 0x92, 0x99, 0x72, 0xc4, 0x46, 0x8d, 0xf2, 0x56, 0x60, 0xe3, 0x15, 0x36, + 0xe9, 0x82, 0xbd, 0xef, 0xab, 0x50, 0x3d, 0x62, 0xa9, 0xdf, 0x25, 0xe1, 0x5b, 0xaf, 0x47, 0xd0, + 0x2f, 0x40, 0x6b, 0x84, 0xc4, 0x89, 0xc9, 0xac, 0xcf, 0x46, 0x0b, 0x3f, 0xf6, 0xdc, 0x5e, 0xd4, + 0x69, 0xeb, 0x39, 0xb4, 0x0f, 0xd5, 0x43, 0x27, 0x4a, 0xed, 0xbe, 0x33, 0x87, 0x8e, 0xd3, 0xa5, + 0xfb, 0xf6, 0x8d, 0x73, 0x38, 0x8a, 0xbf, 0x25, 0xe5, 0x90, 0x09, 0xa8, 0x49, 0xa2, 0x5e, 0xe8, + 0x9d, 0x92, 0x55, 0x99, 0x2d, 0x94, 0x53, 0xcf, 0xa1, 0x17, 0xd4, 0x4f, 0x63, 0x3f, 0x5e, 0x95, + 0xcf, 0xbd, 0x25, 0x93, 0xd3, 0x47, 0xa7, 0x1c, 0xfa, 0x25, 0x6c, 0x75, 0xdf, 0xd0, 0x9f, 0xc9, + 0x5c, 0x34, 0x67, 0x25, 0xf1, 0x28, 0xb5, 0x94, 0x57, 0xf2, 0x55, 0x54, 0xcf, 0xa1, 0x63, 0x40, + 0x59, 0x5e, 0xec, 0x61, 0xe3, 0x42, 0x09, 0x97, 0x4d, 0xb2, 0x87, 0x8c, 0x1c, 0x6a, 0xc2, 0x66, + 0x33, 0x0c, 0x46, 0xab, 0xea, 0xbb, 0xc4, 0x93, 0x9f, 0x81, 0xca, 0x43, 0x81, 0x3d, 0xa1, 0xa1, + 0x2c, 0xf2, 0x9c, 0x3d, 0xab, 0x2d, 0xdb, 0xde, 0x80, 0x6a, 0xe2, 0xc0, 0x4b, 0x18, 0x2c, 0x9b, + 0xd0, 0x73, 0xe8, 0x19, 0x28, 0x54, 0x93, 0x1f, 0x26, 0x81, 0x01, 0x5b, 0x5c, 0x81, 0xe9, 0xa7, + 0xc3, 0x39, 0x3b, 0x64, 0xbf, 0x4f, 0x2e, 0x67, 0x53, 0x39, 0x74, 0xa2, 0x15, 0x79, 0x2c, 0x0f, + 0xe8, 0xe7, 0xb0, 0x49, 0xdd, 0x3c, 0x5d, 0x1f, 0x5d, 0xec, 0x94, 0xdb, 0x8b, 0x4f, 0x11, 0x31, + 0x43, 0x8d, 0x1b, 0x06, 0xa3, 0xab, 0x29, 0xf6, 0x29, 0x14, 0x39, 0xe4, 0x45, 0xbb, 0x73, 0x96, + 0x9d, 0x7e, 0xd5, 0x9a, 0xd3, 0x67, 0xfa, 0x09, 0x93, 0x99, 0xa5, 0x3a, 0x7d, 0x2f, 0xab, 0x4f, + 0xcc, 0xe6, 0x9c, 0x08, 0xd9, 0xe7, 0xae, 0xdb, 0x8b, 0x9f, 0xee, 0xf5, 0x1c, 0x3a, 0xa4, 0x0d, + 0xd7, 0xec, 0xd9, 0x0d, 0xfd, 0xdf, 0x1c, 0xde, 0x9f, 0x7b, 0x91, 0xbb, 0x40, 0xa0, 0xcf, 0xa1, + 0xc8, 0xc1, 0x23, 0x5a, 0xfa, 0xe5, 0xe4, 0x76, 0x76, 0x26, 0xf5, 0x69, 0x82, 0xe5, 0xe1, 0xd6, + 0xdc, 0x17, 0x1c, 0xf4, 0xfe, 0x02, 0x46, 0xd9, 0xef, 0x3b, 0x17, 0x72, 0x7c, 0x02, 0x72, 0x63, + 0xe8, 0x2e, 0xa9, 0x0c, 0x73, 0x42, 0xa6, 0x5e, 0xe8, 0x73, 0xa8, 0x06, 0x30, 0x7b, 0x3e, 0x45, + 0x59, 0x38, 0x3b, 0xf7, 0xae, 0xba, 0xcc, 0xb9, 0x07, 0xb0, 0x7d, 0x1c, 0x92, 0x41, 0xe0, 0xb8, + 0x57, 0x2c, 0x03, 0x4f, 0x60, 0x83, 0xbd, 0x31, 0xcf, 0xa5, 0xdf, 0xec, 0xdd, 0x79, 0xd9, 0xc6, + 0x67, 0xec, 0x69, 0x7e, 0xe4, 0xf4, 0x62, 0x74, 0xeb, 0xfc, 0x0b, 0x89, 0x78, 0x70, 0x5e, 0xb6, + 0xb9, 0x0e, 0x65, 0xe1, 0xb7, 0x3a, 0xba, 0xbd, 0xcc, 0x9d, 0xc7, 0xf5, 0x8b, 0xcc, 0x5f, 0x2f, + 0x7d, 0xbd, 0x31, 0x8c, 0xfa, 0xa3, 0xd3, 0xd3, 0x22, 0xfb, 0x7f, 0x9b, 0x8f, 0xff, 0x13, 0x00, + 0x00, 0xff, 0xff, 0xaf, 0xd6, 0x20, 0xc1, 0x80, 0x23, 0x00, 0x00, } diff --git a/proto/hello.proto b/proto/hello.proto new file mode 100644 index 0000000000..0ca7a876a4 --- /dev/null +++ b/proto/hello.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package milvus.grpc; + +message HelloRequest{ +string name = 1; +} + +message HelloReply{ +string msg = 1; +} + +service HelloService{ + rpc SayHello (HelloRequest) returns (HelloReply){} +} \ No newline at end of file diff --git a/proto/master.proto b/proto/master.proto index 542b1153e8..78f1cbb5c1 100644 --- a/proto/master.proto +++ b/proto/master.proto @@ -1,36 +1,26 @@ syntax = "proto3"; -package masterpb; +package master; -option go_package="master"; +// The greeting service definition. +service Greeter { + // receive a grpc_server address and set to etcd. + rpc ReportAddress (Request) returns (Reply) {} -import "message.proto"; - -message Collection { - uint64 id=1; - string name=2; - milvus.grpc.Schema schema=3; - uint64 create_time=4; - repeated uint64 segment_ids=5; - repeated string partition_tags=6; + // send a grpc_server address to client + rpc GetAddress (EmptyRequest) returns (Request) {} } -message Segment { - uint64 segment_id=1; - uint64 collection_id =2; - string partition_tag=3; - int32 channel_start=4; - int32 channel_end=5; - uint64 open_timestamp=6; - uint64 close_timestamp=7; +// The request message containing the user's name. +message Request { + string address = 1; } -message SegmentStat { - uint64 segment_id=1; - uint64 memory_size=2; - float memory_rate=3; +message EmptyRequest { + } -service Master { - rpc CreateCollection(milvus.grpc.Mapping) returns (milvus.grpc.Status){} +// The response message containing the greetings +message Reply { + bool status = 1; } \ No newline at end of file diff --git a/proto/message.proto b/proto/message.proto index 52c202710a..99f6dfb148 100644 --- a/proto/message.proto +++ b/proto/message.proto @@ -691,13 +691,11 @@ message InsertOrDeleteMsg { message SearchMsg { string collection_name = 1; VectorRowRecord records = 2; - repeated string partition_tag = 3; + string partition_tag = 3; int64 uid = 4; uint64 timestamp =5; int64 client_id = 6; repeated KeyValuePair extra_params = 7; - repeated string json = 8; - string dsl = 9; } enum SyncType { diff --git a/proxy/CMakeLists.txt b/proxy/CMakeLists.txt index 027e7a3dca..9336d57dfb 100644 --- a/proxy/CMakeLists.txt +++ b/proxy/CMakeLists.txt @@ -63,7 +63,7 @@ include( FetchContent ) set( FETCHCONTENT_BASE_DIR ${MILVUS_BINARY_DIR}/3rdparty_download ) set(FETCHCONTENT_QUIET OFF) include( ThirdPartyPackages ) -find_package(OpenMP REQUIRED) + # **************************** Compiler arguments **************************** message( STATUS "Building Milvus CPU version" ) diff --git a/proxy/conf/demo/server_config.yaml b/proxy/conf/demo/server_config.yaml new file mode 100644 index 0000000000..b9626eb952 --- /dev/null +++ b/proxy/conf/demo/server_config.yaml @@ -0,0 +1,187 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +version: 0.5 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cluster Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | If runinng with Mishards, set true, otherwise false. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# role | Milvus deployment role: rw / ro | role | rw | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cluster: + enable: false + role: rw + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# General Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# time_zone | Use UTC-x or UTC+x to specify a time zone. | Timezone | UTC+8 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# meta_uri | URI for metadata storage, using SQLite (for single server | URL | sqlite://:@:/ | +# | Milvus) or MySQL (for distributed cluster Milvus). | | | +# | Format: dialect://username:password@host:port/database | | | +# | Keep 'dialect://:@:/', 'dialect' can be either 'sqlite' or | | | +# | 'mysql', replace other texts with real values. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +general: + timezone: UTC+8 + meta_uri: sqlite://:@:/ + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Network Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.address | IP address that Milvus server monitors. | IP | 0.0.0.0 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.port | Port that Milvus server monitors. Port range (1024, 65535) | Integer | 19530 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.enable | Enable web server or not. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.port | Port that Milvus web server monitors. | Integer | 19121 | +# | Port range (1024, 65535) | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +network: + bind.address: 0.0.0.0 + bind.port: 19530 + http.enable: true + http.port: 19121 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Storage Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Path used to save meta data, vector data and index data. | Path | /var/lib/milvus | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# auto_flush_interval | The interval, in seconds, at which Milvus automatically | Integer | 1 (s) | +# | flushes data to disk. | | | +# | 0 means disable the regular flush. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +storage: + path: /var/lib/milvus + auto_flush_interval: 1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# WAL Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Whether to enable write-ahead logging (WAL) in Milvus. | Boolean | true | +# | If WAL is enabled, Milvus writes all data changes to log | | | +# | files in advance before implementing data changes. WAL | | | +# | ensures the atomicity and durability for Milvus operations.| | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# recovery_error_ignore| Whether to ignore logs with errors that happens during WAL | Boolean | false | +# | recovery. If true, when Milvus restarts for recovery and | | | +# | there are errors in WAL log files, log files with errors | | | +# | are ignored. If false, Milvus does not restart when there | | | +# | are errors in WAL log files. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# buffer_size | Sum total of the read buffer and the write buffer in MBs. | Integer | 256 (MB) | +# | buffer_size must be in range [64, 4096] (MB). | | | +# | If the value you specified is out of range, Milvus | | | +# | automatically uses the boundary value closest to the | | | +# | specified value. It is recommended you set buffer_size to | | | +# | a value greater than the inserted data size of a single | | | +# | insert operation for better performance. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Location of WAL log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +wal: + enable: true + recovery_error_ignore: false + buffer_size: 256MB + path: /var/lib/milvus/wal + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cache Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of CPU memory used for caching data for faster | Integer | 4 (GB) | +# | query. The sum of 'cpu_cache_capacity' and | | | +# | 'insert_buffer_size' must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# insert_buffer_size | Buffer size used for data insertion. | Integer | 1 (GB) | +# | The sum of 'insert_buffer_size' and 'cpu_cache_capacity' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# preload_collection | A comma-separated list of collection names that need to | StringList | | +# | be pre-loaded when Milvus server starts up. | | | +# | '*' means preload all existing tables (single-quote or | | | +# | double-quote required). | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cache: + cache_size: 4GB + insert_buffer_size: 1GB + preload_collection: + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# GPU Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Enable GPU resources or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of GPU memory per card used for cache. | Integer | 1 (GB) | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# gpu_search_threshold | A Milvus performance tuning parameter. This value will be | Integer | 1000 | +# | compared with 'nq' to decide if the search computation will| | | +# | be executed on GPUs only. | | | +# | If nq >= gpu_search_threshold, the search computation will | | | +# | be executed on GPUs only; | | | +# | if nq < gpu_search_threshold, the search computation will | | | +# | be executed on both CPUs and GPUs. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# search_resources | The list of GPU devices used for search computation. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# build_index_resources| The list of GPU devices used for index building. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +gpu: + enable: false + cache_size: 1GB + gpu_search_threshold: 1000 + search_devices: + - gpu0 + build_index_devices: + - gpu0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# level | Log level in Milvus. Must be one of debug, info, warning, | String | debug | +# | error, fatal | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Absolute path to the folder holding the log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | The maximum size of each log file, size range [512, 4096] | Integer | 1024 (MB) | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# log_rotate_num | The maximum number of log files that Milvus keeps for each | Integer | 0 | +# | logging level, num range [0, 1024], 0 means unlimited. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +logs: + level: debug + trace.enable: true + path: /var/lib/milvus/logs + max_log_file_size: 1024MB + log_rotate_num: 0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Metric Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Enable monitoring function or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# address | Pushgateway address | IP | 127.0.0.1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# port | Pushgateway port, port range (1024, 65535) | Integer | 9091 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +metric: + enable: false + address: 127.0.0.1 + port: 9091 + diff --git a/proxy/conf/log_config.conf b/proxy/conf/log_config.conf new file mode 100644 index 0000000000..574ccc2b5f --- /dev/null +++ b/proxy/conf/log_config.conf @@ -0,0 +1,27 @@ +* GLOBAL: + FORMAT = "%datetime | %level | %logger | %msg" + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-global.log" + ENABLED = true + TO_FILE = true + TO_STANDARD_OUTPUT = false + SUBSECOND_PRECISION = 3 + PERFORMANCE_TRACKING = false + MAX_LOG_FILE_SIZE = 209715200 ## Throw log files away after 200MB +* DEBUG: + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-debug.log" + ENABLED = true +* WARNING: + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-warning.log" +* TRACE: + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-trace.log" +* VERBOSE: + FORMAT = "%datetime{%d/%M/%y} | %level-%vlevel | %msg" + TO_FILE = false + TO_STANDARD_OUTPUT = false +## Error logs +* ERROR: + ENABLED = true + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-error.log" +* FATAL: + ENABLED = true + FILENAME = "/usr/local/logs/milvus-%datetime{%y-%M-%d-%H:%m}-fatal.log" diff --git a/proxy/conf/server_config.template b/proxy/conf/server_config.template new file mode 100644 index 0000000000..2ccab5e200 --- /dev/null +++ b/proxy/conf/server_config.template @@ -0,0 +1,188 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +version: 0.5 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cluster Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | If running with Mishards, set true, otherwise false. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# role | Milvus deployment role: rw / ro | Role | rw | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cluster: + enable: false + role: rw + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# General Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# timezone | Use UTC-x or UTC+x to specify a time zone. | Timezone | UTC+8 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# meta_uri | URI for metadata storage, using SQLite (for single server | URI | sqlite://:@:/ | +# | Milvus) or MySQL (for distributed cluster Milvus). | | | +# | Format: dialect://username:password@host:port/database | | | +# | Keep 'dialect://:@:/', 'dialect' can be either 'sqlite' or | | | +# | 'mysql', replace other texts with real values. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +general: + timezone: UTC+8 + meta_uri: sqlite://:@:/ + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Network Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.address | IP address that Milvus server monitors. | IP | 0.0.0.0 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.port | Port that Milvus server monitors. Port range (1024, 65535) | Integer | 19530 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.enable | Enable HTTP server or not. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.port | Port that Milvus HTTP server monitors. | Integer | 19121 | +# | Port range (1024, 65535) | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +network: + bind.address: 0.0.0.0 + bind.port: 19530 + http.enable: true + http.port: 19121 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Storage Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Path used to save meta data, vector data and index data. | Path | /var/lib/milvus | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# auto_flush_interval | The interval, in seconds, at which Milvus automatically | Integer | 1 (s) | +# | flushes data to disk. | | | +# | 0 means disable the regular flush. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +storage: + path: @MILVUS_DB_PATH@ + auto_flush_interval: 1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# WAL Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Whether to enable write-ahead logging (WAL) in Milvus. | Boolean | true | +# | If WAL is enabled, Milvus writes all data changes to log | | | +# | files in advance before implementing data changes. WAL | | | +# | ensures the atomicity and durability for Milvus operations.| | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# recovery_error_ignore| Whether to ignore logs with errors that happens during WAL | Boolean | false | +# | recovery. If true, when Milvus restarts for recovery and | | | +# | there are errors in WAL log files, log files with errors | | | +# | are ignored. If false, Milvus does not restart when there | | | +# | are errors in WAL log files. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# buffer_size | Sum total of the read buffer and the write buffer in Bytes.| String | 256MB | +# | buffer_size must be in range [64MB, 4096MB]. | | | +# | If the value you specified is out of range, Milvus | | | +# | automatically uses the boundary value closest to the | | | +# | specified value. It is recommended you set buffer_size to | | | +# | a value greater than the inserted data size of a single | | | +# | insert operation for better performance. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Location of WAL log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +wal: + enable: true + recovery_error_ignore: false + buffer_size: 256MB + path: @MILVUS_DB_PATH@/wal + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cache Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of CPU memory used for caching data for faster | String | 4GB | +# | query. The sum of 'cache_size' and 'insert_buffer_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# insert_buffer_size | Buffer size used for data insertion. | String | 1GB | +# | The sum of 'insert_buffer_size' and 'cache_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# preload_collection | A comma-separated list of collection names that need to | StringList | | +# | be pre-loaded when Milvus server starts up. | | | +# | '*' means preload all existing tables (single-quote or | | | +# | double-quote required). | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cache: + cache_size: 4GB + insert_buffer_size: 1GB + preload_collection: + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# GPU Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Use GPU devices or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of GPU memory per card used for cache. | String | 1GB | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# gpu_search_threshold | A Milvus performance tuning parameter. This value will be | Integer | 1000 | +# | compared with 'nq' to decide if the search computation will| | | +# | be executed on GPUs only. | | | +# | If nq >= gpu_search_threshold, the search computation will | | | +# | be executed on GPUs only; | | | +# | if nq < gpu_search_threshold, the search computation will | | | +# | be executed on both CPUs and GPUs. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# search_devices | The list of GPU devices used for search computation. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# build_index_devices | The list of GPU devices used for index building. | DeviceList | gpu0 | +# | Must be in format gpux. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +gpu: + enable: @GPU_ENABLE@ + cache_size: 1GB + gpu_search_threshold: 1000 + search_devices: + - gpu0 + build_index_devices: + - gpu0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# level | Log level in Milvus. Must be one of debug, info, warning, | String | debug | +# | error, fatal | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Absolute path to the folder holding the log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | The maximum size of each log file, size range | String | 1024MB | +# | [512MB, 4096MB]. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# log_rotate_num | The maximum number of log files that Milvus keeps for each | Integer | 0 | +# | logging level, num range [0, 1024], 0 means unlimited. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +logs: + level: debug + trace.enable: true + path: @MILVUS_DB_PATH@/logs + max_log_file_size: 1024MB + log_rotate_num: 0 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Metric Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# enable | Enable monitoring function or not. | Boolean | false | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# address | Pushgateway address | IP | 127.0.0.1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# port | Pushgateway port, port range (1024, 65535) | Integer | 9091 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +metric: + enable: false + address: 127.0.0.1 + port: 9091 + diff --git a/proxy/conf/server_config.yaml b/proxy/conf/server_config.yaml new file mode 100644 index 0000000000..ac8dfdfcea --- /dev/null +++ b/proxy/conf/server_config.yaml @@ -0,0 +1,109 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +version: 0.5 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# General Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# timezone | Use UTC-x or UTC+x to specify a time zone. | Timezone | UTC+8 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# meta_uri | URI for metadata storage, using SQLite (for single server | URI | sqlite://:@:/ | +# | Milvus) or MySQL (for distributed cluster Milvus). | | | +# | Format: dialect://username:password@host:port/database | | | +# | Keep 'dialect://:@:/', 'dialect' can be either 'sqlite' or | | | +# | 'mysql', replace other texts with real values. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +general: + timezone: UTC+8 + meta_uri: sqlite://:@:/ + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Network Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.address | IP address that Milvus server monitors. | IP | 0.0.0.0 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# bind.port | Port that Milvus server monitors. Port range (1024, 65535) | Integer | 19530 | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.enable | Enable HTTP server or not. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# http.port | Port that Milvus HTTP server monitors. | Integer | 19121 | +# | Port range (1024, 65535) | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +network: + bind.address: 0.0.0.0 + bind.port: 19530 + http.enable: true + http.port: 19121 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Storage Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Path used to save meta data, vector data and index data. | Path | /var/lib/milvus | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# auto_flush_interval | The interval, in seconds, at which Milvus automatically | Integer | 1 (s) | +# | flushes data to disk. | | | +# | 0 means disable the regular flush. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +storage: + path: /tmp + auto_flush_interval: 1 + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Cache Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# cache_size | The size of CPU memory used for caching data for faster | String | 4GB | +# | query. The sum of 'cache_size' and 'insert_buffer_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# insert_buffer_size | Buffer size used for data insertion. | String | 1GB | +# | The sum of 'insert_buffer_size' and 'cache_size' | | | +# | must be less than system memory size. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# preload_collection | A comma-separated list of collection names that need to | StringList | | +# | be pre-loaded when Milvus server starts up. | | | +# | '*' means preload all existing tables (single-quote or | | | +# | double-quote required). | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +cache: + cache_size: 4GB + insert_buffer_size: 1GB + preload_collection: + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs Config | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# level | Log level in Milvus. Must be one of debug, info, warning, | String | debug | +# | error, fatal | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Absolute path to the folder holding the log files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | The maximum size of each log file, size range | String | 1024MB | +# | [512MB, 4096MB]. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# log_rotate_num | The maximum number of log files that Milvus keeps for each | Integer | 0 | +# | logging level, num range [0, 1024], 0 means unlimited. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +logs: + level: debug + trace.enable: true + path: /tmp/logs + max_log_file_size: 1024MB + log_rotate_num: 0 + +metric: + level: debug + +pulsar: + address: localhost + port: 6650 diff --git a/proxy/conf/tracing_config.json b/proxy/conf/tracing_config.json new file mode 100644 index 0000000000..3a80614390 --- /dev/null +++ b/proxy/conf/tracing_config.json @@ -0,0 +1,26 @@ +{ + "host": "127.0.0.1", + "port": "5666", + "tracer_library": "/path/to/shared_tracing_library", + "tracer_configuration": { + "service_name": "milvus_server", + "sampler": { + "type": "const", + "param": "1" + }, + "disabled": false, + "reporter": { + "localAgentHostPort": "127.0.0.1:6831" + }, + "headers": { + "jaegerDebugHeader": "jaeger_debug_header", + "jaegerBaggageHeader": "jarger_baggage_header", + "TraceContextHeaderName": "trace_context_header_name", + "traceBaggageHeaderPrefix": "trace_baggage_header_prefix" + }, + "baggage_restrictions": { + "denyBaggageOnInitializationFailure": false, + "hostPort": "" + } + } +} diff --git a/proxy/src/CMakeLists.txt b/proxy/src/CMakeLists.txt index e5e00a669c..db9ff20240 100644 --- a/proxy/src/CMakeLists.txt +++ b/proxy/src/CMakeLists.txt @@ -25,6 +25,7 @@ add_subdirectory( db ) # target milvus_engine add_subdirectory( log ) add_subdirectory( server ) add_subdirectory( message_client ) +add_subdirectory( etcd_watcher ) set(link_lib milvus_engine diff --git a/proxy/src/config/ConfigMgr.cpp b/proxy/src/config/ConfigMgr.cpp index 22e830a69e..c3d5b5c046 100644 --- a/proxy/src/config/ConfigMgr.cpp +++ b/proxy/src/config/ConfigMgr.cpp @@ -68,16 +68,22 @@ ConfigMgr ConfigMgr::instance; ConfigMgr::ConfigMgr() { config_list_ = { + /* version */ + {"version", CreateStringConfig("version", false, &config.version.value, "unknown", nullptr, nullptr)}, /* general */ - {"timezone", - CreateStringConfig("timezone", false, &config.timezone.value, "UTC+8", nullptr, nullptr)}, + {"general.timezone", + CreateStringConfig("general.timezone", false, &config.general.timezone.value, "UTC+8", nullptr, nullptr)}, /* network */ - {"network.address", CreateStringConfig("network.address", false, &config.network.address.value, + {"network.bind.address", CreateStringConfig("network.bind.address", false, &config.network.bind.address.value, "0.0.0.0", nullptr, nullptr)}, - {"network.port", CreateIntegerConfig("network.port", false, 0, 65535, &config.network.port.value, + {"network.bind.port", CreateIntegerConfig("network.bind.port", false, 0, 65535, &config.network.bind.port.value, 19530, nullptr, nullptr)}, + {"network.http.enable", + CreateBoolConfig("network.http.enable", false, &config.network.http.enable.value, true, nullptr, nullptr)}, + {"network.http.port", CreateIntegerConfig("network.http.port", false, 0, 65535, &config.network.http.port.value, + 19121, nullptr, nullptr)}, /* pulsar */ @@ -86,6 +92,27 @@ ConfigMgr::ConfigMgr() { {"pulsar.port", CreateIntegerConfig("pulsar.port", false, 0, 65535, &config.pulsar.port.value, 6650, nullptr, nullptr)}, + /* storage */ + {"storage.path", + CreateStringConfig("storage.path", false, &config.storage.path.value, "/var/lib/milvus", nullptr, nullptr)}, + {"storage.auto_flush_interval", + CreateIntegerConfig("storage.auto_flush_interval", true, 0, std::numeric_limits::max(), + &config.storage.auto_flush_interval.value, 1, nullptr, nullptr)}, + + + /* cache */ + {"cache.cache_size", CreateSizeConfig("cache.cache_size", true, 0, std::numeric_limits::max(), + &config.cache.cache_size.value, 4 * GB, nullptr, nullptr)}, + {"cache.cpu_cache_threshold", + CreateFloatingConfig("cache.cpu_cache_threshold", false, 0.0, 1.0, &config.cache.cpu_cache_threshold.value, + 0.7, nullptr, nullptr)}, + {"cache.insert_buffer_size", + CreateSizeConfig("cache.insert_buffer_size", false, 0, std::numeric_limits::max(), + &config.cache.insert_buffer_size.value, 1 * GB, nullptr, nullptr)}, + {"cache.cache_insert_data", CreateBoolConfig("cache.cache_insert_data", false, + &config.cache.cache_insert_data.value, false, nullptr, nullptr)}, + {"cache.preload_collection", CreateStringConfig("cache.preload_collection", false, + &config.cache.preload_collection.value, "", nullptr, nullptr)}, /* log */ {"logs.level", CreateStringConfig("logs.level", false, &config.logs.level.value, "debug", nullptr, nullptr)}, @@ -135,19 +162,13 @@ ConfigMgr::Load(const std::string& path) { auto yaml = YAML::LoadFile(path); /* make it flattened */ std::unordered_map flattened; - // auto proxy_yaml = yaml["porxy"]; - auto other_yaml = YAML::Node{}; - other_yaml["pulsar"] = yaml["pulsar"]; - Flatten(yaml["proxy"], flattened, ""); - Flatten(other_yaml, flattened, ""); - // Flatten(yaml["proxy"], flattened, ""); + Flatten(yaml, flattened, ""); /* update config */ for (auto& it : flattened) Set(it.first, it.second, false); } void ConfigMgr::Set(const std::string& name, const std::string& value, bool update) { - std::cout<<"InSet Config "<< name <; using Floating = ConfigValue; - String timezone{"unknown"}; + String version{"unknown"}; + + struct General { + String timezone{"unknown"}; + } general; struct Network { - String address{"unknown"}; - Integer port{0}; + struct Bind { + String address{"unknown"}; + Integer port{0}; + } bind; + struct Http { + Bool enable{false}; + Integer port{0}; + } http; } network; struct Pulsar{ @@ -76,6 +86,18 @@ struct ServerConfig { Integer port{6650}; }pulsar; + struct Storage { + String path{"unknown"}; + Integer auto_flush_interval{0}; + } storage; + + struct Cache { + Integer cache_size{0}; + Floating cpu_cache_threshold{0.0}; + Integer insert_buffer_size{0}; + Bool cache_insert_data{false}; + String preload_collection{"unknown"}; + } cache; struct Engine { Integer build_index_threshold{4096}; diff --git a/proxy/src/etcd_watcher/CMakeLists.txt b/proxy/src/etcd_watcher/CMakeLists.txt new file mode 100644 index 0000000000..ab142b1ba6 --- /dev/null +++ b/proxy/src/etcd_watcher/CMakeLists.txt @@ -0,0 +1,14 @@ +AUX_SOURCE_DIRECTORY(. watcher_src) +add_executable(test_watcher + ${watcher_src} + ${PROJECT_SOURCE_DIR}/src/grpc/etcd.pb.cc + ${PROJECT_SOURCE_DIR}/src/grpc/etcd.grpc.pb.cc + ) + +target_link_libraries( + test_watcher + PRIVATE + libprotobuf + grpc++_reflection + grpc++ +) \ No newline at end of file diff --git a/proxy/src/etcd_watcher/Watcher.cpp b/proxy/src/etcd_watcher/Watcher.cpp new file mode 100644 index 0000000000..db4b63d7a6 --- /dev/null +++ b/proxy/src/etcd_watcher/Watcher.cpp @@ -0,0 +1,88 @@ +#include "Watcher.h" + +#include +#include +#include "grpc/etcd.grpc.pb.h" + +namespace milvus { +namespace master { + +Watcher::Watcher(const std::string &address, + const std::string &key, + std::function callback) { + auto channel = grpc::CreateChannel(address, grpc::InsecureChannelCredentials()); + stub_ = etcdserverpb::Watch::NewStub(channel); + + call_ = std::make_unique(key, stub_.get()); + work_thread_ = std::thread([&]() { + call_->WaitForResponse(callback); + }); +} + +void Watcher::Cancel() { + call_->CancelWatch(); +} + +Watcher::~Watcher() { + Cancel(); + work_thread_.join(); +} + +AsyncWatchAction::AsyncWatchAction(const std::string &key, etcdserverpb::Watch::Stub *stub) { + // tag `1` means to wire a rpc + stream_ = stub->AsyncWatch(&context_, &cq_, (void *) 1); + etcdserverpb::WatchRequest req; + req.mutable_create_request()->set_key(key); + std::string range_end(key); + int ascii = (int) range_end[range_end.length() - 1]; + range_end.back() = ascii + 1; + req.mutable_create_request()->set_range_end(range_end); + + void *got_tag; + bool ok = false; + if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *) 1) { + // tag `2` means write watch request to stream + stream_->Write(req, (void *) 2); + } else { + throw std::runtime_error("failed to create a watch connection"); + } + + if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *) 2) { + stream_->Read(&reply_, (void *) this); + } else { + throw std::runtime_error("failed to write WatchCreateRequest to server"); + } +} + +void AsyncWatchAction::WaitForResponse(std::function callback) { + void *got_tag; + bool ok = false; + + while (cq_.Next(&got_tag, &ok)) { + if (!ok) { + break; + } + if (got_tag == (void *) 3) { + cancled_.store(true); + cq_.Shutdown(); + break; + } else if (got_tag == (void *) this) // read tag + { + if (reply_.events_size()) { + callback(reply_); + } + stream_->Read(&reply_, (void *) this); + } + } +} + +void AsyncWatchAction::CancelWatch() { + if (!cancled_.load()) { + // tag `3` mean write done + stream_->WritesDone((void *) 3); + cancled_.store(true); + } +} + +} +} \ No newline at end of file diff --git a/proxy/src/etcd_watcher/Watcher.h b/proxy/src/etcd_watcher/Watcher.h new file mode 100644 index 0000000000..869524ab06 --- /dev/null +++ b/proxy/src/etcd_watcher/Watcher.h @@ -0,0 +1,39 @@ +#pragma once +#include "grpc/etcd.grpc.pb.h" +#include +#include + +namespace milvus { +namespace master { + +class AsyncWatchAction; + +class Watcher { + public: + Watcher(std::string const &address, + std::string const &key, + std::function callback); + void Cancel(); + ~Watcher(); + + private: + std::unique_ptr stub_; + std::unique_ptr call_; + std::thread work_thread_; +}; + +class AsyncWatchAction { + public: + AsyncWatchAction(const std::string &key, etcdserverpb::Watch::Stub* stub); + void WaitForResponse(std::function callback); + void CancelWatch(); + private: + // Status status; + grpc::ClientContext context_; + grpc::CompletionQueue cq_; + etcdserverpb::WatchResponse reply_; + std::unique_ptr> stream_; + std::atomic cancled_ = false; +}; +} +} \ No newline at end of file diff --git a/proxy/src/etcd_watcher/test_watcher.cpp b/proxy/src/etcd_watcher/test_watcher.cpp new file mode 100644 index 0000000000..aae0bdd858 --- /dev/null +++ b/proxy/src/etcd_watcher/test_watcher.cpp @@ -0,0 +1,31 @@ +// Steps to test this file: +// 1. start a etcdv3 server +// 2. run this test +// 3. modify test key using etcdctlv3 or etcd-clientv3(Must using v3 api) +// TODO: move this test to unittest + +#include "Watcher.h" + +using namespace milvus::master; +int main() { + try { + Watcher watcher("127.0.0.1:2379", "SomeKey", [](etcdserverpb::WatchResponse res) { + std::cerr << "Key1 changed!" << std::endl; + std::cout << "Event size: " << res.events_size() << std::endl; + for (auto &event: res.events()) { + std::cout << + event.kv().key() << ":" << + event.kv().value() << std::endl; + } + }); + while (true) { + std::this_thread::sleep_for(std::chrono::milliseconds(60000)); + watcher.Cancel(); + break; + } + } + catch (const std::exception &e) { + std::cout << e.what(); + } + +} diff --git a/proxy/src/grpc/etcd.grpc.pb.cc b/proxy/src/grpc/etcd.grpc.pb.cc new file mode 100644 index 0000000000..d9a717cfc8 --- /dev/null +++ b/proxy/src/grpc/etcd.grpc.pb.cc @@ -0,0 +1,70 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: etcd.proto + +#include "etcd.pb.h" +#include "etcd.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace etcdserverpb { + +static const char* Watch_method_names[] = { + "/etcdserverpb.Watch/Watch", +}; + +std::unique_ptr< Watch::Stub> Watch::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< Watch::Stub> stub(new Watch::Stub(channel)); + return stub; +} + +Watch::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel), rpcmethod_Watch_(Watch_method_names[0], ::grpc::internal::RpcMethod::BIDI_STREAMING, channel) + {} + +::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::WatchRaw(::grpc::ClientContext* context) { + return ::grpc_impl::internal::ClientReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), rpcmethod_Watch_, context); +} + +void Watch::Stub::experimental_async::Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) { + ::grpc_impl::internal::ClientCallbackReaderWriterFactory< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_Watch_, context, reactor); +} + +::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), cq, rpcmethod_Watch_, context, true, tag); +} + +::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), cq, rpcmethod_Watch_, context, false, nullptr); +} + +Watch::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + Watch_method_names[0], + ::grpc::internal::RpcMethod::BIDI_STREAMING, + new ::grpc::internal::BidiStreamingHandler< Watch::Service, ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>( + std::mem_fn(&Watch::Service::Watch), this))); +} + +Watch::Service::~Service() { +} + +::grpc::Status Watch::Service::Watch(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream) { + (void) context; + (void) stream; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace etcdserverpb + diff --git a/proxy/src/grpc/etcd.grpc.pb.h b/proxy/src/grpc/etcd.grpc.pb.h new file mode 100644 index 0000000000..53ebd1aeba --- /dev/null +++ b/proxy/src/grpc/etcd.grpc.pb.h @@ -0,0 +1,235 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: etcd.proto +#ifndef GRPC_etcd_2eproto__INCLUDED +#define GRPC_etcd_2eproto__INCLUDED + +#include "etcd.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class CompletionQueue; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc + +namespace etcdserverpb { + +class Watch final { + public: + static constexpr char const* service_full_name() { + return "etcdserverpb.Watch"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + // Watch watches for events happening or that have happened. Both input and output + // are streams; the input stream is for creating and canceling watchers and the output + // stream sends events. One watch RPC can watch on multiple key ranges, streaming events + // for several watches at once. The entire event history can be watched starting from the + // last compaction revision. + std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> Watch(::grpc::ClientContext* context) { + return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(WatchRaw(context)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> AsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(AsyncWatchRaw(context, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> PrepareAsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(PrepareAsyncWatchRaw(context, cq)); + } + class experimental_async_interface { + public: + virtual ~experimental_async_interface() {} + // Watch watches for events happening or that have happened. Both input and output + // are streams; the input stream is for creating and canceling watchers and the output + // stream sends events. One watch RPC can watch on multiple key ranges, streaming events + // for several watches at once. The entire event history can be watched starting from the + // last compaction revision. + virtual void Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) = 0; + }; + virtual class experimental_async_interface* experimental_async() { return nullptr; } + private: + virtual ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* WatchRaw(::grpc::ClientContext* context) = 0; + virtual ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; + virtual ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + std::unique_ptr< ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> Watch(::grpc::ClientContext* context) { + return std::unique_ptr< ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(WatchRaw(context)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> AsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(AsyncWatchRaw(context, cq, tag)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> PrepareAsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(PrepareAsyncWatchRaw(context, cq)); + } + class experimental_async final : + public StubInterface::experimental_async_interface { + public: + void Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) override; + private: + friend class Stub; + explicit experimental_async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class experimental_async_interface* experimental_async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class experimental_async async_stub_{this}; + ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* WatchRaw(::grpc::ClientContext* context) override; + ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; + ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_Watch_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + // Watch watches for events happening or that have happened. Both input and output + // are streams; the input stream is for creating and canceling watchers and the output + // stream sends events. One watch RPC can watch on multiple key ranges, streaming events + // for several watches at once. The entire event history can be watched starting from the + // last compaction revision. + virtual ::grpc::Status Watch(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream); + }; + template + class WithAsyncMethod_Watch : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_Watch() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_Watch() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestWatch(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_Watch AsyncService; + template + class ExperimentalWithCallbackMethod_Watch : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithCallbackMethod_Watch() { + ::grpc::Service::experimental().MarkMethodCallback(0, + new ::grpc_impl::internal::CallbackBidiHandler< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>( + [this] { return this->Watch(); })); + } + ~ExperimentalWithCallbackMethod_Watch() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerBidiReactor< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch() { + return new ::grpc_impl::internal::UnimplementedBidiReactor< + ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>;} + }; + typedef ExperimentalWithCallbackMethod_Watch ExperimentalCallbackService; + template + class WithGenericMethod_Watch : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_Watch() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_Watch() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_Watch : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_Watch() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_Watch() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestWatch(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); + } + }; + template + class ExperimentalWithRawCallbackMethod_Watch : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithRawCallbackMethod_Watch() { + ::grpc::Service::experimental().MarkMethodRawCallback(0, + new ::grpc_impl::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this] { return this->Watch(); })); + } + ~ExperimentalWithRawCallbackMethod_Watch() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* Watch() { + return new ::grpc_impl::internal::UnimplementedBidiReactor< + ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} + }; + typedef Service StreamedUnaryService; + typedef Service SplitStreamedService; + typedef Service StreamedService; +}; + +} // namespace etcdserverpb + + +#endif // GRPC_etcd_2eproto__INCLUDED diff --git a/proxy/src/grpc/etcd.pb.cc b/proxy/src/grpc/etcd.pb.cc new file mode 100644 index 0000000000..489eda74c2 --- /dev/null +++ b/proxy/src/grpc/etcd.pb.cc @@ -0,0 +1,3737 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: etcd.proto + +#include "etcd.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Event_etcd_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValue_etcd_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ResponseHeader_etcd_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCancelRequest_etcd_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCreateRequest_etcd_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchProgressRequest_etcd_2eproto; +namespace etcdserverpb { +class WatchRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; + const ::etcdserverpb::WatchCreateRequest* create_request_; + const ::etcdserverpb::WatchCancelRequest* cancel_request_; + const ::etcdserverpb::WatchProgressRequest* progress_request_; +} _WatchRequest_default_instance_; +class WatchCreateRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _WatchCreateRequest_default_instance_; +class WatchCancelRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _WatchCancelRequest_default_instance_; +class WatchProgressRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _WatchProgressRequest_default_instance_; +class WatchResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _WatchResponse_default_instance_; +class ResponseHeaderDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _ResponseHeader_default_instance_; +class KeyValueDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _KeyValue_default_instance_; +class EventDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Event_default_instance_; +} // namespace etcdserverpb +static void InitDefaultsscc_info_Event_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_Event_default_instance_; + new (ptr) ::etcdserverpb::Event(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::Event::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Event_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Event_etcd_2eproto}, { + &scc_info_KeyValue_etcd_2eproto.base,}}; + +static void InitDefaultsscc_info_KeyValue_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_KeyValue_default_instance_; + new (ptr) ::etcdserverpb::KeyValue(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::KeyValue::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValue_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_KeyValue_etcd_2eproto}, {}}; + +static void InitDefaultsscc_info_ResponseHeader_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_ResponseHeader_default_instance_; + new (ptr) ::etcdserverpb::ResponseHeader(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::ResponseHeader::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ResponseHeader_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_ResponseHeader_etcd_2eproto}, {}}; + +static void InitDefaultsscc_info_WatchCancelRequest_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_WatchCancelRequest_default_instance_; + new (ptr) ::etcdserverpb::WatchCancelRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::WatchCancelRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCancelRequest_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchCancelRequest_etcd_2eproto}, {}}; + +static void InitDefaultsscc_info_WatchCreateRequest_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_WatchCreateRequest_default_instance_; + new (ptr) ::etcdserverpb::WatchCreateRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::WatchCreateRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCreateRequest_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchCreateRequest_etcd_2eproto}, {}}; + +static void InitDefaultsscc_info_WatchProgressRequest_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_WatchProgressRequest_default_instance_; + new (ptr) ::etcdserverpb::WatchProgressRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::WatchProgressRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchProgressRequest_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchProgressRequest_etcd_2eproto}, {}}; + +static void InitDefaultsscc_info_WatchRequest_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_WatchRequest_default_instance_; + new (ptr) ::etcdserverpb::WatchRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::WatchRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_WatchRequest_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_WatchRequest_etcd_2eproto}, { + &scc_info_WatchCreateRequest_etcd_2eproto.base, + &scc_info_WatchCancelRequest_etcd_2eproto.base, + &scc_info_WatchProgressRequest_etcd_2eproto.base,}}; + +static void InitDefaultsscc_info_WatchResponse_etcd_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::etcdserverpb::_WatchResponse_default_instance_; + new (ptr) ::etcdserverpb::WatchResponse(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::etcdserverpb::WatchResponse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_WatchResponse_etcd_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_WatchResponse_etcd_2eproto}, { + &scc_info_ResponseHeader_etcd_2eproto.base, + &scc_info_Event_etcd_2eproto.base,}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_etcd_2eproto[8]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_etcd_2eproto[2]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_etcd_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_etcd_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, create_request_), + offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, cancel_request_), + offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, progress_request_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, request_union_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, key_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, range_end_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, start_revision_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, progress_notify_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, filters_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, prev_kv_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, watch_id_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, fragment_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCancelRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCancelRequest, watch_id_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchProgressRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, header_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, watch_id_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, created_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, canceled_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, compact_revision_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, cancel_reason_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, fragment_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, events_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, cluster_id_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, member_id_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, revision_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, raft_term_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, key_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, create_revision_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, mod_revision_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, version_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, value_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, lease_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, type_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, kv_), + PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, prev_kv_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::etcdserverpb::WatchRequest)}, + { 9, -1, sizeof(::etcdserverpb::WatchCreateRequest)}, + { 22, -1, sizeof(::etcdserverpb::WatchCancelRequest)}, + { 28, -1, sizeof(::etcdserverpb::WatchProgressRequest)}, + { 33, -1, sizeof(::etcdserverpb::WatchResponse)}, + { 46, -1, sizeof(::etcdserverpb::ResponseHeader)}, + { 55, -1, sizeof(::etcdserverpb::KeyValue)}, + { 66, -1, sizeof(::etcdserverpb::Event)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::etcdserverpb::_WatchRequest_default_instance_), + reinterpret_cast(&::etcdserverpb::_WatchCreateRequest_default_instance_), + reinterpret_cast(&::etcdserverpb::_WatchCancelRequest_default_instance_), + reinterpret_cast(&::etcdserverpb::_WatchProgressRequest_default_instance_), + reinterpret_cast(&::etcdserverpb::_WatchResponse_default_instance_), + reinterpret_cast(&::etcdserverpb::_ResponseHeader_default_instance_), + reinterpret_cast(&::etcdserverpb::_KeyValue_default_instance_), + reinterpret_cast(&::etcdserverpb::_Event_default_instance_), +}; + +const char descriptor_table_protodef_etcd_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\netcd.proto\022\014etcdserverpb\"\327\001\n\014WatchRequ" + "est\022:\n\016create_request\030\001 \001(\0132 .etcdserver" + "pb.WatchCreateRequestH\000\022:\n\016cancel_reques" + "t\030\002 \001(\0132 .etcdserverpb.WatchCancelReques" + "tH\000\022>\n\020progress_request\030\003 \001(\0132\".etcdserv" + "erpb.WatchProgressRequestH\000B\017\n\rrequest_u" + "nion\"\377\001\n\022WatchCreateRequest\022\013\n\003key\030\001 \001(\014" + "\022\021\n\trange_end\030\002 \001(\014\022\026\n\016start_revision\030\003 " + "\001(\003\022\027\n\017progress_notify\030\004 \001(\010\022<\n\007filters\030" + "\005 \003(\0162+.etcdserverpb.WatchCreateRequest." + "FilterType\022\017\n\007prev_kv\030\006 \001(\010\022\020\n\010watch_id\030" + "\007 \001(\003\022\020\n\010fragment\030\010 \001(\010\"%\n\nFilterType\022\t\n" + "\005NOPUT\020\000\022\014\n\010NODELETE\020\001\"&\n\022WatchCancelReq" + "uest\022\020\n\010watch_id\030\001 \001(\003\"\026\n\024WatchProgressR" + "equest\"\332\001\n\rWatchResponse\022,\n\006header\030\001 \001(\013" + "2\034.etcdserverpb.ResponseHeader\022\020\n\010watch_" + "id\030\002 \001(\003\022\017\n\007created\030\003 \001(\010\022\020\n\010canceled\030\004 " + "\001(\010\022\030\n\020compact_revision\030\005 \001(\003\022\025\n\rcancel_" + "reason\030\006 \001(\t\022\020\n\010fragment\030\007 \001(\010\022#\n\006events" + "\030\013 \003(\0132\023.etcdserverpb.Event\"\\\n\016ResponseH" + "eader\022\022\n\ncluster_id\030\001 \001(\004\022\021\n\tmember_id\030\002" + " \001(\004\022\020\n\010revision\030\003 \001(\003\022\021\n\traft_term\030\004 \001(" + "\004\"u\n\010KeyValue\022\013\n\003key\030\001 \001(\014\022\027\n\017create_rev" + "ision\030\002 \001(\003\022\024\n\014mod_revision\030\003 \001(\003\022\017\n\007ver" + "sion\030\004 \001(\003\022\r\n\005value\030\005 \001(\014\022\r\n\005lease\030\006 \001(\003" + "\"\243\001\n\005Event\022+\n\004type\030\001 \001(\0162\035.etcdserverpb." + "Event.EventType\022\"\n\002kv\030\002 \001(\0132\026.etcdserver" + "pb.KeyValue\022\'\n\007prev_kv\030\003 \001(\0132\026.etcdserve" + "rpb.KeyValue\" \n\tEventType\022\007\n\003PUT\020\000\022\n\n\006DE" + "LETE\020\0012O\n\005Watch\022F\n\005Watch\022\032.etcdserverpb." + "WatchRequest\032\033.etcdserverpb.WatchRespons" + "e\"\000(\0010\001b\006proto3" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_etcd_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_etcd_2eproto_sccs[8] = { + &scc_info_Event_etcd_2eproto.base, + &scc_info_KeyValue_etcd_2eproto.base, + &scc_info_ResponseHeader_etcd_2eproto.base, + &scc_info_WatchCancelRequest_etcd_2eproto.base, + &scc_info_WatchCreateRequest_etcd_2eproto.base, + &scc_info_WatchProgressRequest_etcd_2eproto.base, + &scc_info_WatchRequest_etcd_2eproto.base, + &scc_info_WatchResponse_etcd_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_etcd_2eproto_once; +static bool descriptor_table_etcd_2eproto_initialized = false; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_etcd_2eproto = { + &descriptor_table_etcd_2eproto_initialized, descriptor_table_protodef_etcd_2eproto, "etcd.proto", 1255, + &descriptor_table_etcd_2eproto_once, descriptor_table_etcd_2eproto_sccs, descriptor_table_etcd_2eproto_deps, 8, 0, + schemas, file_default_instances, TableStruct_etcd_2eproto::offsets, + file_level_metadata_etcd_2eproto, 8, file_level_enum_descriptors_etcd_2eproto, file_level_service_descriptors_etcd_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_etcd_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_etcd_2eproto), true); +namespace etcdserverpb { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* WatchCreateRequest_FilterType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); + return file_level_enum_descriptors_etcd_2eproto[0]; +} +bool WatchCreateRequest_FilterType_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +constexpr WatchCreateRequest_FilterType WatchCreateRequest::NOPUT; +constexpr WatchCreateRequest_FilterType WatchCreateRequest::NODELETE; +constexpr WatchCreateRequest_FilterType WatchCreateRequest::FilterType_MIN; +constexpr WatchCreateRequest_FilterType WatchCreateRequest::FilterType_MAX; +constexpr int WatchCreateRequest::FilterType_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Event_EventType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); + return file_level_enum_descriptors_etcd_2eproto[1]; +} +bool Event_EventType_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +constexpr Event_EventType Event::PUT; +constexpr Event_EventType Event::DELETE; +constexpr Event_EventType Event::EventType_MIN; +constexpr Event_EventType Event::EventType_MAX; +constexpr int Event::EventType_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) + +// =================================================================== + +void WatchRequest::InitAsDefaultInstance() { + ::etcdserverpb::_WatchRequest_default_instance_.create_request_ = const_cast< ::etcdserverpb::WatchCreateRequest*>( + ::etcdserverpb::WatchCreateRequest::internal_default_instance()); + ::etcdserverpb::_WatchRequest_default_instance_.cancel_request_ = const_cast< ::etcdserverpb::WatchCancelRequest*>( + ::etcdserverpb::WatchCancelRequest::internal_default_instance()); + ::etcdserverpb::_WatchRequest_default_instance_.progress_request_ = const_cast< ::etcdserverpb::WatchProgressRequest*>( + ::etcdserverpb::WatchProgressRequest::internal_default_instance()); +} +class WatchRequest::_Internal { + public: + static const ::etcdserverpb::WatchCreateRequest& create_request(const WatchRequest* msg); + static const ::etcdserverpb::WatchCancelRequest& cancel_request(const WatchRequest* msg); + static const ::etcdserverpb::WatchProgressRequest& progress_request(const WatchRequest* msg); +}; + +const ::etcdserverpb::WatchCreateRequest& +WatchRequest::_Internal::create_request(const WatchRequest* msg) { + return *msg->request_union_.create_request_; +} +const ::etcdserverpb::WatchCancelRequest& +WatchRequest::_Internal::cancel_request(const WatchRequest* msg) { + return *msg->request_union_.cancel_request_; +} +const ::etcdserverpb::WatchProgressRequest& +WatchRequest::_Internal::progress_request(const WatchRequest* msg) { + return *msg->request_union_.progress_request_; +} +void WatchRequest::set_allocated_create_request(::etcdserverpb::WatchCreateRequest* create_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_request_union(); + if (create_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + create_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, create_request, submessage_arena); + } + set_has_create_request(); + request_union_.create_request_ = create_request; + } + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.create_request) +} +void WatchRequest::set_allocated_cancel_request(::etcdserverpb::WatchCancelRequest* cancel_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_request_union(); + if (cancel_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + cancel_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, cancel_request, submessage_arena); + } + set_has_cancel_request(); + request_union_.cancel_request_ = cancel_request; + } + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.cancel_request) +} +void WatchRequest::set_allocated_progress_request(::etcdserverpb::WatchProgressRequest* progress_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_request_union(); + if (progress_request) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + progress_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, progress_request, submessage_arena); + } + set_has_progress_request(); + request_union_.progress_request_ = progress_request; + } + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.progress_request) +} +WatchRequest::WatchRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.WatchRequest) +} +WatchRequest::WatchRequest(const WatchRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + clear_has_request_union(); + switch (from.request_union_case()) { + case kCreateRequest: { + mutable_create_request()->::etcdserverpb::WatchCreateRequest::MergeFrom(from.create_request()); + break; + } + case kCancelRequest: { + mutable_cancel_request()->::etcdserverpb::WatchCancelRequest::MergeFrom(from.cancel_request()); + break; + } + case kProgressRequest: { + mutable_progress_request()->::etcdserverpb::WatchProgressRequest::MergeFrom(from.progress_request()); + break; + } + case REQUEST_UNION_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchRequest) +} + +void WatchRequest::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchRequest_etcd_2eproto.base); + clear_has_request_union(); +} + +WatchRequest::~WatchRequest() { + // @@protoc_insertion_point(destructor:etcdserverpb.WatchRequest) + SharedDtor(); +} + +void WatchRequest::SharedDtor() { + if (has_request_union()) { + clear_request_union(); + } +} + +void WatchRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const WatchRequest& WatchRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchRequest_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void WatchRequest::clear_request_union() { +// @@protoc_insertion_point(one_of_clear_start:etcdserverpb.WatchRequest) + switch (request_union_case()) { + case kCreateRequest: { + delete request_union_.create_request_; + break; + } + case kCancelRequest: { + delete request_union_.cancel_request_; + break; + } + case kProgressRequest: { + delete request_union_.progress_request_; + break; + } + case REQUEST_UNION_NOT_SET: { + break; + } + } + _oneof_case_[0] = REQUEST_UNION_NOT_SET; +} + + +void WatchRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_request_union(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* WatchRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .etcdserverpb.WatchCreateRequest create_request = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ctx->ParseMessage(mutable_create_request(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ctx->ParseMessage(mutable_cancel_request(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .etcdserverpb.WatchProgressRequest progress_request = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(mutable_progress_request(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool WatchRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.WatchRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .etcdserverpb.WatchCreateRequest create_request = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_create_request())); + } else { + goto handle_unusual; + } + break; + } + + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_cancel_request())); + } else { + goto handle_unusual; + } + break; + } + + // .etcdserverpb.WatchProgressRequest progress_request = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_progress_request())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.WatchRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void WatchRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.WatchCreateRequest create_request = 1; + if (has_create_request()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, _Internal::create_request(this), output); + } + + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + if (has_cancel_request()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, _Internal::cancel_request(this), output); + } + + // .etcdserverpb.WatchProgressRequest progress_request = 3; + if (has_progress_request()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, _Internal::progress_request(this), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* WatchRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.WatchCreateRequest create_request = 1; + if (has_create_request()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, _Internal::create_request(this), target); + } + + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + if (has_cancel_request()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, _Internal::cancel_request(this), target); + } + + // .etcdserverpb.WatchProgressRequest progress_request = 3; + if (has_progress_request()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, _Internal::progress_request(this), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchRequest) + return target; +} + +size_t WatchRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (request_union_case()) { + // .etcdserverpb.WatchCreateRequest create_request = 1; + case kCreateRequest: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *request_union_.create_request_); + break; + } + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + case kCancelRequest: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *request_union_.cancel_request_); + break; + } + // .etcdserverpb.WatchProgressRequest progress_request = 3; + case kProgressRequest: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *request_union_.progress_request_); + break; + } + case REQUEST_UNION_NOT_SET: { + break; + } + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WatchRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchRequest) + GOOGLE_DCHECK_NE(&from, this); + const WatchRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchRequest) + MergeFrom(*source); + } +} + +void WatchRequest::MergeFrom(const WatchRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.request_union_case()) { + case kCreateRequest: { + mutable_create_request()->::etcdserverpb::WatchCreateRequest::MergeFrom(from.create_request()); + break; + } + case kCancelRequest: { + mutable_cancel_request()->::etcdserverpb::WatchCancelRequest::MergeFrom(from.cancel_request()); + break; + } + case kProgressRequest: { + mutable_progress_request()->::etcdserverpb::WatchProgressRequest::MergeFrom(from.progress_request()); + break; + } + case REQUEST_UNION_NOT_SET: { + break; + } + } +} + +void WatchRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WatchRequest::CopyFrom(const WatchRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WatchRequest::IsInitialized() const { + return true; +} + +void WatchRequest::InternalSwap(WatchRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(request_union_, other->request_union_); + swap(_oneof_case_[0], other->_oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata WatchRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void WatchCreateRequest::InitAsDefaultInstance() { +} +class WatchCreateRequest::_Internal { + public: +}; + +WatchCreateRequest::WatchCreateRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.WatchCreateRequest) +} +WatchCreateRequest::WatchCreateRequest(const WatchCreateRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + filters_(from.filters_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.key().empty()) { + key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); + } + range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.range_end().empty()) { + range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); + } + ::memcpy(&start_revision_, &from.start_revision_, + static_cast(reinterpret_cast(&fragment_) - + reinterpret_cast(&start_revision_)) + sizeof(fragment_)); + // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchCreateRequest) +} + +void WatchCreateRequest::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchCreateRequest_etcd_2eproto.base); + key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&start_revision_, 0, static_cast( + reinterpret_cast(&fragment_) - + reinterpret_cast(&start_revision_)) + sizeof(fragment_)); +} + +WatchCreateRequest::~WatchCreateRequest() { + // @@protoc_insertion_point(destructor:etcdserverpb.WatchCreateRequest) + SharedDtor(); +} + +void WatchCreateRequest::SharedDtor() { + key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + range_end_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void WatchCreateRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const WatchCreateRequest& WatchCreateRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchCreateRequest_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void WatchCreateRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchCreateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + filters_.Clear(); + key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&start_revision_, 0, static_cast( + reinterpret_cast(&fragment_) - + reinterpret_cast(&start_revision_)) + sizeof(fragment_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* WatchCreateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // bytes key = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_key(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bytes range_end = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_range_end(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 start_revision = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + start_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool progress_notify = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + progress_notify_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(mutable_filters(), ptr, ctx); + CHK_(ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + add_filters(static_cast<::etcdserverpb::WatchCreateRequest_FilterType>(val)); + } else goto handle_unusual; + continue; + // bool prev_kv = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + prev_kv_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 watch_id = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool fragment = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + fragment_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool WatchCreateRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.WatchCreateRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bytes key = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_key())); + } else { + goto handle_unusual; + } + break; + } + + // bytes range_end = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_range_end())); + } else { + goto handle_unusual; + } + break; + } + + // int64 start_revision = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &start_revision_))); + } else { + goto handle_unusual; + } + break; + } + + // bool progress_notify = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &progress_notify_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { + ::PROTOBUF_NAMESPACE_ID::uint32 length; + DO_(input->ReadVarint32(&length)); + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream::Limit limit = input->PushLimit(static_cast(length)); + while (input->BytesUntilLimit() > 0) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_filters(static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(value)); + } + input->PopLimit(limit); + } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + add_filters(static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // bool prev_kv = 6; + case 6: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &prev_kv_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 watch_id = 7; + case 7: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &watch_id_))); + } else { + goto handle_unusual; + } + break; + } + + // bool fragment = 8; + case 8: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &fragment_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.WatchCreateRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchCreateRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void WatchCreateRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchCreateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bytes key = 1; + if (this->key().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->key(), output); + } + + // bytes range_end = 2; + if (this->range_end().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->range_end(), output); + } + + // int64 start_revision = 3; + if (this->start_revision() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->start_revision(), output); + } + + // bool progress_notify = 4; + if (this->progress_notify() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(4, this->progress_notify(), output); + } + + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + if (this->filters_size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag( + 5, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + output); + output->WriteVarint32(_filters_cached_byte_size_.load( + std::memory_order_relaxed)); + } + for (int i = 0, n = this->filters_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTag( + this->filters(i), output); + } + + // bool prev_kv = 6; + if (this->prev_kv() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(6, this->prev_kv(), output); + } + + // int64 watch_id = 7; + if (this->watch_id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(7, this->watch_id(), output); + } + + // bool fragment = 8; + if (this->fragment() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(8, this->fragment(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchCreateRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* WatchCreateRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchCreateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bytes key = 1; + if (this->key().size() > 0) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 1, this->key(), target); + } + + // bytes range_end = 2; + if (this->range_end().size() > 0) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 2, this->range_end(), target); + } + + // int64 start_revision = 3; + if (this->start_revision() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->start_revision(), target); + } + + // bool progress_notify = 4; + if (this->progress_notify() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->progress_notify(), target); + } + + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + if (this->filters_size() > 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( + 5, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( _filters_cached_byte_size_.load(std::memory_order_relaxed), + target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTagToArray( + this->filters_, target); + } + + // bool prev_kv = 6; + if (this->prev_kv() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->prev_kv(), target); + } + + // int64 watch_id = 7; + if (this->watch_id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->watch_id(), target); + } + + // bool fragment = 8; + if (this->fragment() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->fragment(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchCreateRequest) + return target; +} + +size_t WatchCreateRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchCreateRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + { + size_t data_size = 0; + unsigned int count = static_cast(this->filters_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( + this->filters(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _filters_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // bytes key = 1; + if (this->key().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->key()); + } + + // bytes range_end = 2; + if (this->range_end().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->range_end()); + } + + // int64 start_revision = 3; + if (this->start_revision() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->start_revision()); + } + + // int64 watch_id = 7; + if (this->watch_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->watch_id()); + } + + // bool progress_notify = 4; + if (this->progress_notify() != 0) { + total_size += 1 + 1; + } + + // bool prev_kv = 6; + if (this->prev_kv() != 0) { + total_size += 1 + 1; + } + + // bool fragment = 8; + if (this->fragment() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WatchCreateRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchCreateRequest) + GOOGLE_DCHECK_NE(&from, this); + const WatchCreateRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchCreateRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchCreateRequest) + MergeFrom(*source); + } +} + +void WatchCreateRequest::MergeFrom(const WatchCreateRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchCreateRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + filters_.MergeFrom(from.filters_); + if (from.key().size() > 0) { + + key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); + } + if (from.range_end().size() > 0) { + + range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); + } + if (from.start_revision() != 0) { + set_start_revision(from.start_revision()); + } + if (from.watch_id() != 0) { + set_watch_id(from.watch_id()); + } + if (from.progress_notify() != 0) { + set_progress_notify(from.progress_notify()); + } + if (from.prev_kv() != 0) { + set_prev_kv(from.prev_kv()); + } + if (from.fragment() != 0) { + set_fragment(from.fragment()); + } +} + +void WatchCreateRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchCreateRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WatchCreateRequest::CopyFrom(const WatchCreateRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchCreateRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WatchCreateRequest::IsInitialized() const { + return true; +} + +void WatchCreateRequest::InternalSwap(WatchCreateRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + filters_.InternalSwap(&other->filters_); + key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + range_end_.Swap(&other->range_end_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(start_revision_, other->start_revision_); + swap(watch_id_, other->watch_id_); + swap(progress_notify_, other->progress_notify_); + swap(prev_kv_, other->prev_kv_); + swap(fragment_, other->fragment_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata WatchCreateRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void WatchCancelRequest::InitAsDefaultInstance() { +} +class WatchCancelRequest::_Internal { + public: +}; + +WatchCancelRequest::WatchCancelRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.WatchCancelRequest) +} +WatchCancelRequest::WatchCancelRequest(const WatchCancelRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + watch_id_ = from.watch_id_; + // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchCancelRequest) +} + +void WatchCancelRequest::SharedCtor() { + watch_id_ = PROTOBUF_LONGLONG(0); +} + +WatchCancelRequest::~WatchCancelRequest() { + // @@protoc_insertion_point(destructor:etcdserverpb.WatchCancelRequest) + SharedDtor(); +} + +void WatchCancelRequest::SharedDtor() { +} + +void WatchCancelRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const WatchCancelRequest& WatchCancelRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchCancelRequest_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void WatchCancelRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchCancelRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + watch_id_ = PROTOBUF_LONGLONG(0); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* WatchCancelRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int64 watch_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool WatchCancelRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.WatchCancelRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int64 watch_id = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &watch_id_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.WatchCancelRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchCancelRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void WatchCancelRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchCancelRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 watch_id = 1; + if (this->watch_id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->watch_id(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchCancelRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* WatchCancelRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchCancelRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 watch_id = 1; + if (this->watch_id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->watch_id(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchCancelRequest) + return target; +} + +size_t WatchCancelRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchCancelRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int64 watch_id = 1; + if (this->watch_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->watch_id()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WatchCancelRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchCancelRequest) + GOOGLE_DCHECK_NE(&from, this); + const WatchCancelRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchCancelRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchCancelRequest) + MergeFrom(*source); + } +} + +void WatchCancelRequest::MergeFrom(const WatchCancelRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchCancelRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.watch_id() != 0) { + set_watch_id(from.watch_id()); + } +} + +void WatchCancelRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchCancelRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WatchCancelRequest::CopyFrom(const WatchCancelRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchCancelRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WatchCancelRequest::IsInitialized() const { + return true; +} + +void WatchCancelRequest::InternalSwap(WatchCancelRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(watch_id_, other->watch_id_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata WatchCancelRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void WatchProgressRequest::InitAsDefaultInstance() { +} +class WatchProgressRequest::_Internal { + public: +}; + +WatchProgressRequest::WatchProgressRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.WatchProgressRequest) +} +WatchProgressRequest::WatchProgressRequest(const WatchProgressRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchProgressRequest) +} + +void WatchProgressRequest::SharedCtor() { +} + +WatchProgressRequest::~WatchProgressRequest() { + // @@protoc_insertion_point(destructor:etcdserverpb.WatchProgressRequest) + SharedDtor(); +} + +void WatchProgressRequest::SharedDtor() { +} + +void WatchProgressRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const WatchProgressRequest& WatchProgressRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchProgressRequest_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void WatchProgressRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchProgressRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* WatchProgressRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool WatchProgressRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.WatchProgressRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.WatchProgressRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchProgressRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void WatchProgressRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchProgressRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchProgressRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* WatchProgressRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchProgressRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchProgressRequest) + return target; +} + +size_t WatchProgressRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchProgressRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WatchProgressRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchProgressRequest) + GOOGLE_DCHECK_NE(&from, this); + const WatchProgressRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchProgressRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchProgressRequest) + MergeFrom(*source); + } +} + +void WatchProgressRequest::MergeFrom(const WatchProgressRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchProgressRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void WatchProgressRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchProgressRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WatchProgressRequest::CopyFrom(const WatchProgressRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchProgressRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WatchProgressRequest::IsInitialized() const { + return true; +} + +void WatchProgressRequest::InternalSwap(WatchProgressRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata WatchProgressRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void WatchResponse::InitAsDefaultInstance() { + ::etcdserverpb::_WatchResponse_default_instance_._instance.get_mutable()->header_ = const_cast< ::etcdserverpb::ResponseHeader*>( + ::etcdserverpb::ResponseHeader::internal_default_instance()); +} +class WatchResponse::_Internal { + public: + static const ::etcdserverpb::ResponseHeader& header(const WatchResponse* msg); +}; + +const ::etcdserverpb::ResponseHeader& +WatchResponse::_Internal::header(const WatchResponse* msg) { + return *msg->header_; +} +WatchResponse::WatchResponse() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.WatchResponse) +} +WatchResponse::WatchResponse(const WatchResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + events_(from.events_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + cancel_reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.cancel_reason().empty()) { + cancel_reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cancel_reason_); + } + if (from.has_header()) { + header_ = new ::etcdserverpb::ResponseHeader(*from.header_); + } else { + header_ = nullptr; + } + ::memcpy(&watch_id_, &from.watch_id_, + static_cast(reinterpret_cast(&fragment_) - + reinterpret_cast(&watch_id_)) + sizeof(fragment_)); + // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchResponse) +} + +void WatchResponse::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchResponse_etcd_2eproto.base); + cancel_reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&header_, 0, static_cast( + reinterpret_cast(&fragment_) - + reinterpret_cast(&header_)) + sizeof(fragment_)); +} + +WatchResponse::~WatchResponse() { + // @@protoc_insertion_point(destructor:etcdserverpb.WatchResponse) + SharedDtor(); +} + +void WatchResponse::SharedDtor() { + cancel_reason_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete header_; +} + +void WatchResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const WatchResponse& WatchResponse::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchResponse_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void WatchResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + events_.Clear(); + cancel_reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { + delete header_; + } + header_ = nullptr; + ::memset(&watch_id_, 0, static_cast( + reinterpret_cast(&fragment_) - + reinterpret_cast(&watch_id_)) + sizeof(fragment_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* WatchResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .etcdserverpb.ResponseHeader header = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ctx->ParseMessage(mutable_header(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 watch_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool created = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + created_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool canceled = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + canceled_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 compact_revision = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + compact_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string cancel_reason = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_cancel_reason(), ptr, ctx, "etcdserverpb.WatchResponse.cancel_reason"); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool fragment = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + fragment_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated .etcdserverpb.Event events = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(add_events(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 90); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool WatchResponse::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.WatchResponse) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .etcdserverpb.ResponseHeader header = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_header())); + } else { + goto handle_unusual; + } + break; + } + + // int64 watch_id = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &watch_id_))); + } else { + goto handle_unusual; + } + break; + } + + // bool created = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &created_))); + } else { + goto handle_unusual; + } + break; + } + + // bool canceled = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &canceled_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 compact_revision = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &compact_revision_))); + } else { + goto handle_unusual; + } + break; + } + + // string cancel_reason = 6; + case 6: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_cancel_reason())); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->cancel_reason().data(), static_cast(this->cancel_reason().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, + "etcdserverpb.WatchResponse.cancel_reason")); + } else { + goto handle_unusual; + } + break; + } + + // bool fragment = 7; + case 7: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &fragment_))); + } else { + goto handle_unusual; + } + break; + } + + // repeated .etcdserverpb.Event events = 11; + case 11: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, add_events())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.WatchResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchResponse) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void WatchResponse::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.ResponseHeader header = 1; + if (this->has_header()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, _Internal::header(this), output); + } + + // int64 watch_id = 2; + if (this->watch_id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->watch_id(), output); + } + + // bool created = 3; + if (this->created() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(3, this->created(), output); + } + + // bool canceled = 4; + if (this->canceled() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(4, this->canceled(), output); + } + + // int64 compact_revision = 5; + if (this->compact_revision() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->compact_revision(), output); + } + + // string cancel_reason = 6; + if (this->cancel_reason().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->cancel_reason().data(), static_cast(this->cancel_reason().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "etcdserverpb.WatchResponse.cancel_reason"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->cancel_reason(), output); + } + + // bool fragment = 7; + if (this->fragment() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(7, this->fragment(), output); + } + + // repeated .etcdserverpb.Event events = 11; + for (unsigned int i = 0, + n = static_cast(this->events_size()); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, + this->events(static_cast(i)), + output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchResponse) +} + +::PROTOBUF_NAMESPACE_ID::uint8* WatchResponse::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.ResponseHeader header = 1; + if (this->has_header()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 1, _Internal::header(this), target); + } + + // int64 watch_id = 2; + if (this->watch_id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->watch_id(), target); + } + + // bool created = 3; + if (this->created() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->created(), target); + } + + // bool canceled = 4; + if (this->canceled() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->canceled(), target); + } + + // int64 compact_revision = 5; + if (this->compact_revision() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->compact_revision(), target); + } + + // string cancel_reason = 6; + if (this->cancel_reason().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->cancel_reason().data(), static_cast(this->cancel_reason().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "etcdserverpb.WatchResponse.cancel_reason"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 6, this->cancel_reason(), target); + } + + // bool fragment = 7; + if (this->fragment() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->fragment(), target); + } + + // repeated .etcdserverpb.Event events = 11; + for (unsigned int i = 0, + n = static_cast(this->events_size()); i < n; i++) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, this->events(static_cast(i)), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchResponse) + return target; +} + +size_t WatchResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchResponse) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .etcdserverpb.Event events = 11; + { + unsigned int count = static_cast(this->events_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + this->events(static_cast(i))); + } + } + + // string cancel_reason = 6; + if (this->cancel_reason().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->cancel_reason()); + } + + // .etcdserverpb.ResponseHeader header = 1; + if (this->has_header()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *header_); + } + + // int64 watch_id = 2; + if (this->watch_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->watch_id()); + } + + // int64 compact_revision = 5; + if (this->compact_revision() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->compact_revision()); + } + + // bool created = 3; + if (this->created() != 0) { + total_size += 1 + 1; + } + + // bool canceled = 4; + if (this->canceled() != 0) { + total_size += 1 + 1; + } + + // bool fragment = 7; + if (this->fragment() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void WatchResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchResponse) + GOOGLE_DCHECK_NE(&from, this); + const WatchResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchResponse) + MergeFrom(*source); + } +} + +void WatchResponse::MergeFrom(const WatchResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + events_.MergeFrom(from.events_); + if (from.cancel_reason().size() > 0) { + + cancel_reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cancel_reason_); + } + if (from.has_header()) { + mutable_header()->::etcdserverpb::ResponseHeader::MergeFrom(from.header()); + } + if (from.watch_id() != 0) { + set_watch_id(from.watch_id()); + } + if (from.compact_revision() != 0) { + set_compact_revision(from.compact_revision()); + } + if (from.created() != 0) { + set_created(from.created()); + } + if (from.canceled() != 0) { + set_canceled(from.canceled()); + } + if (from.fragment() != 0) { + set_fragment(from.fragment()); + } +} + +void WatchResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WatchResponse::CopyFrom(const WatchResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WatchResponse::IsInitialized() const { + return true; +} + +void WatchResponse::InternalSwap(WatchResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + CastToBase(&events_)->InternalSwap(CastToBase(&other->events_)); + cancel_reason_.Swap(&other->cancel_reason_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(header_, other->header_); + swap(watch_id_, other->watch_id_); + swap(compact_revision_, other->compact_revision_); + swap(created_, other->created_); + swap(canceled_, other->canceled_); + swap(fragment_, other->fragment_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata WatchResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void ResponseHeader::InitAsDefaultInstance() { +} +class ResponseHeader::_Internal { + public: +}; + +ResponseHeader::ResponseHeader() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.ResponseHeader) +} +ResponseHeader::ResponseHeader(const ResponseHeader& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&cluster_id_, &from.cluster_id_, + static_cast(reinterpret_cast(&raft_term_) - + reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); + // @@protoc_insertion_point(copy_constructor:etcdserverpb.ResponseHeader) +} + +void ResponseHeader::SharedCtor() { + ::memset(&cluster_id_, 0, static_cast( + reinterpret_cast(&raft_term_) - + reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); +} + +ResponseHeader::~ResponseHeader() { + // @@protoc_insertion_point(destructor:etcdserverpb.ResponseHeader) + SharedDtor(); +} + +void ResponseHeader::SharedDtor() { +} + +void ResponseHeader::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ResponseHeader& ResponseHeader::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ResponseHeader_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void ResponseHeader::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.ResponseHeader) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&cluster_id_, 0, static_cast( + reinterpret_cast(&raft_term_) - + reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* ResponseHeader::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // uint64 cluster_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + cluster_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 member_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + member_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 revision = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 raft_term = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + raft_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool ResponseHeader::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.ResponseHeader) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // uint64 cluster_id = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( + input, &cluster_id_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 member_id = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( + input, &member_id_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 revision = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &revision_))); + } else { + goto handle_unusual; + } + break; + } + + // uint64 raft_term = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( + input, &raft_term_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.ResponseHeader) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.ResponseHeader) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void ResponseHeader::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.ResponseHeader) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 cluster_id = 1; + if (this->cluster_id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->cluster_id(), output); + } + + // uint64 member_id = 2; + if (this->member_id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->member_id(), output); + } + + // int64 revision = 3; + if (this->revision() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->revision(), output); + } + + // uint64 raft_term = 4; + if (this->raft_term() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(4, this->raft_term(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.ResponseHeader) +} + +::PROTOBUF_NAMESPACE_ID::uint8* ResponseHeader::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.ResponseHeader) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 cluster_id = 1; + if (this->cluster_id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->cluster_id(), target); + } + + // uint64 member_id = 2; + if (this->member_id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->member_id(), target); + } + + // int64 revision = 3; + if (this->revision() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->revision(), target); + } + + // uint64 raft_term = 4; + if (this->raft_term() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->raft_term(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.ResponseHeader) + return target; +} + +size_t ResponseHeader::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.ResponseHeader) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 cluster_id = 1; + if (this->cluster_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->cluster_id()); + } + + // uint64 member_id = 2; + if (this->member_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->member_id()); + } + + // int64 revision = 3; + if (this->revision() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->revision()); + } + + // uint64 raft_term = 4; + if (this->raft_term() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->raft_term()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void ResponseHeader::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.ResponseHeader) + GOOGLE_DCHECK_NE(&from, this); + const ResponseHeader* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.ResponseHeader) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.ResponseHeader) + MergeFrom(*source); + } +} + +void ResponseHeader::MergeFrom(const ResponseHeader& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.ResponseHeader) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.cluster_id() != 0) { + set_cluster_id(from.cluster_id()); + } + if (from.member_id() != 0) { + set_member_id(from.member_id()); + } + if (from.revision() != 0) { + set_revision(from.revision()); + } + if (from.raft_term() != 0) { + set_raft_term(from.raft_term()); + } +} + +void ResponseHeader::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.ResponseHeader) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ResponseHeader::CopyFrom(const ResponseHeader& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.ResponseHeader) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ResponseHeader::IsInitialized() const { + return true; +} + +void ResponseHeader::InternalSwap(ResponseHeader* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(cluster_id_, other->cluster_id_); + swap(member_id_, other->member_id_); + swap(revision_, other->revision_); + swap(raft_term_, other->raft_term_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ResponseHeader::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void KeyValue::InitAsDefaultInstance() { +} +class KeyValue::_Internal { + public: +}; + +KeyValue::KeyValue() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.KeyValue) +} +KeyValue::KeyValue(const KeyValue& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.key().empty()) { + key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); + } + value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.value().empty()) { + value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); + } + ::memcpy(&create_revision_, &from.create_revision_, + static_cast(reinterpret_cast(&lease_) - + reinterpret_cast(&create_revision_)) + sizeof(lease_)); + // @@protoc_insertion_point(copy_constructor:etcdserverpb.KeyValue) +} + +void KeyValue::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_KeyValue_etcd_2eproto.base); + key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&create_revision_, 0, static_cast( + reinterpret_cast(&lease_) - + reinterpret_cast(&create_revision_)) + sizeof(lease_)); +} + +KeyValue::~KeyValue() { + // @@protoc_insertion_point(destructor:etcdserverpb.KeyValue) + SharedDtor(); +} + +void KeyValue::SharedDtor() { + key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void KeyValue::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const KeyValue& KeyValue::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_KeyValue_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void KeyValue::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.KeyValue) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&create_revision_, 0, static_cast( + reinterpret_cast(&lease_) - + reinterpret_cast(&create_revision_)) + sizeof(lease_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* KeyValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // bytes key = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_key(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 create_revision = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + create_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 mod_revision = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + mod_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 version = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bytes value = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_value(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 lease = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + lease_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool KeyValue::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.KeyValue) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bytes key = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_key())); + } else { + goto handle_unusual; + } + break; + } + + // int64 create_revision = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &create_revision_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 mod_revision = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &mod_revision_))); + } else { + goto handle_unusual; + } + break; + } + + // int64 version = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &version_))); + } else { + goto handle_unusual; + } + break; + } + + // bytes value = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_value())); + } else { + goto handle_unusual; + } + break; + } + + // int64 lease = 6; + case 6: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &lease_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.KeyValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.KeyValue) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void KeyValue::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.KeyValue) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bytes key = 1; + if (this->key().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->key(), output); + } + + // int64 create_revision = 2; + if (this->create_revision() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->create_revision(), output); + } + + // int64 mod_revision = 3; + if (this->mod_revision() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->mod_revision(), output); + } + + // int64 version = 4; + if (this->version() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->version(), output); + } + + // bytes value = 5; + if (this->value().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 5, this->value(), output); + } + + // int64 lease = 6; + if (this->lease() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(6, this->lease(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.KeyValue) +} + +::PROTOBUF_NAMESPACE_ID::uint8* KeyValue::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.KeyValue) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bytes key = 1; + if (this->key().size() > 0) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 1, this->key(), target); + } + + // int64 create_revision = 2; + if (this->create_revision() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->create_revision(), target); + } + + // int64 mod_revision = 3; + if (this->mod_revision() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->mod_revision(), target); + } + + // int64 version = 4; + if (this->version() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->version(), target); + } + + // bytes value = 5; + if (this->value().size() > 0) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 5, this->value(), target); + } + + // int64 lease = 6; + if (this->lease() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->lease(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.KeyValue) + return target; +} + +size_t KeyValue::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.KeyValue) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bytes key = 1; + if (this->key().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->key()); + } + + // bytes value = 5; + if (this->value().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->value()); + } + + // int64 create_revision = 2; + if (this->create_revision() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->create_revision()); + } + + // int64 mod_revision = 3; + if (this->mod_revision() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->mod_revision()); + } + + // int64 version = 4; + if (this->version() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->version()); + } + + // int64 lease = 6; + if (this->lease() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->lease()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void KeyValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.KeyValue) + GOOGLE_DCHECK_NE(&from, this); + const KeyValue* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.KeyValue) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.KeyValue) + MergeFrom(*source); + } +} + +void KeyValue::MergeFrom(const KeyValue& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.KeyValue) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.key().size() > 0) { + + key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); + } + if (from.value().size() > 0) { + + value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); + } + if (from.create_revision() != 0) { + set_create_revision(from.create_revision()); + } + if (from.mod_revision() != 0) { + set_mod_revision(from.mod_revision()); + } + if (from.version() != 0) { + set_version(from.version()); + } + if (from.lease() != 0) { + set_lease(from.lease()); + } +} + +void KeyValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.KeyValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void KeyValue::CopyFrom(const KeyValue& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.KeyValue) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool KeyValue::IsInitialized() const { + return true; +} + +void KeyValue::InternalSwap(KeyValue* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(create_revision_, other->create_revision_); + swap(mod_revision_, other->mod_revision_); + swap(version_, other->version_); + swap(lease_, other->lease_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata KeyValue::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void Event::InitAsDefaultInstance() { + ::etcdserverpb::_Event_default_instance_._instance.get_mutable()->kv_ = const_cast< ::etcdserverpb::KeyValue*>( + ::etcdserverpb::KeyValue::internal_default_instance()); + ::etcdserverpb::_Event_default_instance_._instance.get_mutable()->prev_kv_ = const_cast< ::etcdserverpb::KeyValue*>( + ::etcdserverpb::KeyValue::internal_default_instance()); +} +class Event::_Internal { + public: + static const ::etcdserverpb::KeyValue& kv(const Event* msg); + static const ::etcdserverpb::KeyValue& prev_kv(const Event* msg); +}; + +const ::etcdserverpb::KeyValue& +Event::_Internal::kv(const Event* msg) { + return *msg->kv_; +} +const ::etcdserverpb::KeyValue& +Event::_Internal::prev_kv(const Event* msg) { + return *msg->prev_kv_; +} +Event::Event() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:etcdserverpb.Event) +} +Event::Event(const Event& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_kv()) { + kv_ = new ::etcdserverpb::KeyValue(*from.kv_); + } else { + kv_ = nullptr; + } + if (from.has_prev_kv()) { + prev_kv_ = new ::etcdserverpb::KeyValue(*from.prev_kv_); + } else { + prev_kv_ = nullptr; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:etcdserverpb.Event) +} + +void Event::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Event_etcd_2eproto.base); + ::memset(&kv_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&kv_)) + sizeof(type_)); +} + +Event::~Event() { + // @@protoc_insertion_point(destructor:etcdserverpb.Event) + SharedDtor(); +} + +void Event::SharedDtor() { + if (this != internal_default_instance()) delete kv_; + if (this != internal_default_instance()) delete prev_kv_; +} + +void Event::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Event& Event::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Event_etcd_2eproto.base); + return *internal_default_instance(); +} + + +void Event::Clear() { +// @@protoc_insertion_point(message_clear_start:etcdserverpb.Event) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaNoVirtual() == nullptr && kv_ != nullptr) { + delete kv_; + } + kv_ = nullptr; + if (GetArenaNoVirtual() == nullptr && prev_kv_ != nullptr) { + delete prev_kv_; + } + prev_kv_ = nullptr; + type_ = 0; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Event::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .etcdserverpb.Event.EventType type = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_type(static_cast<::etcdserverpb::Event_EventType>(val)); + } else goto handle_unusual; + continue; + // .etcdserverpb.KeyValue kv = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ctx->ParseMessage(mutable_kv(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .etcdserverpb.KeyValue prev_kv = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(mutable_prev_kv(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Event::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:etcdserverpb.Event) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // .etcdserverpb.Event.EventType type = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::etcdserverpb::Event_EventType >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .etcdserverpb.KeyValue kv = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_kv())); + } else { + goto handle_unusual; + } + break; + } + + // .etcdserverpb.KeyValue prev_kv = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_prev_kv())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:etcdserverpb.Event) + return true; +failure: + // @@protoc_insertion_point(parse_failure:etcdserverpb.Event) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Event::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:etcdserverpb.Event) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.Event.EventType type = 1; + if (this->type() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); + } + + // .etcdserverpb.KeyValue kv = 2; + if (this->has_kv()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, _Internal::kv(this), output); + } + + // .etcdserverpb.KeyValue prev_kv = 3; + if (this->has_prev_kv()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, _Internal::prev_kv(this), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:etcdserverpb.Event) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Event::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.Event) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .etcdserverpb.Event.EventType type = 1; + if (this->type() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->type(), target); + } + + // .etcdserverpb.KeyValue kv = 2; + if (this->has_kv()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, _Internal::kv(this), target); + } + + // .etcdserverpb.KeyValue prev_kv = 3; + if (this->has_prev_kv()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, _Internal::prev_kv(this), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.Event) + return target; +} + +size_t Event::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.Event) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .etcdserverpb.KeyValue kv = 2; + if (this->has_kv()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *kv_); + } + + // .etcdserverpb.KeyValue prev_kv = 3; + if (this->has_prev_kv()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *prev_kv_); + } + + // .etcdserverpb.Event.EventType type = 1; + if (this->type() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Event::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.Event) + GOOGLE_DCHECK_NE(&from, this); + const Event* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.Event) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.Event) + MergeFrom(*source); + } +} + +void Event::MergeFrom(const Event& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.Event) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_kv()) { + mutable_kv()->::etcdserverpb::KeyValue::MergeFrom(from.kv()); + } + if (from.has_prev_kv()) { + mutable_prev_kv()->::etcdserverpb::KeyValue::MergeFrom(from.prev_kv()); + } + if (from.type() != 0) { + set_type(from.type()); + } +} + +void Event::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.Event) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Event::CopyFrom(const Event& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.Event) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Event::IsInitialized() const { + return true; +} + +void Event::InternalSwap(Event* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(kv_, other->kv_); + swap(prev_kv_, other->prev_kv_); + swap(type_, other->type_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Event::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace etcdserverpb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchRequest >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::WatchRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchCreateRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchCreateRequest >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::WatchCreateRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchCancelRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchCancelRequest >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::WatchCancelRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchProgressRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchProgressRequest >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::WatchProgressRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchResponse* Arena::CreateMaybeMessage< ::etcdserverpb::WatchResponse >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::WatchResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::ResponseHeader* Arena::CreateMaybeMessage< ::etcdserverpb::ResponseHeader >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::ResponseHeader >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::KeyValue* Arena::CreateMaybeMessage< ::etcdserverpb::KeyValue >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::KeyValue >(arena); +} +template<> PROTOBUF_NOINLINE ::etcdserverpb::Event* Arena::CreateMaybeMessage< ::etcdserverpb::Event >(Arena* arena) { + return Arena::CreateInternal< ::etcdserverpb::Event >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/proxy/src/grpc/etcd.pb.h b/proxy/src/grpc/etcd.pb.h new file mode 100644 index 0000000000..c42ab01847 --- /dev/null +++ b/proxy/src/grpc/etcd.pb.h @@ -0,0 +1,2465 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: etcd.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3009000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3009000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_etcd_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_etcd_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[8] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_etcd_2eproto; +namespace etcdserverpb { +class Event; +class EventDefaultTypeInternal; +extern EventDefaultTypeInternal _Event_default_instance_; +class KeyValue; +class KeyValueDefaultTypeInternal; +extern KeyValueDefaultTypeInternal _KeyValue_default_instance_; +class ResponseHeader; +class ResponseHeaderDefaultTypeInternal; +extern ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; +class WatchCancelRequest; +class WatchCancelRequestDefaultTypeInternal; +extern WatchCancelRequestDefaultTypeInternal _WatchCancelRequest_default_instance_; +class WatchCreateRequest; +class WatchCreateRequestDefaultTypeInternal; +extern WatchCreateRequestDefaultTypeInternal _WatchCreateRequest_default_instance_; +class WatchProgressRequest; +class WatchProgressRequestDefaultTypeInternal; +extern WatchProgressRequestDefaultTypeInternal _WatchProgressRequest_default_instance_; +class WatchRequest; +class WatchRequestDefaultTypeInternal; +extern WatchRequestDefaultTypeInternal _WatchRequest_default_instance_; +class WatchResponse; +class WatchResponseDefaultTypeInternal; +extern WatchResponseDefaultTypeInternal _WatchResponse_default_instance_; +} // namespace etcdserverpb +PROTOBUF_NAMESPACE_OPEN +template<> ::etcdserverpb::Event* Arena::CreateMaybeMessage<::etcdserverpb::Event>(Arena*); +template<> ::etcdserverpb::KeyValue* Arena::CreateMaybeMessage<::etcdserverpb::KeyValue>(Arena*); +template<> ::etcdserverpb::ResponseHeader* Arena::CreateMaybeMessage<::etcdserverpb::ResponseHeader>(Arena*); +template<> ::etcdserverpb::WatchCancelRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchCancelRequest>(Arena*); +template<> ::etcdserverpb::WatchCreateRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchCreateRequest>(Arena*); +template<> ::etcdserverpb::WatchProgressRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchProgressRequest>(Arena*); +template<> ::etcdserverpb::WatchRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchRequest>(Arena*); +template<> ::etcdserverpb::WatchResponse* Arena::CreateMaybeMessage<::etcdserverpb::WatchResponse>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace etcdserverpb { + +enum WatchCreateRequest_FilterType : int { + WatchCreateRequest_FilterType_NOPUT = 0, + WatchCreateRequest_FilterType_NODELETE = 1, + WatchCreateRequest_FilterType_WatchCreateRequest_FilterType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + WatchCreateRequest_FilterType_WatchCreateRequest_FilterType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool WatchCreateRequest_FilterType_IsValid(int value); +constexpr WatchCreateRequest_FilterType WatchCreateRequest_FilterType_FilterType_MIN = WatchCreateRequest_FilterType_NOPUT; +constexpr WatchCreateRequest_FilterType WatchCreateRequest_FilterType_FilterType_MAX = WatchCreateRequest_FilterType_NODELETE; +constexpr int WatchCreateRequest_FilterType_FilterType_ARRAYSIZE = WatchCreateRequest_FilterType_FilterType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* WatchCreateRequest_FilterType_descriptor(); +template +inline const std::string& WatchCreateRequest_FilterType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function WatchCreateRequest_FilterType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + WatchCreateRequest_FilterType_descriptor(), enum_t_value); +} +inline bool WatchCreateRequest_FilterType_Parse( + const std::string& name, WatchCreateRequest_FilterType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + WatchCreateRequest_FilterType_descriptor(), name, value); +} +enum Event_EventType : int { + Event_EventType_PUT = 0, + Event_EventType_DELETE = 1, + Event_EventType_Event_EventType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + Event_EventType_Event_EventType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool Event_EventType_IsValid(int value); +constexpr Event_EventType Event_EventType_EventType_MIN = Event_EventType_PUT; +constexpr Event_EventType Event_EventType_EventType_MAX = Event_EventType_DELETE; +constexpr int Event_EventType_EventType_ARRAYSIZE = Event_EventType_EventType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Event_EventType_descriptor(); +template +inline const std::string& Event_EventType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Event_EventType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Event_EventType_descriptor(), enum_t_value); +} +inline bool Event_EventType_Parse( + const std::string& name, Event_EventType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Event_EventType_descriptor(), name, value); +} +// =================================================================== + +class WatchRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchRequest) */ { + public: + WatchRequest(); + virtual ~WatchRequest(); + + WatchRequest(const WatchRequest& from); + WatchRequest(WatchRequest&& from) noexcept + : WatchRequest() { + *this = ::std::move(from); + } + + inline WatchRequest& operator=(const WatchRequest& from) { + CopyFrom(from); + return *this; + } + inline WatchRequest& operator=(WatchRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const WatchRequest& default_instance(); + + enum RequestUnionCase { + kCreateRequest = 1, + kCancelRequest = 2, + kProgressRequest = 3, + REQUEST_UNION_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WatchRequest* internal_default_instance() { + return reinterpret_cast( + &_WatchRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(WatchRequest& a, WatchRequest& b) { + a.Swap(&b); + } + inline void Swap(WatchRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline WatchRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + WatchRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const WatchRequest& from); + void MergeFrom(const WatchRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WatchRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.WatchRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kCreateRequestFieldNumber = 1, + kCancelRequestFieldNumber = 2, + kProgressRequestFieldNumber = 3, + }; + // .etcdserverpb.WatchCreateRequest create_request = 1; + bool has_create_request() const; + void clear_create_request(); + const ::etcdserverpb::WatchCreateRequest& create_request() const; + ::etcdserverpb::WatchCreateRequest* release_create_request(); + ::etcdserverpb::WatchCreateRequest* mutable_create_request(); + void set_allocated_create_request(::etcdserverpb::WatchCreateRequest* create_request); + + // .etcdserverpb.WatchCancelRequest cancel_request = 2; + bool has_cancel_request() const; + void clear_cancel_request(); + const ::etcdserverpb::WatchCancelRequest& cancel_request() const; + ::etcdserverpb::WatchCancelRequest* release_cancel_request(); + ::etcdserverpb::WatchCancelRequest* mutable_cancel_request(); + void set_allocated_cancel_request(::etcdserverpb::WatchCancelRequest* cancel_request); + + // .etcdserverpb.WatchProgressRequest progress_request = 3; + bool has_progress_request() const; + void clear_progress_request(); + const ::etcdserverpb::WatchProgressRequest& progress_request() const; + ::etcdserverpb::WatchProgressRequest* release_progress_request(); + ::etcdserverpb::WatchProgressRequest* mutable_progress_request(); + void set_allocated_progress_request(::etcdserverpb::WatchProgressRequest* progress_request); + + void clear_request_union(); + RequestUnionCase request_union_case() const; + // @@protoc_insertion_point(class_scope:etcdserverpb.WatchRequest) + private: + class _Internal; + void set_has_create_request(); + void set_has_cancel_request(); + void set_has_progress_request(); + + inline bool has_request_union() const; + inline void clear_has_request_union(); + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + union RequestUnionUnion { + RequestUnionUnion() {} + ::etcdserverpb::WatchCreateRequest* create_request_; + ::etcdserverpb::WatchCancelRequest* cancel_request_; + ::etcdserverpb::WatchProgressRequest* progress_request_; + } request_union_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class WatchCreateRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchCreateRequest) */ { + public: + WatchCreateRequest(); + virtual ~WatchCreateRequest(); + + WatchCreateRequest(const WatchCreateRequest& from); + WatchCreateRequest(WatchCreateRequest&& from) noexcept + : WatchCreateRequest() { + *this = ::std::move(from); + } + + inline WatchCreateRequest& operator=(const WatchCreateRequest& from) { + CopyFrom(from); + return *this; + } + inline WatchCreateRequest& operator=(WatchCreateRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const WatchCreateRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WatchCreateRequest* internal_default_instance() { + return reinterpret_cast( + &_WatchCreateRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(WatchCreateRequest& a, WatchCreateRequest& b) { + a.Swap(&b); + } + inline void Swap(WatchCreateRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline WatchCreateRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + WatchCreateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const WatchCreateRequest& from); + void MergeFrom(const WatchCreateRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WatchCreateRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.WatchCreateRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + typedef WatchCreateRequest_FilterType FilterType; + static constexpr FilterType NOPUT = + WatchCreateRequest_FilterType_NOPUT; + static constexpr FilterType NODELETE = + WatchCreateRequest_FilterType_NODELETE; + static inline bool FilterType_IsValid(int value) { + return WatchCreateRequest_FilterType_IsValid(value); + } + static constexpr FilterType FilterType_MIN = + WatchCreateRequest_FilterType_FilterType_MIN; + static constexpr FilterType FilterType_MAX = + WatchCreateRequest_FilterType_FilterType_MAX; + static constexpr int FilterType_ARRAYSIZE = + WatchCreateRequest_FilterType_FilterType_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + FilterType_descriptor() { + return WatchCreateRequest_FilterType_descriptor(); + } + template + static inline const std::string& FilterType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function FilterType_Name."); + return WatchCreateRequest_FilterType_Name(enum_t_value); + } + static inline bool FilterType_Parse(const std::string& name, + FilterType* value) { + return WatchCreateRequest_FilterType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kFiltersFieldNumber = 5, + kKeyFieldNumber = 1, + kRangeEndFieldNumber = 2, + kStartRevisionFieldNumber = 3, + kWatchIdFieldNumber = 7, + kProgressNotifyFieldNumber = 4, + kPrevKvFieldNumber = 6, + kFragmentFieldNumber = 8, + }; + // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; + int filters_size() const; + void clear_filters(); + ::etcdserverpb::WatchCreateRequest_FilterType filters(int index) const; + void set_filters(int index, ::etcdserverpb::WatchCreateRequest_FilterType value); + void add_filters(::etcdserverpb::WatchCreateRequest_FilterType value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField& filters() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_filters(); + + // bytes key = 1; + void clear_key(); + const std::string& key() const; + void set_key(const std::string& value); + void set_key(std::string&& value); + void set_key(const char* value); + void set_key(const void* value, size_t size); + std::string* mutable_key(); + std::string* release_key(); + void set_allocated_key(std::string* key); + + // bytes range_end = 2; + void clear_range_end(); + const std::string& range_end() const; + void set_range_end(const std::string& value); + void set_range_end(std::string&& value); + void set_range_end(const char* value); + void set_range_end(const void* value, size_t size); + std::string* mutable_range_end(); + std::string* release_range_end(); + void set_allocated_range_end(std::string* range_end); + + // int64 start_revision = 3; + void clear_start_revision(); + ::PROTOBUF_NAMESPACE_ID::int64 start_revision() const; + void set_start_revision(::PROTOBUF_NAMESPACE_ID::int64 value); + + // int64 watch_id = 7; + void clear_watch_id(); + ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; + void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); + + // bool progress_notify = 4; + void clear_progress_notify(); + bool progress_notify() const; + void set_progress_notify(bool value); + + // bool prev_kv = 6; + void clear_prev_kv(); + bool prev_kv() const; + void set_prev_kv(bool value); + + // bool fragment = 8; + void clear_fragment(); + bool fragment() const; + void set_fragment(bool value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.WatchCreateRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField filters_; + mutable std::atomic _filters_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr range_end_; + ::PROTOBUF_NAMESPACE_ID::int64 start_revision_; + ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; + bool progress_notify_; + bool prev_kv_; + bool fragment_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class WatchCancelRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchCancelRequest) */ { + public: + WatchCancelRequest(); + virtual ~WatchCancelRequest(); + + WatchCancelRequest(const WatchCancelRequest& from); + WatchCancelRequest(WatchCancelRequest&& from) noexcept + : WatchCancelRequest() { + *this = ::std::move(from); + } + + inline WatchCancelRequest& operator=(const WatchCancelRequest& from) { + CopyFrom(from); + return *this; + } + inline WatchCancelRequest& operator=(WatchCancelRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const WatchCancelRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WatchCancelRequest* internal_default_instance() { + return reinterpret_cast( + &_WatchCancelRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(WatchCancelRequest& a, WatchCancelRequest& b) { + a.Swap(&b); + } + inline void Swap(WatchCancelRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline WatchCancelRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + WatchCancelRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const WatchCancelRequest& from); + void MergeFrom(const WatchCancelRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WatchCancelRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.WatchCancelRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kWatchIdFieldNumber = 1, + }; + // int64 watch_id = 1; + void clear_watch_id(); + ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; + void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.WatchCancelRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class WatchProgressRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchProgressRequest) */ { + public: + WatchProgressRequest(); + virtual ~WatchProgressRequest(); + + WatchProgressRequest(const WatchProgressRequest& from); + WatchProgressRequest(WatchProgressRequest&& from) noexcept + : WatchProgressRequest() { + *this = ::std::move(from); + } + + inline WatchProgressRequest& operator=(const WatchProgressRequest& from) { + CopyFrom(from); + return *this; + } + inline WatchProgressRequest& operator=(WatchProgressRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const WatchProgressRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WatchProgressRequest* internal_default_instance() { + return reinterpret_cast( + &_WatchProgressRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(WatchProgressRequest& a, WatchProgressRequest& b) { + a.Swap(&b); + } + inline void Swap(WatchProgressRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline WatchProgressRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + WatchProgressRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const WatchProgressRequest& from); + void MergeFrom(const WatchProgressRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WatchProgressRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.WatchProgressRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:etcdserverpb.WatchProgressRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class WatchResponse : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchResponse) */ { + public: + WatchResponse(); + virtual ~WatchResponse(); + + WatchResponse(const WatchResponse& from); + WatchResponse(WatchResponse&& from) noexcept + : WatchResponse() { + *this = ::std::move(from); + } + + inline WatchResponse& operator=(const WatchResponse& from) { + CopyFrom(from); + return *this; + } + inline WatchResponse& operator=(WatchResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const WatchResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const WatchResponse* internal_default_instance() { + return reinterpret_cast( + &_WatchResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(WatchResponse& a, WatchResponse& b) { + a.Swap(&b); + } + inline void Swap(WatchResponse* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline WatchResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + WatchResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const WatchResponse& from); + void MergeFrom(const WatchResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(WatchResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.WatchResponse"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kEventsFieldNumber = 11, + kCancelReasonFieldNumber = 6, + kHeaderFieldNumber = 1, + kWatchIdFieldNumber = 2, + kCompactRevisionFieldNumber = 5, + kCreatedFieldNumber = 3, + kCanceledFieldNumber = 4, + kFragmentFieldNumber = 7, + }; + // repeated .etcdserverpb.Event events = 11; + int events_size() const; + void clear_events(); + ::etcdserverpb::Event* mutable_events(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >* + mutable_events(); + const ::etcdserverpb::Event& events(int index) const; + ::etcdserverpb::Event* add_events(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >& + events() const; + + // string cancel_reason = 6; + void clear_cancel_reason(); + const std::string& cancel_reason() const; + void set_cancel_reason(const std::string& value); + void set_cancel_reason(std::string&& value); + void set_cancel_reason(const char* value); + void set_cancel_reason(const char* value, size_t size); + std::string* mutable_cancel_reason(); + std::string* release_cancel_reason(); + void set_allocated_cancel_reason(std::string* cancel_reason); + + // .etcdserverpb.ResponseHeader header = 1; + bool has_header() const; + void clear_header(); + const ::etcdserverpb::ResponseHeader& header() const; + ::etcdserverpb::ResponseHeader* release_header(); + ::etcdserverpb::ResponseHeader* mutable_header(); + void set_allocated_header(::etcdserverpb::ResponseHeader* header); + + // int64 watch_id = 2; + void clear_watch_id(); + ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; + void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); + + // int64 compact_revision = 5; + void clear_compact_revision(); + ::PROTOBUF_NAMESPACE_ID::int64 compact_revision() const; + void set_compact_revision(::PROTOBUF_NAMESPACE_ID::int64 value); + + // bool created = 3; + void clear_created(); + bool created() const; + void set_created(bool value); + + // bool canceled = 4; + void clear_canceled(); + bool canceled() const; + void set_canceled(bool value); + + // bool fragment = 7; + void clear_fragment(); + bool fragment() const; + void set_fragment(bool value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.WatchResponse) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event > events_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cancel_reason_; + ::etcdserverpb::ResponseHeader* header_; + ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; + ::PROTOBUF_NAMESPACE_ID::int64 compact_revision_; + bool created_; + bool canceled_; + bool fragment_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class ResponseHeader : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.ResponseHeader) */ { + public: + ResponseHeader(); + virtual ~ResponseHeader(); + + ResponseHeader(const ResponseHeader& from); + ResponseHeader(ResponseHeader&& from) noexcept + : ResponseHeader() { + *this = ::std::move(from); + } + + inline ResponseHeader& operator=(const ResponseHeader& from) { + CopyFrom(from); + return *this; + } + inline ResponseHeader& operator=(ResponseHeader&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const ResponseHeader& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const ResponseHeader* internal_default_instance() { + return reinterpret_cast( + &_ResponseHeader_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(ResponseHeader& a, ResponseHeader& b) { + a.Swap(&b); + } + inline void Swap(ResponseHeader* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline ResponseHeader* New() const final { + return CreateMaybeMessage(nullptr); + } + + ResponseHeader* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const ResponseHeader& from); + void MergeFrom(const ResponseHeader& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(ResponseHeader* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.ResponseHeader"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kClusterIdFieldNumber = 1, + kMemberIdFieldNumber = 2, + kRevisionFieldNumber = 3, + kRaftTermFieldNumber = 4, + }; + // uint64 cluster_id = 1; + void clear_cluster_id(); + ::PROTOBUF_NAMESPACE_ID::uint64 cluster_id() const; + void set_cluster_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + + // uint64 member_id = 2; + void clear_member_id(); + ::PROTOBUF_NAMESPACE_ID::uint64 member_id() const; + void set_member_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + + // int64 revision = 3; + void clear_revision(); + ::PROTOBUF_NAMESPACE_ID::int64 revision() const; + void set_revision(::PROTOBUF_NAMESPACE_ID::int64 value); + + // uint64 raft_term = 4; + void clear_raft_term(); + ::PROTOBUF_NAMESPACE_ID::uint64 raft_term() const; + void set_raft_term(::PROTOBUF_NAMESPACE_ID::uint64 value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.ResponseHeader) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::uint64 cluster_id_; + ::PROTOBUF_NAMESPACE_ID::uint64 member_id_; + ::PROTOBUF_NAMESPACE_ID::int64 revision_; + ::PROTOBUF_NAMESPACE_ID::uint64 raft_term_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class KeyValue : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.KeyValue) */ { + public: + KeyValue(); + virtual ~KeyValue(); + + KeyValue(const KeyValue& from); + KeyValue(KeyValue&& from) noexcept + : KeyValue() { + *this = ::std::move(from); + } + + inline KeyValue& operator=(const KeyValue& from) { + CopyFrom(from); + return *this; + } + inline KeyValue& operator=(KeyValue&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const KeyValue& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const KeyValue* internal_default_instance() { + return reinterpret_cast( + &_KeyValue_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(KeyValue& a, KeyValue& b) { + a.Swap(&b); + } + inline void Swap(KeyValue* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline KeyValue* New() const final { + return CreateMaybeMessage(nullptr); + } + + KeyValue* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const KeyValue& from); + void MergeFrom(const KeyValue& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(KeyValue* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.KeyValue"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kKeyFieldNumber = 1, + kValueFieldNumber = 5, + kCreateRevisionFieldNumber = 2, + kModRevisionFieldNumber = 3, + kVersionFieldNumber = 4, + kLeaseFieldNumber = 6, + }; + // bytes key = 1; + void clear_key(); + const std::string& key() const; + void set_key(const std::string& value); + void set_key(std::string&& value); + void set_key(const char* value); + void set_key(const void* value, size_t size); + std::string* mutable_key(); + std::string* release_key(); + void set_allocated_key(std::string* key); + + // bytes value = 5; + void clear_value(); + const std::string& value() const; + void set_value(const std::string& value); + void set_value(std::string&& value); + void set_value(const char* value); + void set_value(const void* value, size_t size); + std::string* mutable_value(); + std::string* release_value(); + void set_allocated_value(std::string* value); + + // int64 create_revision = 2; + void clear_create_revision(); + ::PROTOBUF_NAMESPACE_ID::int64 create_revision() const; + void set_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value); + + // int64 mod_revision = 3; + void clear_mod_revision(); + ::PROTOBUF_NAMESPACE_ID::int64 mod_revision() const; + void set_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value); + + // int64 version = 4; + void clear_version(); + ::PROTOBUF_NAMESPACE_ID::int64 version() const; + void set_version(::PROTOBUF_NAMESPACE_ID::int64 value); + + // int64 lease = 6; + void clear_lease(); + ::PROTOBUF_NAMESPACE_ID::int64 lease() const; + void set_lease(::PROTOBUF_NAMESPACE_ID::int64 value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.KeyValue) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; + ::PROTOBUF_NAMESPACE_ID::int64 create_revision_; + ::PROTOBUF_NAMESPACE_ID::int64 mod_revision_; + ::PROTOBUF_NAMESPACE_ID::int64 version_; + ::PROTOBUF_NAMESPACE_ID::int64 lease_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// ------------------------------------------------------------------- + +class Event : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.Event) */ { + public: + Event(); + virtual ~Event(); + + Event(const Event& from); + Event(Event&& from) noexcept + : Event() { + *this = ::std::move(from); + } + + inline Event& operator=(const Event& from) { + CopyFrom(from); + return *this; + } + inline Event& operator=(Event&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const Event& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Event* internal_default_instance() { + return reinterpret_cast( + &_Event_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(Event& a, Event& b) { + a.Swap(&b); + } + inline void Swap(Event* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline Event* New() const final { + return CreateMaybeMessage(nullptr); + } + + Event* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const Event& from); + void MergeFrom(const Event& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Event* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "etcdserverpb.Event"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); + return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + typedef Event_EventType EventType; + static constexpr EventType PUT = + Event_EventType_PUT; + static constexpr EventType DELETE = + Event_EventType_DELETE; + static inline bool EventType_IsValid(int value) { + return Event_EventType_IsValid(value); + } + static constexpr EventType EventType_MIN = + Event_EventType_EventType_MIN; + static constexpr EventType EventType_MAX = + Event_EventType_EventType_MAX; + static constexpr int EventType_ARRAYSIZE = + Event_EventType_EventType_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + EventType_descriptor() { + return Event_EventType_descriptor(); + } + template + static inline const std::string& EventType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function EventType_Name."); + return Event_EventType_Name(enum_t_value); + } + static inline bool EventType_Parse(const std::string& name, + EventType* value) { + return Event_EventType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kKvFieldNumber = 2, + kPrevKvFieldNumber = 3, + kTypeFieldNumber = 1, + }; + // .etcdserverpb.KeyValue kv = 2; + bool has_kv() const; + void clear_kv(); + const ::etcdserverpb::KeyValue& kv() const; + ::etcdserverpb::KeyValue* release_kv(); + ::etcdserverpb::KeyValue* mutable_kv(); + void set_allocated_kv(::etcdserverpb::KeyValue* kv); + + // .etcdserverpb.KeyValue prev_kv = 3; + bool has_prev_kv() const; + void clear_prev_kv(); + const ::etcdserverpb::KeyValue& prev_kv() const; + ::etcdserverpb::KeyValue* release_prev_kv(); + ::etcdserverpb::KeyValue* mutable_prev_kv(); + void set_allocated_prev_kv(::etcdserverpb::KeyValue* prev_kv); + + // .etcdserverpb.Event.EventType type = 1; + void clear_type(); + ::etcdserverpb::Event_EventType type() const; + void set_type(::etcdserverpb::Event_EventType value); + + // @@protoc_insertion_point(class_scope:etcdserverpb.Event) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::etcdserverpb::KeyValue* kv_; + ::etcdserverpb::KeyValue* prev_kv_; + int type_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_etcd_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// WatchRequest + +// .etcdserverpb.WatchCreateRequest create_request = 1; +inline bool WatchRequest::has_create_request() const { + return request_union_case() == kCreateRequest; +} +inline void WatchRequest::set_has_create_request() { + _oneof_case_[0] = kCreateRequest; +} +inline void WatchRequest::clear_create_request() { + if (has_create_request()) { + delete request_union_.create_request_; + clear_has_request_union(); + } +} +inline ::etcdserverpb::WatchCreateRequest* WatchRequest::release_create_request() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.create_request) + if (has_create_request()) { + clear_has_request_union(); + ::etcdserverpb::WatchCreateRequest* temp = request_union_.create_request_; + request_union_.create_request_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::etcdserverpb::WatchCreateRequest& WatchRequest::create_request() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.create_request) + return has_create_request() + ? *request_union_.create_request_ + : *reinterpret_cast< ::etcdserverpb::WatchCreateRequest*>(&::etcdserverpb::_WatchCreateRequest_default_instance_); +} +inline ::etcdserverpb::WatchCreateRequest* WatchRequest::mutable_create_request() { + if (!has_create_request()) { + clear_request_union(); + set_has_create_request(); + request_union_.create_request_ = CreateMaybeMessage< ::etcdserverpb::WatchCreateRequest >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.create_request) + return request_union_.create_request_; +} + +// .etcdserverpb.WatchCancelRequest cancel_request = 2; +inline bool WatchRequest::has_cancel_request() const { + return request_union_case() == kCancelRequest; +} +inline void WatchRequest::set_has_cancel_request() { + _oneof_case_[0] = kCancelRequest; +} +inline void WatchRequest::clear_cancel_request() { + if (has_cancel_request()) { + delete request_union_.cancel_request_; + clear_has_request_union(); + } +} +inline ::etcdserverpb::WatchCancelRequest* WatchRequest::release_cancel_request() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.cancel_request) + if (has_cancel_request()) { + clear_has_request_union(); + ::etcdserverpb::WatchCancelRequest* temp = request_union_.cancel_request_; + request_union_.cancel_request_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::etcdserverpb::WatchCancelRequest& WatchRequest::cancel_request() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.cancel_request) + return has_cancel_request() + ? *request_union_.cancel_request_ + : *reinterpret_cast< ::etcdserverpb::WatchCancelRequest*>(&::etcdserverpb::_WatchCancelRequest_default_instance_); +} +inline ::etcdserverpb::WatchCancelRequest* WatchRequest::mutable_cancel_request() { + if (!has_cancel_request()) { + clear_request_union(); + set_has_cancel_request(); + request_union_.cancel_request_ = CreateMaybeMessage< ::etcdserverpb::WatchCancelRequest >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.cancel_request) + return request_union_.cancel_request_; +} + +// .etcdserverpb.WatchProgressRequest progress_request = 3; +inline bool WatchRequest::has_progress_request() const { + return request_union_case() == kProgressRequest; +} +inline void WatchRequest::set_has_progress_request() { + _oneof_case_[0] = kProgressRequest; +} +inline void WatchRequest::clear_progress_request() { + if (has_progress_request()) { + delete request_union_.progress_request_; + clear_has_request_union(); + } +} +inline ::etcdserverpb::WatchProgressRequest* WatchRequest::release_progress_request() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.progress_request) + if (has_progress_request()) { + clear_has_request_union(); + ::etcdserverpb::WatchProgressRequest* temp = request_union_.progress_request_; + request_union_.progress_request_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::etcdserverpb::WatchProgressRequest& WatchRequest::progress_request() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.progress_request) + return has_progress_request() + ? *request_union_.progress_request_ + : *reinterpret_cast< ::etcdserverpb::WatchProgressRequest*>(&::etcdserverpb::_WatchProgressRequest_default_instance_); +} +inline ::etcdserverpb::WatchProgressRequest* WatchRequest::mutable_progress_request() { + if (!has_progress_request()) { + clear_request_union(); + set_has_progress_request(); + request_union_.progress_request_ = CreateMaybeMessage< ::etcdserverpb::WatchProgressRequest >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.progress_request) + return request_union_.progress_request_; +} + +inline bool WatchRequest::has_request_union() const { + return request_union_case() != REQUEST_UNION_NOT_SET; +} +inline void WatchRequest::clear_has_request_union() { + _oneof_case_[0] = REQUEST_UNION_NOT_SET; +} +inline WatchRequest::RequestUnionCase WatchRequest::request_union_case() const { + return WatchRequest::RequestUnionCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// WatchCreateRequest + +// bytes key = 1; +inline void WatchCreateRequest::clear_key() { + key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& WatchCreateRequest::key() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.key) + return key_.GetNoArena(); +} +inline void WatchCreateRequest::set_key(const std::string& value) { + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.key) +} +inline void WatchCreateRequest::set_key(std::string&& value) { + + key_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchCreateRequest.key) +} +inline void WatchCreateRequest::set_key(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchCreateRequest.key) +} +inline void WatchCreateRequest::set_key(const void* value, size_t size) { + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchCreateRequest.key) +} +inline std::string* WatchCreateRequest::mutable_key() { + + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchCreateRequest.key) + return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* WatchCreateRequest::release_key() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchCreateRequest.key) + + return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void WatchCreateRequest::set_allocated_key(std::string* key) { + if (key != nullptr) { + + } else { + + } + key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchCreateRequest.key) +} + +// bytes range_end = 2; +inline void WatchCreateRequest::clear_range_end() { + range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& WatchCreateRequest::range_end() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.range_end) + return range_end_.GetNoArena(); +} +inline void WatchCreateRequest::set_range_end(const std::string& value) { + + range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.range_end) +} +inline void WatchCreateRequest::set_range_end(std::string&& value) { + + range_end_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchCreateRequest.range_end) +} +inline void WatchCreateRequest::set_range_end(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchCreateRequest.range_end) +} +inline void WatchCreateRequest::set_range_end(const void* value, size_t size) { + + range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchCreateRequest.range_end) +} +inline std::string* WatchCreateRequest::mutable_range_end() { + + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchCreateRequest.range_end) + return range_end_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* WatchCreateRequest::release_range_end() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchCreateRequest.range_end) + + return range_end_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void WatchCreateRequest::set_allocated_range_end(std::string* range_end) { + if (range_end != nullptr) { + + } else { + + } + range_end_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), range_end); + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchCreateRequest.range_end) +} + +// int64 start_revision = 3; +inline void WatchCreateRequest::clear_start_revision() { + start_revision_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCreateRequest::start_revision() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.start_revision) + return start_revision_; +} +inline void WatchCreateRequest::set_start_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { + + start_revision_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.start_revision) +} + +// bool progress_notify = 4; +inline void WatchCreateRequest::clear_progress_notify() { + progress_notify_ = false; +} +inline bool WatchCreateRequest::progress_notify() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.progress_notify) + return progress_notify_; +} +inline void WatchCreateRequest::set_progress_notify(bool value) { + + progress_notify_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.progress_notify) +} + +// repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; +inline int WatchCreateRequest::filters_size() const { + return filters_.size(); +} +inline void WatchCreateRequest::clear_filters() { + filters_.Clear(); +} +inline ::etcdserverpb::WatchCreateRequest_FilterType WatchCreateRequest::filters(int index) const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.filters) + return static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(filters_.Get(index)); +} +inline void WatchCreateRequest::set_filters(int index, ::etcdserverpb::WatchCreateRequest_FilterType value) { + filters_.Set(index, value); + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.filters) +} +inline void WatchCreateRequest::add_filters(::etcdserverpb::WatchCreateRequest_FilterType value) { + filters_.Add(value); + // @@protoc_insertion_point(field_add:etcdserverpb.WatchCreateRequest.filters) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& +WatchCreateRequest::filters() const { + // @@protoc_insertion_point(field_list:etcdserverpb.WatchCreateRequest.filters) + return filters_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +WatchCreateRequest::mutable_filters() { + // @@protoc_insertion_point(field_mutable_list:etcdserverpb.WatchCreateRequest.filters) + return &filters_; +} + +// bool prev_kv = 6; +inline void WatchCreateRequest::clear_prev_kv() { + prev_kv_ = false; +} +inline bool WatchCreateRequest::prev_kv() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.prev_kv) + return prev_kv_; +} +inline void WatchCreateRequest::set_prev_kv(bool value) { + + prev_kv_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.prev_kv) +} + +// int64 watch_id = 7; +inline void WatchCreateRequest::clear_watch_id() { + watch_id_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCreateRequest::watch_id() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.watch_id) + return watch_id_; +} +inline void WatchCreateRequest::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { + + watch_id_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.watch_id) +} + +// bool fragment = 8; +inline void WatchCreateRequest::clear_fragment() { + fragment_ = false; +} +inline bool WatchCreateRequest::fragment() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.fragment) + return fragment_; +} +inline void WatchCreateRequest::set_fragment(bool value) { + + fragment_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.fragment) +} + +// ------------------------------------------------------------------- + +// WatchCancelRequest + +// int64 watch_id = 1; +inline void WatchCancelRequest::clear_watch_id() { + watch_id_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCancelRequest::watch_id() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchCancelRequest.watch_id) + return watch_id_; +} +inline void WatchCancelRequest::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { + + watch_id_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchCancelRequest.watch_id) +} + +// ------------------------------------------------------------------- + +// WatchProgressRequest + +// ------------------------------------------------------------------- + +// WatchResponse + +// .etcdserverpb.ResponseHeader header = 1; +inline bool WatchResponse::has_header() const { + return this != internal_default_instance() && header_ != nullptr; +} +inline void WatchResponse::clear_header() { + if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { + delete header_; + } + header_ = nullptr; +} +inline const ::etcdserverpb::ResponseHeader& WatchResponse::header() const { + const ::etcdserverpb::ResponseHeader* p = header_; + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.header) + return p != nullptr ? *p : *reinterpret_cast( + &::etcdserverpb::_ResponseHeader_default_instance_); +} +inline ::etcdserverpb::ResponseHeader* WatchResponse::release_header() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchResponse.header) + + ::etcdserverpb::ResponseHeader* temp = header_; + header_ = nullptr; + return temp; +} +inline ::etcdserverpb::ResponseHeader* WatchResponse::mutable_header() { + + if (header_ == nullptr) { + auto* p = CreateMaybeMessage<::etcdserverpb::ResponseHeader>(GetArenaNoVirtual()); + header_ = p; + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.header) + return header_; +} +inline void WatchResponse::set_allocated_header(::etcdserverpb::ResponseHeader* header) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete header_; + } + if (header) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + header = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, header, submessage_arena); + } + + } else { + + } + header_ = header; + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchResponse.header) +} + +// int64 watch_id = 2; +inline void WatchResponse::clear_watch_id() { + watch_id_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 WatchResponse::watch_id() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.watch_id) + return watch_id_; +} +inline void WatchResponse::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { + + watch_id_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.watch_id) +} + +// bool created = 3; +inline void WatchResponse::clear_created() { + created_ = false; +} +inline bool WatchResponse::created() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.created) + return created_; +} +inline void WatchResponse::set_created(bool value) { + + created_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.created) +} + +// bool canceled = 4; +inline void WatchResponse::clear_canceled() { + canceled_ = false; +} +inline bool WatchResponse::canceled() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.canceled) + return canceled_; +} +inline void WatchResponse::set_canceled(bool value) { + + canceled_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.canceled) +} + +// int64 compact_revision = 5; +inline void WatchResponse::clear_compact_revision() { + compact_revision_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 WatchResponse::compact_revision() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.compact_revision) + return compact_revision_; +} +inline void WatchResponse::set_compact_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { + + compact_revision_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.compact_revision) +} + +// string cancel_reason = 6; +inline void WatchResponse::clear_cancel_reason() { + cancel_reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& WatchResponse::cancel_reason() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.cancel_reason) + return cancel_reason_.GetNoArena(); +} +inline void WatchResponse::set_cancel_reason(const std::string& value) { + + cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.cancel_reason) +} +inline void WatchResponse::set_cancel_reason(std::string&& value) { + + cancel_reason_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchResponse.cancel_reason) +} +inline void WatchResponse::set_cancel_reason(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchResponse.cancel_reason) +} +inline void WatchResponse::set_cancel_reason(const char* value, size_t size) { + + cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchResponse.cancel_reason) +} +inline std::string* WatchResponse::mutable_cancel_reason() { + + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.cancel_reason) + return cancel_reason_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* WatchResponse::release_cancel_reason() { + // @@protoc_insertion_point(field_release:etcdserverpb.WatchResponse.cancel_reason) + + return cancel_reason_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void WatchResponse::set_allocated_cancel_reason(std::string* cancel_reason) { + if (cancel_reason != nullptr) { + + } else { + + } + cancel_reason_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cancel_reason); + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchResponse.cancel_reason) +} + +// bool fragment = 7; +inline void WatchResponse::clear_fragment() { + fragment_ = false; +} +inline bool WatchResponse::fragment() const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.fragment) + return fragment_; +} +inline void WatchResponse::set_fragment(bool value) { + + fragment_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.fragment) +} + +// repeated .etcdserverpb.Event events = 11; +inline int WatchResponse::events_size() const { + return events_.size(); +} +inline void WatchResponse::clear_events() { + events_.Clear(); +} +inline ::etcdserverpb::Event* WatchResponse::mutable_events(int index) { + // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.events) + return events_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >* +WatchResponse::mutable_events() { + // @@protoc_insertion_point(field_mutable_list:etcdserverpb.WatchResponse.events) + return &events_; +} +inline const ::etcdserverpb::Event& WatchResponse::events(int index) const { + // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.events) + return events_.Get(index); +} +inline ::etcdserverpb::Event* WatchResponse::add_events() { + // @@protoc_insertion_point(field_add:etcdserverpb.WatchResponse.events) + return events_.Add(); +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >& +WatchResponse::events() const { + // @@protoc_insertion_point(field_list:etcdserverpb.WatchResponse.events) + return events_; +} + +// ------------------------------------------------------------------- + +// ResponseHeader + +// uint64 cluster_id = 1; +inline void ResponseHeader::clear_cluster_id() { + cluster_id_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::cluster_id() const { + // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.cluster_id) + return cluster_id_; +} +inline void ResponseHeader::set_cluster_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + cluster_id_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.cluster_id) +} + +// uint64 member_id = 2; +inline void ResponseHeader::clear_member_id() { + member_id_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::member_id() const { + // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.member_id) + return member_id_; +} +inline void ResponseHeader::set_member_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + member_id_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.member_id) +} + +// int64 revision = 3; +inline void ResponseHeader::clear_revision() { + revision_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 ResponseHeader::revision() const { + // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.revision) + return revision_; +} +inline void ResponseHeader::set_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { + + revision_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.revision) +} + +// uint64 raft_term = 4; +inline void ResponseHeader::clear_raft_term() { + raft_term_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::raft_term() const { + // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.raft_term) + return raft_term_; +} +inline void ResponseHeader::set_raft_term(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + raft_term_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.raft_term) +} + +// ------------------------------------------------------------------- + +// KeyValue + +// bytes key = 1; +inline void KeyValue::clear_key() { + key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& KeyValue::key() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.key) + return key_.GetNoArena(); +} +inline void KeyValue::set_key(const std::string& value) { + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.key) +} +inline void KeyValue::set_key(std::string&& value) { + + key_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.KeyValue.key) +} +inline void KeyValue::set_key(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:etcdserverpb.KeyValue.key) +} +inline void KeyValue::set_key(const void* value, size_t size) { + + key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:etcdserverpb.KeyValue.key) +} +inline std::string* KeyValue::mutable_key() { + + // @@protoc_insertion_point(field_mutable:etcdserverpb.KeyValue.key) + return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* KeyValue::release_key() { + // @@protoc_insertion_point(field_release:etcdserverpb.KeyValue.key) + + return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void KeyValue::set_allocated_key(std::string* key) { + if (key != nullptr) { + + } else { + + } + key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.KeyValue.key) +} + +// int64 create_revision = 2; +inline void KeyValue::clear_create_revision() { + create_revision_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::create_revision() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.create_revision) + return create_revision_; +} +inline void KeyValue::set_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { + + create_revision_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.create_revision) +} + +// int64 mod_revision = 3; +inline void KeyValue::clear_mod_revision() { + mod_revision_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::mod_revision() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.mod_revision) + return mod_revision_; +} +inline void KeyValue::set_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { + + mod_revision_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.mod_revision) +} + +// int64 version = 4; +inline void KeyValue::clear_version() { + version_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::version() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.version) + return version_; +} +inline void KeyValue::set_version(::PROTOBUF_NAMESPACE_ID::int64 value) { + + version_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.version) +} + +// bytes value = 5; +inline void KeyValue::clear_value() { + value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& KeyValue::value() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.value) + return value_.GetNoArena(); +} +inline void KeyValue::set_value(const std::string& value) { + + value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.value) +} +inline void KeyValue::set_value(std::string&& value) { + + value_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.KeyValue.value) +} +inline void KeyValue::set_value(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:etcdserverpb.KeyValue.value) +} +inline void KeyValue::set_value(const void* value, size_t size) { + + value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:etcdserverpb.KeyValue.value) +} +inline std::string* KeyValue::mutable_value() { + + // @@protoc_insertion_point(field_mutable:etcdserverpb.KeyValue.value) + return value_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* KeyValue::release_value() { + // @@protoc_insertion_point(field_release:etcdserverpb.KeyValue.value) + + return value_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void KeyValue::set_allocated_value(std::string* value) { + if (value != nullptr) { + + } else { + + } + value_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.KeyValue.value) +} + +// int64 lease = 6; +inline void KeyValue::clear_lease() { + lease_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::lease() const { + // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.lease) + return lease_; +} +inline void KeyValue::set_lease(::PROTOBUF_NAMESPACE_ID::int64 value) { + + lease_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.lease) +} + +// ------------------------------------------------------------------- + +// Event + +// .etcdserverpb.Event.EventType type = 1; +inline void Event::clear_type() { + type_ = 0; +} +inline ::etcdserverpb::Event_EventType Event::type() const { + // @@protoc_insertion_point(field_get:etcdserverpb.Event.type) + return static_cast< ::etcdserverpb::Event_EventType >(type_); +} +inline void Event::set_type(::etcdserverpb::Event_EventType value) { + + type_ = value; + // @@protoc_insertion_point(field_set:etcdserverpb.Event.type) +} + +// .etcdserverpb.KeyValue kv = 2; +inline bool Event::has_kv() const { + return this != internal_default_instance() && kv_ != nullptr; +} +inline void Event::clear_kv() { + if (GetArenaNoVirtual() == nullptr && kv_ != nullptr) { + delete kv_; + } + kv_ = nullptr; +} +inline const ::etcdserverpb::KeyValue& Event::kv() const { + const ::etcdserverpb::KeyValue* p = kv_; + // @@protoc_insertion_point(field_get:etcdserverpb.Event.kv) + return p != nullptr ? *p : *reinterpret_cast( + &::etcdserverpb::_KeyValue_default_instance_); +} +inline ::etcdserverpb::KeyValue* Event::release_kv() { + // @@protoc_insertion_point(field_release:etcdserverpb.Event.kv) + + ::etcdserverpb::KeyValue* temp = kv_; + kv_ = nullptr; + return temp; +} +inline ::etcdserverpb::KeyValue* Event::mutable_kv() { + + if (kv_ == nullptr) { + auto* p = CreateMaybeMessage<::etcdserverpb::KeyValue>(GetArenaNoVirtual()); + kv_ = p; + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.Event.kv) + return kv_; +} +inline void Event::set_allocated_kv(::etcdserverpb::KeyValue* kv) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete kv_; + } + if (kv) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + kv = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, kv, submessage_arena); + } + + } else { + + } + kv_ = kv; + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.Event.kv) +} + +// .etcdserverpb.KeyValue prev_kv = 3; +inline bool Event::has_prev_kv() const { + return this != internal_default_instance() && prev_kv_ != nullptr; +} +inline void Event::clear_prev_kv() { + if (GetArenaNoVirtual() == nullptr && prev_kv_ != nullptr) { + delete prev_kv_; + } + prev_kv_ = nullptr; +} +inline const ::etcdserverpb::KeyValue& Event::prev_kv() const { + const ::etcdserverpb::KeyValue* p = prev_kv_; + // @@protoc_insertion_point(field_get:etcdserverpb.Event.prev_kv) + return p != nullptr ? *p : *reinterpret_cast( + &::etcdserverpb::_KeyValue_default_instance_); +} +inline ::etcdserverpb::KeyValue* Event::release_prev_kv() { + // @@protoc_insertion_point(field_release:etcdserverpb.Event.prev_kv) + + ::etcdserverpb::KeyValue* temp = prev_kv_; + prev_kv_ = nullptr; + return temp; +} +inline ::etcdserverpb::KeyValue* Event::mutable_prev_kv() { + + if (prev_kv_ == nullptr) { + auto* p = CreateMaybeMessage<::etcdserverpb::KeyValue>(GetArenaNoVirtual()); + prev_kv_ = p; + } + // @@protoc_insertion_point(field_mutable:etcdserverpb.Event.prev_kv) + return prev_kv_; +} +inline void Event::set_allocated_prev_kv(::etcdserverpb::KeyValue* prev_kv) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete prev_kv_; + } + if (prev_kv) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + prev_kv = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, prev_kv, submessage_arena); + } + + } else { + + } + prev_kv_ = prev_kv; + // @@protoc_insertion_point(field_set_allocated:etcdserverpb.Event.prev_kv) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace etcdserverpb + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::etcdserverpb::WatchCreateRequest_FilterType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::WatchCreateRequest_FilterType>() { + return ::etcdserverpb::WatchCreateRequest_FilterType_descriptor(); +} +template <> struct is_proto_enum< ::etcdserverpb::Event_EventType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::Event_EventType>() { + return ::etcdserverpb::Event_EventType_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto diff --git a/proxy/src/grpc/hello.grpc.pb.cc b/proxy/src/grpc/hello.grpc.pb.cc new file mode 100644 index 0000000000..279efed628 --- /dev/null +++ b/proxy/src/grpc/hello.grpc.pb.cc @@ -0,0 +1,85 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: hello.proto + +#include "hello.pb.h" +#include "hello.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace milvus { +namespace grpc { + +static const char* HelloService_method_names[] = { + "/milvus.grpc.HelloService/SayHello", +}; + +std::unique_ptr< HelloService::Stub> HelloService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< HelloService::Stub> stub(new HelloService::Stub(channel)); + return stub; +} + +HelloService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel), rpcmethod_SayHello_(HelloService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status HelloService::Stub::SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::milvus::grpc::HelloReply* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_SayHello_, context, request, response); +} + +void HelloService::Stub::experimental_async::SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SayHello_, context, request, response, std::move(f)); +} + +void HelloService::Stub::experimental_async::SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SayHello_, context, request, response, std::move(f)); +} + +void HelloService::Stub::experimental_async::SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SayHello_, context, request, response, reactor); +} + +void HelloService::Stub::experimental_async::SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SayHello_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>* HelloService::Stub::AsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::HelloReply>::Create(channel_.get(), cq, rpcmethod_SayHello_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>* HelloService::Stub::PrepareAsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::HelloReply>::Create(channel_.get(), cq, rpcmethod_SayHello_, context, request, false); +} + +HelloService::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + HelloService_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< HelloService::Service, ::milvus::grpc::HelloRequest, ::milvus::grpc::HelloReply>( + std::mem_fn(&HelloService::Service::SayHello), this))); +} + +HelloService::Service::~Service() { +} + +::grpc::Status HelloService::Service::SayHello(::grpc::ServerContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace milvus +} // namespace grpc + diff --git a/proxy/src/grpc/hello.grpc.pb.h b/proxy/src/grpc/hello.grpc.pb.h new file mode 100644 index 0000000000..a179c4f521 --- /dev/null +++ b/proxy/src/grpc/hello.grpc.pb.h @@ -0,0 +1,254 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: hello.proto +#ifndef GRPC_hello_2eproto__INCLUDED +#define GRPC_hello_2eproto__INCLUDED + +#include "hello.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class CompletionQueue; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc + +namespace milvus { +namespace grpc { + +class HelloService final { + public: + static constexpr char const* service_full_name() { + return "milvus.grpc.HelloService"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + virtual ::grpc::Status SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::milvus::grpc::HelloReply* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>> AsyncSayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>>(AsyncSayHelloRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>> PrepareAsyncSayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>>(PrepareAsyncSayHelloRaw(context, request, cq)); + } + class experimental_async_interface { + public: + virtual ~experimental_async_interface() {} + virtual void SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, std::function) = 0; + virtual void SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, std::function) = 0; + virtual void SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + virtual void SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + }; + virtual class experimental_async_interface* experimental_async() { return nullptr; } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>* AsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::HelloReply>* PrepareAsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + ::grpc::Status SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::milvus::grpc::HelloReply* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>> AsyncSayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>>(AsyncSayHelloRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>> PrepareAsyncSayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>>(PrepareAsyncSayHelloRaw(context, request, cq)); + } + class experimental_async final : + public StubInterface::experimental_async_interface { + public: + void SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, std::function) override; + void SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, std::function) override; + void SayHello(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void SayHello(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::HelloReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + private: + friend class Stub; + explicit experimental_async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class experimental_async_interface* experimental_async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class experimental_async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>* AsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::milvus::grpc::HelloReply>* PrepareAsyncSayHelloRaw(::grpc::ClientContext* context, const ::milvus::grpc::HelloRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_SayHello_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + virtual ::grpc::Status SayHello(::grpc::ServerContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response); + }; + template + class WithAsyncMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_SayHello() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSayHello(::grpc::ServerContext* context, ::milvus::grpc::HelloRequest* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::HelloReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_SayHello AsyncService; + template + class ExperimentalWithCallbackMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithCallbackMethod_SayHello() { + ::grpc::Service::experimental().MarkMethodCallback(0, + new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::HelloRequest, ::milvus::grpc::HelloReply>( + [this](::grpc::ServerContext* context, + const ::milvus::grpc::HelloRequest* request, + ::milvus::grpc::HelloReply* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->SayHello(context, request, response, controller); + })); + } + void SetMessageAllocatorFor_SayHello( + ::grpc::experimental::MessageAllocator< ::milvus::grpc::HelloRequest, ::milvus::grpc::HelloReply>* allocator) { + static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::HelloRequest, ::milvus::grpc::HelloReply>*>( + ::grpc::Service::experimental().GetHandler(0)) + ->SetMessageAllocator(allocator); + } + ~ExperimentalWithCallbackMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + typedef ExperimentalWithCallbackMethod_SayHello ExperimentalCallbackService; + template + class WithGenericMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_SayHello() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_SayHello() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSayHello(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class ExperimentalWithRawCallbackMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithRawCallbackMethod_SayHello() { + ::grpc::Service::experimental().MarkMethodRawCallback(0, + new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->SayHello(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void SayHello(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class WithStreamedUnaryMethod_SayHello : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_SayHello() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::HelloRequest, ::milvus::grpc::HelloReply>(std::bind(&WithStreamedUnaryMethod_SayHello::StreamedSayHello, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_SayHello() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status SayHello(::grpc::ServerContext* /*context*/, const ::milvus::grpc::HelloRequest* /*request*/, ::milvus::grpc::HelloReply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedSayHello(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::HelloRequest,::milvus::grpc::HelloReply>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_SayHello StreamedUnaryService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_SayHello StreamedService; +}; + +} // namespace grpc +} // namespace milvus + + +#endif // GRPC_hello_2eproto__INCLUDED diff --git a/proxy/src/grpc/hello.pb.cc b/proxy/src/grpc/hello.pb.cc new file mode 100644 index 0000000000..6a4380b484 --- /dev/null +++ b/proxy/src/grpc/hello.pb.cc @@ -0,0 +1,664 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: hello.proto + +#include "hello.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +namespace milvus { +namespace grpc { +class HelloRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _HelloRequest_default_instance_; +class HelloReplyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _HelloReply_default_instance_; +} // namespace grpc +} // namespace milvus +static void InitDefaultsscc_info_HelloReply_hello_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_HelloReply_default_instance_; + new (ptr) ::milvus::grpc::HelloReply(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::HelloReply::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HelloReply_hello_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_HelloReply_hello_2eproto}, {}}; + +static void InitDefaultsscc_info_HelloRequest_hello_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::milvus::grpc::_HelloRequest_default_instance_; + new (ptr) ::milvus::grpc::HelloRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::milvus::grpc::HelloRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HelloRequest_hello_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_HelloRequest_hello_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_hello_2eproto[2]; +static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_hello_2eproto = nullptr; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_hello_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_hello_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::HelloRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::HelloRequest, name_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::HelloReply, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::milvus::grpc::HelloReply, msg_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::milvus::grpc::HelloRequest)}, + { 6, -1, sizeof(::milvus::grpc::HelloReply)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::milvus::grpc::_HelloRequest_default_instance_), + reinterpret_cast(&::milvus::grpc::_HelloReply_default_instance_), +}; + +const char descriptor_table_protodef_hello_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\013hello.proto\022\013milvus.grpc\"\034\n\014HelloReque" + "st\022\014\n\004name\030\001 \001(\t\"\031\n\nHelloReply\022\013\n\003msg\030\001 " + "\001(\t2P\n\014HelloService\022@\n\010SayHello\022\031.milvus" + ".grpc.HelloRequest\032\027.milvus.grpc.HelloRe" + "ply\"\000b\006proto3" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_hello_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_hello_2eproto_sccs[2] = { + &scc_info_HelloReply_hello_2eproto.base, + &scc_info_HelloRequest_hello_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_hello_2eproto_once; +static bool descriptor_table_hello_2eproto_initialized = false; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_hello_2eproto = { + &descriptor_table_hello_2eproto_initialized, descriptor_table_protodef_hello_2eproto, "hello.proto", 173, + &descriptor_table_hello_2eproto_once, descriptor_table_hello_2eproto_sccs, descriptor_table_hello_2eproto_deps, 2, 0, + schemas, file_default_instances, TableStruct_hello_2eproto::offsets, + file_level_metadata_hello_2eproto, 2, file_level_enum_descriptors_hello_2eproto, file_level_service_descriptors_hello_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_hello_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_hello_2eproto), true); +namespace milvus { +namespace grpc { + +// =================================================================== + +void HelloRequest::InitAsDefaultInstance() { +} +class HelloRequest::_Internal { + public: +}; + +HelloRequest::HelloRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.HelloRequest) +} +HelloRequest::HelloRequest(const HelloRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.name().empty()) { + name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.HelloRequest) +} + +void HelloRequest::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HelloRequest_hello_2eproto.base); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +HelloRequest::~HelloRequest() { + // @@protoc_insertion_point(destructor:milvus.grpc.HelloRequest) + SharedDtor(); +} + +void HelloRequest::SharedDtor() { + name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void HelloRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const HelloRequest& HelloRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HelloRequest_hello_2eproto.base); + return *internal_default_instance(); +} + + +void HelloRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.HelloRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* HelloRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "milvus.grpc.HelloRequest.name"); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool HelloRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.HelloRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string name = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, + "milvus.grpc.HelloRequest.name")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.HelloRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.HelloRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void HelloRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.HelloRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.HelloRequest.name"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.HelloRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* HelloRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.HelloRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), static_cast(this->name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.HelloRequest.name"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.HelloRequest) + return target; +} + +size_t HelloRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.HelloRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->name()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HelloRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.HelloRequest) + GOOGLE_DCHECK_NE(&from, this); + const HelloRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.HelloRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.HelloRequest) + MergeFrom(*source); + } +} + +void HelloRequest::MergeFrom(const HelloRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.HelloRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); + } +} + +void HelloRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.HelloRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HelloRequest::CopyFrom(const HelloRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.HelloRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HelloRequest::IsInitialized() const { + return true; +} + +void HelloRequest::InternalSwap(HelloRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata HelloRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void HelloReply::InitAsDefaultInstance() { +} +class HelloReply::_Internal { + public: +}; + +HelloReply::HelloReply() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:milvus.grpc.HelloReply) +} +HelloReply::HelloReply(const HelloReply& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + msg_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.msg().empty()) { + msg_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.msg_); + } + // @@protoc_insertion_point(copy_constructor:milvus.grpc.HelloReply) +} + +void HelloReply::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HelloReply_hello_2eproto.base); + msg_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +HelloReply::~HelloReply() { + // @@protoc_insertion_point(destructor:milvus.grpc.HelloReply) + SharedDtor(); +} + +void HelloReply::SharedDtor() { + msg_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void HelloReply::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const HelloReply& HelloReply::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HelloReply_hello_2eproto.base); + return *internal_default_instance(); +} + + +void HelloReply::Clear() { +// @@protoc_insertion_point(message_clear_start:milvus.grpc.HelloReply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + msg_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* HelloReply::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string msg = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_msg(), ptr, ctx, "milvus.grpc.HelloReply.msg"); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool HelloReply::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:milvus.grpc.HelloReply) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string msg = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_msg())); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->msg().data(), static_cast(this->msg().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, + "milvus.grpc.HelloReply.msg")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:milvus.grpc.HelloReply) + return true; +failure: + // @@protoc_insertion_point(parse_failure:milvus.grpc.HelloReply) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void HelloReply::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:milvus.grpc.HelloReply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string msg = 1; + if (this->msg().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->msg().data(), static_cast(this->msg().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.HelloReply.msg"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->msg(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:milvus.grpc.HelloReply) +} + +::PROTOBUF_NAMESPACE_ID::uint8* HelloReply::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.HelloReply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string msg = 1; + if (this->msg().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->msg().data(), static_cast(this->msg().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "milvus.grpc.HelloReply.msg"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 1, this->msg(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.HelloReply) + return target; +} + +size_t HelloReply::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.HelloReply) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string msg = 1; + if (this->msg().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->msg()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HelloReply::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.HelloReply) + GOOGLE_DCHECK_NE(&from, this); + const HelloReply* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.HelloReply) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.HelloReply) + MergeFrom(*source); + } +} + +void HelloReply::MergeFrom(const HelloReply& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.HelloReply) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.msg().size() > 0) { + + msg_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.msg_); + } +} + +void HelloReply::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.HelloReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HelloReply::CopyFrom(const HelloReply& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.HelloReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HelloReply::IsInitialized() const { + return true; +} + +void HelloReply::InternalSwap(HelloReply* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + msg_.Swap(&other->msg_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata HelloReply::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace grpc +} // namespace milvus +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::milvus::grpc::HelloRequest* Arena::CreateMaybeMessage< ::milvus::grpc::HelloRequest >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::HelloRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::milvus::grpc::HelloReply* Arena::CreateMaybeMessage< ::milvus::grpc::HelloReply >(Arena* arena) { + return Arena::CreateInternal< ::milvus::grpc::HelloReply >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/proxy/src/grpc/hello.pb.h b/proxy/src/grpc/hello.pb.h new file mode 100644 index 0000000000..004112d834 --- /dev/null +++ b/proxy/src/grpc/hello.pb.h @@ -0,0 +1,479 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: hello.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_hello_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_hello_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3009000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3009000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_hello_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_hello_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_hello_2eproto; +namespace milvus { +namespace grpc { +class HelloReply; +class HelloReplyDefaultTypeInternal; +extern HelloReplyDefaultTypeInternal _HelloReply_default_instance_; +class HelloRequest; +class HelloRequestDefaultTypeInternal; +extern HelloRequestDefaultTypeInternal _HelloRequest_default_instance_; +} // namespace grpc +} // namespace milvus +PROTOBUF_NAMESPACE_OPEN +template<> ::milvus::grpc::HelloReply* Arena::CreateMaybeMessage<::milvus::grpc::HelloReply>(Arena*); +template<> ::milvus::grpc::HelloRequest* Arena::CreateMaybeMessage<::milvus::grpc::HelloRequest>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace milvus { +namespace grpc { + +// =================================================================== + +class HelloRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.HelloRequest) */ { + public: + HelloRequest(); + virtual ~HelloRequest(); + + HelloRequest(const HelloRequest& from); + HelloRequest(HelloRequest&& from) noexcept + : HelloRequest() { + *this = ::std::move(from); + } + + inline HelloRequest& operator=(const HelloRequest& from) { + CopyFrom(from); + return *this; + } + inline HelloRequest& operator=(HelloRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const HelloRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HelloRequest* internal_default_instance() { + return reinterpret_cast( + &_HelloRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(HelloRequest& a, HelloRequest& b) { + a.Swap(&b); + } + inline void Swap(HelloRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline HelloRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + HelloRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const HelloRequest& from); + void MergeFrom(const HelloRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HelloRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "milvus.grpc.HelloRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_hello_2eproto); + return ::descriptor_table_hello_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + }; + // string name = 1; + void clear_name(); + const std::string& name() const; + void set_name(const std::string& value); + void set_name(std::string&& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + std::string* mutable_name(); + std::string* release_name(); + void set_allocated_name(std::string* name); + + // @@protoc_insertion_point(class_scope:milvus.grpc.HelloRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_hello_2eproto; +}; +// ------------------------------------------------------------------- + +class HelloReply : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.HelloReply) */ { + public: + HelloReply(); + virtual ~HelloReply(); + + HelloReply(const HelloReply& from); + HelloReply(HelloReply&& from) noexcept + : HelloReply() { + *this = ::std::move(from); + } + + inline HelloReply& operator=(const HelloReply& from) { + CopyFrom(from); + return *this; + } + inline HelloReply& operator=(HelloReply&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const HelloReply& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HelloReply* internal_default_instance() { + return reinterpret_cast( + &_HelloReply_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(HelloReply& a, HelloReply& b) { + a.Swap(&b); + } + inline void Swap(HelloReply* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline HelloReply* New() const final { + return CreateMaybeMessage(nullptr); + } + + HelloReply* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const HelloReply& from); + void MergeFrom(const HelloReply& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HelloReply* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "milvus.grpc.HelloReply"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_hello_2eproto); + return ::descriptor_table_hello_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMsgFieldNumber = 1, + }; + // string msg = 1; + void clear_msg(); + const std::string& msg() const; + void set_msg(const std::string& value); + void set_msg(std::string&& value); + void set_msg(const char* value); + void set_msg(const char* value, size_t size); + std::string* mutable_msg(); + std::string* release_msg(); + void set_allocated_msg(std::string* msg); + + // @@protoc_insertion_point(class_scope:milvus.grpc.HelloReply) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr msg_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_hello_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// HelloRequest + +// string name = 1; +inline void HelloRequest::clear_name() { + name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& HelloRequest::name() const { + // @@protoc_insertion_point(field_get:milvus.grpc.HelloRequest.name) + return name_.GetNoArena(); +} +inline void HelloRequest::set_name(const std::string& value) { + + name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.HelloRequest.name) +} +inline void HelloRequest::set_name(std::string&& value) { + + name_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.HelloRequest.name) +} +inline void HelloRequest::set_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.HelloRequest.name) +} +inline void HelloRequest::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.HelloRequest.name) +} +inline std::string* HelloRequest::mutable_name() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.HelloRequest.name) + return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* HelloRequest::release_name() { + // @@protoc_insertion_point(field_release:milvus.grpc.HelloRequest.name) + + return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void HelloRequest::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.HelloRequest.name) +} + +// ------------------------------------------------------------------- + +// HelloReply + +// string msg = 1; +inline void HelloReply::clear_msg() { + msg_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& HelloReply::msg() const { + // @@protoc_insertion_point(field_get:milvus.grpc.HelloReply.msg) + return msg_.GetNoArena(); +} +inline void HelloReply::set_msg(const std::string& value) { + + msg_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:milvus.grpc.HelloReply.msg) +} +inline void HelloReply::set_msg(std::string&& value) { + + msg_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.HelloReply.msg) +} +inline void HelloReply::set_msg(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + msg_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:milvus.grpc.HelloReply.msg) +} +inline void HelloReply::set_msg(const char* value, size_t size) { + + msg_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:milvus.grpc.HelloReply.msg) +} +inline std::string* HelloReply::mutable_msg() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.HelloReply.msg) + return msg_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* HelloReply::release_msg() { + // @@protoc_insertion_point(field_release:milvus.grpc.HelloReply.msg) + + return msg_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void HelloReply::set_allocated_msg(std::string* msg) { + if (msg != nullptr) { + + } else { + + } + msg_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), msg); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.HelloReply.msg) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace grpc +} // namespace milvus + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_hello_2eproto diff --git a/proxy/src/grpc/master.grpc.pb.cc b/proxy/src/grpc/master.grpc.pb.cc new file mode 100644 index 0000000000..7d89b50e28 --- /dev/null +++ b/proxy/src/grpc/master.grpc.pb.cc @@ -0,0 +1,125 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: master.proto + +#include "master.pb.h" +#include "master.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace master { + +static const char* Greeter_method_names[] = { + "/master.Greeter/ReportAddress", + "/master.Greeter/GetAddress", +}; + +std::unique_ptr< Greeter::Stub> Greeter::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + (void)options; + std::unique_ptr< Greeter::Stub> stub(new Greeter::Stub(channel)); + return stub; +} + +Greeter::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel), rpcmethod_ReportAddress_(Greeter_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_GetAddress_(Greeter_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) + {} + +::grpc::Status Greeter::Stub::ReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::master::Reply* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ReportAddress_, context, request, response); +} + +void Greeter::Stub::experimental_async::ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ReportAddress_, context, request, response, std::move(f)); +} + +void Greeter::Stub::experimental_async::ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ReportAddress_, context, request, response, std::move(f)); +} + +void Greeter::Stub::experimental_async::ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ReportAddress_, context, request, response, reactor); +} + +void Greeter::Stub::experimental_async::ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ReportAddress_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::master::Reply>* Greeter::Stub::AsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::master::Reply>::Create(channel_.get(), cq, rpcmethod_ReportAddress_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::master::Reply>* Greeter::Stub::PrepareAsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::master::Reply>::Create(channel_.get(), cq, rpcmethod_ReportAddress_, context, request, false); +} + +::grpc::Status Greeter::Stub::GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::master::Request* response) { + return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_GetAddress_, context, request, response); +} + +void Greeter::Stub::experimental_async::GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetAddress_, context, request, response, std::move(f)); +} + +void Greeter::Stub::experimental_async::GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, std::function f) { + ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetAddress_, context, request, response, std::move(f)); +} + +void Greeter::Stub::experimental_async::GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetAddress_, context, request, response, reactor); +} + +void Greeter::Stub::experimental_async::GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) { + ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetAddress_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::master::Request>* Greeter::Stub::AsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::master::Request>::Create(channel_.get(), cq, rpcmethod_GetAddress_, context, request, true); +} + +::grpc::ClientAsyncResponseReader< ::master::Request>* Greeter::Stub::PrepareAsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::master::Request>::Create(channel_.get(), cq, rpcmethod_GetAddress_, context, request, false); +} + +Greeter::Service::Service() { + AddMethod(new ::grpc::internal::RpcServiceMethod( + Greeter_method_names[0], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Greeter::Service, ::master::Request, ::master::Reply>( + std::mem_fn(&Greeter::Service::ReportAddress), this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + Greeter_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< Greeter::Service, ::master::EmptyRequest, ::master::Request>( + std::mem_fn(&Greeter::Service::GetAddress), this))); +} + +Greeter::Service::~Service() { +} + +::grpc::Status Greeter::Service::ReportAddress(::grpc::ServerContext* context, const ::master::Request* request, ::master::Reply* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + +::grpc::Status Greeter::Service::GetAddress(::grpc::ServerContext* context, const ::master::EmptyRequest* request, ::master::Request* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace master + diff --git a/proxy/src/grpc/master.grpc.pb.h b/proxy/src/grpc/master.grpc.pb.h new file mode 100644 index 0000000000..f8116f7dc8 --- /dev/null +++ b/proxy/src/grpc/master.grpc.pb.h @@ -0,0 +1,420 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: master.proto +#ifndef GRPC_master_2eproto__INCLUDED +#define GRPC_master_2eproto__INCLUDED + +#include "master.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class CompletionQueue; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc + +namespace master { + +// The greeting service definition. +class Greeter final { + public: + static constexpr char const* service_full_name() { + return "master.Greeter"; + } + class StubInterface { + public: + virtual ~StubInterface() {} + // receive a grpc_server address and set to etcd. + virtual ::grpc::Status ReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::master::Reply* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>> AsyncReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>>(AsyncReportAddressRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>> PrepareAsyncReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>>(PrepareAsyncReportAddressRaw(context, request, cq)); + } + // send a grpc_server address to client + virtual ::grpc::Status GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::master::Request* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>> AsyncGetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>>(AsyncGetAddressRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>> PrepareAsyncGetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>>(PrepareAsyncGetAddressRaw(context, request, cq)); + } + class experimental_async_interface { + public: + virtual ~experimental_async_interface() {} + // receive a grpc_server address and set to etcd. + virtual void ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, std::function) = 0; + virtual void ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, std::function) = 0; + virtual void ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + virtual void ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + // send a grpc_server address to client + virtual void GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, std::function) = 0; + virtual void GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, std::function) = 0; + virtual void GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + virtual void GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; + }; + virtual class experimental_async_interface* experimental_async() { return nullptr; } + private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>* AsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::master::Reply>* PrepareAsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>* AsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::master::Request>* PrepareAsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) = 0; + }; + class Stub final : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + ::grpc::Status ReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::master::Reply* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Reply>> AsyncReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Reply>>(AsyncReportAddressRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Reply>> PrepareAsyncReportAddress(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Reply>>(PrepareAsyncReportAddressRaw(context, request, cq)); + } + ::grpc::Status GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::master::Request* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Request>> AsyncGetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Request>>(AsyncGetAddressRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Request>> PrepareAsyncGetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::master::Request>>(PrepareAsyncGetAddressRaw(context, request, cq)); + } + class experimental_async final : + public StubInterface::experimental_async_interface { + public: + void ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, std::function) override; + void ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, std::function) override; + void ReportAddress(::grpc::ClientContext* context, const ::master::Request* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void ReportAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Reply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, std::function) override; + void GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, std::function) override; + void GetAddress(::grpc::ClientContext* context, const ::master::EmptyRequest* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + void GetAddress(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::master::Request* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; + private: + friend class Stub; + explicit experimental_async(Stub* stub): stub_(stub) { } + Stub* stub() { return stub_; } + Stub* stub_; + }; + class experimental_async_interface* experimental_async() override { return &async_stub_; } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + class experimental_async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::master::Reply>* AsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::master::Reply>* PrepareAsyncReportAddressRaw(::grpc::ClientContext* context, const ::master::Request& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::master::Request>* AsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::master::Request>* PrepareAsyncGetAddressRaw(::grpc::ClientContext* context, const ::master::EmptyRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_ReportAddress_; + const ::grpc::internal::RpcMethod rpcmethod_GetAddress_; + }; + static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + // receive a grpc_server address and set to etcd. + virtual ::grpc::Status ReportAddress(::grpc::ServerContext* context, const ::master::Request* request, ::master::Reply* response); + // send a grpc_server address to client + virtual ::grpc::Status GetAddress(::grpc::ServerContext* context, const ::master::EmptyRequest* request, ::master::Request* response); + }; + template + class WithAsyncMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_ReportAddress() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestReportAddress(::grpc::ServerContext* context, ::master::Request* request, ::grpc::ServerAsyncResponseWriter< ::master::Reply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithAsyncMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_GetAddress() { + ::grpc::Service::MarkMethodAsync(1); + } + ~WithAsyncMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetAddress(::grpc::ServerContext* context, ::master::EmptyRequest* request, ::grpc::ServerAsyncResponseWriter< ::master::Request>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_ReportAddress > AsyncService; + template + class ExperimentalWithCallbackMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithCallbackMethod_ReportAddress() { + ::grpc::Service::experimental().MarkMethodCallback(0, + new ::grpc_impl::internal::CallbackUnaryHandler< ::master::Request, ::master::Reply>( + [this](::grpc::ServerContext* context, + const ::master::Request* request, + ::master::Reply* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->ReportAddress(context, request, response, controller); + })); + } + void SetMessageAllocatorFor_ReportAddress( + ::grpc::experimental::MessageAllocator< ::master::Request, ::master::Reply>* allocator) { + static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::master::Request, ::master::Reply>*>( + ::grpc::Service::experimental().GetHandler(0)) + ->SetMessageAllocator(allocator); + } + ~ExperimentalWithCallbackMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithCallbackMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithCallbackMethod_GetAddress() { + ::grpc::Service::experimental().MarkMethodCallback(1, + new ::grpc_impl::internal::CallbackUnaryHandler< ::master::EmptyRequest, ::master::Request>( + [this](::grpc::ServerContext* context, + const ::master::EmptyRequest* request, + ::master::Request* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + return this->GetAddress(context, request, response, controller); + })); + } + void SetMessageAllocatorFor_GetAddress( + ::grpc::experimental::MessageAllocator< ::master::EmptyRequest, ::master::Request>* allocator) { + static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::master::EmptyRequest, ::master::Request>*>( + ::grpc::Service::experimental().GetHandler(1)) + ->SetMessageAllocator(allocator); + } + ~ExperimentalWithCallbackMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + typedef ExperimentalWithCallbackMethod_ReportAddress > ExperimentalCallbackService; + template + class WithGenericMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_ReportAddress() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithGenericMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_GetAddress() { + ::grpc::Service::MarkMethodGeneric(1); + } + ~WithGenericMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template + class WithRawMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_ReportAddress() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestReportAddress(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_GetAddress() { + ::grpc::Service::MarkMethodRaw(1); + } + ~WithRawMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestGetAddress(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template + class ExperimentalWithRawCallbackMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithRawCallbackMethod_ReportAddress() { + ::grpc::Service::experimental().MarkMethodRawCallback(0, + new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->ReportAddress(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void ReportAddress(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class ExperimentalWithRawCallbackMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + ExperimentalWithRawCallbackMethod_GetAddress() { + ::grpc::Service::experimental().MarkMethodRawCallback(1, + new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this](::grpc::ServerContext* context, + const ::grpc::ByteBuffer* request, + ::grpc::ByteBuffer* response, + ::grpc::experimental::ServerCallbackRpcController* controller) { + this->GetAddress(context, request, response, controller); + })); + } + ~ExperimentalWithRawCallbackMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual void GetAddress(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } + }; + template + class WithStreamedUnaryMethod_ReportAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_ReportAddress() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< ::master::Request, ::master::Reply>(std::bind(&WithStreamedUnaryMethod_ReportAddress::StreamedReportAddress, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_ReportAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status ReportAddress(::grpc::ServerContext* /*context*/, const ::master::Request* /*request*/, ::master::Reply* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedReportAddress(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::master::Request,::master::Reply>* server_unary_streamer) = 0; + }; + template + class WithStreamedUnaryMethod_GetAddress : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_GetAddress() { + ::grpc::Service::MarkMethodStreamed(1, + new ::grpc::internal::StreamedUnaryHandler< ::master::EmptyRequest, ::master::Request>(std::bind(&WithStreamedUnaryMethod_GetAddress::StreamedGetAddress, this, std::placeholders::_1, std::placeholders::_2))); + } + ~WithStreamedUnaryMethod_GetAddress() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status GetAddress(::grpc::ServerContext* /*context*/, const ::master::EmptyRequest* /*request*/, ::master::Request* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedGetAddress(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::master::EmptyRequest,::master::Request>* server_unary_streamer) = 0; + }; + typedef WithStreamedUnaryMethod_ReportAddress > StreamedUnaryService; + typedef Service SplitStreamedService; + typedef WithStreamedUnaryMethod_ReportAddress > StreamedService; +}; + +} // namespace master + + +#endif // GRPC_master_2eproto__INCLUDED diff --git a/proxy/src/grpc/master.pb.cc b/proxy/src/grpc/master.pb.cc new file mode 100644 index 0000000000..3b34b2e6eb --- /dev/null +++ b/proxy/src/grpc/master.pb.cc @@ -0,0 +1,867 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: master.proto + +#include "master.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +namespace master { +class RequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Request_default_instance_; +class EmptyRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _EmptyRequest_default_instance_; +class ReplyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Reply_default_instance_; +} // namespace master +static void InitDefaultsscc_info_EmptyRequest_master_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::master::_EmptyRequest_default_instance_; + new (ptr) ::master::EmptyRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::master::EmptyRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EmptyRequest_master_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_EmptyRequest_master_2eproto}, {}}; + +static void InitDefaultsscc_info_Reply_master_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::master::_Reply_default_instance_; + new (ptr) ::master::Reply(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::master::Reply::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Reply_master_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Reply_master_2eproto}, {}}; + +static void InitDefaultsscc_info_Request_master_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::master::_Request_default_instance_; + new (ptr) ::master::Request(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::master::Request::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Request_master_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Request_master_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_master_2eproto[3]; +static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_master_2eproto = nullptr; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_master_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::master::Request, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::master::Request, address_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::master::EmptyRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::master::Reply, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::master::Reply, status_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::master::Request)}, + { 6, -1, sizeof(::master::EmptyRequest)}, + { 11, -1, sizeof(::master::Reply)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::master::_Request_default_instance_), + reinterpret_cast(&::master::_EmptyRequest_default_instance_), + reinterpret_cast(&::master::_Reply_default_instance_), +}; + +const char descriptor_table_protodef_master_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\014master.proto\022\006master\"\032\n\007Request\022\017\n\007add" + "ress\030\001 \001(\t\"\016\n\014EmptyRequest\"\027\n\005Reply\022\016\n\006s" + "tatus\030\001 \001(\0102s\n\007Greeter\0221\n\rReportAddress\022" + "\017.master.Request\032\r.master.Reply\"\000\0225\n\nGet" + "Address\022\024.master.EmptyRequest\032\017.master.R" + "equest\"\000b\006proto3" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_master_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_master_2eproto_sccs[3] = { + &scc_info_EmptyRequest_master_2eproto.base, + &scc_info_Reply_master_2eproto.base, + &scc_info_Request_master_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_master_2eproto_once; +static bool descriptor_table_master_2eproto_initialized = false; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto = { + &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 216, + &descriptor_table_master_2eproto_once, descriptor_table_master_2eproto_sccs, descriptor_table_master_2eproto_deps, 3, 0, + schemas, file_default_instances, TableStruct_master_2eproto::offsets, + file_level_metadata_master_2eproto, 3, file_level_enum_descriptors_master_2eproto, file_level_service_descriptors_master_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_master_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_master_2eproto), true); +namespace master { + +// =================================================================== + +void Request::InitAsDefaultInstance() { +} +class Request::_Internal { + public: +}; + +Request::Request() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:master.Request) +} +Request::Request(const Request& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.address().empty()) { + address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.address_); + } + // @@protoc_insertion_point(copy_constructor:master.Request) +} + +void Request::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Request_master_2eproto.base); + address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +Request::~Request() { + // @@protoc_insertion_point(destructor:master.Request) + SharedDtor(); +} + +void Request::SharedDtor() { + address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void Request::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Request& Request::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_master_2eproto.base); + return *internal_default_instance(); +} + + +void Request::Clear() { +// @@protoc_insertion_point(message_clear_start:master.Request) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + address_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Request::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string address = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_address(), ptr, ctx, "master.Request.address"); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Request::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:master.Request) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // string address = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_address())); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->address().data(), static_cast(this->address().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, + "master.Request.address")); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:master.Request) + return true; +failure: + // @@protoc_insertion_point(parse_failure:master.Request) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Request::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:master.Request) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string address = 1; + if (this->address().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->address().data(), static_cast(this->address().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "master.Request.address"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->address(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:master.Request) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Request::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:master.Request) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string address = 1; + if (this->address().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->address().data(), static_cast(this->address().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "master.Request.address"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 1, this->address(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:master.Request) + return target; +} + +size_t Request::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:master.Request) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string address = 1; + if (this->address().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->address()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Request::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:master.Request) + GOOGLE_DCHECK_NE(&from, this); + const Request* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:master.Request) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:master.Request) + MergeFrom(*source); + } +} + +void Request::MergeFrom(const Request& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:master.Request) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.address().size() > 0) { + + address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.address_); + } +} + +void Request::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:master.Request) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Request::CopyFrom(const Request& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:master.Request) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Request::IsInitialized() const { + return true; +} + +void Request::InternalSwap(Request* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + address_.Swap(&other->address_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Request::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void EmptyRequest::InitAsDefaultInstance() { +} +class EmptyRequest::_Internal { + public: +}; + +EmptyRequest::EmptyRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:master.EmptyRequest) +} +EmptyRequest::EmptyRequest(const EmptyRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:master.EmptyRequest) +} + +void EmptyRequest::SharedCtor() { +} + +EmptyRequest::~EmptyRequest() { + // @@protoc_insertion_point(destructor:master.EmptyRequest) + SharedDtor(); +} + +void EmptyRequest::SharedDtor() { +} + +void EmptyRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const EmptyRequest& EmptyRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EmptyRequest_master_2eproto.base); + return *internal_default_instance(); +} + + +void EmptyRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:master.EmptyRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* EmptyRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool EmptyRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:master.EmptyRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:master.EmptyRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:master.EmptyRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void EmptyRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:master.EmptyRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:master.EmptyRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* EmptyRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:master.EmptyRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:master.EmptyRequest) + return target; +} + +size_t EmptyRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:master.EmptyRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void EmptyRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:master.EmptyRequest) + GOOGLE_DCHECK_NE(&from, this); + const EmptyRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:master.EmptyRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:master.EmptyRequest) + MergeFrom(*source); + } +} + +void EmptyRequest::MergeFrom(const EmptyRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:master.EmptyRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void EmptyRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:master.EmptyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EmptyRequest::CopyFrom(const EmptyRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:master.EmptyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EmptyRequest::IsInitialized() const { + return true; +} + +void EmptyRequest::InternalSwap(EmptyRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata EmptyRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void Reply::InitAsDefaultInstance() { +} +class Reply::_Internal { + public: +}; + +Reply::Reply() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:master.Reply) +} +Reply::Reply(const Reply& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + status_ = from.status_; + // @@protoc_insertion_point(copy_constructor:master.Reply) +} + +void Reply::SharedCtor() { + status_ = false; +} + +Reply::~Reply() { + // @@protoc_insertion_point(destructor:master.Reply) + SharedDtor(); +} + +void Reply::SharedDtor() { +} + +void Reply::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Reply& Reply::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Reply_master_2eproto.base); + return *internal_default_instance(); +} + + +void Reply::Clear() { +// @@protoc_insertion_point(message_clear_start:master.Reply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + status_ = false; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Reply::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // bool status = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Reply::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:master.Reply) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // bool status = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &status_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:master.Reply) + return true; +failure: + // @@protoc_insertion_point(parse_failure:master.Reply) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Reply::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:master.Reply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool status = 1; + if (this->status() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(1, this->status(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:master.Reply) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Reply::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:master.Reply) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // bool status = 1; + if (this->status() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->status(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:master.Reply) + return target; +} + +size_t Reply::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:master.Reply) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool status = 1; + if (this->status() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Reply::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:master.Reply) + GOOGLE_DCHECK_NE(&from, this); + const Reply* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:master.Reply) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:master.Reply) + MergeFrom(*source); + } +} + +void Reply::MergeFrom(const Reply& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:master.Reply) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.status() != 0) { + set_status(from.status()); + } +} + +void Reply::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:master.Reply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Reply::CopyFrom(const Reply& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:master.Reply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Reply::IsInitialized() const { + return true; +} + +void Reply::InternalSwap(Reply* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(status_, other->status_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Reply::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace master +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::master::Request* Arena::CreateMaybeMessage< ::master::Request >(Arena* arena) { + return Arena::CreateInternal< ::master::Request >(arena); +} +template<> PROTOBUF_NOINLINE ::master::EmptyRequest* Arena::CreateMaybeMessage< ::master::EmptyRequest >(Arena* arena) { + return Arena::CreateInternal< ::master::EmptyRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::master::Reply* Arena::CreateMaybeMessage< ::master::Reply >(Arena* arena) { + return Arena::CreateInternal< ::master::Reply >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/proxy/src/grpc/master.pb.h b/proxy/src/grpc/master.pb.h new file mode 100644 index 0000000000..d4c8f8fb51 --- /dev/null +++ b/proxy/src/grpc/master.pb.h @@ -0,0 +1,564 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: master.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_master_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_master_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3009000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3009000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_master_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_master_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto; +namespace master { +class EmptyRequest; +class EmptyRequestDefaultTypeInternal; +extern EmptyRequestDefaultTypeInternal _EmptyRequest_default_instance_; +class Reply; +class ReplyDefaultTypeInternal; +extern ReplyDefaultTypeInternal _Reply_default_instance_; +class Request; +class RequestDefaultTypeInternal; +extern RequestDefaultTypeInternal _Request_default_instance_; +} // namespace master +PROTOBUF_NAMESPACE_OPEN +template<> ::master::EmptyRequest* Arena::CreateMaybeMessage<::master::EmptyRequest>(Arena*); +template<> ::master::Reply* Arena::CreateMaybeMessage<::master::Reply>(Arena*); +template<> ::master::Request* Arena::CreateMaybeMessage<::master::Request>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace master { + +// =================================================================== + +class Request : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:master.Request) */ { + public: + Request(); + virtual ~Request(); + + Request(const Request& from); + Request(Request&& from) noexcept + : Request() { + *this = ::std::move(from); + } + + inline Request& operator=(const Request& from) { + CopyFrom(from); + return *this; + } + inline Request& operator=(Request&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const Request& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Request* internal_default_instance() { + return reinterpret_cast( + &_Request_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Request& a, Request& b) { + a.Swap(&b); + } + inline void Swap(Request* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline Request* New() const final { + return CreateMaybeMessage(nullptr); + } + + Request* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const Request& from); + void MergeFrom(const Request& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Request* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "master.Request"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); + return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kAddressFieldNumber = 1, + }; + // string address = 1; + void clear_address(); + const std::string& address() const; + void set_address(const std::string& value); + void set_address(std::string&& value); + void set_address(const char* value); + void set_address(const char* value, size_t size); + std::string* mutable_address(); + std::string* release_address(); + void set_allocated_address(std::string* address); + + // @@protoc_insertion_point(class_scope:master.Request) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr address_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_master_2eproto; +}; +// ------------------------------------------------------------------- + +class EmptyRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:master.EmptyRequest) */ { + public: + EmptyRequest(); + virtual ~EmptyRequest(); + + EmptyRequest(const EmptyRequest& from); + EmptyRequest(EmptyRequest&& from) noexcept + : EmptyRequest() { + *this = ::std::move(from); + } + + inline EmptyRequest& operator=(const EmptyRequest& from) { + CopyFrom(from); + return *this; + } + inline EmptyRequest& operator=(EmptyRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const EmptyRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const EmptyRequest* internal_default_instance() { + return reinterpret_cast( + &_EmptyRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(EmptyRequest& a, EmptyRequest& b) { + a.Swap(&b); + } + inline void Swap(EmptyRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline EmptyRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + EmptyRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const EmptyRequest& from); + void MergeFrom(const EmptyRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EmptyRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "master.EmptyRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); + return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:master.EmptyRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_master_2eproto; +}; +// ------------------------------------------------------------------- + +class Reply : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:master.Reply) */ { + public: + Reply(); + virtual ~Reply(); + + Reply(const Reply& from); + Reply(Reply&& from) noexcept + : Reply() { + *this = ::std::move(from); + } + + inline Reply& operator=(const Reply& from) { + CopyFrom(from); + return *this; + } + inline Reply& operator=(Reply&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const Reply& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Reply* internal_default_instance() { + return reinterpret_cast( + &_Reply_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(Reply& a, Reply& b) { + a.Swap(&b); + } + inline void Swap(Reply* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline Reply* New() const final { + return CreateMaybeMessage(nullptr); + } + + Reply* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const Reply& from); + void MergeFrom(const Reply& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Reply* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "master.Reply"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); + return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kStatusFieldNumber = 1, + }; + // bool status = 1; + void clear_status(); + bool status() const; + void set_status(bool value); + + // @@protoc_insertion_point(class_scope:master.Reply) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + bool status_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_master_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Request + +// string address = 1; +inline void Request::clear_address() { + address_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline const std::string& Request::address() const { + // @@protoc_insertion_point(field_get:master.Request.address) + return address_.GetNoArena(); +} +inline void Request::set_address(const std::string& value) { + + address_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:master.Request.address) +} +inline void Request::set_address(std::string&& value) { + + address_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:master.Request.address) +} +inline void Request::set_address(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + address_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:master.Request.address) +} +inline void Request::set_address(const char* value, size_t size) { + + address_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:master.Request.address) +} +inline std::string* Request::mutable_address() { + + // @@protoc_insertion_point(field_mutable:master.Request.address) + return address_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Request::release_address() { + // @@protoc_insertion_point(field_release:master.Request.address) + + return address_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Request::set_allocated_address(std::string* address) { + if (address != nullptr) { + + } else { + + } + address_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), address); + // @@protoc_insertion_point(field_set_allocated:master.Request.address) +} + +// ------------------------------------------------------------------- + +// EmptyRequest + +// ------------------------------------------------------------------- + +// Reply + +// bool status = 1; +inline void Reply::clear_status() { + status_ = false; +} +inline bool Reply::status() const { + // @@protoc_insertion_point(field_get:master.Reply.status) + return status_; +} +inline void Reply::set_status(bool value) { + + status_ = value; + // @@protoc_insertion_point(field_set:master.Reply.status) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace master + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_master_2eproto diff --git a/proxy/src/grpc/message.pb.cc b/proxy/src/grpc/message.pb.cc index 72a3d4b7b7..bb9a018e11 100644 --- a/proxy/src/grpc/message.pb.cc +++ b/proxy/src/grpc/message.pb.cc @@ -1290,8 +1290,6 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_message_2eproto::offsets[] PRO PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, timestamp_), PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, client_id_), PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, extra_params_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, json_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, dsl_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::milvus::grpc::TimeSyncMsg, _internal_metadata_), ~0u, // no _extensions_ @@ -1306,7 +1304,6 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_message_2eproto::offsets[] PRO ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, uid_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, timestamp_), PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, segment_id_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -1355,8 +1352,8 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 324, -1, sizeof(::milvus::grpc::SearchParamPB)}, { 333, -1, sizeof(::milvus::grpc::InsertOrDeleteMsg)}, { 348, -1, sizeof(::milvus::grpc::SearchMsg)}, - { 362, -1, sizeof(::milvus::grpc::TimeSyncMsg)}, - { 370, -1, sizeof(::milvus::grpc::Key2SegMsg)}, + { 360, -1, sizeof(::milvus::grpc::TimeSyncMsg)}, + { 368, -1, sizeof(::milvus::grpc::Key2SegMsg)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -1523,83 +1520,82 @@ const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE "\nsegment_id\030\006 \001(\003\022\022\n\nchannel_id\030\007 \001(\003\022\037\n" "\002op\030\010 \001(\0162\023.milvus.grpc.OpType\022\021\n\tclient" "_id\030\t \001(\003\022/\n\014extra_params\030\n \003(\0132\031.milvus" - ".grpc.KeyValuePair\"\351\001\n\tSearchMsg\022\027\n\017coll" + ".grpc.KeyValuePair\"\316\001\n\tSearchMsg\022\027\n\017coll" "ection_name\030\001 \001(\t\022-\n\007records\030\002 \001(\0132\034.mil" "vus.grpc.VectorRowRecord\022\025\n\rpartition_ta" - "g\030\003 \003(\t\022\013\n\003uid\030\004 \001(\003\022\021\n\ttimestamp\030\005 \001(\004\022" + "g\030\003 \001(\t\022\013\n\003uid\030\004 \001(\003\022\021\n\ttimestamp\030\005 \001(\004\022" "\021\n\tclient_id\030\006 \001(\003\022/\n\014extra_params\030\007 \003(\013" - "2\031.milvus.grpc.KeyValuePair\022\014\n\004json\030\010 \003(" - "\t\022\013\n\003dsl\030\t \001(\t\"[\n\013TimeSyncMsg\022\017\n\007peer_Id" - "\030\001 \001(\003\022\021\n\tTimestamp\030\002 \001(\004\022(\n\tsync_type\030\003" - " \001(\0162\025.milvus.grpc.SyncType\"@\n\nKey2SegMs" - "g\022\013\n\003uid\030\001 \001(\003\022\021\n\ttimestamp\030\002 \001(\004\022\022\n\nseg" - "ment_id\030\003 \003(\003*\242\004\n\tErrorCode\022\013\n\007SUCCESS\020\000" - "\022\024\n\020UNEXPECTED_ERROR\020\001\022\022\n\016CONNECT_FAILED" - "\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\031\n\025COLLECTION_" - "NOT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025\n\021IL" - "LEGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_TYPE\020" - "\010\022\033\n\027ILLEGAL_COLLECTION_NAME\020\t\022\020\n\014ILLEGA" - "L_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021ILLEG" - "AL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESULT\020" - "\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020\017\022\020" - "\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOLDER" - "\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_DEL" - "ETE_FOLDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022\025\n\021" - "BUILD_INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST\020\026\022\027" - "\n\023ILLEGAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_MEMORY" - "\020\030*\221\001\n\010DataType\022\010\n\004NONE\020\000\022\010\n\004BOOL\020\001\022\010\n\004I" - "NT8\020\002\022\t\n\005INT16\020\003\022\t\n\005INT32\020\004\022\t\n\005INT64\020\005\022\t" - "\n\005FLOAT\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006STRING\020\024\022\021\n\rVEC" - "TOR_BINARY\020d\022\020\n\014VECTOR_FLOAT\020e*C\n\017Compar" - "eOperator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n\002EQ\020\002\022\006\n\002GT" - "\020\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022\013\n\007INVALID\020" - "\000\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MUST_NOT\020\003* \n" - "\006OpType\022\n\n\006INSERT\020\000\022\n\n\006DELETE\020\001*\037\n\010SyncT" - "ype\022\010\n\004READ\020\000\022\t\n\005WRITE\020\0012\333\r\n\rMilvusServi" - "ce\022\?\n\020CreateCollection\022\024.milvus.grpc.Map" - "ping\032\023.milvus.grpc.Status\"\000\022F\n\rHasCollec" - "tion\022\033.milvus.grpc.CollectionName\032\026.milv" - "us.grpc.BoolReply\"\000\022I\n\022DescribeCollectio" - "n\022\033.milvus.grpc.CollectionName\032\024.milvus." - "grpc.Mapping\"\000\022Q\n\017CountCollection\022\033.milv" - "us.grpc.CollectionName\032\037.milvus.grpc.Col" - "lectionRowCount\"\000\022J\n\017ShowCollections\022\024.m" - "ilvus.grpc.Command\032\037.milvus.grpc.Collect" - "ionNameList\"\000\022P\n\022ShowCollectionInfo\022\033.mi" - "lvus.grpc.CollectionName\032\033.milvus.grpc.C" - "ollectionInfo\"\000\022D\n\016DropCollection\022\033.milv" - "us.grpc.CollectionName\032\023.milvus.grpc.Sta" - "tus\"\000\022=\n\013CreateIndex\022\027.milvus.grpc.Index" - "Param\032\023.milvus.grpc.Status\"\000\022C\n\rDescribe" - "Index\022\027.milvus.grpc.IndexParam\032\027.milvus." - "grpc.IndexParam\"\000\022;\n\tDropIndex\022\027.milvus." - "grpc.IndexParam\032\023.milvus.grpc.Status\"\000\022E" - "\n\017CreatePartition\022\033.milvus.grpc.Partitio" - "nParam\032\023.milvus.grpc.Status\"\000\022E\n\014HasPart" - "ition\022\033.milvus.grpc.PartitionParam\032\026.mil" - "vus.grpc.BoolReply\"\000\022K\n\016ShowPartitions\022\033" - ".milvus.grpc.CollectionName\032\032.milvus.grp" - "c.PartitionList\"\000\022C\n\rDropPartition\022\033.mil" - "vus.grpc.PartitionParam\032\023.milvus.grpc.St" - "atus\"\000\022<\n\006Insert\022\030.milvus.grpc.InsertPar" - "am\032\026.milvus.grpc.EntityIds\"\000\022E\n\rGetEntit" - "yByID\022\033.milvus.grpc.EntityIdentity\032\025.mil" - "vus.grpc.Entities\"\000\022H\n\014GetEntityIDs\022\036.mi" - "lvus.grpc.GetEntityIDsParam\032\026.milvus.grp" - "c.EntityIds\"\000\022>\n\006Search\022\030.milvus.grpc.Se" - "archParam\032\030.milvus.grpc.QueryResult\"\000\022P\n" - "\017SearchInSegment\022!.milvus.grpc.SearchInS" - "egmentParam\032\030.milvus.grpc.QueryResult\"\000\022" - "7\n\003Cmd\022\024.milvus.grpc.Command\032\030.milvus.gr" - "pc.StringReply\"\000\022A\n\nDeleteByID\022\034.milvus." - "grpc.DeleteByIDParam\032\023.milvus.grpc.Statu" - "s\"\000\022G\n\021PreloadCollection\022\033.milvus.grpc.C" - "ollectionName\032\023.milvus.grpc.Status\"\000\0227\n\005" - "Flush\022\027.milvus.grpc.FlushParam\032\023.milvus." - "grpc.Status\"\000\022;\n\007Compact\022\031.milvus.grpc.C" - "ompactParam\032\023.milvus.grpc.Status\"\000\022B\n\010Se" - "archPB\022\032.milvus.grpc.SearchParamPB\032\030.mil" - "vus.grpc.QueryResult\"\000B\007Z\005msgpbb\006proto3" + "2\031.milvus.grpc.KeyValuePair\"[\n\013TimeSyncM" + "sg\022\017\n\007peer_Id\030\001 \001(\003\022\021\n\tTimestamp\030\002 \001(\004\022(" + "\n\tsync_type\030\003 \001(\0162\025.milvus.grpc.SyncType" + "\"-\n\nKey2SegMsg\022\013\n\003uid\030\001 \001(\003\022\022\n\nsegment_i" + "d\030\002 \003(\003*\242\004\n\tErrorCode\022\013\n\007SUCCESS\020\000\022\024\n\020UN" + "EXPECTED_ERROR\020\001\022\022\n\016CONNECT_FAILED\020\002\022\025\n\021" + "PERMISSION_DENIED\020\003\022\031\n\025COLLECTION_NOT_EX" + "ISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025\n\021ILLEGAL_" + "DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_TYPE\020\010\022\033\n\027I" + "LLEGAL_COLLECTION_NAME\020\t\022\020\n\014ILLEGAL_TOPK" + "\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021ILLEGAL_VEC" + "TOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESULT\020\r\022\022\n\016F" + "ILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020\017\022\020\n\014CACH" + "E_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOLDER\020\021\022\026\n\022" + "CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_DELETE_FO" + "LDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022\025\n\021BUILD_" + "INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST\020\026\022\027\n\023ILLE" + "GAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_MEMORY\020\030*\221\001\n" + "\010DataType\022\010\n\004NONE\020\000\022\010\n\004BOOL\020\001\022\010\n\004INT8\020\002\022" + "\t\n\005INT16\020\003\022\t\n\005INT32\020\004\022\t\n\005INT64\020\005\022\t\n\005FLOA" + "T\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006STRING\020\024\022\021\n\rVECTOR_BI" + "NARY\020d\022\020\n\014VECTOR_FLOAT\020e*C\n\017CompareOpera" + "tor\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n\002EQ\020\002\022\006\n\002GT\020\003\022\007\n\003" + "GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022\013\n\007INVALID\020\000\022\010\n\004M" + "UST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MUST_NOT\020\003* \n\006OpTyp" + "e\022\n\n\006INSERT\020\000\022\n\n\006DELETE\020\001*\037\n\010SyncType\022\010\n" + "\004READ\020\000\022\t\n\005WRITE\020\0012\333\r\n\rMilvusService\022\?\n\020" + "CreateCollection\022\024.milvus.grpc.Mapping\032\023" + ".milvus.grpc.Status\"\000\022F\n\rHasCollection\022\033" + ".milvus.grpc.CollectionName\032\026.milvus.grp" + "c.BoolReply\"\000\022I\n\022DescribeCollection\022\033.mi" + "lvus.grpc.CollectionName\032\024.milvus.grpc.M" + "apping\"\000\022Q\n\017CountCollection\022\033.milvus.grp" + "c.CollectionName\032\037.milvus.grpc.Collectio" + "nRowCount\"\000\022J\n\017ShowCollections\022\024.milvus." + "grpc.Command\032\037.milvus.grpc.CollectionNam" + "eList\"\000\022P\n\022ShowCollectionInfo\022\033.milvus.g" + "rpc.CollectionName\032\033.milvus.grpc.Collect" + "ionInfo\"\000\022D\n\016DropCollection\022\033.milvus.grp" + "c.CollectionName\032\023.milvus.grpc.Status\"\000\022" + "=\n\013CreateIndex\022\027.milvus.grpc.IndexParam\032" + "\023.milvus.grpc.Status\"\000\022C\n\rDescribeIndex\022" + "\027.milvus.grpc.IndexParam\032\027.milvus.grpc.I" + "ndexParam\"\000\022;\n\tDropIndex\022\027.milvus.grpc.I" + "ndexParam\032\023.milvus.grpc.Status\"\000\022E\n\017Crea" + "tePartition\022\033.milvus.grpc.PartitionParam" + "\032\023.milvus.grpc.Status\"\000\022E\n\014HasPartition\022" + "\033.milvus.grpc.PartitionParam\032\026.milvus.gr" + "pc.BoolReply\"\000\022K\n\016ShowPartitions\022\033.milvu" + "s.grpc.CollectionName\032\032.milvus.grpc.Part" + "itionList\"\000\022C\n\rDropPartition\022\033.milvus.gr" + "pc.PartitionParam\032\023.milvus.grpc.Status\"\000" + "\022<\n\006Insert\022\030.milvus.grpc.InsertParam\032\026.m" + "ilvus.grpc.EntityIds\"\000\022E\n\rGetEntityByID\022" + "\033.milvus.grpc.EntityIdentity\032\025.milvus.gr" + "pc.Entities\"\000\022H\n\014GetEntityIDs\022\036.milvus.g" + "rpc.GetEntityIDsParam\032\026.milvus.grpc.Enti" + "tyIds\"\000\022>\n\006Search\022\030.milvus.grpc.SearchPa" + "ram\032\030.milvus.grpc.QueryResult\"\000\022P\n\017Searc" + "hInSegment\022!.milvus.grpc.SearchInSegment" + "Param\032\030.milvus.grpc.QueryResult\"\000\0227\n\003Cmd" + "\022\024.milvus.grpc.Command\032\030.milvus.grpc.Str" + "ingReply\"\000\022A\n\nDeleteByID\022\034.milvus.grpc.D" + "eleteByIDParam\032\023.milvus.grpc.Status\"\000\022G\n" + "\021PreloadCollection\022\033.milvus.grpc.Collect" + "ionName\032\023.milvus.grpc.Status\"\000\0227\n\005Flush\022" + "\027.milvus.grpc.FlushParam\032\023.milvus.grpc.S" + "tatus\"\000\022;\n\007Compact\022\031.milvus.grpc.Compact" + "Param\032\023.milvus.grpc.Status\"\000\022B\n\010SearchPB" + "\022\032.milvus.grpc.SearchParamPB\032\030.milvus.gr" + "pc.QueryResult\"\000B\007Z\005msgpbb\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_message_2eproto_deps[1] = { }; @@ -1654,7 +1650,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mes static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_message_2eproto_once; static bool descriptor_table_message_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto = { - &descriptor_table_message_2eproto_initialized, descriptor_table_protodef_message_2eproto, "message.proto", 7599, + &descriptor_table_message_2eproto_initialized, descriptor_table_protodef_message_2eproto, "message.proto", 7553, &descriptor_table_message_2eproto_once, descriptor_table_message_2eproto_sccs, descriptor_table_message_2eproto_deps, 46, 0, schemas, file_default_instances, TableStruct_message_2eproto::offsets, file_level_metadata_message_2eproto, 47, file_level_enum_descriptors_message_2eproto, file_level_service_descriptors_message_2eproto, @@ -18203,17 +18199,15 @@ SearchMsg::SearchMsg() SearchMsg::SearchMsg(const SearchMsg& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr), - partition_tag_(from.partition_tag_), - extra_params_(from.extra_params_), - json_(from.json_) { + extra_params_(from.extra_params_) { _internal_metadata_.MergeFrom(from._internal_metadata_); collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from.collection_name().empty()) { collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); } - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.dsl().empty()) { - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); + partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from.partition_tag().empty()) { + partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); } if (from.has_records()) { records_ = new ::milvus::grpc::VectorRowRecord(*from.records_); @@ -18229,7 +18223,7 @@ SearchMsg::SearchMsg(const SearchMsg& from) void SearchMsg::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SearchMsg_message_2eproto.base); collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&records_, 0, static_cast( reinterpret_cast(&client_id_) - reinterpret_cast(&records_)) + sizeof(client_id_)); @@ -18242,7 +18236,7 @@ SearchMsg::~SearchMsg() { void SearchMsg::SharedDtor() { collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + partition_tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete records_; } @@ -18261,11 +18255,9 @@ void SearchMsg::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - partition_tag_.Clear(); extra_params_.Clear(); - json_.Clear(); collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (GetArenaNoVirtual() == nullptr && records_ != nullptr) { delete records_; } @@ -18298,16 +18290,11 @@ const char* SearchMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: CHK_(ptr); } else goto handle_unusual; continue; - // repeated string partition_tag = 3; + // string partition_tag = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tag(), ptr, ctx, "milvus.grpc.SearchMsg.partition_tag"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_partition_tag(), ptr, ctx, "milvus.grpc.SearchMsg.partition_tag"); + CHK_(ptr); } else goto handle_unusual; continue; // int64 uid = 4; @@ -18343,25 +18330,6 @@ const char* SearchMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:: } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 58); } else goto handle_unusual; continue; - // repeated string json = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_json(), ptr, ctx, "milvus.grpc.SearchMsg.json"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66); - } else goto handle_unusual; - continue; - // string dsl = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_dsl(), ptr, ctx, "milvus.grpc.SearchMsg.dsl"); - CHK_(ptr); - } else goto handle_unusual; - continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -18418,14 +18386,13 @@ bool SearchMsg::MergePartialFromCodedStream( break; } - // repeated string partition_tag = 3; + // string partition_tag = 3; case 3: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tag())); + input, this->mutable_partition_tag())); DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(this->partition_tag_size() - 1).data(), - static_cast(this->partition_tag(this->partition_tag_size() - 1).length()), + this->partition_tag().data(), static_cast(this->partition_tag().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "milvus.grpc.SearchMsg.partition_tag")); } else { @@ -18484,37 +18451,6 @@ bool SearchMsg::MergePartialFromCodedStream( break; } - // repeated string json = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_json())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(this->json_size() - 1).data(), - static_cast(this->json(this->json_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.json")); - } else { - goto handle_unusual; - } - break; - } - - // string dsl = 9; - case 9: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_dsl())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.dsl")); - } else { - goto handle_unusual; - } - break; - } - default: { handle_unusual: if (tag == 0) { @@ -18558,14 +18494,14 @@ void SearchMsg::SerializeWithCachedSizes( 2, _Internal::records(this), output); } - // repeated string partition_tag = 3; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { + // string partition_tag = 3; + if (this->partition_tag().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), + this->partition_tag().data(), static_cast(this->partition_tag().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "milvus.grpc.SearchMsg.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 3, this->partition_tag(i), output); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->partition_tag(), output); } // int64 uid = 4; @@ -18592,26 +18528,6 @@ void SearchMsg::SerializeWithCachedSizes( output); } - // repeated string json = 8; - for (int i = 0, n = this->json_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(i).data(), static_cast(this->json(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.json"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 8, this->json(i), output); - } - - // string dsl = 9; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.dsl"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 9, this->dsl(), output); - } - if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -18643,14 +18559,15 @@ void SearchMsg::SerializeWithCachedSizes( 2, _Internal::records(this), target); } - // repeated string partition_tag = 3; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { + // string partition_tag = 3; + if (this->partition_tag().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), + this->partition_tag().data(), static_cast(this->partition_tag().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "milvus.grpc.SearchMsg.partition_tag"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(3, this->partition_tag(i), target); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 3, this->partition_tag(), target); } // int64 uid = 4; @@ -18676,27 +18593,6 @@ void SearchMsg::SerializeWithCachedSizes( 7, this->extra_params(static_cast(i)), target); } - // repeated string json = 8; - for (int i = 0, n = this->json_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(i).data(), static_cast(this->json(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.json"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(8, this->json(i), target); - } - - // string dsl = 9; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.dsl"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 9, this->dsl(), target); - } - if (_internal_metadata_.have_unknown_fields()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -18718,14 +18614,6 @@ size_t SearchMsg::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated string partition_tag = 3; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tag_size()); - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag(i)); - } - // repeated .milvus.grpc.KeyValuePair extra_params = 7; { unsigned int count = static_cast(this->extra_params_size()); @@ -18737,14 +18625,6 @@ size_t SearchMsg::ByteSizeLong() const { } } - // repeated string json = 8; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->json_size()); - for (int i = 0, n = this->json_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->json(i)); - } - // string collection_name = 1; if (this->collection_name().size() > 0) { total_size += 1 + @@ -18752,11 +18632,11 @@ size_t SearchMsg::ByteSizeLong() const { this->collection_name()); } - // string dsl = 9; - if (this->dsl().size() > 0) { + // string partition_tag = 3; + if (this->partition_tag().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->dsl()); + this->partition_tag()); } // .milvus.grpc.VectorRowRecord records = 2; @@ -18814,16 +18694,14 @@ void SearchMsg::MergeFrom(const SearchMsg& from) { ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - partition_tag_.MergeFrom(from.partition_tag_); extra_params_.MergeFrom(from.extra_params_); - json_.MergeFrom(from.json_); if (from.collection_name().size() > 0) { collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); } - if (from.dsl().size() > 0) { + if (from.partition_tag().size() > 0) { - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); + partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); } if (from.has_records()) { mutable_records()->::milvus::grpc::VectorRowRecord::MergeFrom(from.records()); @@ -18860,12 +18738,10 @@ bool SearchMsg::IsInitialized() const { void SearchMsg::InternalSwap(SearchMsg* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_.InternalSwap(CastToBase(&other->partition_tag_)); CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - json_.InternalSwap(CastToBase(&other->json_)); collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - dsl_.Swap(&other->dsl_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + partition_tag_.Swap(&other->partition_tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); swap(records_, other->records_); swap(uid_, other->uid_); @@ -19236,16 +19112,12 @@ Key2SegMsg::Key2SegMsg(const Key2SegMsg& from) _internal_metadata_(nullptr), segment_id_(from.segment_id_) { _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&uid_, &from.uid_, - static_cast(reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); + uid_ = from.uid_; // @@protoc_insertion_point(copy_constructor:milvus.grpc.Key2SegMsg) } void Key2SegMsg::SharedCtor() { - ::memset(&uid_, 0, static_cast( - reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); + uid_ = PROTOBUF_LONGLONG(0); } Key2SegMsg::~Key2SegMsg() { @@ -19272,9 +19144,7 @@ void Key2SegMsg::Clear() { (void) cached_has_bits; segment_id_.Clear(); - ::memset(&uid_, 0, static_cast( - reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); + uid_ = PROTOBUF_LONGLONG(0); _internal_metadata_.Clear(); } @@ -19293,19 +19163,12 @@ const char* Key2SegMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID: CHK_(ptr); } else goto handle_unusual; continue; - // uint64 timestamp = 2; + // repeated int64 segment_id = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 segment_id = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_segment_id(), ptr, ctx); CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { add_segment_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); CHK_(ptr); } else goto handle_unusual; @@ -19353,29 +19216,16 @@ bool Key2SegMsg::MergePartialFromCodedStream( break; } - // uint64 timestamp = 2; + // repeated int64 segment_id = 2; case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, ×tamp_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 segment_id = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( input, this->mutable_segment_id()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 26u, input, this->mutable_segment_id()))); + 1, 18u, input, this->mutable_segment_id()))); } else { goto handle_unusual; } @@ -19414,14 +19264,9 @@ void Key2SegMsg::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->uid(), output); } - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->timestamp(), output); - } - - // repeated int64 segment_id = 3; + // repeated int64 segment_id = 2; if (this->segment_id_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_segment_id_cached_byte_size_.load( std::memory_order_relaxed)); } @@ -19448,15 +19293,10 @@ void Key2SegMsg::SerializeWithCachedSizes( target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->uid(), target); } - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->timestamp(), target); - } - - // repeated int64 segment_id = 3; + // repeated int64 segment_id = 2; if (this->segment_id_size() > 0) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 3, + 2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( @@ -19487,7 +19327,7 @@ size_t Key2SegMsg::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated int64 segment_id = 3; + // repeated int64 segment_id = 2; { size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: Int64Size(this->segment_id_); @@ -19509,13 +19349,6 @@ size_t Key2SegMsg::ByteSizeLong() const { this->uid()); } - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->timestamp()); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -19547,9 +19380,6 @@ void Key2SegMsg::MergeFrom(const Key2SegMsg& from) { if (from.uid() != 0) { set_uid(from.uid()); } - if (from.timestamp() != 0) { - set_timestamp(from.timestamp()); - } } void Key2SegMsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -19575,7 +19405,6 @@ void Key2SegMsg::InternalSwap(Key2SegMsg* other) { _internal_metadata_.Swap(&other->_internal_metadata_); segment_id_.InternalSwap(&other->segment_id_); swap(uid_, other->uid_); - swap(timestamp_, other->timestamp_); } ::PROTOBUF_NAMESPACE_ID::Metadata Key2SegMsg::GetMetadata() const { diff --git a/proxy/src/grpc/message.pb.h b/proxy/src/grpc/message.pb.h index bbe90573a1..000be12f66 100644 --- a/proxy/src/grpc/message.pb.h +++ b/proxy/src/grpc/message.pb.h @@ -7510,33 +7510,14 @@ class SearchMsg : // accessors ------------------------------------------------------- enum : int { - kPartitionTagFieldNumber = 3, kExtraParamsFieldNumber = 7, - kJsonFieldNumber = 8, kCollectionNameFieldNumber = 1, - kDslFieldNumber = 9, + kPartitionTagFieldNumber = 3, kRecordsFieldNumber = 2, kUidFieldNumber = 4, kTimestampFieldNumber = 5, kClientIdFieldNumber = 6, }; - // repeated string partition_tag = 3; - int partition_tag_size() const; - void clear_partition_tag(); - const std::string& partition_tag(int index) const; - std::string* mutable_partition_tag(int index); - void set_partition_tag(int index, const std::string& value); - void set_partition_tag(int index, std::string&& value); - void set_partition_tag(int index, const char* value); - void set_partition_tag(int index, const char* value, size_t size); - std::string* add_partition_tag(); - void add_partition_tag(const std::string& value); - void add_partition_tag(std::string&& value); - void add_partition_tag(const char* value); - void add_partition_tag(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tag() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tag(); - // repeated .milvus.grpc.KeyValuePair extra_params = 7; int extra_params_size() const; void clear_extra_params(); @@ -7548,23 +7529,6 @@ class SearchMsg : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& extra_params() const; - // repeated string json = 8; - int json_size() const; - void clear_json(); - const std::string& json(int index) const; - std::string* mutable_json(int index); - void set_json(int index, const std::string& value); - void set_json(int index, std::string&& value); - void set_json(int index, const char* value); - void set_json(int index, const char* value, size_t size); - std::string* add_json(); - void add_json(const std::string& value); - void add_json(std::string&& value); - void add_json(const char* value); - void add_json(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& json() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_json(); - // string collection_name = 1; void clear_collection_name(); const std::string& collection_name() const; @@ -7576,16 +7540,16 @@ class SearchMsg : std::string* release_collection_name(); void set_allocated_collection_name(std::string* collection_name); - // string dsl = 9; - void clear_dsl(); - const std::string& dsl() const; - void set_dsl(const std::string& value); - void set_dsl(std::string&& value); - void set_dsl(const char* value); - void set_dsl(const char* value, size_t size); - std::string* mutable_dsl(); - std::string* release_dsl(); - void set_allocated_dsl(std::string* dsl); + // string partition_tag = 3; + void clear_partition_tag(); + const std::string& partition_tag() const; + void set_partition_tag(const std::string& value); + void set_partition_tag(std::string&& value); + void set_partition_tag(const char* value); + void set_partition_tag(const char* value, size_t size); + std::string* mutable_partition_tag(); + std::string* release_partition_tag(); + void set_allocated_partition_tag(std::string* partition_tag); // .milvus.grpc.VectorRowRecord records = 2; bool has_records() const; @@ -7615,11 +7579,9 @@ class SearchMsg : class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tag_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField json_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dsl_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partition_tag_; ::milvus::grpc::VectorRowRecord* records_; ::PROTOBUF_NAMESPACE_ID::int64 uid_; ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; @@ -7887,11 +7849,10 @@ class Key2SegMsg : // accessors ------------------------------------------------------- enum : int { - kSegmentIdFieldNumber = 3, + kSegmentIdFieldNumber = 2, kUidFieldNumber = 1, - kTimestampFieldNumber = 2, }; - // repeated int64 segment_id = 3; + // repeated int64 segment_id = 2; int segment_id_size() const; void clear_segment_id(); ::PROTOBUF_NAMESPACE_ID::int64 segment_id(int index) const; @@ -7907,11 +7868,6 @@ class Key2SegMsg : ::PROTOBUF_NAMESPACE_ID::int64 uid() const; void set_uid(::PROTOBUF_NAMESPACE_ID::int64 value); - // uint64 timestamp = 2; - void clear_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp() const; - void set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - // @@protoc_insertion_point(class_scope:milvus.grpc.Key2SegMsg) private: class _Internal; @@ -7920,7 +7876,6 @@ class Key2SegMsg : ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > segment_id_; mutable std::atomic _segment_id_cached_byte_size_; ::PROTOBUF_NAMESPACE_ID::int64 uid_; - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_message_2eproto; }; @@ -13028,69 +12983,55 @@ inline void SearchMsg::set_allocated_records(::milvus::grpc::VectorRowRecord* re // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.records) } -// repeated string partition_tag = 3; -inline int SearchMsg::partition_tag_size() const { - return partition_tag_.size(); -} +// string partition_tag = 3; inline void SearchMsg::clear_partition_tag() { - partition_tag_.Clear(); + partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -inline const std::string& SearchMsg::partition_tag(int index) const { +inline const std::string& SearchMsg::partition_tag() const { // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Get(index); + return partition_tag_.GetNoArena(); } -inline std::string* SearchMsg::mutable_partition_tag(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Mutable(index); -} -inline void SearchMsg::set_partition_tag(int index, const std::string& value) { +inline void SearchMsg::set_partition_tag(const std::string& value) { + + partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.partition_tag) - partition_tag_.Mutable(index)->assign(value); } -inline void SearchMsg::set_partition_tag(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.partition_tag) - partition_tag_.Mutable(index)->assign(std::move(value)); +inline void SearchMsg::set_partition_tag(std::string&& value) { + + partition_tag_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchMsg.partition_tag) } -inline void SearchMsg::set_partition_tag(int index, const char* value) { +inline void SearchMsg::set_partition_tag(const char* value) { GOOGLE_DCHECK(value != nullptr); - partition_tag_.Mutable(index)->assign(value); + + partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.partition_tag) } -inline void SearchMsg::set_partition_tag(int index, const char* value, size_t size) { - partition_tag_.Mutable(index)->assign( - reinterpret_cast(value), size); +inline void SearchMsg::set_partition_tag(const char* value, size_t size) { + + partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.partition_tag) } -inline std::string* SearchMsg::add_partition_tag() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Add(); +inline std::string* SearchMsg::mutable_partition_tag() { + + // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.partition_tag) + return partition_tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -inline void SearchMsg::add_partition_tag(const std::string& value) { - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.partition_tag) +inline std::string* SearchMsg::release_partition_tag() { + // @@protoc_insertion_point(field_release:milvus.grpc.SearchMsg.partition_tag) + + return partition_tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -inline void SearchMsg::add_partition_tag(std::string&& value) { - partition_tag_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::add_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::add_partition_tag(const char* value, size_t size) { - partition_tag_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchMsg.partition_tag) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchMsg::partition_tag() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchMsg::mutable_partition_tag() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchMsg.partition_tag) - return &partition_tag_; +inline void SearchMsg::set_allocated_partition_tag(std::string* partition_tag) { + if (partition_tag != nullptr) { + + } else { + + } + partition_tag_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), partition_tag); + // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.partition_tag) } // int64 uid = 4; @@ -13165,122 +13106,6 @@ SearchMsg::extra_params() const { return extra_params_; } -// repeated string json = 8; -inline int SearchMsg::json_size() const { - return json_.size(); -} -inline void SearchMsg::clear_json() { - json_.Clear(); -} -inline const std::string& SearchMsg::json(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.json) - return json_.Get(index); -} -inline std::string* SearchMsg::mutable_json(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.json) - return json_.Mutable(index); -} -inline void SearchMsg::set_json(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.json) - json_.Mutable(index)->assign(value); -} -inline void SearchMsg::set_json(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.json) - json_.Mutable(index)->assign(std::move(value)); -} -inline void SearchMsg::set_json(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - json_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::set_json(int index, const char* value, size_t size) { - json_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.json) -} -inline std::string* SearchMsg::add_json() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchMsg.json) - return json_.Add(); -} -inline void SearchMsg::add_json(const std::string& value) { - json_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(std::string&& value) { - json_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(const char* value) { - GOOGLE_DCHECK(value != nullptr); - json_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(const char* value, size_t size) { - json_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchMsg.json) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchMsg::json() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchMsg.json) - return json_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchMsg::mutable_json() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchMsg.json) - return &json_; -} - -// string dsl = 9; -inline void SearchMsg::clear_dsl() { - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchMsg::dsl() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.dsl) - return dsl_.GetNoArena(); -} -inline void SearchMsg::set_dsl(const std::string& value) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(std::string&& value) { - - dsl_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(const char* value, size_t size) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.dsl) -} -inline std::string* SearchMsg::mutable_dsl() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.dsl) - return dsl_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchMsg::release_dsl() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchMsg.dsl) - - return dsl_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchMsg::set_allocated_dsl(std::string* dsl) { - if (dsl != nullptr) { - - } else { - - } - dsl_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dsl); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.dsl) -} - // ------------------------------------------------------------------- // TimeSyncMsg @@ -13345,21 +13170,7 @@ inline void Key2SegMsg::set_uid(::PROTOBUF_NAMESPACE_ID::int64 value) { // @@protoc_insertion_point(field_set:milvus.grpc.Key2SegMsg.uid) } -// uint64 timestamp = 2; -inline void Key2SegMsg::clear_timestamp() { - timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Key2SegMsg::timestamp() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Key2SegMsg.timestamp) - return timestamp_; -} -inline void Key2SegMsg::set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - timestamp_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.Key2SegMsg.timestamp) -} - -// repeated int64 segment_id = 3; +// repeated int64 segment_id = 2; inline int Key2SegMsg::segment_id_size() const { return segment_id_.size(); } diff --git a/proxy/src/grpc/proto/etcd.proto b/proxy/src/grpc/proto/etcd.proto new file mode 100644 index 0000000000..73215ee4a5 --- /dev/null +++ b/proxy/src/grpc/proto/etcd.proto @@ -0,0 +1,164 @@ +syntax = "proto3"; +package etcdserverpb; + +service Watch { + // Watch watches for events happening or that have happened. Both input and output + // are streams; the input stream is for creating and canceling watchers and the output + // stream sends events. One watch RPC can watch on multiple key ranges, streaming events + // for several watches at once. The entire event history can be watched starting from the + // last compaction revision. + rpc Watch(stream WatchRequest) returns (stream WatchResponse) { + } +} + +message WatchRequest { + // request_union is a request to either create a new watcher or cancel an existing watcher. + oneof request_union { + WatchCreateRequest create_request = 1; + WatchCancelRequest cancel_request = 2; + WatchProgressRequest progress_request = 3; + } +} + +message WatchCreateRequest { + // key is the key to register for watching. + bytes key = 1; + + // range_end is the end of the range [key, range_end) to watch. If range_end is not given, + // only the key argument is watched. If range_end is equal to '\0', all keys greater than + // or equal to the key argument are watched. + // If the range_end is one bit larger than the given key, + // then all keys with the prefix (the given key) will be watched. + bytes range_end = 2; + + // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". + int64 start_revision = 3; + + // progress_notify is set so that the etcd server will periodically send a WatchResponse with + // no events to the new watcher if there are no recent events. It is useful when clients + // wish to recover a disconnected watcher starting from a recent known revision. + // The etcd server may decide how often it will send notifications based on current load. + bool progress_notify = 4; + + enum FilterType { + // filter out put event. + NOPUT = 0; + // filter out delete event. + NODELETE = 1; + } + + // filters filter the events at server side before it sends back to the watcher. + repeated FilterType filters = 5; + + // If prev_kv is set, created watcher gets the previous KV before the event happens. + // If the previous KV is already compacted, nothing will be returned. + bool prev_kv = 6; + + // If watch_id is provided and non-zero, it will be assigned to this watcher. + // Since creating a watcher in etcd is not a synchronous operation, + // this can be used ensure that ordering is correct when creating multiple + // watchers on the same stream. Creating a watcher with an ID already in + // use on the stream will cause an error to be returned. + int64 watch_id = 7; + + // fragment enables splitting large revisions into multiple watch responses. + bool fragment = 8; +} + +message WatchCancelRequest { + // watch_id is the watcher id to cancel so that no more events are transmitted. + int64 watch_id = 1; +} + +// Requests the a watch stream progress status be sent in the watch response stream as soon as +// possible. +message WatchProgressRequest { +} + +message WatchResponse { + ResponseHeader header = 1; + // watch_id is the ID of the watcher that corresponds to the response. + int64 watch_id = 2; + + // created is set to true if the response is for a create watch request. + // The client should record the watch_id and expect to receive events for + // the created watcher from the same stream. + // All events sent to the created watcher will attach with the same watch_id. + bool created = 3; + + // canceled is set to true if the response is for a cancel watch request. + // No further events will be sent to the canceled watcher. + bool canceled = 4; + + // compact_revision is set to the minimum index if a watcher tries to watch + // at a compacted index. + // + // This happens when creating a watcher at a compacted revision or the watcher cannot + // catch up with the progress of the key-value store. + // + // The client should treat the watcher as canceled and should not try to create any + // watcher with the same start_revision again. + int64 compact_revision = 5; + + // cancel_reason indicates the reason for canceling the watcher. + string cancel_reason = 6; + + // framgment is true if large watch response was split over multiple responses. + bool fragment = 7; + + repeated Event events = 11; +} + +message ResponseHeader { + // cluster_id is the ID of the cluster which sent the response. + uint64 cluster_id = 1; + // member_id is the ID of the member which sent the response. + uint64 member_id = 2; + // revision is the key-value store revision when the request was applied. + // For watch progress responses, the header.revision indicates progress. All future events + // recieved in this stream are guaranteed to have a higher revision number than the + // header.revision number. + int64 revision = 3; + // raft_term is the raft term when the request was applied. + uint64 raft_term = 4; +} + + +message KeyValue { + // key is the key in bytes. An empty key is not allowed. + bytes key = 1; + // create_revision is the revision of last creation on this key. + int64 create_revision = 2; + // mod_revision is the revision of last modification on this key. + int64 mod_revision = 3; + // version is the version of the key. A deletion resets + // the version to zero and any modification of the key + // increases its version. + int64 version = 4; + // value is the value held by the key, in bytes. + bytes value = 5; + // lease is the ID of the lease that attached to key. + // When the attached lease expires, the key will be deleted. + // If lease is 0, then no lease is attached to the key. + int64 lease = 6; +} + +message Event { + enum EventType { + PUT = 0; + DELETE = 1; + } + // type is the kind of event. If type is a PUT, it indicates + // new data has been stored to the key. If type is a DELETE, + // it indicates the key was deleted. + EventType type = 1; + // kv holds the KeyValue for the event. + // A PUT event contains current kv pair. + // A PUT event with kv.Version=1 indicates the creation of a key. + // A DELETE/EXPIRE event contains the deleted key with + // its modification revision set to the revision of deletion. + KeyValue kv = 2; + + // prev_kv holds the key-value pair before the event happens. + KeyValue prev_kv = 3; +} \ No newline at end of file diff --git a/proxy/src/main.cpp b/proxy/src/main.cpp index c9a7b490d8..46fe5cace0 100644 --- a/proxy/src/main.cpp +++ b/proxy/src/main.cpp @@ -22,6 +22,7 @@ #include "utils/SignalHandler.h" #include "utils/Status.h" #include "message_client/Client.h" +#include "etcd_watcher/etcd_watcher.h" INITIALIZE_EASYLOGGINGPP diff --git a/proxy/src/message_client/ClientV2.cpp b/proxy/src/message_client/ClientV2.cpp index dab00da4a9..823d1010bc 100644 --- a/proxy/src/message_client/ClientV2.cpp +++ b/proxy/src/message_client/ClientV2.cpp @@ -2,130 +2,126 @@ #include "pulsar/Result.h" #include "PartitionPolicy.h" #include "utils/CommonUtil.h" -#include namespace milvus::message_client { -std::map>> total_results; - -MsgClientV2::MsgClientV2(int64_t client_id, const std::string &service_url, const uint32_t mut_parallelism, const pulsar::ClientConfiguration &config) - : client_id_(client_id), service_url_(service_url), mut_parallelism_(mut_parallelism) {} +MsgClientV2::MsgClientV2(int64_t client_id, std::string &service_url, const pulsar::ClientConfiguration &config) + : client_id_(client_id), service_url_(service_url) {} Status MsgClientV2::Init(const std::string &insert_delete, - const std::string &search, - const std::string &time_sync, - const std::string &search_by_id, - const std::string &search_result) { + const std::string &search, + const std::string &time_sync, + const std::string &search_by_id, + const std::string &search_result) { //create pulsar client auto pulsar_client = std::make_shared(service_url_); //create pulsar producer ProducerConfiguration producerConfiguration; producerConfiguration.setPartitionsRoutingMode(ProducerConfiguration::CustomPartition); producerConfiguration.setMessageRouter(std::make_shared()); - // insert_delete_producer_ = std::make_shared(pulsar_client, insert_delete, producerConfiguration); + insert_delete_producer_ = std::make_shared(pulsar_client, insert_delete, producerConfiguration); search_producer_ = std::make_shared(pulsar_client, search, producerConfiguration); search_by_id_producer_ = std::make_shared(pulsar_client, search_by_id, producerConfiguration); time_sync_producer_ = std::make_shared(pulsar_client, time_sync); - - for (auto i = 0; i < mut_parallelism_; i++) { - paralle_mut_producers_.emplace_back(std::make_shared(pulsar_client, - insert_delete, - producerConfiguration)); - } //create pulsar consumer std::string subscribe_name = std::to_string(CommonUtil::RandomUINT64()); - consumer_ = std::make_shared(pulsar_client, search_result + subscribe_name); + consumer_ = std::make_shared(pulsar_client, search_result+subscribe_name); auto result = consumer_->subscribe(search_result); if (result != pulsar::Result::ResultOk) { - return Status(SERVER_UNEXPECTED_ERROR, - "Pulsar message client init occur error, " + std::string(pulsar::strResult(result))); + return Status(SERVER_UNEXPECTED_ERROR, "Pulsar message client init occur error, " + std::string(pulsar::strResult(result))); } return Status::OK(); } int64_t GetQueryNodeNum() { - return 1; + return 2; } -milvus::grpc::QueryResult Aggregation(std::vector> &results) { - //TODO: QueryNode has only one - int64_t length = results.size(); - std::vector all_scores; - std::vector all_distance; - std::vector all_kv_pairs; - std::vector index(length * results[0]->distances_size()); +milvus::grpc::QueryResult Aggregation(std::vector> &results){ + //TODO: QueryNode has only one + int64_t length = results.size(); + std::vector all_scores; + std::vector all_distance; + std::vector all_kv_pairs; + std::vector index(length * results[0]->scores_size()); - for (int n = 0; n < length * results[0]->distances_size(); ++n) { - index[n] = n; - } - - for (int i = 0; i < length; i++) { - for (int j = 0; j < results[i]->distances_size(); j++) { -// all_scores.push_back(results[i]->scores()[j]); - all_distance.push_back(results[i]->distances()[j]); -// all_kv_pairs.push_back(results[i]->extra_params()[j]); + for (int n = 0; n < length * results[0]->scores_size(); ++n) { + index[n] = n; } - } - for (int k = 0; k < all_distance.size() - 1; ++k) { - for (int l = k + 1; l < all_distance.size(); ++l) { - - if (all_distance[l] > all_distance[k]) { - float distance_temp = all_distance[k]; - all_distance[k] = all_distance[l]; - all_distance[l] = distance_temp; - - int index_temp = index[k]; - index[k] = index[l]; - index[l] = index_temp; - } + for (int i = 0; i < length; i++){ + for (int j = 0; j < results[i]->scores_size(); j++){ + all_scores.push_back(results[i]->scores()[j]); + all_distance.push_back(results[i]->distances()[j]); + all_kv_pairs.push_back(results[i]->extra_params()[j]); + } + } + + for (int k = 0; k < all_distance.size() - 1; ++k) { + for (int l = k + 1; l < all_distance.size(); ++l) { + + if (all_distance[l] > all_distance[k]){ + float distance_temp = all_distance[k]; + all_distance[k] = all_distance[l]; + all_distance[l] = distance_temp; + + int index_temp = index[k]; + index[k] = index[l]; + index[l] = index_temp; + } + } } - } grpc::QueryResult result; - +// result_prt->set_allocated_status(const_cast(&results[0]->status())); result.mutable_status()->CopyFrom(results[0]->status()); result.mutable_entities()->CopyFrom(results[0]->entities()); result.set_row_num(results[0]->row_num()); - for (int m = 0; m < results[0]->distances_size(); ++m) { -// result.add_scores(all_scores[index[m]]); + for (int m = 0; m < results[0]->scores_size(); ++m) { + result.add_scores(all_scores[index[m]]); result.add_distances(all_distance[m]); -// result.add_extra_params(); -// result.mutable_extra_params(m)->CopyFrom(all_kv_pairs[index[m]]); + result.add_extra_params(); + result.mutable_extra_params(m)->CopyFrom(all_kv_pairs[index[m]]); } -// result.set_query_id(results[0]->query_id()); -// result.set_client_id(results[0]->client_id()); + result.set_query_id(results[0]->query_id()); + result.set_client_id(results[0]->client_id()); - return result; + return result; } -Status MsgClientV2::GetQueryResult(int64_t query_id, milvus::grpc::QueryResult* result) { +milvus::grpc::QueryResult MsgClientV2::GetQueryResult(int64_t query_id) { +// Result result = MsgProducer::createProducer("result-partition-0"); + auto client = std::make_shared("pulsar://localhost:6650"); + MsgConsumer consumer(client, "my_consumer"); + consumer.subscribe("result"); + + std::vector> results; int64_t query_node_num = GetQueryNodeNum(); + std::map>> total_results; + while (true) { auto received_result = total_results[query_id]; if (received_result.size() == query_node_num) { break; } Message msg; - consumer_->receive(msg); + consumer.receive(msg); grpc::QueryResult search_res_msg; auto status = search_res_msg.ParseFromString(msg.getDataAsString()); if (status) { auto message = std::make_shared(search_res_msg); total_results[message->query_id()].push_back(message); - consumer_->acknowledge(msg); - } else { - return Status(DB_ERROR, "can't parse message which from pulsar!"); + consumer.acknowledge(msg); } } - *result = Aggregation(total_results[query_id]); - return Status::OK(); + + return Aggregation(total_results[query_id]); } Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, uint64_t timestamp) { @@ -133,12 +129,8 @@ Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, uin auto row_count = request.rows_data_size(); // TODO: Get the segment from master int64_t segment = 0; - auto stats = std::vector(ParallelNum); - -#pragma omp parallel for default(none), shared(row_count, request, timestamp, segment, stats), num_threads(ParallelNum) + milvus::grpc::InsertOrDeleteMsg mut_msg; for (auto i = 0; i < row_count; i++) { - milvus::grpc::InsertOrDeleteMsg mut_msg; - int this_thread = omp_get_thread_num(); mut_msg.set_op(milvus::grpc::OpType::INSERT); mut_msg.set_uid(request.entity_id_array(i)); mut_msg.set_client_id(client_id_); @@ -149,160 +141,36 @@ Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, uin mut_msg.mutable_rows_data()->CopyFrom(request.rows_data(i)); mut_msg.mutable_extra_params()->CopyFrom(request.extra_params()); - auto result = paralle_mut_producers_[this_thread]->send(mut_msg); + auto result = insert_delete_producer_->send(mut_msg); if (result != pulsar::ResultOk) { - stats[this_thread] = result; - } - } - for (auto &stat : stats) { - if (stat == pulsar::ResultOk) { - return Status(DB_ERROR, pulsar::strResult(stat)); + // TODO: error code + return Status(DB_ERROR, pulsar::strResult(result)); } } return Status::OK(); } Status MsgClientV2::SendMutMessage(const milvus::grpc::DeleteByIDParam &request, uint64_t timestamp) { - auto stats = std::vector(ParallelNum); -#pragma omp parallel for default(none), shared( request, timestamp, stats), num_threads(ParallelNum) - for (auto i = 0; i < request.id_array_size(); i++) { - milvus::grpc::InsertOrDeleteMsg mut_msg; + milvus::grpc::InsertOrDeleteMsg mut_msg; + for (auto id: request.id_array()) { mut_msg.set_op(milvus::grpc::OpType::DELETE); mut_msg.set_uid(GetUniqueQId()); mut_msg.set_client_id(client_id_); - mut_msg.set_uid(request.id_array(i)); + mut_msg.set_uid(id); mut_msg.set_collection_name(request.collection_name()); mut_msg.set_timestamp(timestamp); - int this_thread = omp_get_thread_num(); - auto result = paralle_mut_producers_[this_thread]->send(mut_msg); + auto result = insert_delete_producer_->send(mut_msg); if (result != pulsar::ResultOk) { - stats[this_thread] = result; - } - } - for (auto &stat : stats) { - if (stat == pulsar::ResultOk) { - return Status(DB_ERROR, pulsar::strResult(stat)); + // TODO: error code + return Status(DB_ERROR, pulsar::strResult(result)); } } return Status::OK(); } -Status MsgClientV2::SendQueryMessage(const milvus::grpc::SearchParam &request, uint64_t timestamp, int64_t &query_id) { - milvus::grpc::SearchMsg search_msg; - - query_id = GetUniqueQId(); - search_msg.set_collection_name(request.collection_name()); - search_msg.set_uid(query_id); - //TODO: get client id from master - search_msg.set_client_id(1); - search_msg.set_timestamp(timestamp); - search_msg.set_dsl(request.dsl()); - - //TODO: get data type from master - milvus::grpc::VectorRowRecord vector_row_recode; - std::vector vectors_records; - for (int i = 0; i < request.vector_param_size(); ++i) { - search_msg.add_json(request.vector_param(i).json()); - for (int j = 0; j < request.vector_param(i).row_record().records_size(); ++j) { - for (int k = 0; k < request.vector_param(i).row_record().records(j).float_data_size(); ++k) { - vector_row_recode.add_float_data(request.vector_param(i).row_record().records(j).float_data(k)); - } - vector_row_recode.set_binary_data(request.vector_param(i).row_record().records(j).binary_data()); - } - } - - search_msg.mutable_records()->CopyFrom(vector_row_recode); - - for (int m = 0; m < request.partition_tag_size(); ++m) { - search_msg.add_partition_tag(request.partition_tag(m)); - } - - for (int l = 0; l < request.extra_params_size(); ++l) { - search_msg.mutable_extra_params(l)->CopyFrom(request.extra_params(l)); - } - - std::cout << search_msg.collection_name() << std::endl; - auto result = search_producer_->send(search_msg); - if (result != pulsar::Result::ResultOk) { - return Status(DB_ERROR, pulsar::strResult(result)); - } - - return Status::OK(); - -// milvus::grpc::QueryResult fake_message; -// milvus::grpc::QueryResult fake_message2; -// -// milvus::grpc::Status fake_status; -// fake_status.set_error_code(milvus::grpc::ErrorCode::SUCCESS); -// std::string aaa = "hahaha"; -// fake_status.set_reason(aaa); -// -// milvus::grpc::RowData fake_row_data; -// fake_row_data.set_blob("fake_row_data"); -// -// milvus::grpc::Entities fake_entities; -//// fake_entities.set_allocated_status(&fake_status); -// fake_entities.mutable_status()->CopyFrom(fake_status); -// for (int i = 0; i < 10; i++){ -// fake_entities.add_ids(i); -// fake_entities.add_valid_row(true); -// fake_entities.add_rows_data()->CopyFrom(fake_row_data); -// } -// -// int64_t fake_row_num = 10; -// -// float fake_scores[10] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0}; -// float fake_distance[10] = {9.7, 9.6, 9.5, 9.8, 8.7, 8.8, 9.9, 8.8, 9.7, 8.9}; -// -// std::vector fake_extra_params; -// milvus::grpc::KeyValuePair keyValuePair; -// for (int i = 0; i < 10; ++i) { -// keyValuePair.set_key(std::to_string(i)); -// keyValuePair.set_value(std::to_string(i + 10)); -// fake_extra_params.push_back(keyValuePair); -// } -// -// int64_t fake_query_id = 10; -// int64_t fake_client_id = 1; -// -// fake_message.mutable_status()->CopyFrom(fake_status); -// fake_message.mutable_entities()->CopyFrom(fake_entities); -// fake_message.set_row_num(fake_row_num); -// for (int i = 0; i < 10; i++) { -// fake_message.add_scores(fake_scores[i]); -// fake_message.add_distances(fake_distance[i]); -// fake_message.add_extra_params()->CopyFrom(fake_extra_params[i]); -// } -// -// fake_message.set_query_id(fake_query_id); -// fake_message.set_client_id(fake_client_id); -// -// float fake_scores2[10] = {2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0, 1.1}; -// float fake_distance2[10] = {9.8, 8.6, 9.6, 9.7, 8.9, 8.8, 9.0, 9.8, 9.7, 8.9}; -// -// fake_message2.mutable_status()->CopyFrom(fake_status); -// fake_message2.mutable_entities()->CopyFrom(fake_entities); -// fake_message2.set_row_num(fake_row_num); -// for (int j = 0; j < 10; ++j) { -// fake_message2.add_scores(fake_scores2[j]); -// fake_message2.add_distances(fake_distance2[j]); -// fake_message2.add_extra_params()->CopyFrom(fake_extra_params[j]); -// } -// -// fake_message2.set_query_id(fake_query_id); -// fake_message2.set_client_id(fake_client_id); -// -// search_by_id_producer_->send(fake_message.SerializeAsString()); -// search_by_id_producer_->send(fake_message2.SerializeAsString()); -// return Status::OK(); -} - MsgClientV2::~MsgClientV2() { - // insert_delete_producer_->close(); - for (auto& producer: paralle_mut_producers_){ - producer->close(); - } + insert_delete_producer_->close(); search_producer_->close(); search_by_id_producer_->close(); time_sync_producer_->close(); diff --git a/proxy/src/message_client/ClientV2.h b/proxy/src/message_client/ClientV2.h index 67d8184241..6cc0ac1385 100644 --- a/proxy/src/message_client/ClientV2.h +++ b/proxy/src/message_client/ClientV2.h @@ -6,13 +6,10 @@ #include "grpc/message.pb.h" namespace milvus::message_client { -constexpr uint32_t ParallelNum = 12 * 20; - class MsgClientV2 { public: MsgClientV2(int64_t client_id, - const std::string &service_url, - const uint32_t mut_parallelism = ParallelNum, + std::string &service_url, const pulsar::ClientConfiguration &config = pulsar::ClientConfiguration()); ~MsgClientV2(); @@ -29,9 +26,9 @@ class MsgClientV2 { Status SendMutMessage(const milvus::grpc::DeleteByIDParam &request, uint64_t timestamp); // - Status SendQueryMessage(const milvus::grpc::SearchParam &request, uint64_t timestamp, int64_t &query_id); + Status SendQueryMessage(const milvus::grpc::SearchParam &request); - Status GetQueryResult(int64_t query_id, milvus::grpc::QueryResult* result); + static milvus::grpc::QueryResult GetQueryResult(int64_t query_id); private: int64_t GetUniqueQId() { @@ -43,11 +40,9 @@ class MsgClientV2 { int64_t client_id_; std::string service_url_; std::shared_ptr consumer_; - // std::shared_ptr insert_delete_producer_; + std::shared_ptr insert_delete_producer_; std::shared_ptr search_producer_; std::shared_ptr time_sync_producer_; std::shared_ptr search_by_id_producer_; - std::vector> paralle_mut_producers_; - const uint32_t mut_parallelism_; }; } \ No newline at end of file diff --git a/proxy/src/server/CMakeLists.txt b/proxy/src/server/CMakeLists.txt index 777f915e19..09e6d8dee2 100644 --- a/proxy/src/server/CMakeLists.txt +++ b/proxy/src/server/CMakeLists.txt @@ -13,6 +13,10 @@ set( GRPC_SERVICE_FILES ${MILVUS_ENGINE_SRC}/grpc/message.grpc.pb.cc ${MILVUS_ENGINE_SRC}/grpc/message.pb.cc + ${MILVUS_ENGINE_SRC}/grpc/hello.grpc.pb.cc + ${MILVUS_ENGINE_SRC}/grpc/hello.pb.cc + ${MILVUS_ENGINE_SRC}/grpc/master.grpc.pb.cc + ${MILVUS_ENGINE_SRC}/grpc/master.pb.cc ) aux_source_directory( ${MILVUS_ENGINE_SRC}/server SERVER_SERVICE_FILES ) diff --git a/proxy/src/server/Server.cpp b/proxy/src/server/Server.cpp index 0f05bb39be..a7b1898a29 100644 --- a/proxy/src/server/Server.cpp +++ b/proxy/src/server/Server.cpp @@ -24,7 +24,6 @@ // #include "scheduler/SchedInst.h" #include "server/grpc_impl/GrpcServer.h" #include "server/init/CpuChecker.h" -#include "server/init/Directory.h" // #include "server/init/GpuChecker.h" #include "server/init/StorageChecker.h" #include "src/version.h" @@ -147,7 +146,7 @@ Server::Start() { tracing_config_path.empty() ? tracing::TracerUtil::InitGlobal() : tracing::TracerUtil::InitGlobal(tracing_config_path); - auto time_zone = config.timezone(); + auto time_zone = config.general.timezone(); if (time_zone.length() == 3) { time_zone = "CUT"; @@ -171,8 +170,6 @@ Server::Start() { STATUS_CHECK(LogMgr::InitLog(config.logs.trace.enable(), config.logs.level(), config.logs.path(), config.logs.max_log_file_size(), config.logs.log_rotate_num())); - STATUS_CHECK(Directory::Initialize(config.logs.path())); - // print version information LOG_SERVER_INFO_ << "Milvus " << BUILD_TYPE << " version: v" << MILVUS_VERSION << ", built at " << BUILD_TIME; #ifdef MILVUS_GPU_VERSION diff --git a/proxy/src/server/delivery/ReqHandler.cpp b/proxy/src/server/delivery/ReqHandler.cpp index 4df402c5da..2f52b7add5 100644 --- a/proxy/src/server/delivery/ReqHandler.cpp +++ b/proxy/src/server/delivery/ReqHandler.cpp @@ -175,10 +175,9 @@ ReqHandler::DeleteEntityByID(const ContextPtr& context, const ::milvus::grpc::De Status ReqHandler::Search(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, engine::QueryResultPtr& result) { -// BaseReqPtr req_ptr = SearchReq::Create(context, query_ptr, json_params, result); -// ReqScheduler::ExecReq(req_ptr); -// return req_ptr->status(); - return Status::OK(); + BaseReqPtr req_ptr = SearchReq::Create(context, query_ptr, json_params, result); + ReqScheduler::ExecReq(req_ptr); + return req_ptr->status(); } Status diff --git a/proxy/src/server/delivery/request/SearchReq.cpp b/proxy/src/server/delivery/request/SearchReq.cpp index d5afd298f8..58dad3df78 100644 --- a/proxy/src/server/delivery/request/SearchReq.cpp +++ b/proxy/src/server/delivery/request/SearchReq.cpp @@ -10,7 +10,6 @@ // or implied. See the License for the specific language governing permissions and limitations under the License. #include "server/delivery/request/SearchReq.h" -#include "server/MessageWrapper.h" // #include "db/Utils.h" #include "server/ValidationUtil.h" #include "utils/CommonUtil.h" @@ -29,38 +28,25 @@ namespace milvus { namespace server { -SearchReq::SearchReq(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *result) +SearchReq::SearchReq(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, + engine::QueryResultPtr& result) : BaseReq(context, ReqType::kSearch), - request_(request), + query_ptr_(query_ptr), + json_params_(json_params), result_(result) { } BaseReqPtr -SearchReq::Create(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *response) { - - return std::shared_ptr(new SearchReq(context, request, response)); +SearchReq::Create(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, + engine::QueryResultPtr& result) { + return std::shared_ptr(new SearchReq(context, query_ptr, json_params, result)); } Status SearchReq::OnExecute() { - auto message_wrapper = milvus::server::MessageWrapper::GetInstance(); - message_wrapper.Init(); - auto client = message_wrapper.MessageClient(); - int64_t query_id; - milvus::grpc::SearchParam request; - auto send_status = client->SendQueryMessage(*request_, timestamp_, query_id); - - if (!send_status.ok()){ - return send_status; - } - - Status status = client->GetQueryResult(query_id, result_); - - return status; + return Status::OK(); } } // namespace server diff --git a/proxy/src/server/delivery/request/SearchReq.h b/proxy/src/server/delivery/request/SearchReq.h index 659ec4948c..e31eb2f24d 100644 --- a/proxy/src/server/delivery/request/SearchReq.h +++ b/proxy/src/server/delivery/request/SearchReq.h @@ -25,19 +25,20 @@ namespace server { class SearchReq : public BaseReq { public: static BaseReqPtr - Create(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *response); + Create(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, + engine::QueryResultPtr& result); protected: - SearchReq(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *result); + SearchReq(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, + engine::QueryResultPtr& result); Status OnExecute() override; private: - const ::milvus::grpc::SearchParam *request_; - ::milvus::grpc::QueryResult* result_; + milvus::query::QueryPtr query_ptr_; + milvus::json json_params_; + engine::QueryResultPtr& result_; }; } // namespace server diff --git a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp b/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp index f28e046e38..9cd86a9a57 100644 --- a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp +++ b/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include "query/BinaryQuery.h" #include "server/ValidationUtil.h" @@ -851,9 +849,6 @@ GrpcRequestHandler::Search(::grpc::ServerContext *context, const ::milvus::grpc: CHECK_NULLPTR_RETURN(request); LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - //TODO: check if the request is legal - BaseReqPtr req_ptr = SearchReq::Create(GetContext(context), request, response); - ReqScheduler::ExecReq(req_ptr); return ::grpc::Status::OK; } diff --git a/proxy/src/server/grpc_impl/GrpcServer.cpp b/proxy/src/server/grpc_impl/GrpcServer.cpp index f72d1e8837..1b0c7ca8da 100644 --- a/proxy/src/server/grpc_impl/GrpcServer.cpp +++ b/proxy/src/server/grpc_impl/GrpcServer.cpp @@ -34,6 +34,8 @@ #include "GrpcRequestHandler.h" #include "config/ServerConfig.h" +#include "server/hello/HelloService.h" +#include "server/hello/ReportAddress.h" // #include "server/DBWrapper.h" #include "server/grpc_impl/interceptor/SpanInterceptor.h" #include "utils/Log.h" @@ -82,7 +84,7 @@ Status GrpcServer::StartService() { SetThreadName("grpcserv_thread"); - std::string server_address(config.network.address() + ":" + std::to_string(config.network.port())); + std::string server_address(config.network.bind.address() + ":" + std::to_string(config.network.bind.port())); ::grpc::ServerBuilder builder; builder.SetOption(std::unique_ptr<::grpc::ServerBuilderOption>(new NoReusePortOption)); @@ -99,6 +101,9 @@ GrpcServer::StartService() { builder.AddListeningPort(server_address, ::grpc::InsecureServerCredentials()); builder.RegisterService(&service); + HelloService helloService; + builder.RegisterService(&helloService); + // timeSync // client id should same to MessageWrapper @@ -107,6 +112,14 @@ GrpcServer::StartService() { (std::string{"pulsar://"} + config.pulsar.address() + ":" + std::to_string(config.pulsar.port())); timesync::TimeSync syc(client_id,GetMessageTimeSyncTime, 20, pulsar_server_addr, "TimeSync"); + // report address to master, test only for now +// auto reportClient = new ReportClient(::grpc::CreateChannel("192.168.2.28:50051", +// ::grpc::InsecureChannelCredentials())); +// auto status = reportClient->ReportAddress(); +// delete(reportClient); +// if (!status.ok()){ +// return Status(milvus::DB_ERROR, ""); +// } // Add gRPC interceptor using InterceptorI = ::grpc::experimental::ServerInterceptorFactoryInterface; diff --git a/proxy/src/server/hello/HelloService.h b/proxy/src/server/hello/HelloService.h new file mode 100644 index 0000000000..8673e2200a --- /dev/null +++ b/proxy/src/server/hello/HelloService.h @@ -0,0 +1,17 @@ +#ifndef MILVUS_HELLOSERVICE_H +#define MILVUS_HELLOSERVICE_H + +#include "grpc++/grpc++.h" +#include + +class HelloService final : public ::milvus::grpc::HelloService::Service{ + ::grpc::Status SayHello + (::grpc::ServerContext* context, const ::milvus::grpc::HelloRequest* request, ::milvus::grpc::HelloReply* response){ + const auto& name = request->name(); + response->mutable_msg()->append( "hello " + name); + return ::grpc::Status::OK; + } +}; + + +#endif //MILVUS_HELLOSERVICE_H diff --git a/proxy/src/server/hello/ReportAddress.h b/proxy/src/server/hello/ReportAddress.h new file mode 100644 index 0000000000..13ffebdbb1 --- /dev/null +++ b/proxy/src/server/hello/ReportAddress.h @@ -0,0 +1,30 @@ +#pragma once + +#include "grpc++/grpc++.h" +#include "src/grpc/master.grpc.pb.h" + +class ReportClient { +public: + ReportClient(const std::shared_ptr<::grpc::ChannelInterface>& channel) + : stub_(master::Greeter::NewStub(channel)) {} + + milvus::Status + ReportAddress(){ + grpc::ClientContext context; + master::Request req; + master::Reply rsp; + + req.set_address("192.168.2.18:19530"); + auto status = stub_->ReportAddress(&context, req, &rsp); + if (status.ok() && rsp.status()){ + std::cout << "Report address to master Succeed" << std::endl; + return milvus::Status::OK(); + } else{ + std::cout << "Error occur when report address to master " << status.error_message() << std::endl; + return milvus::Status(milvus::SERVER_ERROR_CODE_BASE, ""); + } + } + +private: + std::unique_ptr stub_; +}; \ No newline at end of file diff --git a/proxy/src/server/init/Directory.cpp b/proxy/src/server/init/Directory.cpp deleted file mode 100644 index 6b868a2e85..0000000000 --- a/proxy/src/server/init/Directory.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/init/Directory.h" - -#include -#include -#include -#include - -#include "config/ServerConfig.h" - -namespace milvus::server { - -Status -Directory::Initialize(const std::string& path) { - try { - init(path); - } catch (std::exception& ex) { - return Status(SERVER_UNEXPECTED_ERROR, ex.what()); - } - return Status::OK(); -} - - -Status -Directory::Access(const std::string& path) { - try { - access_check(path); - } catch (std::exception& ex) { - return Status(SERVER_UNEXPECTED_ERROR, ex.what()); - } - return Status::OK(); -} - -void -Directory::init(const std::string& path) { - if (path.empty()) { - return; - } - try { - // Returns True if a new directory was created, otherwise false. - boost::filesystem::create_directories(path); - } catch (std::exception& ex) { - std::string msg = "Cannot create directory: " + path + ", reason: " + ex.what(); - throw std::runtime_error(msg); - } catch (...) { - std::string msg = "Cannot create directory: " + path; - throw std::runtime_error(msg); - } -} - -void -Directory::access_check(const std::string& path) { - if (path.empty()) { - return; - } - int ret = access(path.c_str(), F_OK | R_OK | W_OK); - if (0 != ret) { - std::string msg = "Cannot access path: " + path + ", error(" + std::to_string(errno) + - "): " + std::string(strerror(errno)) + "."; - throw std::runtime_error(msg); - } -} - -} // namespace milvus::server diff --git a/proxy/src/server/init/Directory.h b/proxy/src/server/init/Directory.h deleted file mode 100644 index 0e405c3d77..0000000000 --- a/proxy/src/server/init/Directory.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include "utils/Status.h" - -namespace milvus::server { - -class Directory { - public: - static Status - Initialize(const std::string& path); - - static Status - Lock(const std::string& path); - - static Status - Access(const std::string& path); - - private: - static void - init(const std::string& path); - - static void - lock(const std::string& path); - - static void - access_check(const std::string& path); -}; - -} // namespace milvus::server diff --git a/proxy/src/server/init/StorageChecker.cpp b/proxy/src/server/init/StorageChecker.cpp index 939c67ca59..8f6f8ffb9e 100644 --- a/proxy/src/server/init/StorageChecker.cpp +++ b/proxy/src/server/init/StorageChecker.cpp @@ -37,6 +37,18 @@ StorageChecker::CheckStoragePermission() { return Status(SERVER_UNEXPECTED_ERROR, err_msg); } + /* Check db directory write permission */ + const std::string& primary_path = config.storage.path(); + + ret = access(primary_path.c_str(), F_OK | R_OK | W_OK); + if (0 != ret) { + std::string err_msg = " Access DB storage path " + primary_path + " fail. " + strerror(errno) + + "(code: " + std::to_string(errno) + ")"; + LOG_SERVER_FATAL_ << err_msg; + std::cerr << err_msg << std::endl; + return Status(SERVER_UNEXPECTED_ERROR, err_msg); + } + return Status::OK(); } diff --git a/proxy/thirdparty/grpc/CMakeLists.txt b/proxy/thirdparty/grpc/CMakeLists.txt index e41ec9d524..5065ffaa5d 100644 --- a/proxy/thirdparty/grpc/CMakeLists.txt +++ b/proxy/thirdparty/grpc/CMakeLists.txt @@ -66,6 +66,10 @@ add_custom_command(TARGET generate_suvlim_pb_grpc COMMAND echo "${PROTOC_EXCUTABLE}" COMMAND bash "${PROTO_GEN_SCRIPTS_DIR}/generate_go.sh" -p "${PROTOC_EXCUTABLE}" COMMAND echo "${PROTO_GEN_SCRIPTS_DIR}/generate_cpp.sh" -p "${PROTOC_EXCUTABLE}" -g "${GRPC_CPP_PLUGIN_EXCUTABLE}" + COMMAND ${PROTOC_EXCUTABLE} -I "${PROTO_PATH}/proto" --grpc_out "${PROTO_PATH}" --cpp_out "${PROTO_PATH}" + --plugin=protoc-gen-grpc="${GRPC_CPP_PLUGIN_EXCUTABLE}" + "${PROTO_PATH}/proto/etcd.proto" + DEPENDS "${PROTO_PATH}/proto/etcd.proto" ) set_property( GLOBAL PROPERTY PROTOC_EXCUTABLE ${PROTOC_EXCUTABLE}) diff --git a/proxy/unittest/message_client/get_result_test.cpp b/proxy/unittest/message_client/get_result_test.cpp index 47ca45f240..5f4c7d0827 100644 --- a/proxy/unittest/message_client/get_result_test.cpp +++ b/proxy/unittest/message_client/get_result_test.cpp @@ -1,88 +1,81 @@ #include -#include "src/message_client/ClientV2.h" +#include "message_client/ClientV2.h" TEST(CLIENT_CPP, GetResult) { -// auto client= std::make_shared("pulsar://localhost:6650"); -// milvus::message_client::MsgProducer producer(client,"test"); -// producer.createProducer("result"); -// producer.send("result"); -// milvus::grpc::QueryResult fake_message; -// milvus::grpc::QueryResult fake_message2; -// -// milvus::grpc::Status fake_status; -// fake_status.set_error_code(milvus::grpc::ErrorCode::SUCCESS); -// std::string aaa = "hahaha"; -// fake_status.set_reason(aaa); -// -// milvus::grpc::RowData fake_row_data; -// fake_row_data.set_blob("fake_row_data"); -// -// milvus::grpc::Entities fake_entities; -//// fake_entities.set_allocated_status(&fake_status); -// fake_entities.mutable_status()->CopyFrom(fake_status); -// for (int i = 0; i < 10; i++){ -// fake_entities.add_ids(i); -// fake_entities.add_valid_row(true); -// fake_entities.add_rows_data()->CopyFrom(fake_row_data); -// } -// -// int64_t fake_row_num = 10; -// -// float fake_scores[10] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0}; -// float fake_distance[10] = {9.7, 9.6, 9.5, 9.8, 8.7, 8.8, 9.9, 8.8, 9.7, 8.9}; -// -// std::vector fake_extra_params; -// milvus::grpc::KeyValuePair keyValuePair; -// for (int i = 0; i < 10; ++i) { -// keyValuePair.set_key(std::to_string(i)); -// keyValuePair.set_value(std::to_string(i + 10)); -// fake_extra_params.push_back(keyValuePair); -// } -// -// int64_t fake_query_id = 10; -// int64_t fake_client_id = 1; -// -// fake_message.mutable_status()->CopyFrom(fake_status); -// fake_message.mutable_entities()->CopyFrom(fake_entities); -// fake_message.set_row_num(fake_row_num); -// for (int i = 0; i < 10; i++) { -// fake_message.add_scores(fake_scores[i]); -// fake_message.add_distances(fake_distance[i]); -// fake_message.add_extra_params()->CopyFrom(fake_extra_params[i]); -// } -// -// fake_message.set_query_id(fake_query_id); -// fake_message.set_client_id(fake_client_id); -// -// float fake_scores2[10] = {2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0, 1.1}; -// float fake_distance2[10] = {9.8, 8.6, 9.6, 9.7, 8.9, 8.8, 9.0, 9.8, 9.7, 8.9}; -// -// fake_message2.mutable_status()->CopyFrom(fake_status); -// fake_message2.mutable_entities()->CopyFrom(fake_entities); -// fake_message2.set_row_num(fake_row_num); -// for (int j = 0; j < 10; ++j) { -// fake_message2.add_scores(fake_scores2[j]); -// fake_message2.add_distances(fake_distance2[j]); -// fake_message2.add_extra_params()->CopyFrom(fake_extra_params[j]); -// } -// -// fake_message2.set_query_id(fake_query_id); -// fake_message2.set_client_id(fake_client_id); -// -// producer.send(fake_message.SerializeAsString()); -// producer.send(fake_message2.SerializeAsString()); + auto client= std::make_shared("pulsar://localhost:6650"); + milvus::message_client::MsgProducer producer(client,"test"); + producer.createProducer("result"); + producer.send("result"); + milvus::grpc::QueryResult fake_message; + milvus::grpc::QueryResult fake_message2; - int64_t query_id = 10; - milvus::message_client::MsgClientV2 client_v2(1, "pulsar://localhost:6650"); - auto init_status = client_v2.Init("insert_delete", "search", "time_sync", "result", "result"); + milvus::grpc::Status fake_status; + fake_status.set_error_code(milvus::grpc::ErrorCode::SUCCESS); + std::string aaa = "hahaha"; + fake_status.set_reason(aaa); -// client_v2.SendQueryMessage(); - milvus::grpc::SearchParam request; - auto status_send = client_v2.SendQueryMessage(request, 10, query_id); + milvus::grpc::RowData fake_row_data; + fake_row_data.set_blob("fake_row_data"); - milvus::grpc::QueryResult result; - auto status = client_v2.GetQueryResult(query_id, result); + milvus::grpc::Entities fake_entities; +// fake_entities.set_allocated_status(&fake_status); + fake_entities.mutable_status()->CopyFrom(fake_status); + for (int i = 0; i < 10; i++){ + fake_entities.add_ids(i); + fake_entities.add_valid_row(true); + fake_entities.add_rows_data()->CopyFrom(fake_row_data); + } + int64_t fake_row_num = 10; + + float fake_scores[10] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0}; + float fake_distance[10] = {9.7, 9.6, 9.5, 9.8, 8.7, 8.8, 9.9, 8.8, 9.7, 8.9}; + + std::vector fake_extra_params; + milvus::grpc::KeyValuePair keyValuePair; + for (int i = 0; i < 10; ++i) { + keyValuePair.set_key(std::to_string(i)); + keyValuePair.set_value(std::to_string(i + 10)); + fake_extra_params.push_back(keyValuePair); + } + + int64_t fake_query_id = 10; + int64_t fake_client_id = 1; + + fake_message.mutable_status()->CopyFrom(fake_status); + fake_message.mutable_entities()->CopyFrom(fake_entities); + fake_message.set_row_num(fake_row_num); + for (int i = 0; i < 10; i++) { + fake_message.add_scores(fake_scores[i]); + fake_message.add_distances(fake_distance[i]); + fake_message.add_extra_params()->CopyFrom(fake_extra_params[i]); + } + + fake_message.set_query_id(fake_query_id); + fake_message.set_client_id(fake_client_id); + + float fake_scores2[10] = {2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 0.0, 1.1}; + float fake_distance2[10] = {9.8, 8.6, 9.6, 9.7, 8.9, 8.8, 9.0, 9.8, 9.7, 8.9}; + + fake_message2.mutable_status()->CopyFrom(fake_status); + fake_message2.mutable_entities()->CopyFrom(fake_entities); + fake_message2.set_row_num(fake_row_num); + for (int j = 0; j < 10; ++j) { + fake_message2.add_scores(fake_scores2[j]); + fake_message2.add_distances(fake_distance2[j]); + fake_message2.add_extra_params()->CopyFrom(fake_extra_params[j]); + } + + fake_message2.set_query_id(fake_query_id); + fake_message2.set_client_id(fake_client_id); + + producer.send(fake_message.SerializeAsString()); + producer.send(fake_message2.SerializeAsString()); + + producer.close(); + client->close(); + + auto result = milvus::message_client::MsgClientV2::GetQueryResult(fake_query_id); std::cout << result.client_id() << std::endl; for (int k = 0; k < result.distances_size(); ++k) { std::cout << result.distances(k) << "\t"; diff --git a/proxy/unittest/message_client/test_pulsar.cpp b/proxy/unittest/message_client/test_pulsar.cpp index 404f894be7..074098708a 100644 --- a/proxy/unittest/message_client/test_pulsar.cpp +++ b/proxy/unittest/message_client/test_pulsar.cpp @@ -1,5 +1,6 @@ #include "thread" #include "pulsar/Client.h" +#include using namespace pulsar; using MyData = milvus::grpc::PMessage; diff --git a/reader/collection.go b/reader/collection.go index 09991e9f9d..5d94b321cd 100644 --- a/reader/collection.go +++ b/reader/collection.go @@ -34,3 +34,15 @@ func (c *Collection) DeletePartition(partition *Partition) { // TODO: remove from c.Partitions } + +func (c *Collection) GetSegments() ([]*Segment, error) { + // TODO: add get segments + //segments, status := C.GetSegments(c.CollectionPtr) + // + //if status != 0 { + // return nil, errors.New("get segments failed") + //} + // + //return segments, nil + return nil, nil +} diff --git a/reader/index.go b/reader/index.go index 28d376c040..1a125ece22 100644 --- a/reader/index.go +++ b/reader/index.go @@ -1,15 +1,15 @@ package reader import ( - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + schema2 "github.com/czs007/suvlim/pulsar/client-go/pb" ) type IndexConfig struct {} -func buildIndex(config IndexConfig) msgPb.Status { - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} +func buildIndex(config IndexConfig) schema2.Status { + return schema2.Status{ErrorCode: schema2.ErrorCode_SUCCESS} } -func dropIndex(fieldName string) msgPb.Status { - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} +func dropIndex(fieldName string) schema2.Status { + return schema2.Status{ErrorCode: schema2.ErrorCode_SUCCESS} } diff --git a/reader/message_client/message_client.go b/reader/message_client/message_client.go index afe5e0b16c..7c5a33c7a2 100644 --- a/reader/message_client/message_client.go +++ b/reader/message_client/message_client.go @@ -2,8 +2,8 @@ package message_client import ( "context" - "github.com/apache/pulsar-client-go/pulsar" - msgpb "github.com/czs007/suvlim/pkg/master/grpc/message" + "github.com/apache/pulsar/pulsar-client-go/pulsar" + msgpb "github.com/czs007/suvlim/pkg/message" "github.com/golang/protobuf/proto" "log" ) @@ -32,18 +32,13 @@ type MessageClient struct { } func (mc *MessageClient) Send(ctx context.Context, msg msgpb.QueryResult) { - var msgBuffer, _ = proto.Marshal(&msg) - if _, err := mc.searchResultProducer.Send(ctx, &pulsar.ProducerMessage{ - Payload: msgBuffer, + if err := mc.searchResultProducer.Send(ctx, pulsar.ProducerMessage{ + Payload: []byte(msg.String()), }); err != nil { log.Fatal(err) } } -func (mc *MessageClient) GetSearchChan() chan *msgpb.SearchMsg { - return mc.searchChan -} - func (mc *MessageClient) ReceiveInsertOrDeleteMsg() { for { insetOrDeleteMsg := msgpb.InsertOrDeleteMsg{} @@ -100,7 +95,6 @@ func (mc *MessageClient) ReceiveMessage() { go mc.ReceiveInsertOrDeleteMsg() go mc.ReceiveSearchMsg() go mc.ReceiveTimeSyncMsg() - go mc.ReceiveKey2SegMsg() } func (mc *MessageClient) CreatProducer(topicName string) pulsar.Producer { @@ -203,30 +197,21 @@ func (mc *MessageClient) PrepareMsg(messageType MessageType, msgLen int) { } } -func (mc *MessageClient) PrepareKey2SegmentMsg() { - mc.Key2SegMsg = mc.Key2SegMsg[:0] - msgLen := len(mc.key2SegChan) - for i := 0; i < msgLen; i++ { - msg := <-mc.key2SegChan - mc.Key2SegMsg = append(mc.Key2SegMsg, msg) - } -} - func (mc *MessageClient) PrepareBatchMsg() []int { // assume the channel not full mc.InsertOrDeleteMsg = mc.InsertOrDeleteMsg[:0] - //mc.SearchMsg = mc.SearchMsg[:0] + mc.SearchMsg = mc.SearchMsg[:0] mc.TimeSyncMsg = mc.TimeSyncMsg[:0] // get the length of every channel insertOrDeleteLen := len(mc.insertOrDeleteChan) - //searchLen := len(mc.searchChan) + searchLen := len(mc.searchChan) timeLen := len(mc.timeSyncChan) // get message from channel to slice mc.PrepareMsg(InsertOrDelete, insertOrDeleteLen) - //mc.PrepareMsg(Search, searchLen) + mc.PrepareMsg(Search, searchLen) mc.PrepareMsg(TimeSync, timeLen) - return []int{insertOrDeleteLen} + return []int{insertOrDeleteLen, searchLen, timeLen} } diff --git a/reader/query_node.go b/reader/query_node.go index 3e6c983ca8..c969ff5f1b 100644 --- a/reader/query_node.go +++ b/reader/query_node.go @@ -15,36 +15,34 @@ import "C" import ( "fmt" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgPb "github.com/czs007/suvlim/pkg/message" "github.com/czs007/suvlim/reader/message_client" "sort" "sync" - "sync/atomic" - "time" ) type InsertData struct { - insertIDs map[int64][]int64 - insertTimestamps map[int64][]uint64 - insertRecords map[int64][][]byte - insertOffset map[int64]int64 + insertIDs map[int64][]int64 + insertTimestamps map[int64][]uint64 + insertRecords map[int64][][]byte + insertOffset map[int64]int64 } type DeleteData struct { - deleteIDs map[int64][]int64 - deleteTimestamps map[int64][]uint64 - deleteOffset map[int64]int64 + deleteIDs map[int64][]int64 + deleteTimestamps map[int64][]uint64 + deleteOffset map[int64]int64 } type DeleteRecord struct { - entityID int64 - timestamp uint64 - segmentID int64 + entityID int64 + timestamp uint64 + segmentID int64 } type DeletePreprocessData struct { - deleteRecords []*DeleteRecord - count int32 + deleteRecords []*DeleteRecord + count chan int } type QueryNodeDataBuffer struct { @@ -62,7 +60,7 @@ type QueryNode struct { queryNodeTimeSync *QueryNodeTime buffer QueryNodeDataBuffer deletePreprocessData DeletePreprocessData - deleteData DeleteData + deleteData DeleteData insertData InsertData } @@ -79,47 +77,15 @@ func NewQueryNode(queryNodeId uint64, timeSync uint64) *QueryNode { segmentsMap := make(map[int64]*Segment) - buffer := QueryNodeDataBuffer{ - InsertDeleteBuffer: make([]*msgPb.InsertOrDeleteMsg, 0), - SearchBuffer: make([]*msgPb.SearchMsg, 0), - validInsertDeleteBuffer: make([]bool, 0), - validSearchBuffer: make([]bool, 0), - } - return &QueryNode{ - QueryNodeId: queryNodeId, - Collections: nil, - SegmentsMap: segmentsMap, - messageClient: mc, - queryNodeTimeSync: queryNodeTimeSync, - buffer: buffer, + QueryNodeId: queryNodeId, + Collections: nil, + SegmentsMap: segmentsMap, + messageClient: mc, + queryNodeTimeSync: queryNodeTimeSync, } } -func (node *QueryNode) QueryNodeDataInit() { - deletePreprocessData := DeletePreprocessData{ - deleteRecords: make([]*DeleteRecord, 0), - count: 0, - } - - deleteData := DeleteData{ - deleteIDs: make(map[int64][]int64), - deleteTimestamps: make(map[int64][]uint64), - deleteOffset: make(map[int64]int64), - } - - insertData := InsertData{ - insertIDs: make(map[int64][]int64), - insertTimestamps: make(map[int64][]uint64), - insertRecords: make(map[int64][][]byte), - insertOffset: make(map[int64]int64), - } - - node.deletePreprocessData = deletePreprocessData - node.deleteData = deleteData - node.insertData = insertData -} - func (node *QueryNode) NewCollection(collectionName string, schemaConfig string) *Collection { cName := C.CString(collectionName) cSchema := C.CString(schemaConfig) @@ -140,14 +106,13 @@ func (node *QueryNode) DeleteCollection(collection *Collection) { //////////////////////////////////////////////////////////////////////////////////////////////////// -func (node *QueryNode) PrepareBatchMsg() []int { - var msgLen = node.messageClient.PrepareBatchMsg() - return msgLen +func (node *QueryNode) PrepareBatchMsg() { + node.messageClient.PrepareBatchMsg() } func (node *QueryNode) StartMessageClient() { // TODO: add consumerMsgSchema - node.messageClient.InitClient("pulsar://192.168.2.28:6650") + node.messageClient.InitClient("pulsar://localhost:6650") go node.messageClient.ReceiveMessage() } @@ -158,47 +123,26 @@ func (node *QueryNode) InitQueryNodeCollection() { var newCollection = node.NewCollection("collection1", "fakeSchema") var newPartition = newCollection.NewPartition("partition1") // TODO: add segment id - var segment = newPartition.NewSegment(0) - node.SegmentsMap[0] = segment + var _ = newPartition.NewSegment(0) } //////////////////////////////////////////////////////////////////////////////////////////////////// func (node *QueryNode) RunInsertDelete() { for { - time.Sleep(2 * 1000 * time.Millisecond) - node.QueryNodeDataInit() // TODO: get timeRange from message client var timeRange = TimeRange{0, 0} - var msgLen = node.PrepareBatchMsg() - fmt.Println("PrepareBatchMsg Done, Insert len = ", msgLen[0]) - if msgLen[0] == 0 { - fmt.Println("0 msg found") - continue - } + node.PrepareBatchMsg() node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) - fmt.Println("MessagesPreprocess Done") node.WriterDelete() node.PreInsertAndDelete() - fmt.Println("PreInsertAndDelete Done") node.DoInsertAndDelete() - fmt.Println("DoInsertAndDelete Done") node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) - fmt.Print("UpdateSearchTimeSync Done\n\n\n") } } func (node *QueryNode) RunSearch() { for { - time.Sleep(2 * 1000 * time.Millisecond) - if len(node.messageClient.GetSearchChan()) <= 0 { - fmt.Println("null Search") - continue - } - node.messageClient.SearchMsg = node.messageClient.SearchMsg[:0] - msg := <-node.messageClient.GetSearchChan() - node.messageClient.SearchMsg = append(node.messageClient.SearchMsg, msg) - fmt.Println("Do Search...") node.Search(node.messageClient.SearchMsg) } } @@ -206,29 +150,26 @@ func (node *QueryNode) RunSearch() { //////////////////////////////////////////////////////////////////////////////////////////////////// func (node *QueryNode) MessagesPreprocess(insertDeleteMessages []*msgPb.InsertOrDeleteMsg, timeRange TimeRange) msgPb.Status { - //var tMax = timeRange.timestampMax + var tMax = timeRange.timestampMax // 1. Extract messages before readTimeSync from QueryNodeDataBuffer. // Set valid bitmap to false. for i, msg := range node.buffer.InsertDeleteBuffer { - //if msg.Timestamp < tMax { - if msg.Op == msgPb.OpType_INSERT { - if msg.RowsData == nil { - continue + if msg.Timestamp < tMax { + if msg.Op == msgPb.OpType_INSERT { + node.insertData.insertIDs[msg.SegmentId] = append(node.insertData.insertIDs[msg.SegmentId], msg.Uid) + node.insertData.insertTimestamps[msg.SegmentId] = append(node.insertData.insertTimestamps[msg.SegmentId], msg.Timestamp) + node.insertData.insertRecords[msg.SegmentId] = append(node.insertData.insertRecords[msg.SegmentId], msg.RowsData.Blob) + } else if msg.Op == msgPb.OpType_DELETE { + var r = DeleteRecord { + entityID: msg.Uid, + timestamp: msg.Timestamp, + } + node.deletePreprocessData.deleteRecords = append(node.deletePreprocessData.deleteRecords, &r) + node.deletePreprocessData.count <- <- node.deletePreprocessData.count + 1 } - node.insertData.insertIDs[msg.SegmentId] = append(node.insertData.insertIDs[msg.SegmentId], msg.Uid) - node.insertData.insertTimestamps[msg.SegmentId] = append(node.insertData.insertTimestamps[msg.SegmentId], msg.Timestamp) - node.insertData.insertRecords[msg.SegmentId] = append(node.insertData.insertRecords[msg.SegmentId], msg.RowsData.Blob) - } else if msg.Op == msgPb.OpType_DELETE { - var r = DeleteRecord{ - entityID: msg.Uid, - timestamp: msg.Timestamp, - } - node.deletePreprocessData.deleteRecords = append(node.deletePreprocessData.deleteRecords, &r) - atomic.AddInt32(&node.deletePreprocessData.count, 1) + node.buffer.validInsertDeleteBuffer[i] = false } - node.buffer.validInsertDeleteBuffer[i] = false - //} } // 2. Remove invalid messages from buffer. @@ -244,50 +185,46 @@ func (node *QueryNode) MessagesPreprocess(insertDeleteMessages []*msgPb.InsertOr // Move massages after readTimeSync to QueryNodeDataBuffer. // Set valid bitmap to true. for _, msg := range insertDeleteMessages { - //if msg.Timestamp < tMax { - if msg.Op == msgPb.OpType_INSERT { - if msg.RowsData == nil { - continue + if msg.Timestamp < tMax { + if msg.Op == msgPb.OpType_INSERT { + node.insertData.insertIDs[msg.SegmentId] = append(node.insertData.insertIDs[msg.SegmentId], msg.Uid) + node.insertData.insertTimestamps[msg.SegmentId] = append(node.insertData.insertTimestamps[msg.SegmentId], msg.Timestamp) + node.insertData.insertRecords[msg.SegmentId] = append(node.insertData.insertRecords[msg.SegmentId], msg.RowsData.Blob) + } else if msg.Op == msgPb.OpType_DELETE { + var r = DeleteRecord { + entityID: msg.Uid, + timestamp: msg.Timestamp, + } + node.deletePreprocessData.deleteRecords = append(node.deletePreprocessData.deleteRecords, &r) + node.deletePreprocessData.count <- <- node.deletePreprocessData.count + 1 } - node.insertData.insertIDs[msg.SegmentId] = append(node.insertData.insertIDs[msg.SegmentId], msg.Uid) - node.insertData.insertTimestamps[msg.SegmentId] = append(node.insertData.insertTimestamps[msg.SegmentId], msg.Timestamp) - node.insertData.insertRecords[msg.SegmentId] = append(node.insertData.insertRecords[msg.SegmentId], msg.RowsData.Blob) - } else if msg.Op == msgPb.OpType_DELETE { - var r = DeleteRecord{ - entityID: msg.Uid, - timestamp: msg.Timestamp, - } - node.deletePreprocessData.deleteRecords = append(node.deletePreprocessData.deleteRecords, &r) - atomic.AddInt32(&node.deletePreprocessData.count, 1) + } else { + node.buffer.InsertDeleteBuffer = append(node.buffer.InsertDeleteBuffer, msg) + node.buffer.validInsertDeleteBuffer = append(node.buffer.validInsertDeleteBuffer, true) } - //} else { - // node.buffer.InsertDeleteBuffer = append(node.buffer.InsertDeleteBuffer, msg) - // node.buffer.validInsertDeleteBuffer = append(node.buffer.validInsertDeleteBuffer, true) - //} } - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } func (node *QueryNode) WriterDelete() msgPb.Status { // TODO: set timeout for { - if node.deletePreprocessData.count == 0 { - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} - } - node.messageClient.PrepareKey2SegmentMsg() var ids, timestamps, segmentIDs = node.GetKey2Segments() - for i := 0; i < len(*ids); i++ { - id := (*ids)[i] - timestamp := (*timestamps)[i] - segmentID := (*segmentIDs)[i] + for i := 0; i <= len(ids); i++ { + id := ids[i] + timestamp := timestamps[i] + segmentID := segmentIDs[i] for _, r := range node.deletePreprocessData.deleteRecords { if r.timestamp == timestamp && r.entityID == id { r.segmentID = segmentID - atomic.AddInt32(&node.deletePreprocessData.count, -1) + node.deletePreprocessData.count <- <- node.deletePreprocessData.count - 1 } } } + if <- node.deletePreprocessData.count == 0 { + return msgPb.Status{ErrorCode: 0} + } } } @@ -324,7 +261,7 @@ func (node *QueryNode) PreInsertAndDelete() msgPb.Status { node.deleteData.deleteOffset[segmentID] = offset } - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } func (node *QueryNode) DoInsertAndDelete() msgPb.Status { @@ -339,12 +276,11 @@ func (node *QueryNode) DoInsertAndDelete() msgPb.Status { for segmentID, deleteIDs := range node.deleteData.deleteIDs { wg.Add(1) var deleteTimestamps = node.deleteData.deleteTimestamps[segmentID] - fmt.Println("Doing delete......") go node.DoDelete(segmentID, &deleteIDs, &deleteTimestamps, &wg) } wg.Wait() - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } func (node *QueryNode) DoInsert(segmentID int64, records *[][]byte, wg *sync.WaitGroup) msgPb.Status { @@ -365,7 +301,7 @@ func (node *QueryNode) DoInsert(segmentID int64, records *[][]byte, wg *sync.Wai } wg.Done() - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } func (node *QueryNode) DoDelete(segmentID int64, deleteIDs *[]int64, deleteTimestamps *[]uint64, wg *sync.WaitGroup) msgPb.Status { @@ -384,15 +320,15 @@ func (node *QueryNode) DoDelete(segmentID int64, deleteIDs *[]int64, deleteTimes } wg.Done() - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { - var clientId = (*(searchMessages[0])).ClientId + var clientId = searchMessages[0].ClientId type SearchResultTmp struct { - ResultId int64 - ResultDistance float32 + ResultId int64 + ResultDistance float32 } // Traverse all messages in the current messageClient. @@ -405,7 +341,7 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { return msgPb.Status{ErrorCode: 1} } - var resultsTmp = make([]SearchResultTmp, 0) + var resultsTmp []SearchResultTmp // TODO: get top-k's k from queryString const TopK = 1 @@ -414,9 +350,9 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { // 1. Timestamp check // TODO: return or wait? Or adding graceful time - //if timestamp > node.queryNodeTimeSync.SearchTimeSync { - // return msgPb.Status{ErrorCode: 1} - //} + if timestamp > node.queryNodeTimeSync.SearchTimeSync { + return msgPb.Status{ErrorCode: 1} + } // 2. Do search in all segments for _, partition := range targetCollection.Partitions { @@ -426,8 +362,7 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { fmt.Println(err.Error()) return msgPb.Status{ErrorCode: 1} } - fmt.Println(res.ResultIds) - for i := 0; i < len(res.ResultIds); i++ { + for i := 0; i <= len(res.ResultIds); i++ { resultsTmp = append(resultsTmp, SearchResultTmp{ResultId: res.ResultIds[i], ResultDistance: res.ResultDistances[i]}) } } @@ -448,22 +383,15 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { return resultsTmp[i].ResultDistance < resultsTmp[j].ResultDistance }) resultsTmp = resultsTmp[:TopK] - var entities = msgPb.Entities{ - Ids: make([]int64, 0), - } - var results = msgPb.QueryResult{ - Entities: &entities, - Distances: make([]float32, 0), - QueryId: msg.Uid, - } + var results SearchResult for _, res := range resultsTmp { - results.Entities.Ids = append(results.Entities.Ids, res.ResultId) - results.Distances = append(results.Distances, res.ResultDistance) + results.ResultIds = append(results.ResultIds, res.ResultId) + results.ResultDistances = append(results.ResultDistances, res.ResultDistance) } // 3. publish result to pulsar - node.PublishSearchResult(&results, clientId) + publishSearchResult(&results, clientId) } - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} + return msgPb.Status{ErrorCode: 0} } diff --git a/reader/quety_node_test.go b/reader/quety_node_test.go deleted file mode 100644 index 3cf4dbc26b..0000000000 --- a/reader/quety_node_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package reader - -import ( - "testing" -) - -// TODO: add query node test - -func TestQueryNode_RunInsertDelete(t *testing.T) { - -} - diff --git a/reader/reader.go b/reader/reader.go index 6a1b612c41..dc9c58fe8a 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -3,9 +3,9 @@ package reader func startQueryNode() { qn := NewQueryNode(0, 0) qn.InitQueryNodeCollection() - //go qn.SegmentService() + go qn.SegmentService() qn.StartMessageClient() + go qn.RunInsertDelete() go qn.RunSearch() - qn.RunInsertDelete() } diff --git a/reader/reader_test.go b/reader/reader_test.go deleted file mode 100644 index e467f29753..0000000000 --- a/reader/reader_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package reader - -import ( - "testing" -) - -func TestReader_startQueryNode(t *testing.T) { - startQueryNode() -} diff --git a/reader/result.go b/reader/result.go index 785cc3116e..433f540be5 100644 --- a/reader/result.go +++ b/reader/result.go @@ -1,9 +1,8 @@ package reader import ( - "context" "fmt" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgPb "github.com/czs007/suvlim/pkg/message" "strconv" ) @@ -19,16 +18,21 @@ func getResultTopicByClientId(clientId int64) string { return "result-topic/partition-" + strconv.FormatInt(clientId, 10) } -func (node *QueryNode) PublishSearchResult(results *msgPb.QueryResult, clientId int64) msgPb.Status { - var ctx = context.Background() - +func publishResult(ids *ResultEntityIds, clientId int64) msgPb.Status { + // TODO: Pulsar publish var resultTopic = getResultTopicByClientId(clientId) - node.messageClient.Send(ctx, *results) fmt.Println(resultTopic) return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} } -func (node *QueryNode) PublicStatistic(statisticTopic string) msgPb.Status { +func publishSearchResult(searchResults *SearchResult, clientId int64) msgPb.Status { + // TODO: Pulsar publish + var resultTopic = getResultTopicByClientId(clientId) + fmt.Println(resultTopic) + return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} +} + +func publicStatistic(statisticTopic string) msgPb.Status { // TODO: get statistic info // getStatisticInfo() // var info = getStatisticInfo() diff --git a/reader/result_test.go b/reader/result_test.go deleted file mode 100644 index 5ce12ba873..0000000000 --- a/reader/result_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package reader - -import ( - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" - "testing" -) - -func TestResult_PublishSearchResult(t *testing.T) { - // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) - var collection = node.NewCollection("collection0", "fake schema") - var partition = collection.NewPartition("partition0") - var segment = partition.NewSegment(0) - node.SegmentsMap[0] = segment - - // TODO: start pulsar server - // TODO: fix result PublishSearchResult - const N = 10 - var entityIDs = msgPb.Entities { - Ids: make([]int64, N), - } - var results = msgPb.QueryResult { - Entities: &entityIDs, - Distances: make([]float32, N), - } - for i := 0; i < N; i++ { - results.Entities.Ids = append(results.Entities.Ids, int64(i)) - results.Distances = append(results.Distances, float32(i)) - } - node.PublishSearchResult(&results, 0) -} diff --git a/reader/segment.go b/reader/segment.go index 420f95d087..683268b9a0 100644 --- a/reader/segment.go +++ b/reader/segment.go @@ -13,9 +13,8 @@ package reader */ import "C" import ( - "fmt" "github.com/czs007/suvlim/errors" - schema "github.com/czs007/suvlim/pkg/master/grpc/message" + schema "github.com/czs007/suvlim/pkg/message" "strconv" "unsafe" ) @@ -82,9 +81,9 @@ func (s *Segment) SegmentPreInsert(numOfRecords int) int64 { long int PreInsert(CSegmentBase c_segment, long int size); */ - var offset = C.PreInsert(s.SegmentPtr, C.long(int64(numOfRecords))) + var offset = C.PreInsert(C.long(int64(numOfRecords))) - return int64(offset) + return offset } func (s *Segment) SegmentPreDelete(numOfRecords int) int64 { @@ -92,9 +91,9 @@ func (s *Segment) SegmentPreDelete(numOfRecords int) int64 { long int PreDelete(CSegmentBase c_segment, long int size); */ - var offset = C.PreDelete(s.SegmentPtr, C.long(int64(numOfRecords))) + var offset = C.PreDelete(C.long(int64(numOfRecords))) - return int64(offset) + return offset } func (s *Segment) SegmentInsert(offset int64, entityIDs *[]int64, timestamps *[]uint64, records *[][]byte) error { @@ -110,19 +109,16 @@ func (s *Segment) SegmentInsert(offset int64, entityIDs *[]int64, timestamps *[] signed long int count); */ // Blobs to one big blob - var numOfRow = len(*entityIDs) - var sizeofPerRow = len((*records)[0]) - - var rawData = make([]byte, numOfRow * sizeofPerRow) + var rawData []byte for i := 0; i < len(*records); i++ { copy(rawData, (*records)[i]) } var cOffset = C.long(offset) - var cNumOfRows = C.long(numOfRow) - var cEntityIdsPtr = (*C.long)(&(*entityIDs)[0]) + var cNumOfRows = C.long(len(*entityIDs)) + var cEntityIdsPtr = (*C.ulong)(&(*entityIDs)[0]) var cTimestampsPtr = (*C.ulong)(&(*timestamps)[0]) - var cSizeofPerRow = C.int(sizeofPerRow) + var cSizeofPerRow = C.int(len((*records)[0])) var cRawDataVoidPtr = unsafe.Pointer(&rawData[0]) var status = C.Insert(s.SegmentPtr, @@ -152,7 +148,7 @@ func (s *Segment) SegmentDelete(offset int64, entityIDs *[]int64, timestamps *[] */ var cOffset = C.long(offset) var cSize = C.long(len(*entityIDs)) - var cEntityIdsPtr = (*C.long)(&(*entityIDs)[0]) + var cEntityIdsPtr = (*C.ulong)(&(*entityIDs)[0]) var cTimestampsPtr = (*C.ulong)(&(*timestamps)[0]) var status = C.Delete(s.SegmentPtr, cOffset, cSize, cEntityIdsPtr, cTimestampsPtr) @@ -174,7 +170,7 @@ func (s *Segment) SegmentSearch(queryString string, timestamp uint64, vectorReco float* result_distances); */ // TODO: get top-k's k from queryString - const TopK = 10 + const TopK = 1 resultIds := make([]int64, TopK) resultDistances := make([]float32, TopK) @@ -190,7 +186,5 @@ func (s *Segment) SegmentSearch(queryString string, timestamp uint64, vectorReco return nil, errors.New("Search failed, error code = " + strconv.Itoa(int(status))) } - fmt.Println("Search Result---- Ids =", resultIds, ", Distances =", resultDistances) - return &SearchResult{ResultIds: resultIds, ResultDistances: resultDistances}, nil } diff --git a/reader/segment_management_test.go b/reader/segment_management_test.go deleted file mode 100644 index f72b6f29f2..0000000000 --- a/reader/segment_management_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package reader - -import ( - "testing" -) - -func TestSegmentManagement_SegmentsManagement(t *testing.T) { - // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) - var collection = node.NewCollection("collection0", "fake schema") - var partition = collection.NewPartition("partition0") - var segment = partition.NewSegment(0) - node.SegmentsMap[0] = segment - - // TODO: fix segment management - node.SegmentsManagement() -} - -func TestSegmentManagement_SegmentService(t *testing.T) { - // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) - var collection = node.NewCollection("collection0", "fake schema") - var partition = collection.NewPartition("partition0") - var segment = partition.NewSegment(0) - node.SegmentsMap[0] = segment - - // TODO: fix segment service - node.SegmentService() -} diff --git a/reader/segment_test.go b/reader/segment_test.go index 1b24166b09..79a488f049 100644 --- a/reader/segment_test.go +++ b/reader/segment_test.go @@ -1,15 +1,13 @@ package reader import ( - "encoding/binary" "fmt" "github.com/stretchr/testify/assert" - "math" "testing" ) -func TestSegment_ConstructorAndDestructor(t *testing.T) { - // 1. Construct node, collection, partition and segment +func TestConstructorAndDestructor(t *testing.T) { + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") @@ -22,39 +20,35 @@ func TestSegment_ConstructorAndDestructor(t *testing.T) { } func TestSegment_SegmentInsert(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) // 2. Create ids and timestamps - ids := []int64{1, 2, 3} - timestamps := []uint64{0, 0, 0} + ids :=[] int64{1, 2, 3} + timestamps :=[] uint64 {0, 0, 0} // 3. Create records, use schema below: // schema_tmp->AddField("fakeVec", DataType::VECTOR_FLOAT, 16); // schema_tmp->AddField("age", DataType::INT32); - const DIM = 16 + const DIM = 4 const N = 3 - var vec = [DIM]float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} + var vec = [DIM]float32{1.1, 2.2, 3.3, 4.4} var rawData []byte for _, ele := range vec { - buf := make([]byte, 4) - binary.LittleEndian.PutUint32(buf, math.Float32bits(ele)) - rawData = append(rawData, buf...) + rawData=append(rawData, byte(ele)) } - bs := make([]byte, 4) - binary.LittleEndian.PutUint32(bs, 1) - rawData = append(rawData, bs...) + rawData=append(rawData, byte(1)) var records [][]byte - for i := 0; i < N; i++ { + for i:= 0; i < N; i++ { records = append(records, rawData) } // 4. Do PreInsert var offset = segment.SegmentPreInsert(N) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 5. Do Insert var err = segment.SegmentInsert(offset, &ids, ×tamps, &records) @@ -67,19 +61,19 @@ func TestSegment_SegmentInsert(t *testing.T) { } func TestSegment_SegmentDelete(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) // 2. Create ids and timestamps - ids := []int64{1, 2, 3} - timestamps := []uint64{0, 0, 0} + ids :=[] int64{1, 2, 3} + timestamps :=[] uint64 {0, 0, 0} // 3. Do PreDelete var offset = segment.SegmentPreDelete(10) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 4. Do Delete var err = segment.SegmentDelete(offset, &ids, ×tamps) @@ -92,39 +86,35 @@ func TestSegment_SegmentDelete(t *testing.T) { } func TestSegment_SegmentSearch(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) // 2. Create ids and timestamps - ids := []int64{1, 2, 3} - timestamps := []uint64{0, 0, 0} + ids :=[] int64{1, 2, 3} + timestamps :=[] uint64 {0, 0, 0} // 3. Create records, use schema below: // schema_tmp->AddField("fakeVec", DataType::VECTOR_FLOAT, 16); // schema_tmp->AddField("age", DataType::INT32); - const DIM = 16 + const DIM = 4 const N = 3 - var vec = [DIM]float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} + var vec = [DIM]float32{1.1, 2.2, 3.3, 4.4} var rawData []byte for _, ele := range vec { - buf := make([]byte, 4) - binary.LittleEndian.PutUint32(buf, math.Float32bits(ele)) - rawData = append(rawData, buf...) + rawData=append(rawData, byte(ele)) } - bs := make([]byte, 4) - binary.LittleEndian.PutUint32(bs, 1) - rawData = append(rawData, bs...) + rawData=append(rawData, byte(1)) var records [][]byte - for i := 0; i < N; i++ { + for i:= 0; i < N; i++ { records = append(records, rawData) } // 4. Do PreInsert var offset = segment.SegmentPreInsert(N) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 5. Do Insert var err = segment.SegmentInsert(offset, &ids, ×tamps, &records) @@ -142,7 +132,7 @@ func TestSegment_SegmentSearch(t *testing.T) { } func TestSegment_SegmentPreInsert(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") @@ -150,7 +140,7 @@ func TestSegment_SegmentPreInsert(t *testing.T) { // 2. Do PreInsert var offset = segment.SegmentPreInsert(10) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 3. Destruct node, collection, and segment partition.DeleteSegment(segment) @@ -159,7 +149,7 @@ func TestSegment_SegmentPreInsert(t *testing.T) { } func TestSegment_SegmentPreDelete(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") @@ -167,7 +157,7 @@ func TestSegment_SegmentPreDelete(t *testing.T) { // 2. Do PreDelete var offset = segment.SegmentPreDelete(10) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 3. Destruct node, collection, and segment partition.DeleteSegment(segment) @@ -178,7 +168,7 @@ func TestSegment_SegmentPreDelete(t *testing.T) { // Segment util functions test //////////////////////////////////////////////////////////////////////////// func TestSegment_GetStatus(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") @@ -195,7 +185,7 @@ func TestSegment_GetStatus(t *testing.T) { } func TestSegment_Close(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") @@ -212,39 +202,35 @@ func TestSegment_Close(t *testing.T) { } func TestSegment_GetRowCount(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) // 2. Create ids and timestamps - ids := []int64{1, 2, 3} - timestamps := []uint64{0, 0, 0} + ids :=[] int64{1, 2, 3} + timestamps :=[] uint64 {0, 0, 0} // 3. Create records, use schema below: // schema_tmp->AddField("fakeVec", DataType::VECTOR_FLOAT, 16); // schema_tmp->AddField("age", DataType::INT32); - const DIM = 16 + const DIM = 4 const N = 3 - var vec = [DIM]float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} + var vec = [DIM]float32{1.1, 2.2, 3.3, 4.4} var rawData []byte for _, ele := range vec { - buf := make([]byte, 4) - binary.LittleEndian.PutUint32(buf, math.Float32bits(ele)) - rawData = append(rawData, buf...) + rawData=append(rawData, byte(ele)) } - bs := make([]byte, 4) - binary.LittleEndian.PutUint32(bs, 1) - rawData = append(rawData, bs...) + rawData=append(rawData, byte(1)) var records [][]byte - for i := 0; i < N; i++ { + for i:= 0; i < N; i++ { records = append(records, rawData) } // 4. Do PreInsert var offset = segment.SegmentPreInsert(N) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 5. Do Insert var err = segment.SegmentInsert(offset, &ids, ×tamps, &records) @@ -261,19 +247,19 @@ func TestSegment_GetRowCount(t *testing.T) { } func TestSegment_GetDeletedCount(t *testing.T) { - // 1. Construct node, collection, partition and segment + // 1. Construct node, collection, and segment node := NewQueryNode(0, 0) var collection = node.NewCollection("collection0", "fake schema") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) // 2. Create ids and timestamps - ids := []int64{1, 2, 3} - timestamps := []uint64{0, 0, 0} + ids :=[] int64{1, 2, 3} + timestamps :=[] uint64 {0, 0, 0} // 3. Do PreDelete var offset = segment.SegmentPreDelete(10) - assert.GreaterOrEqual(t, offset, int64(0)) + assert.Greater(t, offset, 0) // 4. Do Delete var err = segment.SegmentDelete(offset, &ids, ×tamps) diff --git a/reader/util_functions.go b/reader/util_functions.go index 8496b1ffc2..cc5b133319 100644 --- a/reader/util_functions.go +++ b/reader/util_functions.go @@ -6,21 +6,35 @@ import ( ) // Function `GetSegmentByEntityId` should return entityIDs, timestamps and segmentIDs -func (node *QueryNode) GetKey2Segments() (*[]int64, *[]uint64, *[]int64) { - var entityIDs = make([]int64, 0) - var timestamps = make([]uint64, 0) - var segmentIDs = make([]int64, 0) +func (node *QueryNode) GetKey2Segments() ([]int64, []uint64, []int64) { + // TODO: get id2segment info from pulsar + return nil, nil, nil +} - var key2SegMsg = node.messageClient.Key2SegMsg - for _, msg := range key2SegMsg { - for _, segmentID := range msg.SegmentId { - entityIDs = append(entityIDs, msg.Uid) - timestamps = append(timestamps, msg.Timestamp) - segmentIDs = append(segmentIDs, segmentID) +func (node *QueryNode) GetTargetSegment(collectionName *string, partitionTag *string) (*Segment, error) { + var targetPartition *Partition + + for _, collection := range node.Collections { + if *collectionName == collection.CollectionName { + for _, partition := range collection.Partitions { + if *partitionTag == partition.PartitionName { + targetPartition = partition + break + } + } } } - return &entityIDs, ×tamps, &segmentIDs + if targetPartition == nil { + return nil, errors.New("cannot found target partition") + } + + for _, segment := range targetPartition.OpenedSegments { + // TODO: add other conditions + return segment, nil + } + + return nil, errors.New("cannot found target segment") } func (node *QueryNode) GetCollectionByCollectionName(collectionName string) (*Collection, error) { diff --git a/reader/util_functions_test.go b/reader/util_functions_test.go deleted file mode 100644 index b8ddefc6ed..0000000000 --- a/reader/util_functions_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package reader - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestUtilFunctions_GetKey2Segments(t *testing.T) { - // TODO: Add GetKey2Segments test -} - -func TestUtilFunctions_GetCollectionByCollectionName(t *testing.T) { - // 1. Construct node, and collections - node := NewQueryNode(0, 0) - var _ = node.NewCollection("collection0", "fake schema") - - // 2. Get collection by collectionName - var c0, err = node.GetCollectionByCollectionName("collection0") - assert.NoError(t, err) - assert.Equal(t, c0.CollectionName, "collection0") -} - -func TestUtilFunctions_GetSegmentBySegmentID(t *testing.T) { - // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) - var collection = node.NewCollection("collection0", "fake schema") - var partition = collection.NewPartition("partition0") - var segment = partition.NewSegment(0) - node.SegmentsMap[0] = segment - - // 2. Get segment by segment id - var s0, err = node.GetSegmentBySegmentID(0) - assert.NoError(t, err) - assert.Equal(t, s0.SegmentId, int64(0)) -} diff --git a/scripts/generate_cpp.sh b/scripts/generate_cpp.sh index bcb6a96cd9..7a85b320c9 100755 --- a/scripts/generate_cpp.sh +++ b/scripts/generate_cpp.sh @@ -49,7 +49,7 @@ GRPC_INCLUDE=.:. rm -rf proto-cpp && mkdir -p proto-cpp PB_FILES=() -GRPC_FILES=("message.proto") +GRPC_FILES=("hello.proto" "master.proto" "message.proto") ALL_FILES=("${PB_FILES[@]}") ALL_FILES+=("${GRPC_FILES[@]}") diff --git a/scripts/generate_go.sh b/scripts/generate_go.sh index 8e6a5ade41..61d59e77cb 100755 --- a/scripts/generate_go.sh +++ b/scripts/generate_go.sh @@ -41,12 +41,8 @@ if [ -z $GOPATH ]; then exit 1 fi -export PATH=${GOPATH}/bin:$PATH -echo `which protoc-gen-go` - GO_PREFIX_PATH=github.com/czs007/suvlim/pkg - function collect() { file=$(basename $1) base_name=$(basename $file ".proto") diff --git a/storage/conf/conf.go b/storage/conf/conf.go new file mode 100644 index 0000000000..ce7a0e5a86 --- /dev/null +++ b/storage/conf/conf.go @@ -0,0 +1,31 @@ +package conf + +import ( + "fmt" + "path" + "os" + "github.com/BurntSushi/toml" +) + +type StorageConfig struct { + Driver string +} + +var config *StorageConfig = new(StorageConfig) + +func GetConfig() *StorageConfig { + return config +} + +func init() { + //读取配置文件 + dirPath, _ := os.Getwd() + filePath := path.Join(dirPath, "config/storage.toml") + fmt.Println("aaa") + fmt.Println(filePath) + fmt.Println("bbb") + _, err := toml.DecodeFile(filePath, config) + if err != nil { + fmt.Println(err) + } +} diff --git a/storage/conf/conf_test.go b/storage/conf/conf_test.go new file mode 100644 index 0000000000..b5a0714d65 --- /dev/null +++ b/storage/conf/conf_test.go @@ -0,0 +1,16 @@ +package conf_test + +import ( + "fmt" + "os" + "storage/pkg/conf" + "testing" +) + +func TestMain(m *testing.M) { + exitCode := m.Run() + fmt.Println("haha") + config := conf.GetConfig() + fmt.Println(config.Driver) + os.Exit(exitCode) +} diff --git a/storage/internal/minio/minio_store.go b/storage/internal/minio/minio_store.go index 8319f3aa31..3e8f5419dc 100644 --- a/storage/internal/minio/minio_store.go +++ b/storage/internal/minio/minio_store.go @@ -15,7 +15,7 @@ type minioDriver struct { func NewMinioDriver(ctx context.Context) (*minioDriver, error) { // to-do read conf - var endPoint = "localhost:9000" + var endPoint = "192.168.2.28:9000" var accessKeyID = "testminio" var secretAccessKey = "testminio" var useSSL = false diff --git a/storage/pkg/conf/conf.go b/storage/pkg/conf/conf.go new file mode 100644 index 0000000000..ce7a0e5a86 --- /dev/null +++ b/storage/pkg/conf/conf.go @@ -0,0 +1,31 @@ +package conf + +import ( + "fmt" + "path" + "os" + "github.com/BurntSushi/toml" +) + +type StorageConfig struct { + Driver string +} + +var config *StorageConfig = new(StorageConfig) + +func GetConfig() *StorageConfig { + return config +} + +func init() { + //读取配置文件 + dirPath, _ := os.Getwd() + filePath := path.Join(dirPath, "config/storage.toml") + fmt.Println("aaa") + fmt.Println(filePath) + fmt.Println("bbb") + _, err := toml.DecodeFile(filePath, config) + if err != nil { + fmt.Println(err) + } +} diff --git a/storage/pkg/conf/conf_test.go b/storage/pkg/conf/conf_test.go new file mode 100644 index 0000000000..b5a0714d65 --- /dev/null +++ b/storage/pkg/conf/conf_test.go @@ -0,0 +1,16 @@ +package conf_test + +import ( + "fmt" + "os" + "storage/pkg/conf" + "testing" +) + +func TestMain(m *testing.M) { + exitCode := m.Run() + fmt.Println("haha") + config := conf.GetConfig() + fmt.Println(config.Driver) + os.Exit(exitCode) +} diff --git a/timesync/readertimesync.go b/timesync/readertimesync.go index 60f44c5b8a..411cc6e6a4 100644 --- a/timesync/readertimesync.go +++ b/timesync/readertimesync.go @@ -10,7 +10,7 @@ import ( "sort" ) -const ReadStopFlagEnd int64 = 0 +const TimeSyncClientId int64 = -1 type ReaderTimeSync interface { Start() error @@ -36,17 +36,15 @@ type readerTimeSyncCfg struct { timesyncMsgChan chan TimeSyncMsg insertOrDeleteChan chan *pb.InsertOrDeleteMsg //output insert or delete msg - readStopFlagClientId int64 - interval int - proxyIdList []int64 - readerQueueSize int + interval int + proxyIdList []int64 + readerQueueSize int revTimesyncFromReader map[uint64]int ctx context.Context cancel context.CancelFunc } - /* layout of timestamp time ms logic number @@ -66,7 +64,6 @@ func NewReaderTimeSync( readSubName string, proxyIdList []int64, interval int, - readStopFlagClientId int64, opts ...ReaderTimeSyncOption, ) (ReaderTimeSync, error) { //check if proxyId has duplication @@ -97,10 +94,6 @@ func NewReaderTimeSync( if r.readerQueueSize == 0 { r.readerQueueSize = 1024 } - if readStopFlagClientId >= ReadStopFlagEnd { - return nil, fmt.Errorf("read stop flag client id should less than %d", ReadStopFlagEnd) - } - r.readStopFlagClientId = readStopFlagClientId r.timesyncMsgChan = make(chan TimeSyncMsg, len(readTopics)*r.readerQueueSize) r.insertOrDeleteChan = make(chan *pb.InsertOrDeleteMsg, len(readTopics)*r.readerQueueSize) @@ -197,9 +190,8 @@ func (r *readerTimeSyncCfg) alignTimeSync(ts []*pb.TimeSyncMsg) []*pb.TimeSyncMs } } } else { - if len(ts) > 1 { - ts = ts[len(ts)-1:] - } + ts = ts[len(ts)-1:] + return ts } return ts } @@ -209,10 +201,7 @@ func (r *readerTimeSyncCfg) readTimeSync(ctx context.Context, ts []*pb.TimeSyncM select { case <-ctx.Done(): return nil, ctx.Err() - case cm, ok := <-r.timeSyncConsumer.Chan(): - if ok == false { - return nil, fmt.Errorf("timesync consumer closed") - } + case cm := <-r.timeSyncConsumer.Chan(): msg := cm.Message var tsm pb.TimeSyncMsg if err := proto.Unmarshal(msg.Payload(), &tsm); err != nil { @@ -250,7 +239,7 @@ func (r *readerTimeSyncCfg) startTimeSync() { } tsm = tsm[:0] //send timestamp flag to reader channel - msg := pb.InsertOrDeleteMsg{Timestamp: ts, ClientId: r.readStopFlagClientId} + msg := pb.InsertOrDeleteMsg{Timestamp: ts, ClientId: TimeSyncClientId} payload, err := proto.Marshal(&msg) if err != nil { //TODO log error @@ -266,10 +255,6 @@ func (r *readerTimeSyncCfg) startTimeSync() { } } -func (r *readerTimeSyncCfg) isReadStopFlag(imsg *pb.InsertOrDeleteMsg) bool { - return imsg.ClientId < ReadStopFlagEnd -} - func (r *readerTimeSyncCfg) startReadTopics() { ctx, _ := context.WithCancel(r.ctx) tsm := TimeSyncMsg{Timestamp: 0, NumRecorders: 0} @@ -277,11 +262,7 @@ func (r *readerTimeSyncCfg) startReadTopics() { select { case <-ctx.Done(): return - case cm, ok := <-r.readerConsumer.Chan(): - if ok == false { - //TODO,log error - log.Printf("reader consumer closed") - } + case cm := <-r.readerConsumer.Chan(): msg := cm.Message var imsg pb.InsertOrDeleteMsg if err := proto.Unmarshal(msg.Payload(), &imsg); err != nil { @@ -289,20 +270,18 @@ func (r *readerTimeSyncCfg) startReadTopics() { log.Printf("unmarshal InsertOrDeleteMsg error %v", err) break } - if r.isReadStopFlag(&imsg) { //timestamp flag - if imsg.ClientId == r.readStopFlagClientId { - gval := r.revTimesyncFromReader[imsg.Timestamp] - gval++ - if gval >= len(r.readerProducer) { - if imsg.Timestamp >= tsm.Timestamp { - tsm.Timestamp = imsg.Timestamp - r.timesyncMsgChan <- tsm - tsm.NumRecorders = 0 - } - delete(r.revTimesyncFromReader, imsg.Timestamp) - } else { - r.revTimesyncFromReader[imsg.Timestamp] = gval + if imsg.ClientId == TimeSyncClientId { //timestamp flag + gval := r.revTimesyncFromReader[imsg.Timestamp] + gval++ + if gval >= len(r.readerProducer) { + if imsg.Timestamp >= tsm.Timestamp { + tsm.Timestamp = imsg.Timestamp + r.timesyncMsgChan <- tsm + tsm.NumRecorders = 0 } + delete(r.revTimesyncFromReader, imsg.Timestamp) + } else { + r.revTimesyncFromReader[imsg.Timestamp] = gval } } else { if r.IsInsertDeleteChanFull() { diff --git a/timesync/readertimesync_test.go b/timesync/readertimesync_test.go index 1f1c4b81df..ac03907923 100644 --- a/timesync/readertimesync_test.go +++ b/timesync/readertimesync_test.go @@ -6,41 +6,20 @@ import ( pb "github.com/czs007/suvlim/pkg/message" "github.com/golang/protobuf/proto" "log" - "sync" "testing" "time" ) const ( - pulsarAddr = "pulsar://localhost:6650" - timeSyncTopic = "timesync" - timeSyncTopic2 = "timesync2" - timeSyncTopic3 = "timesync3" - timeSyncSubName = "timesync-g" - timeSyncSubName1 = "timesync-g1" - timeSyncSubName2 = "timesync-g2" - timeSyncSubName3 = "timesync-g3" - readerTopic1 = "reader1" - readerTopic12 = "reader12" - readerTopic13 = "reader13" - readerTopic2 = "reader2" - readerTopic22 = "reader22" - readerTopic23 = "reader23" - readerTopic3 = "reader3" - readerTopic32 = "reader32" - readerTopic33 = "reader33" - readerTopic4 = "reader4" - readerTopic42 = "reader42" - readerTopic43 = "reader43" - readerSubName = "reader-g" - readerSubName1 = "reader-g1" - readerSubName2 = "reader-g2" - readerSubName3 = "reader-g3" - interval = 200 - readStopFlag int64 = -1 - readStopFlag1 int64 = -1 - readStopFlag2 int64 = -2 - readStopFlag3 int64 = -3 + pulsarAddr = "pulsar://localhost:6650" + timeSyncTopic = "timesync" + timeSyncSubName = "timesync-g" + readerTopic1 = "reader1" + readerTopic2 = "reader2" + readerTopic3 = "reader3" + readerTopic4 = "reader4" + readerSubName = "reader-g" + interval = 200 ) func TestAlignTimeSync(t *testing.T) { @@ -213,7 +192,6 @@ func TestNewReaderTimeSync(t *testing.T) { readerSubName, []int64{2, 1}, interval, - readStopFlag, WithReaderQueueSize(8), ) if err != nil { @@ -235,9 +213,6 @@ func TestNewReaderTimeSync(t *testing.T) { if rr.interval != interval { t.Fatalf("interval shoudl be %d", interval) } - if rr.readStopFlagClientId != readStopFlag { - t.Fatalf("raed stop flag client id should be %d", rr.readStopFlagClientId) - } if rr.readerQueueSize != 8 { t.Fatalf("set read queue size failed") } @@ -297,7 +272,6 @@ func TestReaderTimesync(t *testing.T) { readerSubName, []int64{2, 1}, interval, - readStopFlag, WithReaderQueueSize(1024), ) if err != nil { @@ -372,195 +346,6 @@ func TestReaderTimesync(t *testing.T) { t.Fatalf("total records should be 800") } r.Close() - pt1.Close() - pt2.Close() - pr1.Close() - pr2.Close() - pr3.Close() - pr4.Close() -} - -func TestReaderTimesync2(t *testing.T) { - client, _ := pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) - pt1, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic2}) - pt2, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic2}) - pr1, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic12}) - pr2, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic22}) - pr3, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic32}) - pr4, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic42}) - - go startProxy(pt1, 1, pr1, 1, pr2, 2, 2*time.Second, t) - go startProxy(pt2, 2, pr3, 3, pr4, 4, 2*time.Second, t) - - r1, _ := NewReaderTimeSync(pulsarAddr, - timeSyncTopic2, - timeSyncSubName1, - []string{readerTopic12, readerTopic22, readerTopic32, readerTopic42}, - readerSubName1, - []int64{2, 1}, - interval, - readStopFlag1, - WithReaderQueueSize(1024), - ) - - r2, _ := NewReaderTimeSync(pulsarAddr, - timeSyncTopic2, - timeSyncSubName2, - []string{readerTopic12, readerTopic22, readerTopic32, readerTopic42}, - readerSubName2, - []int64{2, 1}, - interval, - readStopFlag2, - WithReaderQueueSize(1024), - ) - - ctx, _ := context.WithTimeout(context.Background(), 3*time.Second) - rt := []ReaderTimeSync{r1, r2} - var wg sync.WaitGroup - for _, r := range rt { - r := r - _ = r.Start() - wg.Add(1) - go func() { - var tsm1, tsm2 TimeSyncMsg - var totalRecordes int64 = 0 - work := false - defer wg.Done() - for { - if ctx.Err() != nil { - break - } - select { - case tsm1 = <-r.TimeSync(): - work = true - default: - work = false - } - if work { - if tsm1.NumRecorders > 0 { - //log.Printf("timestamp %d, num records = %d", getMillisecond(tsm1.Timestamp), tsm1.NumRecorders) - totalRecordes += tsm1.NumRecorders - for i := int64(0); i < tsm1.NumRecorders; i++ { - im := <-r.InsertOrDelete() - //log.Printf("%d - %d", getMillisecond(im.Timestamp), getMillisecond(tsm2.Timestamp)) - if im.Timestamp < tsm2.Timestamp { - t.Fatalf("time sync error , im.Timestamp = %d, tsm2.Timestamp = %d", getMillisecond(im.Timestamp), getMillisecond(tsm2.Timestamp)) - } - } - tsm2 = tsm1 - } - } - } - log.Printf("total recordes = %d", totalRecordes) - if totalRecordes != 800 { - t.Fatalf("total records should be 800") - } - }() - } - wg.Wait() - r1.Close() - r2.Close() - pt1.Close() - pt2.Close() - pr1.Close() - pr2.Close() - pr3.Close() - pr4.Close() -} - -func TestReaderTimesync3(t *testing.T) { - client, _ := pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) - pt, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic3}) - pr1, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic13}) - pr2, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic23}) - pr3, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic33}) - pr4, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic43}) - defer func() { - pr1.Close() - pr2.Close() - pr3.Close() - pr4.Close() - pt.Close() - client.Close() - }() - go func() { - total := 2 * 1000 / 10 - ticker := time.Tick(10 * time.Millisecond) - var timestamp uint64 = 0 - prlist := []pulsar.Producer{pr1, pr2, pr3, pr4} - for i := 1; i <= total; i++ { - <-ticker - timestamp += 10 - for idx, pr := range prlist { - msg := pb.InsertOrDeleteMsg{ClientId: int64(idx + 1), Timestamp: toTimestamp(timestamp)} - mb, err := proto.Marshal(&msg) - if err != nil { - t.Fatal(err) - } - if _, err := pr.Send(context.Background(), &pulsar.ProducerMessage{Payload: mb}); err != nil { - t.Fatal(err) - } - } - if i%20 == 0 { - tm := pb.TimeSyncMsg{Peer_Id: 1, Timestamp: toTimestamp(timestamp)} - tb, err := proto.Marshal(&tm) - if err != nil { - t.Fatal(err) - } - if _, err := pt.Send(context.Background(), &pulsar.ProducerMessage{Payload: tb}); err != nil { - t.Fatal(err) - } - } - } - }() - - r, err := NewReaderTimeSync(pulsarAddr, - timeSyncTopic3, - timeSyncSubName3, - []string{readerTopic13, readerTopic23, readerTopic33, readerTopic43}, - readerSubName3, - []int64{1}, - interval, - readStopFlag3, - WithReaderQueueSize(1024)) - if err != nil { - t.Fatal(err) - } - defer r.Close() - - ctx, _ := context.WithTimeout(context.Background(), 3*time.Second) - if err := r.Start(); err != nil { - t.Fatal(err) - } - var tsm1, tsm2 TimeSyncMsg - var totalRecords int64 = 0 - for { - if ctx.Err() != nil { - break - } - select { - case <-ctx.Done(): - tsm1.NumRecorders = 0 - break - case tsm1 = <-r.TimeSync(): - - } - if tsm1.NumRecorders > 0 { - totalRecords += tsm1.NumRecorders - for i := int64(0); i < tsm1.NumRecorders; i++ { - im := <-r.InsertOrDelete() - if im.Timestamp < tsm2.Timestamp { - t.Fatalf("time sync error , im.Timestamp = %d, tsm2.Timestamp = %d", im.Timestamp, tsm2.Timestamp) - } - } - tsm2 = tsm1 - } - } - log.Printf("total records = %d", totalRecords) - if totalRecords != 800 { - t.Fatalf("total records should be 800") - } - } func getMillisecond(ts uint64) uint64 { diff --git a/writer/main.go b/writer/main.go index 44207e7155..5b4267f55c 100644 --- a/writer/main.go +++ b/writer/main.go @@ -3,8 +3,8 @@ package main import ( "context" "fmt" - "github.com/czs007/suvlim/conf" "github.com/czs007/suvlim/storage/pkg" + "github.com/czs007/suvlim/storage/pkg/types" "github.com/czs007/suvlim/writer/message_client" "github.com/czs007/suvlim/writer/write_node" "log" @@ -16,13 +16,14 @@ func main() { mc := message_client.MessageClient{} mc.InitClient("pulsar://localhost:6650") + //mc.InitClient("pulsar://192.168.2.18:6650") //TODO::close client / consumer/ producer //mc.Close() go mc.ReceiveMessage() wg := sync.WaitGroup{} ctx := context.Background() - kv, err := storage.NewStore(ctx, conf.Config.Storage.Driver) + kv, err := storage.NewStore(ctx, types.MinIODriver) // if err != nil, should retry link if err != nil { log.Fatal(err) diff --git a/writer/message_client/message_client.go b/writer/message_client/message_client.go index 27d4713674..f39e12eebc 100644 --- a/writer/message_client/message_client.go +++ b/writer/message_client/message_client.go @@ -2,8 +2,8 @@ package message_client import ( "context" - "github.com/apache/pulsar-client-go/pulsar" - msgpb "github.com/czs007/suvlim/pkg/master/grpc/message" + "github.com/apache/pulsar/pulsar-client-go/pulsar" + msgpb "github.com/czs007/suvlim/pkg/message" "github.com/golang/protobuf/proto" "log" ) @@ -30,9 +30,8 @@ type MessageClient struct { } func (mc *MessageClient) Send(ctx context.Context, msg msgpb.Key2SegMsg) { - var msgBuffer, _ = proto.Marshal(&msg) - if _, err := mc.key2segProducer.Send(ctx, &pulsar.ProducerMessage{ - Payload: msgBuffer, + if err := mc.key2segProducer.Send(ctx, pulsar.ProducerMessage{ + Payload: []byte(msg.String()), }); err != nil { log.Fatal(err) } diff --git a/writer/write_node/writer_node.go b/writer/write_node/writer_node.go index 9189141296..213ee6fbf0 100644 --- a/writer/write_node/writer_node.go +++ b/writer/write_node/writer_node.go @@ -3,7 +3,7 @@ package write_node import ( "context" "fmt" - msgpb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgpb "github.com/czs007/suvlim/pkg/message" storage "github.com/czs007/suvlim/storage/pkg" "github.com/czs007/suvlim/storage/pkg/types" "github.com/czs007/suvlim/writer/message_client" @@ -85,7 +85,6 @@ func (wn *WriteNode) DeleteBatchData(ctx context.Context, data []*msgpb.InsertOr segmentInfo := msgpb.Key2SegMsg{ Uid: data[i].Uid, SegmentId: segmentIds, - Timestamp: data[i].Timestamp, } wn.MessageClient.Send(ctx, segmentInfo) }