// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: greptime/v1/meta/route.proto

#include "greptime/v1/meta/route.pb.h"

#include <algorithm>

#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>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace greptime {
namespace v1 {
namespace meta {
PROTOBUF_CONSTEXPR TableRoute::TableRoute(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.region_routes_)*/{}
  , /*decltype(_impl_.table_)*/nullptr
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct TableRouteDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TableRouteDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TableRouteDefaultTypeInternal() {}
  union {
    TableRoute _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TableRouteDefaultTypeInternal _TableRoute_default_instance_;
PROTOBUF_CONSTEXPR RegionRoute::RegionRoute(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.follower_peer_indexes_)*/{}
  , /*decltype(_impl_._follower_peer_indexes_cached_byte_size_)*/{0}
  , /*decltype(_impl_.region_)*/nullptr
  , /*decltype(_impl_.leader_peer_index_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct RegionRouteDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegionRouteDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegionRouteDefaultTypeInternal() {}
  union {
    RegionRoute _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionRouteDefaultTypeInternal _RegionRoute_default_instance_;
PROTOBUF_CONSTEXPR Table::Table(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.table_schema_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.table_name_)*/nullptr
  , /*decltype(_impl_.id_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct TableDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TableDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TableDefaultTypeInternal() {}
  union {
    Table _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TableDefaultTypeInternal _Table_default_instance_;
PROTOBUF_CONSTEXPR Region_AttrsEntry_DoNotUse::Region_AttrsEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct Region_AttrsEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Region_AttrsEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Region_AttrsEntry_DoNotUseDefaultTypeInternal() {}
  union {
    Region_AttrsEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Region_AttrsEntry_DoNotUseDefaultTypeInternal _Region_AttrsEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR Region::Region(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.attrs_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.partition_)*/nullptr
  , /*decltype(_impl_.id_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct RegionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegionDefaultTypeInternal() {}
  union {
    Region _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionDefaultTypeInternal _Region_default_instance_;
PROTOBUF_CONSTEXPR Partition::Partition(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.column_list_)*/{}
  , /*decltype(_impl_.value_list_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct PartitionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PartitionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~PartitionDefaultTypeInternal() {}
  union {
    Partition _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionDefaultTypeInternal _Partition_default_instance_;
PROTOBUF_CONSTEXPR TableRouteValue::TableRouteValue(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.peers_)*/{}
  , /*decltype(_impl_.table_route_)*/nullptr
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct TableRouteValueDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TableRouteValueDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TableRouteValueDefaultTypeInternal() {}
  union {
    TableRouteValue _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TableRouteValueDefaultTypeInternal _TableRouteValue_default_instance_;
}  // namespace meta
}  // namespace v1
}  // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[7];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fmeta_2froute_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fmeta_2froute_2eproto = nullptr;

const uint32_t TableStruct_greptime_2fv1_2fmeta_2froute_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRoute, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRoute, _impl_.table_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRoute, _impl_.region_routes_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoute, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoute, _impl_.region_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoute, _impl_.leader_peer_index_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoute, _impl_.follower_peer_indexes_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Table, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Table, _impl_.id_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Table, _impl_.table_name_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Table, _impl_.table_schema_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region_AttrsEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region_AttrsEntry_DoNotUse, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region_AttrsEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region_AttrsEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region, _impl_.id_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region, _impl_.name_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region, _impl_.partition_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Region, _impl_.attrs_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Partition, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Partition, _impl_.column_list_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::Partition, _impl_.value_list_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRouteValue, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRouteValue, _impl_.peers_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::TableRouteValue, _impl_.table_route_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::greptime::v1::meta::TableRoute)},
  { 8, -1, -1, sizeof(::greptime::v1::meta::RegionRoute)},
  { 17, -1, -1, sizeof(::greptime::v1::meta::Table)},
  { 26, 34, -1, sizeof(::greptime::v1::meta::Region_AttrsEntry_DoNotUse)},
  { 36, -1, -1, sizeof(::greptime::v1::meta::Region)},
  { 46, -1, -1, sizeof(::greptime::v1::meta::Partition)},
  { 54, -1, -1, sizeof(::greptime::v1::meta::TableRouteValue)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::greptime::v1::meta::_TableRoute_default_instance_._instance,
  &::greptime::v1::meta::_RegionRoute_default_instance_._instance,
  &::greptime::v1::meta::_Table_default_instance_._instance,
  &::greptime::v1::meta::_Region_AttrsEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::meta::_Region_default_instance_._instance,
  &::greptime::v1::meta::_Partition_default_instance_._instance,
  &::greptime::v1::meta::_TableRouteValue_default_instance_._instance,
};

