diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 7cafaa8f00..fe39bb12ba 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -201,12 +201,3 @@ if ( NOT MILVUS_DB_PATH ) endif () set( GPU_ENABLE "false" ) - -install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/dog_segment/ - DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include - FILES_MATCHING PATTERN "*_c.h" -) - -install(FILES ${CMAKE_BINARY_DIR}/src/dog_segment/libmilvus_dog_segment.so - DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/lib) diff --git a/core/include/segment_c.h b/core/include/segment_c.h index a9dbb05fd9..937ec69578 100644 --- a/core/include/segment_c.h +++ b/core/include/segment_c.h @@ -40,10 +40,8 @@ PreDelete(CSegmentBase c_segment, long int size); int Search(CSegmentBase c_segment, - const char* query_json, + void* fake_query, unsigned long timestamp, - float* query_raw_data, - int num_of_query_raw_data, long int* result_ids, float* result_distances); @@ -52,9 +50,6 @@ Search(CSegmentBase c_segment, int Close(CSegmentBase c_segment); -int -BuildIndex(CSegmentBase c_segment); - bool IsOpened(CSegmentBase c_segment); diff --git a/core/src/dog_segment/DeletedRecord.h b/core/src/dog_segment/DeletedRecord.h deleted file mode 100644 index 3efc34b0b7..0000000000 --- a/core/src/dog_segment/DeletedRecord.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include "AckResponder.h" -#include "SegmentDefs.h" -#include "knowhere//index/vector_index/IndexIVF.h" -#include - -namespace milvus::dog_segment { - -struct DeletedRecord { - struct TmpBitmap { - // Just for query - int64_t del_barrier = 0; - faiss::ConcurrentBitsetPtr bitmap_ptr; - - std::shared_ptr clone(int64_t capacity); - }; - - DeletedRecord() : lru_(std::make_shared()) { - lru_->bitmap_ptr = std::make_shared(0); - } - - auto get_lru_entry() { - std::shared_lock lck(shared_mutex_); - return lru_; - } - - void insert_lru_entry(std::shared_ptr new_entry, bool force = false) { - std::lock_guard lck(shared_mutex_); - if (new_entry->del_barrier <= lru_->del_barrier) { - if (!force || new_entry->bitmap_ptr->capacity() <= lru_->bitmap_ptr->capacity()) { - // DO NOTHING - return; - } - } - lru_ = std::move(new_entry); - } - -public: - std::atomic reserved = 0; - AckResponder ack_responder_; - ConcurrentVector timestamps_; - ConcurrentVector uids_; -private: - std::shared_ptr lru_; - std::shared_mutex shared_mutex_; - -}; - -auto DeletedRecord::TmpBitmap::clone(int64_t capacity) -> std::shared_ptr { - auto res = std::make_shared(); - res->del_barrier = this->del_barrier; - res->bitmap_ptr = std::make_shared(capacity); - auto u8size = this->bitmap_ptr->u8size(); - memcpy(res->bitmap_ptr->mutable_data(), res->bitmap_ptr->data(), u8size); - return res; -} - -} diff --git a/core/src/dog_segment/SegmentDefs.h b/core/src/dog_segment/SegmentDefs.h index 97ae5784c1..7f1dab4ee1 100644 --- a/core/src/dog_segment/SegmentDefs.h +++ b/core/src/dog_segment/SegmentDefs.h @@ -164,9 +164,7 @@ class Schema { const FieldMeta& operator[](const std::string& field_name) const { auto offset_iter = offsets_.find(field_name); - if (offset_iter == offsets_.end()) { - throw std::runtime_error("Cannot found field_name: " + field_name); - } + assert(offset_iter != offsets_.end()); auto offset = offset_iter->second; return (*this)[offset]; } @@ -182,6 +180,5 @@ class Schema { }; using SchemaPtr = std::shared_ptr; -using idx_t = int64_t; } // namespace milvus::dog_segment diff --git a/core/src/dog_segment/SegmentNaive.cpp b/core/src/dog_segment/SegmentNaive.cpp index 08327eebe7..1c2746e5c3 100644 --- a/core/src/dog_segment/SegmentNaive.cpp +++ b/core/src/dog_segment/SegmentNaive.cpp @@ -17,6 +17,7 @@ TestABI() { std::unique_ptr CreateSegment(SchemaPtr schema, IndexMetaPtr remote_index_meta) { + if (remote_index_meta == nullptr) { auto index_meta = std::make_shared(schema); auto dim = schema->operator[]("fakevec").get_dim(); @@ -64,20 +65,14 @@ SegmentNaive::PreDelete(int64_t size) { } auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_timestamp, - int64_t insert_barrier, bool force) -> std::shared_ptr { + int64_t insert_barrier) -> std::shared_ptr { auto old = deleted_record_.get_lru_entry(); - - if(!force || old->bitmap_ptr->capacity() == insert_barrier) { - if (old->del_barrier == del_barrier) { - return old; - } + if (old->del_barrier == del_barrier) { + return old; } + auto current = std::make_shared(*old); + auto &vec = current->bitmap; - - auto current = old->clone(insert_barrier); - current->del_barrier = del_barrier; - - auto bitmap = current->bitmap_ptr; if (del_barrier < old->del_barrier) { for (auto del_index = del_barrier; del_index < old->del_barrier; ++del_index) { // get uid in delete logs @@ -89,7 +84,7 @@ auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_times for (auto iter = iter_b; iter != iter_e; ++iter) { auto offset = iter->second; if (record_.timestamps_[offset] < query_timestamp) { - assert(offset < insert_barrier); + assert(offset < vec.size()); the_offset = std::max(the_offset, offset); } } @@ -98,10 +93,11 @@ auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_times continue; } // otherwise, clear the flag - bitmap->clear(the_offset); + 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]; @@ -114,11 +110,11 @@ auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_times if (offset >= insert_barrier) { continue; } - if (offset >= insert_barrier) { + if (offset >= vec.size()) { continue; } if (record_.timestamps_[offset] < query_timestamp) { - assert(offset < insert_barrier); + assert(offset < vec.size()); the_offset = std::max(the_offset, offset); } } @@ -129,7 +125,7 @@ auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_times } // otherwise, set the flag - bitmap->set(the_offset); + vec[the_offset] = true; } this->deleted_record_.insert_lru_entry(current); } @@ -254,6 +250,15 @@ SegmentNaive::Delete(int64_t reserved_begin, int64_t size, const int64_t *uids_r // return Status::OK(); } +// TODO: remove mock + +Status +SegmentNaive::QueryImpl(const query::QueryPtr &query, Timestamp timestamp, QueryResult &result) { +// assert(query); + + throw std::runtime_error("unimplemnted"); +} + template int64_t get_barrier(const RecordType &record, Timestamp timestamp) { auto &vec = record.timestamps_; @@ -270,70 +275,11 @@ int64_t get_barrier(const RecordType &record, Timestamp timestamp) { return beg; } -Status -SegmentNaive::QueryImpl(query::QueryPtr query_info, Timestamp timestamp, QueryResult &result) { - auto ins_barrier = get_barrier(record_, timestamp); - auto del_barrier = get_barrier(deleted_record_, timestamp); - auto bitmap_holder = get_deleted_bitmap(del_barrier, timestamp, ins_barrier, true); - assert(bitmap_holder); - assert(bitmap_holder->bitmap_ptr->capacity() == ins_barrier); - - auto field_offset = schema_->get_offset(query_info->field_name); - auto &field = schema_->operator[](query_info->field_name); - - assert(field.get_data_type() == DataType::VECTOR_FLOAT); - auto dim = field.get_dim(); - auto bitmap = bitmap_holder->bitmap_ptr; - auto topK = query_info->topK; - auto num_queries = query_info->num_queries; - auto vec_ptr = std::static_pointer_cast>(record_.entity_vec_[0]); - auto index_entry = index_meta_->lookup_by_field(query_info->field_name); - auto conf = index_entry.config; - - conf[milvus::knowhere::meta::TOPK] = query_info->topK; - { - auto count = 0; - for(int i = 0; i < bitmap->capacity(); ++i) { - if(bitmap->test(i)) { - ++count; - } - } - std::cout << "fuck " << count << std::endl; - } - - auto indexing = std::static_pointer_cast(indexings_[index_entry.index_name]); - indexing->SetBlacklist(bitmap); - auto ds = knowhere::GenDataset(query_info->num_queries, dim, query_info->query_raw_data.data()); - auto final = indexing->Query(ds, conf); - - auto ids = final->Get(knowhere::meta::IDS); - auto distances = final->Get(knowhere::meta::DISTANCE); - - auto total_num = num_queries * topK; - result.result_ids_.resize(total_num); - result.result_distances_.resize(total_num); - - result.row_num_ = total_num; - result.num_queries_ = num_queries; - result.topK_ = topK; - - std::copy_n(ids, total_num, result.result_ids_.data()); - std::copy_n(distances, total_num, result.result_distances_.data()); - - for(auto& id: result.result_ids_) { - id = record_.uids_[id]; - } - - return Status::OK(); -} - - - Status SegmentNaive::Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult &result) { // TODO: enable delete // TODO: enable index - // TODO: remove mock + if (query_info == nullptr) { query_info = std::make_shared(); query_info->field_name = "fakevec"; @@ -349,22 +295,27 @@ SegmentNaive::Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult } } - if(index_ready_) { - return QueryImpl(query_info, timestamp, result); - } - - auto ins_barrier = get_barrier(record_, timestamp); - auto del_barrier = get_barrier(deleted_record_, timestamp); - auto bitmap_holder = get_deleted_bitmap(del_barrier, timestamp, ins_barrier); - assert(bitmap_holder); - auto &field = schema_->operator[](query_info->field_name); assert(field.get_data_type() == DataType::VECTOR_FLOAT); + auto dim = field.get_dim(); - auto bitmap = bitmap_holder->bitmap_ptr; auto topK = query_info->topK; auto num_queries = query_info->num_queries; + 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) { @@ -374,12 +325,11 @@ SegmentNaive::Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult return L2_distance; }; - - // TODO: optimize std::vector>> records(num_queries); + // TODO: optimize auto vec_ptr = std::static_pointer_cast>(record_.entity_vec_[0]); - for (int64_t i = 0; i < ins_barrier; ++i) { - if (i < bitmap->capacity() && bitmap->test(i)) { + for (int64_t i = 0; i < barrier; ++i) { + if (i < bitmap->size() && bitmap->at(i)) { continue; } auto element = vec_ptr->get_element(i); @@ -456,16 +406,17 @@ knowhere::IndexPtr SegmentNaive::BuildVecIndexImpl(const IndexMeta::Entry &entry std::vector datasets; for (int chunk_id = 0; chunk_id < uids.chunk_size(); ++chunk_id) { - auto entities_chunk = entities->get_chunk(chunk_id).data(); + auto &uids_chunk = uids.get_chunk(chunk_id); + auto &entities_chunk = entities->get_chunk(chunk_id); int64_t count = chunk_id == uids.chunk_size() - 1 ? record_.reserved - chunk_id * DefaultElementPerChunk : DefaultElementPerChunk; - datasets.push_back(knowhere::GenDataset(count, dim, entities_chunk)); + datasets.push_back(knowhere::GenDatasetWithIds(count, dim, entities_chunk.data(), uids_chunk.data())); } for (auto &ds: datasets) { indexing->Train(ds, entry.config); } for (auto &ds: datasets) { - indexing->AddWithoutIds(ds, entry.config); + indexing->Add(ds, entry.config); } return indexing; } @@ -484,7 +435,6 @@ SegmentNaive::BuildIndex() { throw std::runtime_error("unimplemented"); } } - index_ready_ = true; return Status::OK(); } diff --git a/core/src/dog_segment/SegmentNaive.h b/core/src/dog_segment/SegmentNaive.h index b9b62d4389..113211bbed 100644 --- a/core/src/dog_segment/SegmentNaive.h +++ b/core/src/dog_segment/SegmentNaive.h @@ -1,5 +1,4 @@ #pragma once - #include #include #include @@ -13,19 +12,18 @@ // #include "knowhere/index/structured_index/StructuredIndex.h" #include "query/GeneralQuery.h" #include "utils/Status.h" -#include "dog_segment/DeletedRecord.h" +using idx_t = int64_t; namespace milvus::dog_segment { struct ColumnBasedDataChunk { std::vector> entity_vecs; - static ColumnBasedDataChunk - from(const DogDataChunk &source, const Schema &schema) { + from(const DogDataChunk& source, const Schema& schema) { ColumnBasedDataChunk dest; auto count = source.count; - auto raw_data = reinterpret_cast(source.raw_data); + auto raw_data = reinterpret_cast(source.raw_data); auto align = source.sizeof_per_row; - for (auto &field : schema) { + for (auto& field : schema) { auto len = field.get_sizeof(); assert(len % sizeof(float) == 0); std::vector new_col(len * count / sizeof(float)); @@ -41,7 +39,7 @@ struct ColumnBasedDataChunk { }; class SegmentNaive : public SegmentBase { -public: + public: virtual ~SegmentNaive() = default; // SegmentBase(std::shared_ptr collection); @@ -51,18 +49,17 @@ public: // TODO: originally, id should be put into data_chunk // TODO: Is it ok to put them the other side? Status - Insert(int64_t reserverd_offset, int64_t size, const int64_t *primary_keys, const Timestamp *timestamps, - const DogDataChunk &values) override; + Insert(int64_t reserverd_offset, int64_t size, const int64_t* primary_keys, const Timestamp* timestamps, const DogDataChunk& values) override; int64_t PreDelete(int64_t size) override; // TODO: add id into delete log, possibly bitmap Status - Delete(int64_t reserverd_offset, int64_t size, const int64_t *primary_keys, const Timestamp *timestamps) override; + Delete(int64_t reserverd_offset, int64_t size, const int64_t* primary_keys, const Timestamp* timestamps) override; // query contains metadata of Status - Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult &results) override; + Query(query::QueryPtr query_info, Timestamp timestamp, QueryResult& results) override; // stop receive insert requests // will move data to immutable vector or something @@ -86,7 +83,7 @@ public: } Status - LoadRawData(std::string_view field_name, const char *blob, int64_t blob_size) override { + LoadRawData(std::string_view field_name, const char* blob, int64_t blob_size) override { // TODO: NO-OP return Status::OK(); } @@ -96,12 +93,10 @@ public: get_row_count() const override { return record_.ack_responder_.GetAck(); } - SegmentState get_state() const override { return state_.load(std::memory_order_relaxed); } - ssize_t get_deleted_count() const override { return 0; @@ -110,17 +105,15 @@ public: public: friend std::unique_ptr CreateSegment(SchemaPtr schema, IndexMetaPtr index_meta); - explicit SegmentNaive(SchemaPtr schema, IndexMetaPtr index_meta) : schema_(schema), index_meta_(index_meta), record_(*schema) { } -private: + private: struct MutableRecord { ConcurrentVector uids_; tbb::concurrent_vector timestamps_; std::vector> entity_vecs_; - MutableRecord(int entity_size) : entity_vecs_(entity_size) { } }; @@ -131,34 +124,58 @@ private: ConcurrentVector timestamps_; ConcurrentVector uids_; std::vector> entity_vec_; - - Record(const Schema &schema); - + Record(const Schema& schema); template auto get_vec_entity(int offset) { return std::static_pointer_cast>(entity_vec_[offset]); } }; + tbb::concurrent_unordered_multimap uid2offset_; - std::shared_ptr - get_deleted_bitmap(int64_t del_barrier, Timestamp query_timestamp, int64_t insert_barrier, bool force = false); + 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(query::QueryPtr query, Timestamp timestamp, QueryResult &results); + QueryImpl(const query::QueryPtr& query, Timestamp timestamp, QueryResult& results); template - knowhere::IndexPtr BuildVecIndexImpl(const IndexMeta::Entry &entry); + knowhere::IndexPtr BuildVecIndexImpl(const IndexMeta::Entry& entry); -private: + private: SchemaPtr schema_; std::atomic state_ = SegmentState::Open; Record record_; DeletedRecord deleted_record_; - std::atomic index_ready_ = false; IndexMetaPtr index_meta_; std::unordered_map indexings_; // index_name => indexing - tbb::concurrent_unordered_multimap uid2offset_; }; } // namespace milvus::dog_segment diff --git a/core/src/dog_segment/segment_c.cpp b/core/src/dog_segment/segment_c.cpp index 5ee49378ed..a8de22bb5b 100644 --- a/core/src/dog_segment/segment_c.cpp +++ b/core/src/dog_segment/segment_c.cpp @@ -91,29 +91,14 @@ PreDelete(CSegmentBase c_segment, long int size) { int Search(CSegmentBase c_segment, - const char* query_json, + void* fake_query, unsigned long timestamp, - float* query_raw_data, - int num_of_query_raw_data, long int* result_ids, float* result_distances) { auto segment = (milvus::dog_segment::SegmentBase*)c_segment; milvus::dog_segment::QueryResult query_result; - // parse query param json - auto query_param_json_string = std::string(query_json); - auto query_param_json = nlohmann::json::parse(query_param_json_string); - - // construct QueryPtr - auto query_ptr = std::make_shared(); - query_ptr->num_queries = query_param_json["num_queries"]; - query_ptr->topK = query_param_json["topK"]; - query_ptr->field_name = query_param_json["field_name"]; - - query_ptr->query_raw_data.resize(num_of_query_raw_data); - memcpy(query_ptr->query_raw_data.data(), query_raw_data, num_of_query_raw_data * sizeof(float)); - - auto res = segment->Query(query_ptr, timestamp, query_result); + auto res = segment->Query(nullptr, timestamp, query_result); // result_ids and result_distances have been allocated memory in goLang, // so we don't need to malloc here. diff --git a/core/src/dog_segment/segment_c.h b/core/src/dog_segment/segment_c.h index a9dbb05fd9..9d64d9f68e 100644 --- a/core/src/dog_segment/segment_c.h +++ b/core/src/dog_segment/segment_c.h @@ -40,10 +40,8 @@ PreDelete(CSegmentBase c_segment, long int size); int Search(CSegmentBase c_segment, - const char* query_json, + void* fake_query, unsigned long timestamp, - float* query_raw_data, - int num_of_query_raw_data, long int* result_ids, float* result_distances); diff --git a/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h b/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h index ab7440de9a..4cde0ff0b9 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h @@ -108,7 +108,7 @@ class VecIndex : public Index { size_t BlacklistSize() { if (bitset_) { - return bitset_->u8size() * sizeof(uint8_t); + return bitset_->size() * sizeof(uint8_t); } else { return 0; } diff --git a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp b/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp index 2bdd404ee9..1ba9a1e406 100644 --- a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp +++ b/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp @@ -197,7 +197,7 @@ ConcurrentBitset::capacity() { } size_t -ConcurrentBitset::u8size() { +ConcurrentBitset::size() { return ((capacity_ + 8 - 1) >> 3); } diff --git a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h b/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h index 5959aa34cf..121e212b03 100644 --- a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h +++ b/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h @@ -63,15 +63,15 @@ class ConcurrentBitset { size_t capacity(); + size_t + size(); + const uint8_t* data(); uint8_t* mutable_data(); - size_t - u8size(); - private: size_t capacity_; std::vector> bitset_; diff --git a/core/unittest/test_c_api.cpp b/core/unittest/test_c_api.cpp index c62a3549d9..ba28395563 100644 --- a/core/unittest/test_c_api.cpp +++ b/core/unittest/test_c_api.cpp @@ -7,182 +7,178 @@ #include "dog_segment/segment_c.h" + + TEST(CApiTest, CollectionTest) { - auto collection_name = "collection0"; - auto schema_tmp_conf = "null_schema"; - auto collection = NewCollection(collection_name, schema_tmp_conf); - DeleteCollection(collection); + auto collection_name = "collection0"; + auto schema_tmp_conf = "null_schema"; + auto collection = NewCollection(collection_name, schema_tmp_conf); + DeleteCollection(collection); } TEST(CApiTest, PartitonTest) { - 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); - DeleteCollection(collection); - DeletePartition(partition); + 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); + DeleteCollection(collection); + DeletePartition(partition); } TEST(CApiTest, SegmentTest) { - 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); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + 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); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } TEST(CApiTest, InsertTest) { - 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 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); - 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; - } - 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)); + 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; } + 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); + auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); + 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, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); - assert(res == 0); + assert(res == 0); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } TEST(CApiTest, DeleteTest) { - 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 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); - long delete_primary_keys[] = {100000, 100001, 100002}; - unsigned long delete_timestamps[] = {0, 0, 0}; + long delete_primary_keys[] = {100000, 100001, 100002}; + unsigned long delete_timestamps[] = {0, 0, 0}; - auto offset = PreDelete(segment, 3); + auto offset = PreDelete(segment, 3); - auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); - assert(del_res == 0); + auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); + assert(del_res == 0); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } + TEST(CApiTest, SearchTest) { - 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 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); - 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; - } - 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)); + 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; } + 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); + auto line_sizeof = (sizeof(int) + sizeof(float) * 16); - auto offset = PreInsert(segment, N); + auto offset = PreInsert(segment, N); - auto ins_res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int) line_sizeof, N); - assert(ins_res == 0); + auto ins_res = Insert(segment, offset, N, uids.data(), timestamps.data(), raw_data.data(), (int)line_sizeof, N); + assert(ins_res == 0); - long result_ids[10]; - float result_distances[10]; + long result_ids[10]; + float result_distances[10]; + auto sea_res = Search(segment, nullptr, 1, result_ids, result_distances); + assert(sea_res == 0); - auto query_json = std::string(R"({"field_name":"fakevec","num_queries":1,"topK":10})"); - std::vector query_raw_data(16); - for (int i = 0; i < 16; i++) { - query_raw_data[i] = e() % 2000 * 0.001 - 1.0; - } - - auto sea_res = Search(segment, query_json.data(), 1, query_raw_data.data(), 16, result_ids, result_distances); - assert(sea_res == 0); - - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } TEST(CApiTest, IsOpenedTest) { - 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 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 is_opened = IsOpened(segment); - assert(is_opened); + auto is_opened = IsOpened(segment); + assert(is_opened); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } TEST(CApiTest, CloseTest) { - 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 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 status = Close(segment); - assert(status == 0); + auto status = Close(segment); + assert(status == 0); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } @@ -194,17 +190,17 @@ auto generate_data(int N) { 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) { + 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) { + for(auto &x: vec) { x = distribution(er); } - raw_data.insert(raw_data.end(), (const char *) std::begin(vec), (const char *) std::end(vec)); + 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)); + raw_data.insert(raw_data.end(), (const char*)&age, ((const char*)&age) + sizeof(age)); } return std::make_tuple(raw_data, timestamps, uids); } @@ -221,10 +217,10 @@ TEST(CApiTest, TestQuery) { int N = 1000 * 1000; - auto[raw_data, timestamps, uids] = generate_data(N); + 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); + 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); @@ -232,18 +228,15 @@ TEST(CApiTest, TestQuery) { std::vector result_ids(10); std::vector result_distances(10); - auto query_json = std::string(R"({"field_name":"fakevec","num_queries":1,"topK":10})"); - auto sea_res = Search(segment, query_json.data(), 1, (float *) raw_data.data(), 16, result_ids.data(), - result_distances.data()); + 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); - auto N_del = N / 2; - std::vector del_ts(N_del, 100); - auto pre_off = PreDelete(segment, N_del); - Delete(segment, pre_off, N_del, uids.data(), del_ts.data()); + 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()); Close(segment); BuildIndex(segment); @@ -251,37 +244,25 @@ TEST(CApiTest, TestQuery) { std::vector result_ids2(10); std::vector result_distances2(10); + sea_res = Search(segment, nullptr, 104, result_ids2.data(), result_distances2.data()); - sea_res = Search(segment, query_json.data(), 104, (float *) raw_data.data(), 16, result_ids2.data(), - result_distances2.data()); -// sea_res = Search(segment, nullptr, 104, result_ids2.data(), result_distances2.data()); - - std::cout << "case 1" << std::endl; - for (int i = 0; i < 10; ++i) { - std::cout << result_ids[i] << "->" << result_distances[i] << std::endl; - } - std::cout << "case 2" << std::endl; - for (int i = 0; i < 10; ++i) { - std::cout << result_ids2[i] << "->" << result_distances2[i] << std::endl; - } - - for (auto x: result_ids2) { - ASSERT_GE(x, 10 * N + N_del); + 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_del) { -// auto uid2 = result_ids2[iter]; -// auto dis2 = result_distances2[iter]; -// ASSERT_EQ(uid, uid2); -// ASSERT_EQ(dis, dis2); -// ++iter; -// } -// } + 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); @@ -290,28 +271,28 @@ TEST(CApiTest, TestQuery) { } TEST(CApiTest, GetDeletedCountTest) { - 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 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); - long delete_primary_keys[] = {100000, 100001, 100002}; - unsigned long delete_timestamps[] = {0, 0, 0}; + long delete_primary_keys[] = {100000, 100001, 100002}; + unsigned long delete_timestamps[] = {0, 0, 0}; - auto offset = PreDelete(segment, 3); + auto offset = PreDelete(segment, 3); - auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); - assert(del_res == 0); + auto del_res = Delete(segment, offset, 3, delete_primary_keys, delete_timestamps); + assert(del_res == 0); - // TODO: assert(deleted_count == len(delete_primary_keys)) - auto deleted_count = GetDeletedCount(segment); - assert(deleted_count == 0); + // TODO: assert(deleted_count == len(delete_primary_keys)) + auto deleted_count = GetDeletedCount(segment); + assert(deleted_count == 0); - DeleteCollection(collection); - DeletePartition(partition); - DeleteSegment(segment); + DeleteCollection(collection); + DeletePartition(partition); + DeleteSegment(segment); } @@ -325,10 +306,10 @@ TEST(CApiTest, GetRowCountTest) { int N = 10000; - auto[raw_data, timestamps, uids] = generate_data(N); + 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); + 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); diff --git a/core/unittest/test_indexing.cpp b/core/unittest/test_indexing.cpp index 20fee4e865..f83d31f9ff 100644 --- a/core/unittest/test_indexing.cpp +++ b/core/unittest/test_indexing.cpp @@ -26,30 +26,29 @@ using std::vector; using namespace milvus; namespace { -template -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[DIM]; - for (auto &x: vec) { - x = distribution(er); - } - raw_data.insert(raw_data.end(), (const char *) std::begin(vec), (const char *) std::end(vec)); + template + 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[DIM]; + 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)); + } + return std::make_tuple(raw_data, timestamps, uids); } - return std::make_tuple(raw_data, timestamps, uids); } -} - TEST(TestIndex, Naive) { constexpr int N = 100000; @@ -70,59 +69,25 @@ TEST(TestIndex, Naive) { {milvus::knowhere::meta::DEVICEID, 0}, }; -// auto ds = knowhere::GenDataset(N, DIM, raw_data.data()); -// auto ds2 = knowhere::GenDatasetWithIds(N / 2, DIM, raw_data.data() + sizeof(float[DIM]) * N / 2, uids.data() + N / 2); + auto ds = knowhere::GenDatasetWithIds(N / 2, DIM, raw_data.data(), uids.data()); + auto ds2 = knowhere::GenDatasetWithIds(N / 2, DIM, raw_data.data() + sizeof(float[DIM]) * N / 2, uids.data() + N / 2); // NOTE: you must train first and then add -// index->Train(ds, conf); -// index->Train(ds2, conf); -// index->AddWithoutIds(ds, conf); -// index->Add(ds2, conf); + index->Train(ds, conf); + index->Train(ds2, conf); + index->Add(ds, conf); + index->Add(ds2, conf); - - - std::vector datasets; - std::vector> ftrashs; - for (int beg = 0; beg < N; beg += N) { - auto end = beg + N; - if (end > N) { - end = N; - } - - std::vector ft(raw_data.data() + DIM * beg, raw_data.data() + DIM * end); - - auto ds = knowhere::GenDataset(end - beg, DIM, ft.data()); - datasets.push_back(ds); - ftrashs.push_back(std::move(ft)); - - // // NOTE: you must train first and then add - // index->Train(ds, conf); - // index->Add(ds, conf); - } - - for (auto &ds: datasets) { - index->Train(ds, conf); - } - for (auto &ds: datasets) { - index->AddWithoutIds(ds, conf); - } - - auto bitmap = std::make_shared(N); - // exclude the first - for (int i = 0; i < N / 2; ++i) { - bitmap->set(i); - } - - index->SetBlacklist(bitmap); auto query_ds = knowhere::GenDataset(1, DIM, raw_data.data()); - auto final = index->Query(query_ds, conf); - auto ids = final->Get(knowhere::meta::IDS); - auto distances = final->Get(knowhere::meta::DISTANCE); - for (int i = 0; i < TOPK; ++i) { - if (ids[i] < N / 2) { - cout << "WRONG: "; - } + auto mmm = final->data(); + cout << endl; + for(auto [k, v]: mmm) { + cout << k << endl; + } + auto ids = final->Get(knowhere::meta::IDS); + auto distances = final->Get(knowhere::meta::DISTANCE); + for(int i = 0; i < TOPK; ++i) { cout << ids[i] << "->" << distances[i] << endl; } - int i = 1 + 1; + int i = 1+1; } diff --git a/proxy/src/CMakeLists.txt b/proxy/src/CMakeLists.txt index 96ac10c691..e5e00a669c 100644 --- a/proxy/src/CMakeLists.txt +++ b/proxy/src/CMakeLists.txt @@ -25,15 +25,13 @@ add_subdirectory( db ) # target milvus_engine add_subdirectory( log ) add_subdirectory( server ) add_subdirectory( message_client ) -add_subdirectory( meta ) set(link_lib milvus_engine config - query + query utils log - meta ) diff --git a/proxy/src/config/ConfigMgr.cpp b/proxy/src/config/ConfigMgr.cpp index c49ddba871..22e830a69e 100644 --- a/proxy/src/config/ConfigMgr.cpp +++ b/proxy/src/config/ConfigMgr.cpp @@ -85,11 +85,6 @@ ConfigMgr::ConfigMgr() { "localhost", nullptr, nullptr)}, {"pulsar.port", CreateIntegerConfig("pulsar.port", false, 0, 65535, &config.pulsar.port.value, 6650, nullptr, nullptr)}, - /* master */ - {"master.address", CreateStringConfig("master.address", false, &config.master.address.value, - "localhost", nullptr, nullptr)}, - {"master.port", CreateIntegerConfig("master.port", false, 0, 65535, &config.master.port.value, - 6000, nullptr, nullptr)}, /* log */ diff --git a/proxy/src/config/ServerConfig.h b/proxy/src/config/ServerConfig.h index 78353c8019..a057b49d3b 100644 --- a/proxy/src/config/ServerConfig.h +++ b/proxy/src/config/ServerConfig.h @@ -76,11 +76,6 @@ struct ServerConfig { Integer port{6650}; }pulsar; - struct Master{ - String address{"localhost"}; - Integer port{6000}; - }master; - struct Engine { Integer build_index_threshold{4096}; diff --git a/proxy/src/grpc/etcd.grpc.pb.cc b/proxy/src/grpc/etcd.grpc.pb.cc deleted file mode 100644 index d9a717cfc8..0000000000 --- a/proxy/src/grpc/etcd.grpc.pb.cc +++ /dev/null @@ -1,70 +0,0 @@ -// 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 deleted file mode 100644 index 53ebd1aeba..0000000000 --- a/proxy/src/grpc/etcd.grpc.pb.h +++ /dev/null @@ -1,235 +0,0 @@ -// 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 deleted file mode 100644 index 489eda74c2..0000000000 --- a/proxy/src/grpc/etcd.pb.cc +++ /dev/null @@ -1,3737 +0,0 @@ -// 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 deleted file mode 100644 index c42ab01847..0000000000 --- a/proxy/src/grpc/etcd.pb.h +++ /dev/null @@ -1,2465 +0,0 @@ -// 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/master.grpc.pb.cc b/proxy/src/grpc/master.grpc.pb.cc deleted file mode 100644 index 177bf00c34..0000000000 --- a/proxy/src/grpc/master.grpc.pb.cc +++ /dev/null @@ -1,83 +0,0 @@ -// 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 masterpb { - -static const char* Master_method_names[] = { - "/masterpb.Master/CreateCollection", -}; - -std::unique_ptr< Master::Stub> Master::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< Master::Stub> stub(new Master::Stub(channel)); - return stub; -} - -Master::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_CreateCollection_(Master_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status Master::Stub::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateCollection_, context, request, response); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, false); -} - -Master::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Master_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Master::Service, ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - std::mem_fn(&Master::Service::CreateCollection), this))); -} - -Master::Service::~Service() { -} - -::grpc::Status Master::Service::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace masterpb - diff --git a/proxy/src/grpc/master.grpc.pb.h b/proxy/src/grpc/master.grpc.pb.h deleted file mode 100644 index 2d4c06c22a..0000000000 --- a/proxy/src/grpc/master.grpc.pb.h +++ /dev/null @@ -1,252 +0,0 @@ -// 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 masterpb { - -class Master final { - public: - static constexpr char const* service_full_name() { - return "masterpb.Master"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - virtual ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* 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::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_CreateCollection_; - }; - 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 CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response); - }; - template - class WithAsyncMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreateCollection() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::grpc::ServerContext* context, ::milvus::grpc::Mapping* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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_CreateCollection AsyncService; - template - class ExperimentalWithCallbackMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreateCollection() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::Mapping* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreateCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreateCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::Mapping, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(0)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - typedef ExperimentalWithCallbackMethod_CreateCollection ExperimentalCallbackService; - template - class WithGenericMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreateCollection() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreateCollection() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::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_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreateCollection() { - ::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->CreateCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class WithStreamedUnaryMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreateCollection() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateCollection::StreamedCreateCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreateCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Mapping,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_CreateCollection StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_CreateCollection StreamedService; -}; - -} // namespace masterpb - - -#endif // GRPC_master_2eproto__INCLUDED diff --git a/proxy/src/grpc/master.pb.cc b/proxy/src/grpc/master.pb.cc deleted file mode 100644 index 1535ed7de2..0000000000 --- a/proxy/src/grpc/master.pb.cc +++ /dev/null @@ -1,1590 +0,0 @@ -// 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 -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Schema_message_2eproto; -namespace masterpb { -class CollectionDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Collection_default_instance_; -class SegmentDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Segment_default_instance_; -class SegmentStatDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SegmentStat_default_instance_; -} // namespace masterpb -static void InitDefaultsscc_info_Collection_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_Collection_default_instance_; - new (ptr) ::masterpb::Collection(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::Collection::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Collection_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Collection_master_2eproto}, { - &scc_info_Schema_message_2eproto.base,}}; - -static void InitDefaultsscc_info_Segment_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_Segment_default_instance_; - new (ptr) ::masterpb::Segment(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::Segment::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Segment_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Segment_master_2eproto}, {}}; - -static void InitDefaultsscc_info_SegmentStat_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_SegmentStat_default_instance_; - new (ptr) ::masterpb::SegmentStat(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::SegmentStat::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SegmentStat_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_SegmentStat_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(::masterpb::Collection, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, name_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, schema_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, create_time_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, segment_ids_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, partition_tags_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, segment_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, collection_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, partition_tag_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, channel_start_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, channel_end_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, open_timestamp_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, close_timestamp_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, segment_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_size_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_rate_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::masterpb::Collection)}, - { 11, -1, sizeof(::masterpb::Segment)}, - { 23, -1, sizeof(::masterpb::SegmentStat)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::masterpb::_Collection_default_instance_), - reinterpret_cast(&::masterpb::_Segment_default_instance_), - reinterpret_cast(&::masterpb::_SegmentStat_default_instance_), -}; - -const char descriptor_table_protodef_master_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\014master.proto\022\010masterpb\032\rmessage.proto\"" - "\215\001\n\nCollection\022\n\n\002id\030\001 \001(\004\022\014\n\004name\030\002 \001(\t" - "\022#\n\006schema\030\003 \001(\0132\023.milvus.grpc.Schema\022\023\n" - "\013create_time\030\004 \001(\004\022\023\n\013segment_ids\030\005 \003(\004\022" - "\026\n\016partition_tags\030\006 \003(\t\"\250\001\n\007Segment\022\022\n\ns" - "egment_id\030\001 \001(\004\022\025\n\rcollection_id\030\002 \001(\004\022\025" - "\n\rpartition_tag\030\003 \001(\t\022\025\n\rchannel_start\030\004" - " \001(\005\022\023\n\013channel_end\030\005 \001(\005\022\026\n\016open_timest" - "amp\030\006 \001(\004\022\027\n\017close_timestamp\030\007 \001(\004\"K\n\013Se" - "gmentStat\022\022\n\nsegment_id\030\001 \001(\004\022\023\n\013memory_" - "size\030\002 \001(\004\022\023\n\013memory_rate\030\003 \001(\0022I\n\006Maste" - "r\022\?\n\020CreateCollection\022\024.milvus.grpc.Mapp" - "ing\032\023.milvus.grpc.Status\"\000B\010Z\006masterb\006pr" - "oto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_master_2eproto_deps[1] = { - &::descriptor_table_message_2eproto, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_master_2eproto_sccs[3] = { - &scc_info_Collection_master_2eproto.base, - &scc_info_Segment_master_2eproto.base, - &scc_info_SegmentStat_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", 524, - &descriptor_table_master_2eproto_once, descriptor_table_master_2eproto_sccs, descriptor_table_master_2eproto_deps, 3, 1, - 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 masterpb { - -// =================================================================== - -void Collection::InitAsDefaultInstance() { - ::masterpb::_Collection_default_instance_._instance.get_mutable()->schema_ = const_cast< ::milvus::grpc::Schema*>( - ::milvus::grpc::Schema::internal_default_instance()); -} -class Collection::_Internal { - public: - static const ::milvus::grpc::Schema& schema(const Collection* msg); -}; - -const ::milvus::grpc::Schema& -Collection::_Internal::schema(const Collection* msg) { - return *msg->schema_; -} -void Collection::clear_schema() { - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; -} -Collection::Collection() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.Collection) -} -Collection::Collection(const Collection& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - segment_ids_(from.segment_ids_), - partition_tags_(from.partition_tags_) { - _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_); - } - if (from.has_schema()) { - schema_ = new ::milvus::grpc::Schema(*from.schema_); - } else { - schema_ = nullptr; - } - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&create_time_) - - reinterpret_cast(&id_)) + sizeof(create_time_)); - // @@protoc_insertion_point(copy_constructor:masterpb.Collection) -} - -void Collection::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Collection_master_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&schema_, 0, static_cast( - reinterpret_cast(&create_time_) - - reinterpret_cast(&schema_)) + sizeof(create_time_)); -} - -Collection::~Collection() { - // @@protoc_insertion_point(destructor:masterpb.Collection) - SharedDtor(); -} - -void Collection::SharedDtor() { - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete schema_; -} - -void Collection::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Collection& Collection::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Collection_master_2eproto.base); - return *internal_default_instance(); -} - - -void Collection::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - segment_ids_.Clear(); - partition_tags_.Clear(); - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; - ::memset(&id_, 0, static_cast( - reinterpret_cast(&create_time_) - - reinterpret_cast(&id_)) + sizeof(create_time_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Collection::_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 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "masterpb.Collection.name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.Schema schema = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_schema(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 create_time = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - create_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated uint64 segment_ids = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(mutable_segment_ids(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) { - add_segment_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tags = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tags(), ptr, ctx, "masterpb.Collection.partition_tags"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); - } 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 Collection::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:masterpb.Collection) - 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 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, &id_))); - } else { - goto handle_unusual; - } - break; - } - - // string name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 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, - "masterpb.Collection.name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.Schema schema = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_schema())); - } else { - goto handle_unusual; - } - break; - } - - // uint64 create_time = 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, &create_time_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated uint64 segment_ids = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, this->mutable_segment_ids()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - 1, 42u, input, this->mutable_segment_ids()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tags = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tags())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(this->partition_tags_size() - 1).data(), - static_cast(this->partition_tags(this->partition_tags_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Collection.partition_tags")); - } 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:masterpb.Collection) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.Collection) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Collection::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); - } - - // string name = 2; - 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, - "masterpb.Collection.name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->name(), output); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::schema(this), output); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(4, this->create_time(), output); - } - - // repeated uint64 segment_ids = 5; - if (this->segment_ids_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(5, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_segment_ids_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->segment_ids_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64NoTag( - this->segment_ids(i), output); - } - - // repeated string partition_tags = 6; - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(i).data(), static_cast(this->partition_tags(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.partition_tags"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 6, this->partition_tags(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.Collection) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Collection::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); - } - - // string name = 2; - 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, - "masterpb.Collection.name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->name(), target); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::schema(this), target); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->create_time(), target); - } - - // repeated uint64 segment_ids = 5; - if (this->segment_ids_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( - _segment_ids_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteUInt64NoTagToArray(this->segment_ids_, target); - } - - // repeated string partition_tags = 6; - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(i).data(), static_cast(this->partition_tags(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.partition_tags"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(6, this->partition_tags(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:masterpb.Collection) - return target; -} - -size_t Collection::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.Collection) - 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 uint64 segment_ids = 5; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - UInt64Size(this->segment_ids_); - 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); - _segment_ids_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated string partition_tags = 6; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tags_size()); - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tags(i)); - } - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->name()); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *schema_); - } - - // uint64 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->id()); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->create_time()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Collection::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.Collection) - GOOGLE_DCHECK_NE(&from, this); - const Collection* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.Collection) - MergeFrom(*source); - } -} - -void Collection::MergeFrom(const Collection& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.Collection) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - segment_ids_.MergeFrom(from.segment_ids_); - partition_tags_.MergeFrom(from.partition_tags_); - if (from.name().size() > 0) { - - name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.has_schema()) { - mutable_schema()->::milvus::grpc::Schema::MergeFrom(from.schema()); - } - if (from.id() != 0) { - set_id(from.id()); - } - if (from.create_time() != 0) { - set_create_time(from.create_time()); - } -} - -void Collection::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.Collection) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Collection::CopyFrom(const Collection& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.Collection) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Collection::IsInitialized() const { - return true; -} - -void Collection::InternalSwap(Collection* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - segment_ids_.InternalSwap(&other->segment_ids_); - partition_tags_.InternalSwap(CastToBase(&other->partition_tags_)); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(schema_, other->schema_); - swap(id_, other->id_); - swap(create_time_, other->create_time_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Collection::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Segment::InitAsDefaultInstance() { -} -class Segment::_Internal { - public: -}; - -Segment::Segment() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.Segment) -} -Segment::Segment(const Segment& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.partition_tag().empty()) { - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); - // @@protoc_insertion_point(copy_constructor:masterpb.Segment) -} - -void Segment::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Segment_master_2eproto.base); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); -} - -Segment::~Segment() { - // @@protoc_insertion_point(destructor:masterpb.Segment) - SharedDtor(); -} - -void Segment::SharedDtor() { - partition_tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Segment::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Segment& Segment::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Segment_master_2eproto.base); - return *internal_default_instance(); -} - - -void Segment::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Segment::_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 segment_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 collection_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - collection_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string partition_tag = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_partition_tag(), ptr, ctx, "masterpb.Segment.partition_tag"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 channel_start = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - channel_start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 channel_end = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - channel_end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 open_timestamp = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - open_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 close_timestamp = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - close_timestamp_ = ::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 Segment::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:masterpb.Segment) - 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 segment_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, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 collection_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, &collection_id_))); - } else { - goto handle_unusual; - } - break; - } - - // 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->mutable_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Segment.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // int32 channel_start = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( - input, &channel_start_))); - } else { - goto handle_unusual; - } - break; - } - - // int32 channel_end = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( - input, &channel_end_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 open_timestamp = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &open_timestamp_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 close_timestamp = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &close_timestamp_))); - } 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:masterpb.Segment) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.Segment) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Segment::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->segment_id(), output); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->collection_id(), output); - } - - // string partition_tag = 3; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->partition_tag(), output); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->channel_start(), output); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(5, this->channel_end(), output); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(6, this->open_timestamp(), output); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(7, this->close_timestamp(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.Segment) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Segment::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->segment_id(), target); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->collection_id(), target); - } - - // string partition_tag = 3; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.partition_tag"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 3, this->partition_tag(), target); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->channel_start(), target); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->channel_end(), target); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(6, this->open_timestamp(), target); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(7, this->close_timestamp(), 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:masterpb.Segment) - return target; -} - -size_t Segment::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.Segment) - 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 partition_tag = 3; - if (this->partition_tag().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag()); - } - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->segment_id()); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->collection_id()); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->channel_start()); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->channel_end()); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->open_timestamp()); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->close_timestamp()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Segment::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.Segment) - GOOGLE_DCHECK_NE(&from, this); - const Segment* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.Segment) - MergeFrom(*source); - } -} - -void Segment::MergeFrom(const Segment& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.Segment) - 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.partition_tag().size() > 0) { - - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.segment_id() != 0) { - set_segment_id(from.segment_id()); - } - if (from.collection_id() != 0) { - set_collection_id(from.collection_id()); - } - if (from.channel_start() != 0) { - set_channel_start(from.channel_start()); - } - if (from.channel_end() != 0) { - set_channel_end(from.channel_end()); - } - if (from.open_timestamp() != 0) { - set_open_timestamp(from.open_timestamp()); - } - if (from.close_timestamp() != 0) { - set_close_timestamp(from.close_timestamp()); - } -} - -void Segment::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.Segment) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Segment::CopyFrom(const Segment& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.Segment) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Segment::IsInitialized() const { - return true; -} - -void Segment::InternalSwap(Segment* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_.Swap(&other->partition_tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(segment_id_, other->segment_id_); - swap(collection_id_, other->collection_id_); - swap(channel_start_, other->channel_start_); - swap(channel_end_, other->channel_end_); - swap(open_timestamp_, other->open_timestamp_); - swap(close_timestamp_, other->close_timestamp_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Segment::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SegmentStat::InitAsDefaultInstance() { -} -class SegmentStat::_Internal { - public: -}; - -SegmentStat::SegmentStat() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.SegmentStat) -} -SegmentStat::SegmentStat(const SegmentStat& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); - // @@protoc_insertion_point(copy_constructor:masterpb.SegmentStat) -} - -void SegmentStat::SharedCtor() { - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); -} - -SegmentStat::~SegmentStat() { - // @@protoc_insertion_point(destructor:masterpb.SegmentStat) - SharedDtor(); -} - -void SegmentStat::SharedDtor() { -} - -void SegmentStat::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SegmentStat& SegmentStat::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SegmentStat_master_2eproto.base); - return *internal_default_instance(); -} - - -void SegmentStat::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SegmentStat::_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 segment_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 memory_size = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - memory_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float memory_rate = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) { - memory_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } 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 SegmentStat::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:masterpb.SegmentStat) - 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 segment_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, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 memory_size = 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, &memory_size_))); - } else { - goto handle_unusual; - } - break; - } - - // float memory_rate = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, &memory_rate_))); - } 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:masterpb.SegmentStat) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.SegmentStat) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SegmentStat::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->segment_id(), output); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->memory_size(), output); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->memory_rate(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.SegmentStat) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SegmentStat::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->segment_id(), target); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->memory_size(), target); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->memory_rate(), 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:masterpb.SegmentStat) - return target; -} - -size_t SegmentStat::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.SegmentStat) - 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 segment_id = 1; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->segment_id()); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->memory_size()); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - total_size += 1 + 4; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SegmentStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.SegmentStat) - GOOGLE_DCHECK_NE(&from, this); - const SegmentStat* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.SegmentStat) - MergeFrom(*source); - } -} - -void SegmentStat::MergeFrom(const SegmentStat& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.SegmentStat) - 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.segment_id() != 0) { - set_segment_id(from.segment_id()); - } - if (from.memory_size() != 0) { - set_memory_size(from.memory_size()); - } - if (!(from.memory_rate() <= 0 && from.memory_rate() >= 0)) { - set_memory_rate(from.memory_rate()); - } -} - -void SegmentStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.SegmentStat) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SegmentStat::CopyFrom(const SegmentStat& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.SegmentStat) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SegmentStat::IsInitialized() const { - return true; -} - -void SegmentStat::InternalSwap(SegmentStat* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(segment_id_, other->segment_id_); - swap(memory_size_, other->memory_size_); - swap(memory_rate_, other->memory_rate_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SegmentStat::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace masterpb -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::masterpb::Collection* Arena::CreateMaybeMessage< ::masterpb::Collection >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::Collection >(arena); -} -template<> PROTOBUF_NOINLINE ::masterpb::Segment* Arena::CreateMaybeMessage< ::masterpb::Segment >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::Segment >(arena); -} -template<> PROTOBUF_NOINLINE ::masterpb::SegmentStat* Arena::CreateMaybeMessage< ::masterpb::SegmentStat >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::SegmentStat >(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 deleted file mode 100644 index 18e134696f..0000000000 --- a/proxy/src/grpc/master.pb.h +++ /dev/null @@ -1,1024 +0,0 @@ -// 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 -#include "message.pb.h" -// @@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 masterpb { -class Collection; -class CollectionDefaultTypeInternal; -extern CollectionDefaultTypeInternal _Collection_default_instance_; -class Segment; -class SegmentDefaultTypeInternal; -extern SegmentDefaultTypeInternal _Segment_default_instance_; -class SegmentStat; -class SegmentStatDefaultTypeInternal; -extern SegmentStatDefaultTypeInternal _SegmentStat_default_instance_; -} // namespace masterpb -PROTOBUF_NAMESPACE_OPEN -template<> ::masterpb::Collection* Arena::CreateMaybeMessage<::masterpb::Collection>(Arena*); -template<> ::masterpb::Segment* Arena::CreateMaybeMessage<::masterpb::Segment>(Arena*); -template<> ::masterpb::SegmentStat* Arena::CreateMaybeMessage<::masterpb::SegmentStat>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace masterpb { - -// =================================================================== - -class Collection : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.Collection) */ { - public: - Collection(); - virtual ~Collection(); - - Collection(const Collection& from); - Collection(Collection&& from) noexcept - : Collection() { - *this = ::std::move(from); - } - - inline Collection& operator=(const Collection& from) { - CopyFrom(from); - return *this; - } - inline Collection& operator=(Collection&& 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 Collection& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Collection* internal_default_instance() { - return reinterpret_cast( - &_Collection_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Collection& a, Collection& b) { - a.Swap(&b); - } - inline void Swap(Collection* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Collection* New() const final { - return CreateMaybeMessage(nullptr); - } - - Collection* 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 Collection& from); - void MergeFrom(const Collection& 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(Collection* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.Collection"; - } - 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 { - kSegmentIdsFieldNumber = 5, - kPartitionTagsFieldNumber = 6, - kNameFieldNumber = 2, - kSchemaFieldNumber = 3, - kIdFieldNumber = 1, - kCreateTimeFieldNumber = 4, - }; - // repeated uint64 segment_ids = 5; - int segment_ids_size() const; - void clear_segment_ids(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_ids(int index) const; - void set_segment_ids(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value); - void add_segment_ids(::PROTOBUF_NAMESPACE_ID::uint64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >& - segment_ids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >* - mutable_segment_ids(); - - // repeated string partition_tags = 6; - int partition_tags_size() const; - void clear_partition_tags(); - const std::string& partition_tags(int index) const; - std::string* mutable_partition_tags(int index); - void set_partition_tags(int index, const std::string& value); - void set_partition_tags(int index, std::string&& value); - void set_partition_tags(int index, const char* value); - void set_partition_tags(int index, const char* value, size_t size); - std::string* add_partition_tags(); - void add_partition_tags(const std::string& value); - void add_partition_tags(std::string&& value); - void add_partition_tags(const char* value); - void add_partition_tags(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tags() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tags(); - - // string name = 2; - 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); - - // .milvus.grpc.Schema schema = 3; - bool has_schema() const; - void clear_schema(); - const ::milvus::grpc::Schema& schema() const; - ::milvus::grpc::Schema* release_schema(); - ::milvus::grpc::Schema* mutable_schema(); - void set_allocated_schema(::milvus::grpc::Schema* schema); - - // uint64 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 create_time = 4; - void clear_create_time(); - ::PROTOBUF_NAMESPACE_ID::uint64 create_time() const; - void set_create_time(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // @@protoc_insertion_point(class_scope:masterpb.Collection) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > segment_ids_; - mutable std::atomic _segment_ids_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tags_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::milvus::grpc::Schema* schema_; - ::PROTOBUF_NAMESPACE_ID::uint64 id_; - ::PROTOBUF_NAMESPACE_ID::uint64 create_time_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_master_2eproto; -}; -// ------------------------------------------------------------------- - -class Segment : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.Segment) */ { - public: - Segment(); - virtual ~Segment(); - - Segment(const Segment& from); - Segment(Segment&& from) noexcept - : Segment() { - *this = ::std::move(from); - } - - inline Segment& operator=(const Segment& from) { - CopyFrom(from); - return *this; - } - inline Segment& operator=(Segment&& 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 Segment& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Segment* internal_default_instance() { - return reinterpret_cast( - &_Segment_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Segment& a, Segment& b) { - a.Swap(&b); - } - inline void Swap(Segment* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Segment* New() const final { - return CreateMaybeMessage(nullptr); - } - - Segment* 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 Segment& from); - void MergeFrom(const Segment& 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(Segment* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.Segment"; - } - 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 { - kPartitionTagFieldNumber = 3, - kSegmentIdFieldNumber = 1, - kCollectionIdFieldNumber = 2, - kChannelStartFieldNumber = 4, - kChannelEndFieldNumber = 5, - kOpenTimestampFieldNumber = 6, - kCloseTimestampFieldNumber = 7, - }; - // 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); - - // uint64 segment_id = 1; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 collection_id = 2; - void clear_collection_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 collection_id() const; - void set_collection_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int32 channel_start = 4; - void clear_channel_start(); - ::PROTOBUF_NAMESPACE_ID::int32 channel_start() const; - void set_channel_start(::PROTOBUF_NAMESPACE_ID::int32 value); - - // int32 channel_end = 5; - void clear_channel_end(); - ::PROTOBUF_NAMESPACE_ID::int32 channel_end() const; - void set_channel_end(::PROTOBUF_NAMESPACE_ID::int32 value); - - // uint64 open_timestamp = 6; - void clear_open_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp() const; - void set_open_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 close_timestamp = 7; - void clear_close_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp() const; - void set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // @@protoc_insertion_point(class_scope:masterpb.Segment) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partition_tag_; - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 collection_id_; - ::PROTOBUF_NAMESPACE_ID::int32 channel_start_; - ::PROTOBUF_NAMESPACE_ID::int32 channel_end_; - ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp_; - ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_master_2eproto; -}; -// ------------------------------------------------------------------- - -class SegmentStat : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.SegmentStat) */ { - public: - SegmentStat(); - virtual ~SegmentStat(); - - SegmentStat(const SegmentStat& from); - SegmentStat(SegmentStat&& from) noexcept - : SegmentStat() { - *this = ::std::move(from); - } - - inline SegmentStat& operator=(const SegmentStat& from) { - CopyFrom(from); - return *this; - } - inline SegmentStat& operator=(SegmentStat&& 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 SegmentStat& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SegmentStat* internal_default_instance() { - return reinterpret_cast( - &_SegmentStat_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(SegmentStat& a, SegmentStat& b) { - a.Swap(&b); - } - inline void Swap(SegmentStat* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SegmentStat* New() const final { - return CreateMaybeMessage(nullptr); - } - - SegmentStat* 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 SegmentStat& from); - void MergeFrom(const SegmentStat& 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(SegmentStat* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.SegmentStat"; - } - 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 { - kSegmentIdFieldNumber = 1, - kMemorySizeFieldNumber = 2, - kMemoryRateFieldNumber = 3, - }; - // uint64 segment_id = 1; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 memory_size = 2; - void clear_memory_size(); - ::PROTOBUF_NAMESPACE_ID::uint64 memory_size() const; - void set_memory_size(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // float memory_rate = 3; - void clear_memory_rate(); - float memory_rate() const; - void set_memory_rate(float value); - - // @@protoc_insertion_point(class_scope:masterpb.SegmentStat) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 memory_size_; - float memory_rate_; - 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__ -// Collection - -// uint64 id = 1; -inline void Collection::clear_id() { - id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::id() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.id) - return id_; -} -inline void Collection::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Collection.id) -} - -// string name = 2; -inline void Collection::clear_name() { - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Collection::name() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.name) - return name_.GetNoArena(); -} -inline void Collection::set_name(const std::string& value) { - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:masterpb.Collection.name) -} -inline void Collection::set_name(std::string&& value) { - - name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:masterpb.Collection.name) -} -inline void Collection::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:masterpb.Collection.name) -} -inline void Collection::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:masterpb.Collection.name) -} -inline std::string* Collection::mutable_name() { - - // @@protoc_insertion_point(field_mutable:masterpb.Collection.name) - return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Collection::release_name() { - // @@protoc_insertion_point(field_release:masterpb.Collection.name) - - return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Collection::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:masterpb.Collection.name) -} - -// .milvus.grpc.Schema schema = 3; -inline bool Collection::has_schema() const { - return this != internal_default_instance() && schema_ != nullptr; -} -inline const ::milvus::grpc::Schema& Collection::schema() const { - const ::milvus::grpc::Schema* p = schema_; - // @@protoc_insertion_point(field_get:masterpb.Collection.schema) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Schema_default_instance_); -} -inline ::milvus::grpc::Schema* Collection::release_schema() { - // @@protoc_insertion_point(field_release:masterpb.Collection.schema) - - ::milvus::grpc::Schema* temp = schema_; - schema_ = nullptr; - return temp; -} -inline ::milvus::grpc::Schema* Collection::mutable_schema() { - - if (schema_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Schema>(GetArenaNoVirtual()); - schema_ = p; - } - // @@protoc_insertion_point(field_mutable:masterpb.Collection.schema) - return schema_; -} -inline void Collection::set_allocated_schema(::milvus::grpc::Schema* schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(schema_); - } - if (schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - schema = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, schema, submessage_arena); - } - - } else { - - } - schema_ = schema; - // @@protoc_insertion_point(field_set_allocated:masterpb.Collection.schema) -} - -// uint64 create_time = 4; -inline void Collection::clear_create_time() { - create_time_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::create_time() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.create_time) - return create_time_; -} -inline void Collection::set_create_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - create_time_ = value; - // @@protoc_insertion_point(field_set:masterpb.Collection.create_time) -} - -// repeated uint64 segment_ids = 5; -inline int Collection::segment_ids_size() const { - return segment_ids_.size(); -} -inline void Collection::clear_segment_ids() { - segment_ids_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::segment_ids(int index) const { - // @@protoc_insertion_point(field_get:masterpb.Collection.segment_ids) - return segment_ids_.Get(index); -} -inline void Collection::set_segment_ids(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) { - segment_ids_.Set(index, value); - // @@protoc_insertion_point(field_set:masterpb.Collection.segment_ids) -} -inline void Collection::add_segment_ids(::PROTOBUF_NAMESPACE_ID::uint64 value) { - segment_ids_.Add(value); - // @@protoc_insertion_point(field_add:masterpb.Collection.segment_ids) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >& -Collection::segment_ids() const { - // @@protoc_insertion_point(field_list:masterpb.Collection.segment_ids) - return segment_ids_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >* -Collection::mutable_segment_ids() { - // @@protoc_insertion_point(field_mutable_list:masterpb.Collection.segment_ids) - return &segment_ids_; -} - -// repeated string partition_tags = 6; -inline int Collection::partition_tags_size() const { - return partition_tags_.size(); -} -inline void Collection::clear_partition_tags() { - partition_tags_.Clear(); -} -inline const std::string& Collection::partition_tags(int index) const { - // @@protoc_insertion_point(field_get:masterpb.Collection.partition_tags) - return partition_tags_.Get(index); -} -inline std::string* Collection::mutable_partition_tags(int index) { - // @@protoc_insertion_point(field_mutable:masterpb.Collection.partition_tags) - return partition_tags_.Mutable(index); -} -inline void Collection::set_partition_tags(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:masterpb.Collection.partition_tags) - partition_tags_.Mutable(index)->assign(value); -} -inline void Collection::set_partition_tags(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:masterpb.Collection.partition_tags) - partition_tags_.Mutable(index)->assign(std::move(value)); -} -inline void Collection::set_partition_tags(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tags_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:masterpb.Collection.partition_tags) -} -inline void Collection::set_partition_tags(int index, const char* value, size_t size) { - partition_tags_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:masterpb.Collection.partition_tags) -} -inline std::string* Collection::add_partition_tags() { - // @@protoc_insertion_point(field_add_mutable:masterpb.Collection.partition_tags) - return partition_tags_.Add(); -} -inline void Collection::add_partition_tags(const std::string& value) { - partition_tags_.Add()->assign(value); - // @@protoc_insertion_point(field_add:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(std::string&& value) { - partition_tags_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tags_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(const char* value, size_t size) { - partition_tags_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:masterpb.Collection.partition_tags) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -Collection::partition_tags() const { - // @@protoc_insertion_point(field_list:masterpb.Collection.partition_tags) - return partition_tags_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -Collection::mutable_partition_tags() { - // @@protoc_insertion_point(field_mutable_list:masterpb.Collection.partition_tags) - return &partition_tags_; -} - -// ------------------------------------------------------------------- - -// Segment - -// uint64 segment_id = 1; -inline void Segment::clear_segment_id() { - segment_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::segment_id() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.segment_id) - return segment_id_; -} -inline void Segment::set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.segment_id) -} - -// uint64 collection_id = 2; -inline void Segment::clear_collection_id() { - collection_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::collection_id() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.collection_id) - return collection_id_; -} -inline void Segment::set_collection_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - collection_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.collection_id) -} - -// string partition_tag = 3; -inline void Segment::clear_partition_tag() { - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Segment::partition_tag() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.partition_tag) - return partition_tag_.GetNoArena(); -} -inline void Segment::set_partition_tag(const std::string& value) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:masterpb.Segment.partition_tag) -} -inline void Segment::set_partition_tag(std::string&& value) { - - partition_tag_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:masterpb.Segment.partition_tag) -} -inline void Segment::set_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:masterpb.Segment.partition_tag) -} -inline void Segment::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:masterpb.Segment.partition_tag) -} -inline std::string* Segment::mutable_partition_tag() { - - // @@protoc_insertion_point(field_mutable:masterpb.Segment.partition_tag) - return partition_tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Segment::release_partition_tag() { - // @@protoc_insertion_point(field_release:masterpb.Segment.partition_tag) - - return partition_tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Segment::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:masterpb.Segment.partition_tag) -} - -// int32 channel_start = 4; -inline void Segment::clear_channel_start() { - channel_start_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Segment::channel_start() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.channel_start) - return channel_start_; -} -inline void Segment::set_channel_start(::PROTOBUF_NAMESPACE_ID::int32 value) { - - channel_start_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.channel_start) -} - -// int32 channel_end = 5; -inline void Segment::clear_channel_end() { - channel_end_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Segment::channel_end() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.channel_end) - return channel_end_; -} -inline void Segment::set_channel_end(::PROTOBUF_NAMESPACE_ID::int32 value) { - - channel_end_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.channel_end) -} - -// uint64 open_timestamp = 6; -inline void Segment::clear_open_timestamp() { - open_timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::open_timestamp() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.open_timestamp) - return open_timestamp_; -} -inline void Segment::set_open_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - open_timestamp_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.open_timestamp) -} - -// uint64 close_timestamp = 7; -inline void Segment::clear_close_timestamp() { - close_timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::close_timestamp() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.close_timestamp) - return close_timestamp_; -} -inline void Segment::set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - close_timestamp_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.close_timestamp) -} - -// ------------------------------------------------------------------- - -// SegmentStat - -// uint64 segment_id = 1; -inline void SegmentStat::clear_segment_id() { - segment_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 SegmentStat::segment_id() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.segment_id) - return segment_id_; -} -inline void SegmentStat::set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.segment_id) -} - -// uint64 memory_size = 2; -inline void SegmentStat::clear_memory_size() { - memory_size_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 SegmentStat::memory_size() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.memory_size) - return memory_size_; -} -inline void SegmentStat::set_memory_size(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - memory_size_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_size) -} - -// float memory_rate = 3; -inline void SegmentStat::clear_memory_rate() { - memory_rate_ = 0; -} -inline float SegmentStat::memory_rate() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.memory_rate) - return memory_rate_; -} -inline void SegmentStat::set_memory_rate(float value) { - - memory_rate_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_rate) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace masterpb - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_master_2eproto diff --git a/proxy/src/grpc/proto/etcd.proto b/proxy/src/grpc/proto/etcd.proto deleted file mode 100644 index 73215ee4a5..0000000000 --- a/proxy/src/grpc/proto/etcd.proto +++ /dev/null @@ -1,164 +0,0 @@ -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/message_client/ClientV2.cpp b/proxy/src/message_client/ClientV2.cpp index 436bab632f..1a86f90176 100644 --- a/proxy/src/message_client/ClientV2.cpp +++ b/proxy/src/message_client/ClientV2.cpp @@ -3,6 +3,8 @@ #include "PartitionPolicy.h" #include "utils/CommonUtil.h" #include +#include +#include namespace milvus::message_client { @@ -48,64 +50,81 @@ int64_t GetQueryNodeNum() { return 1; } -milvus::grpc::QueryResult Aggregation(std::vector> &results) { - //TODO: QueryNode has only one - int64_t length = results.size(); +Status +Aggregation(std::vector> results, milvus::grpc::QueryResult* result) { + if (results.empty()) { + return Status(DB_ERROR, "The result is null!"); + } + std::vector all_scores; std::vector all_distance; + std::vector all_entities_ids; + std::vector all_valid_row; + std::vector all_row_data; std::vector all_kv_pairs; - std::vector index(length * results[0]->distances_size()); - for (int n = 0; n < length * results[0]->distances_size(); ++n) { - index[n] = n; - } + grpc::Status status; + int row_num = 0; - 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 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 (auto & result_per_node : results) { + if (result_per_node->status().error_code() != grpc::ErrorCode::SUCCESS){ +// if (one_node_res->status().error_code() != grpc::ErrorCode::SUCCESS || +// one_node_res->entities().status().error_code() != grpc::ErrorCode::SUCCESS) { + return Status(DB_ERROR, "QueryNode return wrong status!"); } - } + for (int j = 0; j < result_per_node->distances_size(); j++) { + all_scores.push_back(result_per_node->scores()[j]); + all_distance.push_back(result_per_node->distances()[j]); +// all_kv_pairs.push_back(result_per_node->extra_params()[j]); + } + for (int k = 0; k < result_per_node->entities().ids_size(); ++k) { + all_entities_ids.push_back(result_per_node->entities().ids(k)); +// all_valid_row.push_back(result_per_node->entities().valid_row(k)); +// all_row_data.push_back(result_per_node->entities().rows_data(k)); + } + if (result_per_node->row_num() > row_num){ + row_num = result_per_node->row_num(); + } + status = result_per_node->status(); } - grpc::QueryResult result; + std::vector index(all_distance.size()); - result.mutable_status()->CopyFrom(results[0]->status()); - result.mutable_entities()->CopyFrom(results[0]->entities()); - result.set_row_num(results[0]->row_num()); + iota(index.begin(), index.end(), 0); - for (int m = 0; m < results[0]->distances_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]]); + std::stable_sort(index.begin(), index.end(), + [&all_distance](size_t i1, size_t i2) {return all_distance[i1] > all_distance[i2];}); + + grpc::Entities result_entities; + + for (int m = 0; m < result->row_num(); ++m) { + result->add_scores(all_scores[index[m]]); + result->add_distances(all_distance[index[m]]); +// result->add_extra_params(); +// result->mutable_extra_params(m)->CopyFrom(all_kv_pairs[index[m]]); + + result_entities.add_ids(all_entities_ids[index[m]]); +// result_entities.add_valid_row(all_valid_row[index[m]]); +// result_entities.add_rows_data(); +// result_entities.mutable_rows_data(m)->CopyFrom(all_row_data[index[m]]); } -// result.set_query_id(results[0]->query_id()); -// result.set_client_id(results[0]->client_id()); + result_entities.mutable_status()->CopyFrom(status); - return result; + result->set_row_num(row_num); + result->mutable_entities()->CopyFrom(result_entities); + result->set_query_id(results[0]->query_id()); +// result->set_client_id(results[0]->client_id()); + + return Status::OK(); } Status MsgClientV2::GetQueryResult(int64_t query_id, milvus::grpc::QueryResult* result) { int64_t query_node_num = GetQueryNodeNum(); + auto t1 = std::chrono::high_resolution_clock::now(); + while (true) { auto received_result = total_results[query_id]; if (received_result.size() == query_node_num) { @@ -124,8 +143,9 @@ Status MsgClientV2::GetQueryResult(int64_t query_id, milvus::grpc::QueryResult* return Status(DB_ERROR, "can't parse message which from pulsar!"); } } - *result = Aggregation(total_results[query_id]); - return Status::OK(); + auto status = Aggregation(total_results[query_id], result); + + return status; } Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, uint64_t timestamp) { @@ -155,7 +175,7 @@ Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, uin } } for (auto &stat : stats) { - if (stat != pulsar::ResultOk) { + if (stat == pulsar::ResultOk) { return Status(DB_ERROR, pulsar::strResult(stat)); } } @@ -181,7 +201,7 @@ Status MsgClientV2::SendMutMessage(const milvus::grpc::DeleteByIDParam &request, } } for (auto &stat : stats) { - if (stat != pulsar::ResultOk) { + if (stat == pulsar::ResultOk) { return Status(DB_ERROR, pulsar::strResult(stat)); } } @@ -199,18 +219,19 @@ Status MsgClientV2::SendQueryMessage(const milvus::grpc::SearchParam &request, u 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; + std::string binary_data; 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()); + binary_data.append(request.vector_param(i).row_record().records(j).binary_data()); } } + vector_row_recode.set_binary_data(binary_data); search_msg.mutable_records()->CopyFrom(vector_row_recode); @@ -222,80 +243,12 @@ Status MsgClientV2::SendQueryMessage(const milvus::grpc::SearchParam &request, u 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() { diff --git a/proxy/src/message_client/ClientV2.h b/proxy/src/message_client/ClientV2.h index 67d8184241..7f4404216b 100644 --- a/proxy/src/message_client/ClientV2.h +++ b/proxy/src/message_client/ClientV2.h @@ -31,7 +31,7 @@ class MsgClientV2 { // Status SendQueryMessage(const milvus::grpc::SearchParam &request, uint64_t timestamp, int64_t &query_id); - Status GetQueryResult(int64_t query_id, milvus::grpc::QueryResult* result); + Status GetQueryResult(int64_t query_id, milvus::grpc::QueryResult *result); private: int64_t GetUniqueQId() { diff --git a/proxy/src/meta/CMakeLists.txt b/proxy/src/meta/CMakeLists.txt deleted file mode 100644 index 69748ecd0a..0000000000 --- a/proxy/src/meta/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -include_directories(${PROJECT_BINARY_DIR}/thirdparty/grpc/grpc-src/third_party/protobuf/src) -include_directories(${PROJECT_BINARY_DIR}/thirdparty/grpc/grpc-src/include) - -add_subdirectory( etcd_watcher ) -aux_source_directory( ./master master_src) -add_library(meta ${master_src} - ./etcd_watcher/Watcher.cpp - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.grpc.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/master.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/master.grpc.pb.cc - ) diff --git a/proxy/src/meta/etcd_watcher/CMakeLists.txt b/proxy/src/meta/etcd_watcher/CMakeLists.txt deleted file mode 100644 index ab142b1ba6..0000000000 --- a/proxy/src/meta/etcd_watcher/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -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/meta/etcd_watcher/Watcher.cpp b/proxy/src/meta/etcd_watcher/Watcher.cpp deleted file mode 100644 index f292cdf211..0000000000 --- a/proxy/src/meta/etcd_watcher/Watcher.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#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, - bool with_prefix) { - auto channel = grpc::CreateChannel(address, grpc::InsecureChannelCredentials()); - stub_ = etcdserverpb::Watch::NewStub(channel); - - call_ = std::make_unique(key, with_prefix, 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, bool with_prefix, 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); - if (with_prefix) { - 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/meta/etcd_watcher/Watcher.h b/proxy/src/meta/etcd_watcher/Watcher.h deleted file mode 100644 index 657a0ea913..0000000000 --- a/proxy/src/meta/etcd_watcher/Watcher.h +++ /dev/null @@ -1,40 +0,0 @@ -#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, - bool with_prefix = true); - void Cancel(); - ~Watcher(); - - private: - std::unique_ptr stub_; - std::unique_ptr call_; - std::thread work_thread_; -}; - -class AsyncWatchAction { - public: - AsyncWatchAction(const std::string &key, bool with_prefix, 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/meta/etcd_watcher/test_watcher.cpp b/proxy/src/meta/etcd_watcher/test_watcher.cpp deleted file mode 100644 index edb80c39cc..0000000000 --- a/proxy/src/meta/etcd_watcher/test_watcher.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// 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; - } - }, false); - 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/meta/master/GrpcClient.cpp b/proxy/src/meta/master/GrpcClient.cpp deleted file mode 100644 index 2e116178fe..0000000000 --- a/proxy/src/meta/master/GrpcClient.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "GrpcClient.h" -#include "grpc++/grpc++.h" - -using grpc::ClientContext; - -namespace milvus { -namespace master { -GrpcClient::GrpcClient(const std::string &addr) { - auto channel = ::grpc::CreateChannel(addr, ::grpc::InsecureChannelCredentials()); - stub_ = masterpb::Master::NewStub(channel); -} - -GrpcClient::GrpcClient(std::shared_ptr<::grpc::Channel> &channel) - : stub_(masterpb::Master::NewStub(channel)) { -} - -Status GrpcClient::CreateCollection(const milvus::grpc::Mapping &mapping) { - ClientContext context; - ::milvus::grpc::Status response; - ::grpc::Status grpc_status = stub_->CreateCollection(&context, mapping, &response); - - if (!grpc_status.ok()) { - std::cerr << "CreateHybridCollection gRPC failed!" << std::endl; - return Status(grpc_status.error_code(), grpc_status.error_message()); - } - - if (response.error_code() != grpc::SUCCESS) { - // TODO: LOG - return Status(response.error_code(), response.reason()); - } - return Status::OK(); -} - -} -} \ No newline at end of file diff --git a/proxy/src/meta/master/GrpcClient.h b/proxy/src/meta/master/GrpcClient.h deleted file mode 100644 index 45db5a1ed0..0000000000 --- a/proxy/src/meta/master/GrpcClient.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include "grpc/master.grpc.pb.h" -#include "grpc/message.pb.h" -#include "grpc++/grpc++.h" -#include "utils/Status.h" - -namespace milvus { -namespace master { -class GrpcClient { - public: - explicit GrpcClient(const std::string& addr); - explicit GrpcClient(std::shared_ptr<::grpc::Channel>& channel); - ~GrpcClient() = default; - - public: - Status - CreateCollection(const milvus::grpc::Mapping& mapping); - - private: - std::unique_ptr stub_; - -}; - - -} -} - diff --git a/proxy/src/server/CMakeLists.txt b/proxy/src/server/CMakeLists.txt index 386e251e18..777f915e19 100644 --- a/proxy/src/server/CMakeLists.txt +++ b/proxy/src/server/CMakeLists.txt @@ -43,7 +43,7 @@ set( GRPC_SERVER_FILES ${GRPC_IMPL_FILES} aux_source_directory( ${MILVUS_ENGINE_SRC}/server/context SERVER_CONTEXT_FILES ) -add_library( server STATIC) +add_library( server STATIC MessageWrapper.cpp MessageWrapper.h) target_sources( server PRIVATE ${GRPC_SERVER_FILES} ${GRPC_SERVICE_FILES} diff --git a/proxy/src/server/MetaWrapper.cpp b/proxy/src/server/MetaWrapper.cpp deleted file mode 100644 index b2073810e7..0000000000 --- a/proxy/src/server/MetaWrapper.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "MetaWrapper.h" -#include "config/ServerConfig.h" -namespace milvus{ -namespace server { - -MetaWrapper& MetaWrapper::GetInstance() { - static MetaWrapper wrapper; - return wrapper; -} - -Status MetaWrapper::Init() { - auto addr = config.master.address() + ":" + std::to_string(config.master.port()); - client_ = std::make_shared(addr); -} - -std::shared_ptr MetaWrapper::MetaClient() { - return client_; -} - -} -} \ No newline at end of file diff --git a/proxy/src/server/MetaWrapper.h b/proxy/src/server/MetaWrapper.h deleted file mode 100644 index bf5c264b08..0000000000 --- a/proxy/src/server/MetaWrapper.h +++ /dev/null @@ -1,24 +0,0 @@ -#include "utils/Status.h" -#include "meta/master/GrpcClient.h" - -namespace milvus{ -namespace server{ - -class MetaWrapper { - public: - static MetaWrapper& - GetInstance(); - - Status - Init(); - - std::shared_ptr - MetaClient(); - - private: - std::shared_ptr client_; -}; - - -} -} diff --git a/proxy/src/server/Server.cpp b/proxy/src/server/Server.cpp index 026157de29..0f05bb39be 100644 --- a/proxy/src/server/Server.cpp +++ b/proxy/src/server/Server.cpp @@ -34,7 +34,6 @@ #include "utils/SignalHandler.h" #include "utils/TimeRecorder.h" #include "MessageWrapper.h" -#include "MetaWrapper.h" namespace milvus { namespace server { @@ -241,15 +240,12 @@ Server::StartService() { grpc::GrpcServer::GetInstance().Start(); - // Init pulsar message client stat = MessageWrapper::GetInstance().Init(); if (!stat.ok()) { LOG_SERVER_ERROR_ << "Pulsar message client start service fail: " << stat.message(); goto FAIL; } - MetaWrapper::GetInstance().Init(); - return Status::OK(); FAIL: std::cerr << "Milvus initializes fail: " << stat.message() << std::endl; diff --git a/proxy/src/server/delivery/request/SearchReq.cpp b/proxy/src/server/delivery/request/SearchReq.cpp index d5afd298f8..379972a9e8 100644 --- a/proxy/src/server/delivery/request/SearchReq.cpp +++ b/proxy/src/server/delivery/request/SearchReq.cpp @@ -46,7 +46,6 @@ SearchReq::Create(const ContextPtr& context, const ::milvus::grpc::SearchParam * Status SearchReq::OnExecute() { auto message_wrapper = milvus::server::MessageWrapper::GetInstance(); - message_wrapper.Init(); auto client = message_wrapper.MessageClient(); int64_t query_id; diff --git a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp b/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp index 70334e3c36..eb0ab3d7f3 100644 --- a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp +++ b/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp @@ -26,7 +26,6 @@ #include "tracing/TextMapCarrier.h" #include "tracing/TracerUtil.h" #include "utils/Log.h" -#include "server/MetaWrapper.h" namespace milvus { namespace server { @@ -341,10 +340,6 @@ GrpcRequestHandler::CreateCollection(::grpc::ServerContext *context, const ::mil CHECK_NULLPTR_RETURN(request); LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - Status status = MetaWrapper::GetInstance().MetaClient()->CreateCollection(*request); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context) return ::grpc::Status::OK; } @@ -857,8 +852,10 @@ GrpcRequestHandler::Search(::grpc::ServerContext *context, const ::milvus::grpc: 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); + + BaseReqPtr req_ptr = SearchReq::Create(GetContext(context), request, response); + ReqScheduler::ExecReq(req_ptr); + return ::grpc::Status::OK; } diff --git a/proxy/thirdparty/grpc/CMakeLists.txt b/proxy/thirdparty/grpc/CMakeLists.txt index b39512ff57..bfe7d99481 100644 --- a/proxy/thirdparty/grpc/CMakeLists.txt +++ b/proxy/thirdparty/grpc/CMakeLists.txt @@ -66,10 +66,6 @@ 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 bash "${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/reader/query_node.go b/reader/query_node.go index a6dab554b0..890780db5b 100644 --- a/reader/query_node.go +++ b/reader/query_node.go @@ -87,12 +87,12 @@ func NewQueryNode(queryNodeId uint64, timeSync uint64) *QueryNode { } return &QueryNode{ - QueryNodeId: queryNodeId, - Collections: nil, - SegmentsMap: segmentsMap, - messageClient: mc, - queryNodeTimeSync: queryNodeTimeSync, - buffer: buffer, + QueryNodeId: queryNodeId, + Collections: nil, + SegmentsMap: segmentsMap, + messageClient: mc, + queryNodeTimeSync: queryNodeTimeSync, + buffer: buffer, } } @@ -145,9 +145,9 @@ func (node *QueryNode) PrepareBatchMsg() []int { return msgLen } -func (node *QueryNode) StartMessageClient(pulsarURL string) { +func (node *QueryNode) StartMessageClient() { // TODO: add consumerMsgSchema - node.messageClient.InitClient(pulsarURL) + node.messageClient.InitClient("pulsar://192.168.2.28:6650") go node.messageClient.ReceiveMessage() } @@ -181,7 +181,7 @@ func (node *QueryNode) RunInsertDelete() { if count == 0 { start = time.Now() } - count += msgLen[0] + count+=msgLen[0] node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) //fmt.Println("MessagesPreprocess Done") node.WriterDelete() @@ -191,7 +191,7 @@ func (node *QueryNode) RunInsertDelete() { //fmt.Println("DoInsertAndDelete Done") node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) //fmt.Print("UpdateSearchTimeSync Done\n\n\n") - if count == 100000-1 { + if count == 100000 - 1 { elapsed := time.Since(start) fmt.Println("Query node insert 10 × 10000 time:", elapsed) } @@ -200,23 +200,19 @@ func (node *QueryNode) RunInsertDelete() { func (node *QueryNode) RunSearch() { for { - time.Sleep(0.2 * 1000 * time.Millisecond) + //time.Sleep(2 * 1000 * time.Millisecond) start := time.Now() if len(node.messageClient.GetSearchChan()) <= 0 { - fmt.Println("null Search") + //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...") - var status = node.Search(node.messageClient.SearchMsg) - if status.ErrorCode != 0 { - fmt.Println("Search Failed") - node.PublishFailedSearchResult() - } + node.Search(node.messageClient.SearchMsg) elapsed := time.Since(start) fmt.Println("Query node search time:", elapsed) @@ -431,8 +427,6 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { var timestamp = msg.Timestamp var vector = msg.Records - // We now only the first Json is valid. - var queryJson = msg.Json[0] // 1. Timestamp check // TODO: return or wait? Or adding graceful time @@ -443,7 +437,7 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { // 2. Do search in all segments for _, partition := range targetCollection.Partitions { for _, openSegment := range partition.OpenedSegments { - var res, err = openSegment.SegmentSearch(queryJson, timestamp, vector) + var res, err = openSegment.SegmentSearch("", timestamp, vector) if err != nil { fmt.Println(err.Error()) return msgPb.Status{ErrorCode: 1} @@ -454,7 +448,7 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { } } for _, closedSegment := range partition.ClosedSegments { - var res, err = closedSegment.SegmentSearch(queryJson, timestamp, vector) + var res, err = closedSegment.SegmentSearch("", timestamp, vector) if err != nil { fmt.Println(err.Error()) return msgPb.Status{ErrorCode: 1} @@ -474,9 +468,6 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { Ids: make([]int64, 0), } var results = msgPb.QueryResult{ - Status: &msgPb.Status{ - ErrorCode: 0, - }, Entities: &entities, Distances: make([]float32, 0), QueryId: msg.Uid, diff --git a/reader/reader.go b/reader/reader.go index 5b05250790..6a1b612c41 100644 --- a/reader/reader.go +++ b/reader/reader.go @@ -1,10 +1,10 @@ package reader -func startQueryNode(pulsarURL string) { +func startQueryNode() { qn := NewQueryNode(0, 0) qn.InitQueryNodeCollection() //go qn.SegmentService() - qn.StartMessageClient(pulsarURL) + qn.StartMessageClient() go qn.RunSearch() qn.RunInsertDelete() diff --git a/reader/reader_test.go b/reader/reader_test.go index 0b1f93354d..e467f29753 100644 --- a/reader/reader_test.go +++ b/reader/reader_test.go @@ -5,6 +5,5 @@ import ( ) func TestReader_startQueryNode(t *testing.T) { - pulsarURL := "pulsar://192.168.2.28:6650" - startQueryNode(pulsarURL) + startQueryNode() } diff --git a/reader/result.go b/reader/result.go index 6b88199865..785cc3116e 100644 --- a/reader/result.go +++ b/reader/result.go @@ -10,8 +10,8 @@ import ( type ResultEntityIds []int64 type SearchResult struct { - ResultIds []int64 - ResultDistances []float32 + ResultIds []int64 + ResultDistances []float32 } func getResultTopicByClientId(clientId int64) string { @@ -28,20 +28,6 @@ func (node *QueryNode) PublishSearchResult(results *msgPb.QueryResult, clientId return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} } -func (node *QueryNode) PublishFailedSearchResult() msgPb.Status { - var results = msgPb.QueryResult{ - Status: &msgPb.Status{ - ErrorCode: 1, - Reason: "Search Failed", - }, - } - - var ctx = context.Background() - - node.messageClient.Send(ctx, results) - return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} -} - func (node *QueryNode) PublicStatistic(statisticTopic string) msgPb.Status { // TODO: get statistic info // getStatisticInfo() diff --git a/reader/segment.go b/reader/segment.go index 7b775892b4..420f95d087 100644 --- a/reader/segment.go +++ b/reader/segment.go @@ -164,14 +164,12 @@ func (s *Segment) SegmentDelete(offset int64, entityIDs *[]int64, timestamps *[] return nil } -func (s *Segment) SegmentSearch(queryJson string, timestamp uint64, vectorRecord *schema.VectorRowRecord) (*SearchResult, error) { +func (s *Segment) SegmentSearch(queryString string, timestamp uint64, vectorRecord *schema.VectorRowRecord) (*SearchResult, error) { /*C.Search int Search(CSegmentBase c_segment, - const char* query_json, + void* fake_query, unsigned long timestamp, - float* query_raw_data, - int num_of_query_raw_data, long int* result_ids, float* result_distances); */ @@ -181,23 +179,12 @@ func (s *Segment) SegmentSearch(queryJson string, timestamp uint64, vectorRecord resultIds := make([]int64, TopK) resultDistances := make([]float32, TopK) - var cQueryJson = C.CString(queryJson) + var cQueryPtr = unsafe.Pointer(nil) var cTimestamp = C.ulong(timestamp) var cResultIds = (*C.long)(&resultIds[0]) var cResultDistances = (*C.float)(&resultDistances[0]) - var cQueryRawData *C.float - var cQueryRawDataLength C.int - if vectorRecord.BinaryData != nil { - return nil, errors.New("Data of binary type is not supported yet") - } else if len(vectorRecord.FloatData) <= 0 { - return nil, errors.New("Null query vector data") - } else { - cQueryRawData = (*C.float)(&vectorRecord.FloatData[0]) - cQueryRawDataLength = (C.int)(len(vectorRecord.FloatData)) - } - - var status = C.Search(s.SegmentPtr, cQueryJson, cTimestamp, cQueryRawData, cQueryRawDataLength, cResultIds, cResultDistances) + var status = C.Search(s.SegmentPtr, cQueryPtr, cTimestamp, cResultIds, cResultDistances) if status != 0 { return nil, errors.New("Search failed, error code = " + strconv.Itoa(int(status))) diff --git a/reader/segment_test.go b/reader/segment_test.go index 170b512f49..1b24166b09 100644 --- a/reader/segment_test.go +++ b/reader/segment_test.go @@ -3,7 +3,6 @@ package reader import ( "encoding/binary" "fmt" - schema "github.com/czs007/suvlim/pkg/master/grpc/message" "github.com/stretchr/testify/assert" "math" "testing" @@ -132,15 +131,7 @@ func TestSegment_SegmentSearch(t *testing.T) { assert.NoError(t, err) // 6. Do search - var queryJson = "{\"field_name\":\"fakevec\",\"num_queries\":1,\"topK\":10}" - var queryRawData = make([]float32, 0) - for i := 0; i < 16; i ++ { - queryRawData = append(queryRawData, float32(i)) - } - var vectorRecord = schema.VectorRowRecord { - FloatData: queryRawData, - } - var searchRes, searchErr = segment.SegmentSearch(queryJson, timestamps[0], &vectorRecord) + var searchRes, searchErr = segment.SegmentSearch("fake query string", timestamps[0], nil) assert.NoError(t, searchErr) fmt.Println(searchRes) diff --git a/scripts/generate_cpp.sh b/scripts/generate_cpp.sh index a13ed8f825..bcb6a96cd9 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" "master.proto") +GRPC_FILES=("message.proto") ALL_FILES=("${PB_FILES[@]}") ALL_FILES+=("${GRPC_FILES[@]}") diff --git a/sdk/examples/search.cpp b/sdk/examples/search.cpp index 58ffdf3ac8..f53c55a1ca 100644 --- a/sdk/examples/search.cpp +++ b/sdk/examples/search.cpp @@ -14,6 +14,7 @@ #include "include/MilvusApi.h" #include "grpc/ClientProxy.h" #include "interface/ConnectionImpl.h" +#include "utils/TimeRecorder.h" int main(int argc , char**argv) { auto client = milvus::ConnectionImpl(); @@ -50,25 +51,9 @@ int main(int argc , char**argv) { milvus::TopKQueryResult result; - - - auto t1 = std::chrono::high_resolution_clock::now(); -// for (int k = 0; k < 1000; ++k) { + milvus_sdk::TimeRecorder test_search("search"); auto status = client.Search("collection1", partition_list, "dsl", vectorParam, result); -// } - -// std::cout << "hahaha" << std::endl; -// if (result.size() > 0){ -// std::cout << result[0].ids[0] << std::endl; -// std::cout << result[0].distances[0] << std::endl; -// } else { -// std::cout << "sheep is a shadiao"; -// } - auto t2 = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration_cast(t2 - t1).count(); - - std::cout << "Query run time: " << duration/1000.0 << "ms" << std::endl; return 0; }