milvus/proxy/src/grpc/master.pb.cc
FluorineDog 99ef484273 Format Unittest
Signed-off-by: FluorineDog <guilin.gou@zilliz.com>
2020-09-15 16:23:29 +08:00

1591 lines
58 KiB
C++

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: master.proto
#include "master.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
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<Collection> _instance;
} _Collection_default_instance_;
class SegmentDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Segment> _instance;
} _Segment_default_instance_;
class SegmentStatDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SegmentStat> _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<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::masterpb::_Collection_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::masterpb::_Segment_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::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<size_t>(reinterpret_cast<char*>(&create_time_) -
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&create_time_) -
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&create_time_) -
reinterpret_cast<char*>(&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<int>(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<int>(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<int>(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<int>(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<int>(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<int>(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<Collection>(
&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<size_t>(reinterpret_cast<char*>(&close_timestamp_) -
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&close_timestamp_) -
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&close_timestamp_) -
reinterpret_cast<char*>(&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<int>(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<int>(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<int>(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<Segment>(
&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<size_t>(reinterpret_cast<char*>(&memory_rate_) -
reinterpret_cast<char*>(&segment_id_)) + sizeof(memory_rate_));
// @@protoc_insertion_point(copy_constructor:masterpb.SegmentStat)
}
void SegmentStat::SharedCtor() {
::memset(&segment_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&memory_rate_) -
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&memory_rate_) -
reinterpret_cast<char*>(&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<float>(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<SegmentStat>(
&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 <google/protobuf/port_undef.inc>