const char descriptor_table_protodef_greptime_2fv1_2fmeta_2froute_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\034greptime/v1/meta/route.proto\022\020greptime"
  ".v1.meta\032\035greptime/v1/meta/common.proto\032"
  "\030greptime/v1/common.proto\"j\n\nTableRoute\022"
  "&\n\005table\030\001 \001(\0132\027.greptime.v1.meta.Table\022"
  "4\n\rregion_routes\030\002 \003(\0132\035.greptime.v1.met"
  "a.RegionRoute\"q\n\013RegionRoute\022(\n\006region\030\001"
  " \001(\0132\030.greptime.v1.meta.Region\022\031\n\021leader"
  "_peer_index\030\002 \001(\004\022\035\n\025follower_peer_index"
  "es\030\003 \003(\004\"U\n\005Table\022\n\n\002id\030\001 \001(\004\022*\n\ntable_n"
  "ame\030\002 \001(\0132\026.greptime.v1.TableName\022\024\n\014tab"
  "le_schema\030\003 \001(\014\"\264\001\n\006Region\022\n\n\002id\030\001 \001(\004\022\014"
  "\n\004name\030\002 \001(\t\022.\n\tpartition\030\003 \001(\0132\033.grepti"
  "me.v1.meta.Partition\0222\n\005attrs\030d \003(\0132#.gr"
  "eptime.v1.meta.Region.AttrsEntry\032,\n\nAttr"
  "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"4"
  "\n\tPartition\022\023\n\013column_list\030\001 \003(\014\022\022\n\nvalu"
  "e_list\030\002 \003(\014\"k\n\017TableRouteValue\022%\n\005peers"
  "\030\001 \003(\0132\026.greptime.v1.meta.Peer\0221\n\013table_"
  "route\030\002 \001(\0132\034.greptime.v1.meta.TableRout"
  "eB<Z:github.com/GreptimeTeam/greptime-pr"
  "oto/go/greptime/v1/metab\006proto3"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_deps[2] = {
  &::descriptor_table_greptime_2fv1_2fcommon_2eproto,
  &::descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto = {
    false, false, 831, descriptor_table_protodef_greptime_2fv1_2fmeta_2froute_2eproto,
    "greptime/v1/meta/route.proto",
    &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once, descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_deps, 2, 7,
    schemas, file_default_instances, TableStruct_greptime_2fv1_2fmeta_2froute_2eproto::offsets,
    file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto, file_level_enum_descriptors_greptime_2fv1_2fmeta_2froute_2eproto,
    file_level_service_descriptors_greptime_2fv1_2fmeta_2froute_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter() {
  return &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_greptime_2fv1_2fmeta_2froute_2eproto(&descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto);
namespace greptime {
namespace v1 {
namespace meta {

// ===================================================================

class TableRoute::_Internal {
 public:
  static const ::greptime::v1::meta::Table& table(const TableRoute* msg);
};

const ::greptime::v1::meta::Table&
TableRoute::_Internal::table(const TableRoute* msg) {
  return *msg->_impl_.table_;
}
TableRoute::TableRoute(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.TableRoute)
}
TableRoute::TableRoute(const TableRoute& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  TableRoute* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.region_routes_){from._impl_.region_routes_}
    , decltype(_impl_.table_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_table()) {
    _this->_impl_.table_ = new ::greptime::v1::meta::Table(*from._impl_.table_);
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.TableRoute)
}

inline void TableRoute::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.region_routes_){arena}
    , decltype(_impl_.table_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

TableRoute::~TableRoute() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.TableRoute)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void TableRoute::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.region_routes_.~RepeatedPtrField();
  if (this != internal_default_instance()) delete _impl_.table_;
}

void TableRoute::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void TableRoute::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.TableRoute)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.region_routes_.Clear();
  if (GetArenaForAllocation() == nullptr && _impl_.table_ != nullptr) {
    delete _impl_.table_;
  }
  _impl_.table_ = nullptr;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TableRoute::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .greptime.v1.meta.Table table = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_table(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .greptime.v1.meta.RegionRoute region_routes = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_region_routes(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* TableRoute::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.TableRoute)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .greptime.v1.meta.Table table = 1;
  if (this->_internal_has_table()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::table(this),
        _Internal::table(this).GetCachedSize(), target, stream);
  }

  // repeated .greptime.v1.meta.RegionRoute region_routes = 2;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_region_routes_size()); i < n; i++) {
    const auto& repfield = this->_internal_region_routes(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.TableRoute)
  return target;
}

size_t TableRoute::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.TableRoute)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .greptime.v1.meta.RegionRoute region_routes = 2;
  total_size += 1UL * this->_internal_region_routes_size();
  for (const auto& msg : this->_impl_.region_routes_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // .greptime.v1.meta.Table table = 1;
  if (this->_internal_has_table()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.table_);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TableRoute::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    TableRoute::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TableRoute::GetClassData() const { return &_class_data_; }


void TableRoute::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<TableRoute*>(&to_msg);
  auto& from = static_cast<const TableRoute&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.TableRoute)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.region_routes_.MergeFrom(from._impl_.region_routes_);
  if (from._internal_has_table()) {
    _this->_internal_mutable_table()->::greptime::v1::meta::Table::MergeFrom(
        from._internal_table());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void TableRoute::CopyFrom(const TableRoute& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.TableRoute)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TableRoute::IsInitialized() const {
  return true;
}

void TableRoute::InternalSwap(TableRoute* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.region_routes_.InternalSwap(&other->_impl_.region_routes_);
  swap(_impl_.table_, other->_impl_.table_);
}

::PROTOBUF_NAMESPACE_ID::Metadata TableRoute::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[0]);
}

// ===================================================================

class RegionRoute::_Internal {
 public:
  static const ::greptime::v1::meta::Region& region(const RegionRoute* msg);
};

const ::greptime::v1::meta::Region&
RegionRoute::_Internal::region(const RegionRoute* msg) {
  return *msg->_impl_.region_;
}
RegionRoute::RegionRoute(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.RegionRoute)
}
RegionRoute::RegionRoute(const RegionRoute& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  RegionRoute* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.follower_peer_indexes_){from._impl_.follower_peer_indexes_}
    , /*decltype(_impl_._follower_peer_indexes_cached_byte_size_)*/{0}
    , decltype(_impl_.region_){nullptr}
    , decltype(_impl_.leader_peer_index_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_region()) {
    _this->_impl_.region_ = new ::greptime::v1::meta::Region(*from._impl_.region_);
  }
  _this->_impl_.leader_peer_index_ = from._impl_.leader_peer_index_;
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionRoute)
}

inline void RegionRoute::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.follower_peer_indexes_){arena}
    , /*decltype(_impl_._follower_peer_indexes_cached_byte_size_)*/{0}
    , decltype(_impl_.region_){nullptr}
    , decltype(_impl_.leader_peer_index_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

RegionRoute::~RegionRoute() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.RegionRoute)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void RegionRoute::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.follower_peer_indexes_.~RepeatedField();
  if (this != internal_default_instance()) delete _impl_.region_;
}

void RegionRoute::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void RegionRoute::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.RegionRoute)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.follower_peer_indexes_.Clear();
  if (GetArenaForAllocation() == nullptr && _impl_.region_ != nullptr) {
    delete _impl_.region_;
  }
  _impl_.region_ = nullptr;
  _impl_.leader_peer_index_ = uint64_t{0u};
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* RegionRoute::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .greptime.v1.meta.Region region = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_region(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 leader_peer_index = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.leader_peer_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated uint64 follower_peer_indexes = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_follower_peer_indexes(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 24) {
          _internal_add_follower_peer_indexes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* RegionRoute::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.RegionRoute)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .greptime.v1.meta.Region region = 1;
  if (this->_internal_has_region()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::region(this),
        _Internal::region(this).GetCachedSize(), target, stream);
  }

  // uint64 leader_peer_index = 2;
  if (this->_internal_leader_peer_index() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_leader_peer_index(), target);
  }

  // repeated uint64 follower_peer_indexes = 3;
  {
    int byte_size = _impl_._follower_peer_indexes_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt64Packed(
          3, _internal_follower_peer_indexes(), byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.RegionRoute)
  return target;
}

size_t RegionRoute::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.RegionRoute)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint64 follower_peer_indexes = 3;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      UInt64Size(this->_impl_.follower_peer_indexes_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _impl_._follower_peer_indexes_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // .greptime.v1.meta.Region region = 1;
  if (this->_internal_has_region()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.region_);
  }

  // uint64 leader_peer_index = 2;
  if (this->_internal_leader_peer_index() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_leader_peer_index());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RegionRoute::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    RegionRoute::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RegionRoute::GetClassData() const { return &_class_data_; }


void RegionRoute::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<RegionRoute*>(&to_msg);
  auto& from = static_cast<const RegionRoute&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.RegionRoute)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.follower_peer_indexes_.MergeFrom(from._impl_.follower_peer_indexes_);
  if (from._internal_has_region()) {
    _this->_internal_mutable_region()->::greptime::v1::meta::Region::MergeFrom(
        from._internal_region());
  }
  if (from._internal_leader_peer_index() != 0) {
    _this->_internal_set_leader_peer_index(from._internal_leader_peer_index());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void RegionRoute::CopyFrom(const RegionRoute& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.RegionRoute)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool RegionRoute::IsInitialized() const {
  return true;
}

void RegionRoute::InternalSwap(RegionRoute* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.follower_peer_indexes_.InternalSwap(&other->_impl_.follower_peer_indexes_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(RegionRoute, _impl_.leader_peer_index_)
      + sizeof(RegionRoute::_impl_.leader_peer_index_)
      - PROTOBUF_FIELD_OFFSET(RegionRoute, _impl_.region_)>(
          reinterpret_cast<char*>(&_impl_.region_),
          reinterpret_cast<char*>(&other->_impl_.region_));
}

::PROTOBUF_NAMESPACE_ID::Metadata RegionRoute::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[1]);
}

// ===================================================================

class Table::_Internal {
 public:
  static const ::greptime::v1::TableName& table_name(const Table* msg);
};

const ::greptime::v1::TableName&
Table::_Internal::table_name(const Table* msg) {
  return *msg->_impl_.table_name_;
}
void Table::clear_table_name() {
  if (GetArenaForAllocation() == nullptr && _impl_.table_name_ != nullptr) {
    delete _impl_.table_name_;
  }
  _impl_.table_name_ = nullptr;
}
Table::Table(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.Table)
}
Table::Table(const Table& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Table* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.table_schema_){}
    , decltype(_impl_.table_name_){nullptr}
    , decltype(_impl_.id_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.table_schema_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.table_schema_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_table_schema().empty()) {
    _this->_impl_.table_schema_.Set(from._internal_table_schema(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_table_name()) {
    _this->_impl_.table_name_ = new ::greptime::v1::TableName(*from._impl_.table_name_);
  }
  _this->_impl_.id_ = from._impl_.id_;
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.Table)
}

inline void Table::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.table_schema_){}
    , decltype(_impl_.table_name_){nullptr}
    , decltype(_impl_.id_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.table_schema_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.table_schema_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Table::~Table() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.Table)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Table::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.table_schema_.Destroy();
  if (this != internal_default_instance()) delete _impl_.table_name_;
}

void Table::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Table::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.Table)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.table_schema_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && _impl_.table_name_ != nullptr) {
    delete _impl_.table_name_;
  }
  _impl_.table_name_ = nullptr;
  _impl_.id_ = uint64_t{0u};
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Table::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.TableName table_name = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_table_name(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes table_schema = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_table_schema();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Table::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.Table)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint64 id = 1;
  if (this->_internal_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target);
  }

  // .greptime.v1.TableName table_name = 2;
  if (this->_internal_has_table_name()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::table_name(this),
        _Internal::table_name(this).GetCachedSize(), target, stream);
  }

  // bytes table_schema = 3;
  if (!this->_internal_table_schema().empty()) {
    target = stream->WriteBytesMaybeAliased(
        3, this->_internal_table_schema(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.Table)
  return target;
}

size_t Table::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.Table)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // bytes table_schema = 3;
  if (!this->_internal_table_schema().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_table_schema());
  }

  // .greptime.v1.TableName table_name = 2;
  if (this->_internal_has_table_name()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.table_name_);
  }

  // uint64 id = 1;
  if (this->_internal_id() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Table::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Table::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Table::GetClassData() const { return &_class_data_; }


void Table::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Table*>(&to_msg);
  auto& from = static_cast<const Table&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.Table)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (!from._internal_table_schema().empty()) {
    _this->_internal_set_table_schema(from._internal_table_schema());
  }
  if (from._internal_has_table_name()) {
    _this->_internal_mutable_table_name()->::greptime::v1::TableName::MergeFrom(
        from._internal_table_name());
  }
  if (from._internal_id() != 0) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Table::CopyFrom(const Table& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.Table)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Table::IsInitialized() const {
  return true;
}

void Table::InternalSwap(Table* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.table_schema_, lhs_arena,
      &other->_impl_.table_schema_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Table, _impl_.id_)
      + sizeof(Table::_impl_.id_)
      - PROTOBUF_FIELD_OFFSET(Table, _impl_.table_name_)>(
          reinterpret_cast<char*>(&_impl_.table_name_),
          reinterpret_cast<char*>(&other->_impl_.table_name_));
}

::PROTOBUF_NAMESPACE_ID::Metadata Table::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[2]);
}

// ===================================================================

Region_AttrsEntry_DoNotUse::Region_AttrsEntry_DoNotUse() {}
Region_AttrsEntry_DoNotUse::Region_AttrsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void Region_AttrsEntry_DoNotUse::MergeFrom(const Region_AttrsEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata Region_AttrsEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[3]);
}

// ===================================================================

class Region::_Internal {
 public:
  static const ::greptime::v1::meta::Partition& partition(const Region* msg);
};

const ::greptime::v1::meta::Partition&
Region::_Internal::partition(const Region* msg) {
  return *msg->_impl_.partition_;
}
Region::Region(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  if (arena != nullptr && !is_message_owned) {
    arena->OwnCustomDestructor(this, &Region::ArenaDtor);
  }
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.Region)
}
Region::Region(const Region& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Region* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_.attrs_)*/{}
    , decltype(_impl_.name_){}
    , decltype(_impl_.partition_){nullptr}
    , decltype(_impl_.id_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.attrs_.MergeFrom(from._impl_.attrs_);
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_name().empty()) {
    _this->_impl_.name_.Set(from._internal_name(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_partition()) {
    _this->_impl_.partition_ = new ::greptime::v1::meta::Partition(*from._impl_.partition_);
  }
  _this->_impl_.id_ = from._impl_.id_;
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.Region)
}

inline void Region::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.attrs_)*/{::_pbi::ArenaInitialized(), arena}
    , decltype(_impl_.name_){}
    , decltype(_impl_.partition_){nullptr}
    , decltype(_impl_.id_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Region::~Region() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.Region)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    ArenaDtor(this);
    return;
  }
  SharedDtor();
}

inline void Region::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.attrs_.Destruct();
  _impl_.attrs_.~MapField();
  _impl_.name_.Destroy();
  if (this != internal_default_instance()) delete _impl_.partition_;
}

void Region::ArenaDtor(void* object) {
  Region* _this = reinterpret_cast< Region* >(object);
  _this->_impl_.attrs_.Destruct();
}
void Region::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Region::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.Region)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.attrs_.Clear();
  _impl_.name_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && _impl_.partition_ != nullptr) {
    delete _impl_.partition_;
  }
  _impl_.partition_ = nullptr;
  _impl_.id_ = uint64_t{0u};
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Region::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string name = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.Region.name"));
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.Partition partition = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_partition(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // map<string, string> attrs = 100;
      case 100:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(&_impl_.attrs_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<802>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Region::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.Region)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint64 id = 1;
  if (this->_internal_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target);
  }

  // string name = 2;
  if (!this->_internal_name().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "greptime.v1.meta.Region.name");
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_name(), target);
  }

  // .greptime.v1.meta.Partition partition = 3;
  if (this->_internal_has_partition()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::partition(this),
        _Internal::partition(this).GetCachedSize(), target, stream);
  }

  // map<string, string> attrs = 100;
  if (!this->_internal_attrs().empty()) {
    using MapType = ::_pb::Map<std::string, std::string>;
    using WireHelper = Region_AttrsEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_attrs();
    auto check_utf8 = [](const MapType::value_type& entry) {
      (void)entry;
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        entry.first.data(), static_cast<int>(entry.first.length()),
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
        "greptime.v1.meta.Region.AttrsEntry.key");
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
        entry.second.data(), static_cast<int>(entry.second.length()),
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
        "greptime.v1.meta.Region.AttrsEntry.value");
    };

    if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
      for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
        target = WireHelper::InternalSerialize(100, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    } else {
      for (const auto& entry : map_field) {
        target = WireHelper::InternalSerialize(100, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.Region)
  return target;
}

size_t Region::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.Region)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // map<string, string> attrs = 100;
  total_size += 2 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attrs_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
      it = this->_internal_attrs().begin();
      it != this->_internal_attrs().end(); ++it) {
    total_size += Region_AttrsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // string name = 2;
  if (!this->_internal_name().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }

  // .greptime.v1.meta.Partition partition = 3;
  if (this->_internal_has_partition()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.partition_);
  }

  // uint64 id = 1;
  if (this->_internal_id() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Region::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Region::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Region::GetClassData() const { return &_class_data_; }


void Region::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Region*>(&to_msg);
  auto& from = static_cast<const Region&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.Region)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.attrs_.MergeFrom(from._impl_.attrs_);
  if (!from._internal_name().empty()) {
    _this->_internal_set_name(from._internal_name());
  }
  if (from._internal_has_partition()) {
    _this->_internal_mutable_partition()->::greptime::v1::meta::Partition::MergeFrom(
        from._internal_partition());
  }
  if (from._internal_id() != 0) {
    _this->_internal_set_id(from._internal_id());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Region::CopyFrom(const Region& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.Region)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Region::IsInitialized() const {
  return true;
}

void Region::InternalSwap(Region* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.attrs_.InternalSwap(&other->_impl_.attrs_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.name_, lhs_arena,
      &other->_impl_.name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Region, _impl_.id_)
      + sizeof(Region::_impl_.id_)
      - PROTOBUF_FIELD_OFFSET(Region, _impl_.partition_)>(
          reinterpret_cast<char*>(&_impl_.partition_),
          reinterpret_cast<char*>(&other->_impl_.partition_));
}

::PROTOBUF_NAMESPACE_ID::Metadata Region::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[4]);
}

// ===================================================================

class Partition::_Internal {
 public:
};

Partition::Partition(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.Partition)
}
Partition::Partition(const Partition& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Partition* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.column_list_){from._impl_.column_list_}
    , decltype(_impl_.value_list_){from._impl_.value_list_}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.Partition)
}

inline void Partition::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.column_list_){arena}
    , decltype(_impl_.value_list_){arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

Partition::~Partition() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.Partition)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Partition::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.column_list_.~RepeatedPtrField();
  _impl_.value_list_.~RepeatedPtrField();
}

void Partition::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Partition::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.Partition)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.column_list_.Clear();
  _impl_.value_list_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Partition::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated bytes column_list = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_column_list();
            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated bytes value_list = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_value_list();
            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Partition::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.Partition)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated bytes column_list = 1;
  for (int i = 0, n = this->_internal_column_list_size(); i < n; i++) {
    const auto& s = this->_internal_column_list(i);
    target = stream->WriteBytes(1, s, target);
  }

  // repeated bytes value_list = 2;
  for (int i = 0, n = this->_internal_value_list_size(); i < n; i++) {
    const auto& s = this->_internal_value_list(i);
    target = stream->WriteBytes(2, s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.Partition)
  return target;
}

size_t Partition::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.Partition)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated bytes column_list = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.column_list_.size());
  for (int i = 0, n = _impl_.column_list_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
      _impl_.column_list_.Get(i));
  }

  // repeated bytes value_list = 2;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.value_list_.size());
  for (int i = 0, n = _impl_.value_list_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
      _impl_.value_list_.Get(i));
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Partition::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Partition::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Partition::GetClassData() const { return &_class_data_; }


void Partition::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Partition*>(&to_msg);
  auto& from = static_cast<const Partition&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.Partition)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.column_list_.MergeFrom(from._impl_.column_list_);
  _this->_impl_.value_list_.MergeFrom(from._impl_.value_list_);
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Partition::CopyFrom(const Partition& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.Partition)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Partition::IsInitialized() const {
  return true;
}

void Partition::InternalSwap(Partition* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.column_list_.InternalSwap(&other->_impl_.column_list_);
  _impl_.value_list_.InternalSwap(&other->_impl_.value_list_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Partition::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[5]);
}

// ===================================================================

class TableRouteValue::_Internal {
 public:
  static const ::greptime::v1::meta::TableRoute& table_route(const TableRouteValue* msg);
};

const ::greptime::v1::meta::TableRoute&
TableRouteValue::_Internal::table_route(const TableRouteValue* msg) {
  return *msg->_impl_.table_route_;
}
void TableRouteValue::clear_peers() {
  _impl_.peers_.Clear();
}
TableRouteValue::TableRouteValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.TableRouteValue)
}
TableRouteValue::TableRouteValue(const TableRouteValue& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  TableRouteValue* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.peers_){from._impl_.peers_}
    , decltype(_impl_.table_route_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_table_route()) {
    _this->_impl_.table_route_ = new ::greptime::v1::meta::TableRoute(*from._impl_.table_route_);
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.TableRouteValue)
}

inline void TableRouteValue::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.peers_){arena}
    , decltype(_impl_.table_route_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

TableRouteValue::~TableRouteValue() {
  // @@protoc_insertion_point(destructor:greptime.v1.meta.TableRouteValue)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void TableRouteValue::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.peers_.~RepeatedPtrField();
  if (this != internal_default_instance()) delete _impl_.table_route_;
}

void TableRouteValue::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void TableRouteValue::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.TableRouteValue)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_.peers_.Clear();
  if (GetArenaForAllocation() == nullptr && _impl_.table_route_ != nullptr) {
    delete _impl_.table_route_;
  }
  _impl_.table_route_ = nullptr;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TableRouteValue::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .greptime.v1.meta.Peer peers = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_peers(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.TableRoute table_route = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_table_route(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* TableRouteValue::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.TableRouteValue)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .greptime.v1.meta.Peer peers = 1;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_peers_size()); i < n; i++) {
    const auto& repfield = this->_internal_peers(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.TableRoute table_route = 2;
  if (this->_internal_has_table_route()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::table_route(this),
        _Internal::table_route(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.TableRouteValue)
  return target;
}

size_t TableRouteValue::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.TableRouteValue)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .greptime.v1.meta.Peer peers = 1;
  total_size += 1UL * this->_internal_peers_size();
  for (const auto& msg : this->_impl_.peers_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // .greptime.v1.meta.TableRoute table_route = 2;
  if (this->_internal_has_table_route()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.table_route_);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TableRouteValue::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    TableRouteValue::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TableRouteValue::GetClassData() const { return &_class_data_; }


void TableRouteValue::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<TableRouteValue*>(&to_msg);
  auto& from = static_cast<const TableRouteValue&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.TableRouteValue)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  _this->_impl_.peers_.MergeFrom(from._impl_.peers_);
  if (from._internal_has_table_route()) {
    _this->_internal_mutable_table_route()->::greptime::v1::meta::TableRoute::MergeFrom(
        from._internal_table_route());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void TableRouteValue::CopyFrom(const TableRouteValue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.TableRouteValue)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TableRouteValue::IsInitialized() const {
  return true;
}

void TableRouteValue::InternalSwap(TableRouteValue* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.peers_.InternalSwap(&other->_impl_.peers_);
  swap(_impl_.table_route_, other->_impl_.table_route_);
}

::PROTOBUF_NAMESPACE_ID::Metadata TableRouteValue::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2froute_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2froute_2eproto[6]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace meta
}  // namespace v1
}  // namespace greptime
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::TableRoute*
Arena::CreateMaybeMessage< ::greptime::v1::meta::TableRoute >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::TableRoute >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionRoute*
Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionRoute >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionRoute >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::Table*
Arena::CreateMaybeMessage< ::greptime::v1::meta::Table >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::Table >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::Region_AttrsEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::Region_AttrsEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::Region_AttrsEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::Region*
Arena::CreateMaybeMessage< ::greptime::v1::meta::Region >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::Region >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::Partition*
Arena::CreateMaybeMessage< ::greptime::v1::meta::Partition >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::Partition >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::TableRouteValue*
Arena::CreateMaybeMessage< ::greptime::v1::meta::TableRouteValue >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::TableRouteValue >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
