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

#include "greptime/v1/meta/heartbeat.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 HeartbeatRequest::HeartbeatRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.region_stats_)*/{}
  , /*decltype(_impl_.header_)*/nullptr
  , /*decltype(_impl_.peer_)*/nullptr
  , /*decltype(_impl_.report_interval_)*/nullptr
  , /*decltype(_impl_.mailbox_message_)*/nullptr
  , /*decltype(_impl_.info_)*/nullptr
  , /*decltype(_impl_.flow_stat_)*/nullptr
  , /*decltype(_impl_.duration_since_epoch_)*/uint64_t{0u}
  , /*decltype(_impl_.node_epoch_)*/uint64_t{0u}
  , /*decltype(_impl_.node_workloads_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct HeartbeatRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR HeartbeatRequestDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~HeartbeatRequestDefaultTypeInternal() {}
  union {
    HeartbeatRequest _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeartbeatRequestDefaultTypeInternal _HeartbeatRequest_default_instance_;
PROTOBUF_CONSTEXPR DatanodeWorkloads::DatanodeWorkloads(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.types_)*/{}
  , /*decltype(_impl_._types_cached_byte_size_)*/{0}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct DatanodeWorkloadsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR DatanodeWorkloadsDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~DatanodeWorkloadsDefaultTypeInternal() {}
  union {
    DatanodeWorkloads _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DatanodeWorkloadsDefaultTypeInternal _DatanodeWorkloads_default_instance_;
PROTOBUF_CONSTEXPR FrontendWorkloads::FrontendWorkloads(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.types_)*/{}
  , /*decltype(_impl_._types_cached_byte_size_)*/{0}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct FrontendWorkloadsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FrontendWorkloadsDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FrontendWorkloadsDefaultTypeInternal() {}
  union {
    FrontendWorkloads _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FrontendWorkloadsDefaultTypeInternal _FrontendWorkloads_default_instance_;
PROTOBUF_CONSTEXPR FlownodeWorkloads::FlownodeWorkloads(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.types_)*/{}
  , /*decltype(_impl_._types_cached_byte_size_)*/{0}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct FlownodeWorkloadsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FlownodeWorkloadsDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FlownodeWorkloadsDefaultTypeInternal() {}
  union {
    FlownodeWorkloads _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlownodeWorkloadsDefaultTypeInternal _FlownodeWorkloads_default_instance_;
PROTOBUF_CONSTEXPR NodeInfo::NodeInfo(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.git_commit_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.start_time_ms_)*/uint64_t{0u}
  , /*decltype(_impl_.cpus_)*/0u
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct NodeInfoDefaultTypeInternal {
  PROTOBUF_CONSTEXPR NodeInfoDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~NodeInfoDefaultTypeInternal() {}
  union {
    NodeInfo _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NodeInfoDefaultTypeInternal _NodeInfo_default_instance_;
PROTOBUF_CONSTEXPR RegionStat_ExtensionsEntry_DoNotUse::RegionStat_ExtensionsEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct RegionStat_ExtensionsEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegionStat_ExtensionsEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegionStat_ExtensionsEntry_DoNotUseDefaultTypeInternal() {}
  union {
    RegionStat_ExtensionsEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionStat_ExtensionsEntry_DoNotUseDefaultTypeInternal _RegionStat_ExtensionsEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR RegionStat::RegionStat(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.extensions_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_.engine_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.region_id_)*/uint64_t{0u}
  , /*decltype(_impl_.rcus_)*/int64_t{0}
  , /*decltype(_impl_.wcus_)*/int64_t{0}
  , /*decltype(_impl_.approximate_bytes_)*/int64_t{0}
  , /*decltype(_impl_.role_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct RegionStatDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegionStatDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegionStatDefaultTypeInternal() {}
  union {
    RegionStat _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionStatDefaultTypeInternal _RegionStat_default_instance_;
PROTOBUF_CONSTEXPR FlowStat_FlowStatSizeEntry_DoNotUse::FlowStat_FlowStatSizeEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct FlowStat_FlowStatSizeEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FlowStat_FlowStatSizeEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FlowStat_FlowStatSizeEntry_DoNotUseDefaultTypeInternal() {}
  union {
    FlowStat_FlowStatSizeEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlowStat_FlowStatSizeEntry_DoNotUseDefaultTypeInternal _FlowStat_FlowStatSizeEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR FlowStat_FlowLastExecTimeMapEntry_DoNotUse::FlowStat_FlowLastExecTimeMapEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct FlowStat_FlowLastExecTimeMapEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FlowStat_FlowLastExecTimeMapEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FlowStat_FlowLastExecTimeMapEntry_DoNotUseDefaultTypeInternal() {}
  union {
    FlowStat_FlowLastExecTimeMapEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlowStat_FlowLastExecTimeMapEntry_DoNotUseDefaultTypeInternal _FlowStat_FlowLastExecTimeMapEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR FlowStat::FlowStat(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.flow_stat_size_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_.flow_last_exec_time_map_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct FlowStatDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FlowStatDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FlowStatDefaultTypeInternal() {}
  union {
    FlowStat _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlowStatDefaultTypeInternal _FlowStat_default_instance_;
PROTOBUF_CONSTEXPR HeartbeatResponse::HeartbeatResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.header_)*/nullptr
  , /*decltype(_impl_.mailbox_message_)*/nullptr
  , /*decltype(_impl_.region_lease_)*/nullptr
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct HeartbeatResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR HeartbeatResponseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~HeartbeatResponseDefaultTypeInternal() {}
  union {
    HeartbeatResponse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeartbeatResponseDefaultTypeInternal _HeartbeatResponse_default_instance_;
PROTOBUF_CONSTEXPR GrantedRegion_ExtensionsEntry_DoNotUse::GrantedRegion_ExtensionsEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct GrantedRegion_ExtensionsEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GrantedRegion_ExtensionsEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~GrantedRegion_ExtensionsEntry_DoNotUseDefaultTypeInternal() {}
  union {
    GrantedRegion_ExtensionsEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GrantedRegion_ExtensionsEntry_DoNotUseDefaultTypeInternal _GrantedRegion_ExtensionsEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR GrantedRegion::GrantedRegion(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.extensions_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_.region_id_)*/uint64_t{0u}
  , /*decltype(_impl_.role_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct GrantedRegionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GrantedRegionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~GrantedRegionDefaultTypeInternal() {}
  union {
    GrantedRegion _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GrantedRegionDefaultTypeInternal _GrantedRegion_default_instance_;
PROTOBUF_CONSTEXPR RegionLease::RegionLease(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.regions_)*/{}
  , /*decltype(_impl_.closeable_region_ids_)*/{}
  , /*decltype(_impl_._closeable_region_ids_cached_byte_size_)*/{0}
  , /*decltype(_impl_.duration_since_epoch_)*/uint64_t{0u}
  , /*decltype(_impl_.lease_seconds_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct RegionLeaseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegionLeaseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegionLeaseDefaultTypeInternal() {}
  union {
    RegionLease _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionLeaseDefaultTypeInternal _RegionLease_default_instance_;
PROTOBUF_CONSTEXPR AskLeaderRequest::AskLeaderRequest(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.header_)*/nullptr
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct AskLeaderRequestDefaultTypeInternal {
  PROTOBUF_CONSTEXPR AskLeaderRequestDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~AskLeaderRequestDefaultTypeInternal() {}
  union {
    AskLeaderRequest _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AskLeaderRequestDefaultTypeInternal _AskLeaderRequest_default_instance_;
PROTOBUF_CONSTEXPR AskLeaderResponse::AskLeaderResponse(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.header_)*/nullptr
  , /*decltype(_impl_.leader_)*/nullptr
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct AskLeaderResponseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR AskLeaderResponseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~AskLeaderResponseDefaultTypeInternal() {}
  union {
    AskLeaderResponse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AskLeaderResponseDefaultTypeInternal _AskLeaderResponse_default_instance_;
PROTOBUF_CONSTEXPR MailboxMessage::MailboxMessage(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.subject_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.from_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.to_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.id_)*/uint64_t{0u}
  , /*decltype(_impl_.timestamp_millis_)*/int64_t{0}
  , /*decltype(_impl_.payload_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct MailboxMessageDefaultTypeInternal {
  PROTOBUF_CONSTEXPR MailboxMessageDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~MailboxMessageDefaultTypeInternal() {}
  union {
    MailboxMessage _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MailboxMessageDefaultTypeInternal _MailboxMessage_default_instance_;
}  // namespace meta
}  // namespace v1
}  // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[17];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto = nullptr;

const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.header_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.peer_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.report_interval_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.region_stats_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.mailbox_message_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.duration_since_epoch_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.node_epoch_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.info_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.flow_stat_),
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.node_workloads_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::DatanodeWorkloads, _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::DatanodeWorkloads, _impl_.types_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FrontendWorkloads, _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::FrontendWorkloads, _impl_.types_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlownodeWorkloads, _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::FlownodeWorkloads, _impl_.types_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::NodeInfo, _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::NodeInfo, _impl_.version_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::NodeInfo, _impl_.git_commit_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::NodeInfo, _impl_.start_time_ms_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::NodeInfo, _impl_.cpus_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat_ExtensionsEntry_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::RegionStat_ExtensionsEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _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::RegionStat, _impl_.region_id_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.rcus_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.wcus_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.approximate_bytes_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.engine_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.role_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.extensions_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowStatSizeEntry_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::FlowStat_FlowStatSizeEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse, value_),
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_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::FlowStat_FlowLastExecTimeMapEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat, _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::FlowStat, _impl_.flow_stat_size_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::FlowStat, _impl_.flow_last_exec_time_map_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _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::HeartbeatResponse, _impl_.header_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _impl_.mailbox_message_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _impl_.region_lease_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion_ExtensionsEntry_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::GrantedRegion_ExtensionsEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _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::GrantedRegion, _impl_.region_id_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _impl_.role_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _impl_.extensions_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _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::RegionLease, _impl_.regions_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.duration_since_epoch_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.lease_seconds_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.closeable_region_ids_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::AskLeaderRequest, _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::AskLeaderRequest, _impl_.header_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::AskLeaderResponse, _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::AskLeaderResponse, _impl_.header_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::AskLeaderResponse, _impl_.leader_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.id_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.subject_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.from_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.to_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.timestamp_millis_),
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.payload_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::greptime::v1::meta::HeartbeatRequest)},
  { 19, -1, -1, sizeof(::greptime::v1::meta::DatanodeWorkloads)},
  { 26, -1, -1, sizeof(::greptime::v1::meta::FrontendWorkloads)},
  { 33, -1, -1, sizeof(::greptime::v1::meta::FlownodeWorkloads)},
  { 40, -1, -1, sizeof(::greptime::v1::meta::NodeInfo)},
  { 50, 58, -1, sizeof(::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse)},
  { 60, -1, -1, sizeof(::greptime::v1::meta::RegionStat)},
  { 73, 81, -1, sizeof(::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse)},
  { 83, 91, -1, sizeof(::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse)},
  { 93, -1, -1, sizeof(::greptime::v1::meta::FlowStat)},
  { 101, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)},
  { 110, 118, -1, sizeof(::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse)},
  { 120, -1, -1, sizeof(::greptime::v1::meta::GrantedRegion)},
  { 129, -1, -1, sizeof(::greptime::v1::meta::RegionLease)},
  { 139, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)},
  { 146, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)},
  { 154, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::greptime::v1::meta::_HeartbeatRequest_default_instance_._instance,
  &::greptime::v1::meta::_DatanodeWorkloads_default_instance_._instance,
  &::greptime::v1::meta::_FrontendWorkloads_default_instance_._instance,
  &::greptime::v1::meta::_FlownodeWorkloads_default_instance_._instance,
  &::greptime::v1::meta::_NodeInfo_default_instance_._instance,
  &::greptime::v1::meta::_RegionStat_ExtensionsEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::meta::_RegionStat_default_instance_._instance,
  &::greptime::v1::meta::_FlowStat_FlowStatSizeEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::meta::_FlowStat_FlowLastExecTimeMapEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::meta::_FlowStat_default_instance_._instance,
  &::greptime::v1::meta::_HeartbeatResponse_default_instance_._instance,
  &::greptime::v1::meta::_GrantedRegion_ExtensionsEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::meta::_GrantedRegion_default_instance_._instance,
  &::greptime::v1::meta::_RegionLease_default_instance_._instance,
  &::greptime::v1::meta::_AskLeaderRequest_default_instance_._instance,
  &::greptime::v1::meta::_AskLeaderResponse_default_instance_._instance,
  &::greptime::v1::meta::_MailboxMessage_default_instance_._instance,
};

const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n greptime/v1/meta/heartbeat.proto\022\020grep"
  "time.v1.meta\032\035greptime/v1/meta/common.pr"
  "oto\"\331\004\n\020HeartbeatRequest\022/\n\006header\030\001 \001(\013"
  "2\037.greptime.v1.meta.RequestHeader\022$\n\004pee"
  "r\030\002 \001(\0132\026.greptime.v1.meta.Peer\0227\n\017repor"
  "t_interval\030\003 \001(\0132\036.greptime.v1.meta.Time"
  "Interval\0222\n\014region_stats\030\004 \003(\0132\034.greptim"
  "e.v1.meta.RegionStat\0229\n\017mailbox_message\030"
  "\005 \001(\0132 .greptime.v1.meta.MailboxMessage\022"
  "\034\n\024duration_since_epoch\030\006 \001(\004\022\022\n\nnode_ep"
  "och\030\007 \001(\004\022(\n\004info\030\010 \001(\0132\032.greptime.v1.me"
  "ta.NodeInfo\022-\n\tflow_stat\030\t \001(\0132\032.greptim"
  "e.v1.meta.FlowStat\0227\n\010datanode\030\n \001(\0132#.g"
  "reptime.v1.meta.DatanodeWorkloadsH\000\0227\n\010f"
  "rontend\030\013 \001(\0132#.greptime.v1.meta.Fronten"
  "dWorkloadsH\000\0227\n\010flownode\030\014 \001(\0132#.greptim"
  "e.v1.meta.FlownodeWorkloadsH\000B\020\n\016node_wo"
  "rkloads\"\"\n\021DatanodeWorkloads\022\r\n\005types\030\001 "
  "\003(\005\"\"\n\021FrontendWorkloads\022\r\n\005types\030\001 \003(\005\""
  "\"\n\021FlownodeWorkloads\022\r\n\005types\030\001 \003(\005\"T\n\010N"
  "odeInfo\022\017\n\007version\030\001 \001(\t\022\022\n\ngit_commit\030\002"
  " \001(\t\022\025\n\rstart_time_ms\030\003 \001(\004\022\014\n\004cpus\030\004 \001("
  "\r\"\207\002\n\nRegionStat\022\021\n\tregion_id\030\001 \001(\004\022\014\n\004r"
  "cus\030\002 \001(\003\022\014\n\004wcus\030\003 \001(\003\022\031\n\021approximate_b"
  "ytes\030\004 \001(\003\022\016\n\006engine\030\006 \001(\t\022*\n\004role\030\007 \001(\016"
  "2\034.greptime.v1.meta.RegionRole\022@\n\nextens"
  "ions\030c \003(\0132,.greptime.v1.meta.RegionStat"
  ".ExtensionsEntry\0321\n\017ExtensionsEntry\022\013\n\003k"
  "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\227\002\n\010FlowStat"
  "\022D\n\016flow_stat_size\030\001 \003(\0132,.greptime.v1.m"
  "eta.FlowStat.FlowStatSizeEntry\022T\n\027flow_l"
  "ast_exec_time_map\030\002 \003(\01323.greptime.v1.me"
  "ta.FlowStat.FlowLastExecTimeMapEntry\0323\n\021"
  "FlowStatSizeEntry\022\013\n\003key\030\001 \001(\r\022\r\n\005value\030"
  "\002 \001(\004:\0028\001\032:\n\030FlowLastExecTimeMapEntry\022\013\n"
  "\003key\030\001 \001(\r\022\r\n\005value\030\002 \001(\003:\0028\001\"\265\001\n\021Heartb"
  "eatResponse\0220\n\006header\030\001 \001(\0132 .greptime.v"
  "1.meta.ResponseHeader\0229\n\017mailbox_message"
  "\030\002 \001(\0132 .greptime.v1.meta.MailboxMessage"
  "\0223\n\014region_lease\030\003 \001(\0132\035.greptime.v1.met"
  "a.RegionLease\"\306\001\n\rGrantedRegion\022\021\n\tregio"
  "n_id\030\001 \001(\004\022*\n\004role\030\002 \001(\0162\034.greptime.v1.m"
  "eta.RegionRole\022C\n\nextensions\030c \003(\0132/.gre"
  "ptime.v1.meta.GrantedRegion.ExtensionsEn"
  "try\0321\n\017ExtensionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v"
  "alue\030\002 \001(\014:\0028\001\"\222\001\n\013RegionLease\0220\n\007region"
  "s\030\001 \003(\0132\037.greptime.v1.meta.GrantedRegion"
  "\022\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlease_"
  "seconds\030\003 \001(\004\022\034\n\024closeable_region_ids\030\004 "
  "\003(\004\"C\n\020AskLeaderRequest\022/\n\006header\030\001 \001(\0132"
  "\037.greptime.v1.meta.RequestHeader\"m\n\021AskL"
  "eaderResponse\0220\n\006header\030\001 \001(\0132 .greptime"
  ".v1.meta.ResponseHeader\022&\n\006leader\030\002 \001(\0132"
  "\026.greptime.v1.meta.Peer\"|\n\016MailboxMessag"
  "e\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030\002 \001(\t\022\014\n\004from\030\003"
  " \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020timestamp_millis\030\005 \001"
  "(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload*=\n\nRegionR"
  "ole\022\n\n\006Leader\020\000\022\014\n\010Follower\020\001\022\025\n\021Downgra"
  "dingLeader\020\0022\277\001\n\tHeartbeat\022Z\n\tHeartbeat\022"
  "\".greptime.v1.meta.HeartbeatRequest\032#.gr"
  "eptime.v1.meta.HeartbeatResponse\"\000(\0010\001\022V"
  "\n\tAskLeader\022\".greptime.v1.meta.AskLeader"
  "Request\032#.greptime.v1.meta.AskLeaderResp"
  "onse\"\000B<Z:github.com/GreptimeTeam/grepti"
  "me-proto/go/greptime/v1/metab\006proto3"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_deps[1] = {
  &::descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto = {
    false, false, 2596, descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
    "greptime/v1/meta/heartbeat.proto",
    &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_deps, 1, 17,
    schemas, file_default_instances, TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets,
    file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto, file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
    file_level_service_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter() {
  return &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_greptime_2fv1_2fmeta_2fheartbeat_2eproto(&descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto);
namespace greptime {
namespace v1 {
namespace meta {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RegionRole_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto);
  return file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[0];
}
bool RegionRole_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}


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

class HeartbeatRequest::_Internal {
 public:
  static const ::greptime::v1::meta::RequestHeader& header(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::Peer& peer(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::TimeInterval& report_interval(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::MailboxMessage& mailbox_message(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::NodeInfo& info(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::FlowStat& flow_stat(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::DatanodeWorkloads& datanode(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::FrontendWorkloads& frontend(const HeartbeatRequest* msg);
  static const ::greptime::v1::meta::FlownodeWorkloads& flownode(const HeartbeatRequest* msg);
};

const ::greptime::v1::meta::RequestHeader&
HeartbeatRequest::_Internal::header(const HeartbeatRequest* msg) {
  return *msg->_impl_.header_;
}
const ::greptime::v1::meta::Peer&
HeartbeatRequest::_Internal::peer(const HeartbeatRequest* msg) {
  return *msg->_impl_.peer_;
}
const ::greptime::v1::meta::TimeInterval&
HeartbeatRequest::_Internal::report_interval(const HeartbeatRequest* msg) {
  return *msg->_impl_.report_interval_;
}
const ::greptime::v1::meta::MailboxMessage&
HeartbeatRequest::_Internal::mailbox_message(const HeartbeatRequest* msg) {
  return *msg->_impl_.mailbox_message_;
}
const ::greptime::v1::meta::NodeInfo&
HeartbeatRequest::_Internal::info(const HeartbeatRequest* msg) {
  return *msg->_impl_.info_;
}
const ::greptime::v1::meta::FlowStat&
HeartbeatRequest::_Internal::flow_stat(const HeartbeatRequest* msg) {
  return *msg->_impl_.flow_stat_;
}
const ::greptime::v1::meta::DatanodeWorkloads&
HeartbeatRequest::_Internal::datanode(const HeartbeatRequest* msg) {
  return *msg->_impl_.node_workloads_.datanode_;
}
const ::greptime::v1::meta::FrontendWorkloads&
HeartbeatRequest::_Internal::frontend(const HeartbeatRequest* msg) {
  return *msg->_impl_.node_workloads_.frontend_;
}
const ::greptime::v1::meta::FlownodeWorkloads&
HeartbeatRequest::_Internal::flownode(const HeartbeatRequest* msg) {
  return *msg->_impl_.node_workloads_.flownode_;
}
void HeartbeatRequest::clear_header() {
  if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) {
    delete _impl_.header_;
  }
  _impl_.header_ = nullptr;
}
void HeartbeatRequest::clear_peer() {
  if (GetArenaForAllocation() == nullptr && _impl_.peer_ != nullptr) {
    delete _impl_.peer_;
  }
  _impl_.peer_ = nullptr;
}
void HeartbeatRequest::clear_report_interval() {
  if (GetArenaForAllocation() == nullptr && _impl_.report_interval_ != nullptr) {
    delete _impl_.report_interval_;
  }
  _impl_.report_interval_ = nullptr;
}
void HeartbeatRequest::set_allocated_datanode(::greptime::v1::meta::DatanodeWorkloads* datanode) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_node_workloads();
  if (datanode) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(datanode);
    if (message_arena != submessage_arena) {
      datanode = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, datanode, submessage_arena);
    }
    set_has_datanode();
    _impl_.node_workloads_.datanode_ = datanode;
  }
  // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.HeartbeatRequest.datanode)
}
void HeartbeatRequest::set_allocated_frontend(::greptime::v1::meta::FrontendWorkloads* frontend) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_node_workloads();
  if (frontend) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(frontend);
    if (message_arena != submessage_arena) {
      frontend = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, frontend, submessage_arena);
    }
    set_has_frontend();
    _impl_.node_workloads_.frontend_ = frontend;
  }
  // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.HeartbeatRequest.frontend)
}
void HeartbeatRequest::set_allocated_flownode(::greptime::v1::meta::FlownodeWorkloads* flownode) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_node_workloads();
  if (flownode) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(flownode);
    if (message_arena != submessage_arena) {
      flownode = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, flownode, submessage_arena);
    }
    set_has_flownode();
    _impl_.node_workloads_.flownode_ = flownode;
  }
  // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.HeartbeatRequest.flownode)
}
HeartbeatRequest::HeartbeatRequest(::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.HeartbeatRequest)
}
HeartbeatRequest::HeartbeatRequest(const HeartbeatRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  HeartbeatRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.region_stats_){from._impl_.region_stats_}
    , decltype(_impl_.header_){nullptr}
    , decltype(_impl_.peer_){nullptr}
    , decltype(_impl_.report_interval_){nullptr}
    , decltype(_impl_.mailbox_message_){nullptr}
    , decltype(_impl_.info_){nullptr}
    , decltype(_impl_.flow_stat_){nullptr}
    , decltype(_impl_.duration_since_epoch_){}
    , decltype(_impl_.node_epoch_){}
    , decltype(_impl_.node_workloads_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_header()) {
    _this->_impl_.header_ = new ::greptime::v1::meta::RequestHeader(*from._impl_.header_);
  }
  if (from._internal_has_peer()) {
    _this->_impl_.peer_ = new ::greptime::v1::meta::Peer(*from._impl_.peer_);
  }
  if (from._internal_has_report_interval()) {
    _this->_impl_.report_interval_ = new ::greptime::v1::meta::TimeInterval(*from._impl_.report_interval_);
  }
  if (from._internal_has_mailbox_message()) {
    _this->_impl_.mailbox_message_ = new ::greptime::v1::meta::MailboxMessage(*from._impl_.mailbox_message_);
  }
  if (from._internal_has_info()) {
    _this->_impl_.info_ = new ::greptime::v1::meta::NodeInfo(*from._impl_.info_);
  }
  if (from._internal_has_flow_stat()) {
    _this->_impl_.flow_stat_ = new ::greptime::v1::meta::FlowStat(*from._impl_.flow_stat_);
  }
  ::memcpy(&_impl_.duration_since_epoch_, &from._impl_.duration_since_epoch_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.node_epoch_) -
    reinterpret_cast<char*>(&_impl_.duration_since_epoch_)) + sizeof(_impl_.node_epoch_));
  clear_has_node_workloads();
  switch (from.node_workloads_case()) {
    case kDatanode: {
      _this->_internal_mutable_datanode()->::greptime::v1::meta::DatanodeWorkloads::MergeFrom(
          from._internal_datanode());
      break;
    }
    case kFrontend: {
      _this->_internal_mutable_frontend()->::greptime::v1::meta::FrontendWorkloads::MergeFrom(
          from._internal_frontend());
      break;
    }
    case kFlownode: {
      _this->_internal_mutable_flownode()->::greptime::v1::meta::FlownodeWorkloads::MergeFrom(
          from._internal_flownode());
      break;
    }
    case NODE_WORKLOADS_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.HeartbeatRequest)
}

inline void HeartbeatRequest::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.region_stats_){arena}
    , decltype(_impl_.header_){nullptr}
    , decltype(_impl_.peer_){nullptr}
    , decltype(_impl_.report_interval_){nullptr}
    , decltype(_impl_.mailbox_message_){nullptr}
    , decltype(_impl_.info_){nullptr}
    , decltype(_impl_.flow_stat_){nullptr}
    , decltype(_impl_.duration_since_epoch_){uint64_t{0u}}
    , decltype(_impl_.node_epoch_){uint64_t{0u}}
    , decltype(_impl_.node_workloads_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_node_workloads();
}

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

inline void HeartbeatRequest::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.region_stats_.~RepeatedPtrField();
  if (this != internal_default_instance()) delete _impl_.header_;
  if (this != internal_default_instance()) delete _impl_.peer_;
  if (this != internal_default_instance()) delete _impl_.report_interval_;
  if (this != internal_default_instance()) delete _impl_.mailbox_message_;
  if (this != internal_default_instance()) delete _impl_.info_;
  if (this != internal_default_instance()) delete _impl_.flow_stat_;
  if (has_node_workloads()) {
    clear_node_workloads();
  }
}

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

void HeartbeatRequest::clear_node_workloads() {
// @@protoc_insertion_point(one_of_clear_start:greptime.v1.meta.HeartbeatRequest)
  switch (node_workloads_case()) {
    case kDatanode: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.node_workloads_.datanode_;
      }
      break;
    }
    case kFrontend: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.node_workloads_.frontend_;
      }
      break;
    }
    case kFlownode: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.node_workloads_.flownode_;
      }
      break;
    }
    case NODE_WORKLOADS_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = NODE_WORKLOADS_NOT_SET;
}


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

  _impl_.region_stats_.Clear();
  if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) {
    delete _impl_.header_;
  }
  _impl_.header_ = nullptr;
  if (GetArenaForAllocation() == nullptr && _impl_.peer_ != nullptr) {
    delete _impl_.peer_;
  }
  _impl_.peer_ = nullptr;
  if (GetArenaForAllocation() == nullptr && _impl_.report_interval_ != nullptr) {
    delete _impl_.report_interval_;
  }
  _impl_.report_interval_ = nullptr;
  if (GetArenaForAllocation() == nullptr && _impl_.mailbox_message_ != nullptr) {
    delete _impl_.mailbox_message_;
  }
  _impl_.mailbox_message_ = nullptr;
  if (GetArenaForAllocation() == nullptr && _impl_.info_ != nullptr) {
    delete _impl_.info_;
  }
  _impl_.info_ = nullptr;
  if (GetArenaForAllocation() == nullptr && _impl_.flow_stat_ != nullptr) {
    delete _impl_.flow_stat_;
  }
  _impl_.flow_stat_ = nullptr;
  ::memset(&_impl_.duration_since_epoch_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.node_epoch_) -
      reinterpret_cast<char*>(&_impl_.duration_since_epoch_)) + sizeof(_impl_.node_epoch_));
  clear_node_workloads();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* HeartbeatRequest::_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.RequestHeader header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_header(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.Peer peer = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_peer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.TimeInterval report_interval = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_report_interval(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .greptime.v1.meta.RegionStat region_stats = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_region_stats(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.MailboxMessage mailbox_message = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_mailbox_message(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 duration_since_epoch = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _impl_.duration_since_epoch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 node_epoch = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _impl_.node_epoch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.NodeInfo info = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_info(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.FlowStat flow_stat = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_flow_stat(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.DatanodeWorkloads datanode = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_datanode(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.FrontendWorkloads frontend = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_frontend(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.FlownodeWorkloads flownode = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
          ptr = ctx->ParseMessage(_internal_mutable_flownode(), 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* HeartbeatRequest::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.HeartbeatRequest)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

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

  // repeated .greptime.v1.meta.RegionStat region_stats = 4;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_region_stats_size()); i < n; i++) {
    const auto& repfield = this->_internal_region_stats(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.MailboxMessage mailbox_message = 5;
  if (this->_internal_has_mailbox_message()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, _Internal::mailbox_message(this),
        _Internal::mailbox_message(this).GetCachedSize(), target, stream);
  }

  // uint64 duration_since_epoch = 6;
  if (this->_internal_duration_since_epoch() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_duration_since_epoch(), target);
  }

  // uint64 node_epoch = 7;
  if (this->_internal_node_epoch() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_node_epoch(), target);
  }

  // .greptime.v1.meta.NodeInfo info = 8;
  if (this->_internal_has_info()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::info(this),
        _Internal::info(this).GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.FlowStat flow_stat = 9;
  if (this->_internal_has_flow_stat()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::flow_stat(this),
        _Internal::flow_stat(this).GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.DatanodeWorkloads datanode = 10;
  if (_internal_has_datanode()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::datanode(this),
        _Internal::datanode(this).GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.FrontendWorkloads frontend = 11;
  if (_internal_has_frontend()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(11, _Internal::frontend(this),
        _Internal::frontend(this).GetCachedSize(), target, stream);
  }

  // .greptime.v1.meta.FlownodeWorkloads flownode = 12;
  if (_internal_has_flownode()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(12, _Internal::flownode(this),
        _Internal::flownode(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.HeartbeatRequest)
  return target;
}

size_t HeartbeatRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.HeartbeatRequest)
  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.RegionStat region_stats = 4;
  total_size += 1UL * this->_internal_region_stats_size();
  for (const auto& msg : this->_impl_.region_stats_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // .greptime.v1.meta.RequestHeader header = 1;
  if (this->_internal_has_header()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.header_);
  }

  // .greptime.v1.meta.Peer peer = 2;
  if (this->_internal_has_peer()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.peer_);
  }

  // .greptime.v1.meta.TimeInterval report_interval = 3;
  if (this->_internal_has_report_interval()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.report_interval_);
  }

  // .greptime.v1.meta.MailboxMessage mailbox_message = 5;
  if (this->_internal_has_mailbox_message()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.mailbox_message_);
  }

  // .greptime.v1.meta.NodeInfo info = 8;
  if (this->_internal_has_info()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.info_);
  }

  // .greptime.v1.meta.FlowStat flow_stat = 9;
  if (this->_internal_has_flow_stat()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.flow_stat_);
  }

  // uint64 duration_since_epoch = 6;
  if (this->_internal_duration_since_epoch() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_duration_since_epoch());
  }

  // uint64 node_epoch = 7;
  if (this->_internal_node_epoch() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_node_epoch());
  }

  switch (node_workloads_case()) {
    // .greptime.v1.meta.DatanodeWorkloads datanode = 10;
    case kDatanode: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.node_workloads_.datanode_);
      break;
    }
    // .greptime.v1.meta.FrontendWorkloads frontend = 11;
    case kFrontend: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.node_workloads_.frontend_);
      break;
    }
    // .greptime.v1.meta.FlownodeWorkloads flownode = 12;
    case kFlownode: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.node_workloads_.flownode_);
      break;
    }
    case NODE_WORKLOADS_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  _this->_impl_.region_stats_.MergeFrom(from._impl_.region_stats_);
  if (from._internal_has_header()) {
    _this->_internal_mutable_header()->::greptime::v1::meta::RequestHeader::MergeFrom(
        from._internal_header());
  }
  if (from._internal_has_peer()) {
    _this->_internal_mutable_peer()->::greptime::v1::meta::Peer::MergeFrom(
        from._internal_peer());
  }
  if (from._internal_has_report_interval()) {
    _this->_internal_mutable_report_interval()->::greptime::v1::meta::TimeInterval::MergeFrom(
        from._internal_report_interval());
  }
  if (from._internal_has_mailbox_message()) {
    _this->_internal_mutable_mailbox_message()->::greptime::v1::meta::MailboxMessage::MergeFrom(
        from._internal_mailbox_message());
  }
  if (from._internal_has_info()) {
    _this->_internal_mutable_info()->::greptime::v1::meta::NodeInfo::MergeFrom(
        from._internal_info());
  }
  if (from._internal_has_flow_stat()) {
    _this->_internal_mutable_flow_stat()->::greptime::v1::meta::FlowStat::MergeFrom(
        from._internal_flow_stat());
  }
  if (from._internal_duration_since_epoch() != 0) {
    _this->_internal_set_duration_since_epoch(from._internal_duration_since_epoch());
  }
  if (from._internal_node_epoch() != 0) {
    _this->_internal_set_node_epoch(from._internal_node_epoch());
  }
  switch (from.node_workloads_case()) {
    case kDatanode: {
      _this->_internal_mutable_datanode()->::greptime::v1::meta::DatanodeWorkloads::MergeFrom(
          from._internal_datanode());
      break;
    }
    case kFrontend: {
      _this->_internal_mutable_frontend()->::greptime::v1::meta::FrontendWorkloads::MergeFrom(
          from._internal_frontend());
      break;
    }
    case kFlownode: {
      _this->_internal_mutable_flownode()->::greptime::v1::meta::FlownodeWorkloads::MergeFrom(
          from._internal_flownode());
      break;
    }
    case NODE_WORKLOADS_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void HeartbeatRequest::InternalSwap(HeartbeatRequest* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.region_stats_.InternalSwap(&other->_impl_.region_stats_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(HeartbeatRequest, _impl_.node_epoch_)
      + sizeof(HeartbeatRequest::_impl_.node_epoch_)
      - PROTOBUF_FIELD_OFFSET(HeartbeatRequest, _impl_.header_)>(
          reinterpret_cast<char*>(&_impl_.header_),
          reinterpret_cast<char*>(&other->_impl_.header_));
  swap(_impl_.node_workloads_, other->_impl_.node_workloads_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata HeartbeatRequest::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[0]);
}

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

class DatanodeWorkloads::_Internal {
 public:
};

DatanodeWorkloads::DatanodeWorkloads(::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.DatanodeWorkloads)
}
DatanodeWorkloads::DatanodeWorkloads(const DatanodeWorkloads& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  DatanodeWorkloads* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){from._impl_.types_}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}};

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

inline void DatanodeWorkloads::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){arena}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void DatanodeWorkloads::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.types_.~RepeatedField();
}

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

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

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

const char* DatanodeWorkloads::_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 int32 types = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 8) {
          _internal_add_types(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* DatanodeWorkloads::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.DatanodeWorkloads)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 types = 1;
  {
    int byte_size = _impl_._types_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          1, _internal_types(), 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.DatanodeWorkloads)
  return target;
}

size_t DatanodeWorkloads::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.DatanodeWorkloads)
  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 int32 types = 1;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      Int32Size(this->_impl_.types_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _impl_._types_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

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

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


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

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

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

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

void DatanodeWorkloads::InternalSwap(DatanodeWorkloads* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.types_.InternalSwap(&other->_impl_.types_);
}

::PROTOBUF_NAMESPACE_ID::Metadata DatanodeWorkloads::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]);
}

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

class FrontendWorkloads::_Internal {
 public:
};

FrontendWorkloads::FrontendWorkloads(::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.FrontendWorkloads)
}
FrontendWorkloads::FrontendWorkloads(const FrontendWorkloads& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FrontendWorkloads* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){from._impl_.types_}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}};

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

inline void FrontendWorkloads::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){arena}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void FrontendWorkloads::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.types_.~RepeatedField();
}

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

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

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

const char* FrontendWorkloads::_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 int32 types = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 8) {
          _internal_add_types(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* FrontendWorkloads::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.FrontendWorkloads)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 types = 1;
  {
    int byte_size = _impl_._types_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          1, _internal_types(), 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.FrontendWorkloads)
  return target;
}

size_t FrontendWorkloads::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.FrontendWorkloads)
  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 int32 types = 1;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      Int32Size(this->_impl_.types_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _impl_._types_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

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

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


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

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

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

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

void FrontendWorkloads::InternalSwap(FrontendWorkloads* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.types_.InternalSwap(&other->_impl_.types_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FrontendWorkloads::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[2]);
}

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

class FlownodeWorkloads::_Internal {
 public:
};

FlownodeWorkloads::FlownodeWorkloads(::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.FlownodeWorkloads)
}
FlownodeWorkloads::FlownodeWorkloads(const FlownodeWorkloads& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FlownodeWorkloads* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){from._impl_.types_}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}};

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

inline void FlownodeWorkloads::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.types_){arena}
    , /*decltype(_impl_._types_cached_byte_size_)*/{0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void FlownodeWorkloads::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.types_.~RepeatedField();
}

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

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

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

const char* FlownodeWorkloads::_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 int32 types = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_types(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 8) {
          _internal_add_types(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* FlownodeWorkloads::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.FlownodeWorkloads)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 types = 1;
  {
    int byte_size = _impl_._types_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          1, _internal_types(), 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.FlownodeWorkloads)
  return target;
}

size_t FlownodeWorkloads::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.FlownodeWorkloads)
  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 int32 types = 1;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      Int32Size(this->_impl_.types_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _impl_._types_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

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

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


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

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

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

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

void FlownodeWorkloads::InternalSwap(FlownodeWorkloads* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.types_.InternalSwap(&other->_impl_.types_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FlownodeWorkloads::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[3]);
}

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

class NodeInfo::_Internal {
 public:
};

NodeInfo::NodeInfo(::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.NodeInfo)
}
NodeInfo::NodeInfo(const NodeInfo& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  NodeInfo* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.version_){}
    , decltype(_impl_.git_commit_){}
    , decltype(_impl_.start_time_ms_){}
    , decltype(_impl_.cpus_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.version_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.version_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_version().empty()) {
    _this->_impl_.version_.Set(from._internal_version(), 
      _this->GetArenaForAllocation());
  }
  _impl_.git_commit_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.git_commit_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_git_commit().empty()) {
    _this->_impl_.git_commit_.Set(from._internal_git_commit(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.start_time_ms_, &from._impl_.start_time_ms_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.cpus_) -
    reinterpret_cast<char*>(&_impl_.start_time_ms_)) + sizeof(_impl_.cpus_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.NodeInfo)
}

inline void NodeInfo::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.version_){}
    , decltype(_impl_.git_commit_){}
    , decltype(_impl_.start_time_ms_){uint64_t{0u}}
    , decltype(_impl_.cpus_){0u}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.version_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.version_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.git_commit_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.git_commit_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void NodeInfo::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.version_.Destroy();
  _impl_.git_commit_.Destroy();
}

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

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

  _impl_.version_.ClearToEmpty();
  _impl_.git_commit_.ClearToEmpty();
  ::memset(&_impl_.start_time_ms_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.cpus_) -
      reinterpret_cast<char*>(&_impl_.start_time_ms_)) + sizeof(_impl_.cpus_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* NodeInfo::_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) {
      // string version = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_version();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.NodeInfo.version"));
        } else
          goto handle_unusual;
        continue;
      // string git_commit = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_git_commit();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.NodeInfo.git_commit"));
        } else
          goto handle_unusual;
        continue;
      // uint64 start_time_ms = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.start_time_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 cpus = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.cpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* NodeInfo::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.NodeInfo)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

  // uint64 start_time_ms = 3;
  if (this->_internal_start_time_ms() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_start_time_ms(), target);
  }

  // uint32 cpus = 4;
  if (this->_internal_cpus() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_cpus(), 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.NodeInfo)
  return target;
}

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

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

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

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

  // uint64 start_time_ms = 3;
  if (this->_internal_start_time_ms() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_start_time_ms());
  }

  // uint32 cpus = 4;
  if (this->_internal_cpus() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_cpus());
  }

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

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


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

  if (!from._internal_version().empty()) {
    _this->_internal_set_version(from._internal_version());
  }
  if (!from._internal_git_commit().empty()) {
    _this->_internal_set_git_commit(from._internal_git_commit());
  }
  if (from._internal_start_time_ms() != 0) {
    _this->_internal_set_start_time_ms(from._internal_start_time_ms());
  }
  if (from._internal_cpus() != 0) {
    _this->_internal_set_cpus(from._internal_cpus());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void NodeInfo::InternalSwap(NodeInfo* 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_.version_, lhs_arena,
      &other->_impl_.version_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.git_commit_, lhs_arena,
      &other->_impl_.git_commit_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(NodeInfo, _impl_.cpus_)
      + sizeof(NodeInfo::_impl_.cpus_)
      - PROTOBUF_FIELD_OFFSET(NodeInfo, _impl_.start_time_ms_)>(
          reinterpret_cast<char*>(&_impl_.start_time_ms_),
          reinterpret_cast<char*>(&other->_impl_.start_time_ms_));
}

::PROTOBUF_NAMESPACE_ID::Metadata NodeInfo::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[4]);
}

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

RegionStat_ExtensionsEntry_DoNotUse::RegionStat_ExtensionsEntry_DoNotUse() {}
RegionStat_ExtensionsEntry_DoNotUse::RegionStat_ExtensionsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void RegionStat_ExtensionsEntry_DoNotUse::MergeFrom(const RegionStat_ExtensionsEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata RegionStat_ExtensionsEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[5]);
}

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

class RegionStat::_Internal {
 public:
};

RegionStat::RegionStat(::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, &RegionStat::ArenaDtor);
  }
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.RegionStat)
}
RegionStat::RegionStat(const RegionStat& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  RegionStat* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_.extensions_)*/{}
    , decltype(_impl_.engine_){}
    , decltype(_impl_.region_id_){}
    , decltype(_impl_.rcus_){}
    , decltype(_impl_.wcus_){}
    , decltype(_impl_.approximate_bytes_){}
    , decltype(_impl_.role_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.extensions_.MergeFrom(from._impl_.extensions_);
  _impl_.engine_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.engine_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_engine().empty()) {
    _this->_impl_.engine_.Set(from._internal_engine(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.region_id_, &from._impl_.region_id_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.role_) -
    reinterpret_cast<char*>(&_impl_.region_id_)) + sizeof(_impl_.role_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionStat)
}

inline void RegionStat::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.extensions_)*/{::_pbi::ArenaInitialized(), arena}
    , decltype(_impl_.engine_){}
    , decltype(_impl_.region_id_){uint64_t{0u}}
    , decltype(_impl_.rcus_){int64_t{0}}
    , decltype(_impl_.wcus_){int64_t{0}}
    , decltype(_impl_.approximate_bytes_){int64_t{0}}
    , decltype(_impl_.role_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.engine_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.engine_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void RegionStat::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.extensions_.Destruct();
  _impl_.extensions_.~MapField();
  _impl_.engine_.Destroy();
}

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

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

  _impl_.extensions_.Clear();
  _impl_.engine_.ClearToEmpty();
  ::memset(&_impl_.region_id_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.role_) -
      reinterpret_cast<char*>(&_impl_.region_id_)) + sizeof(_impl_.role_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* RegionStat::_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 region_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.region_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int64 rcus = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.rcus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int64 wcus = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.wcus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int64 approximate_bytes = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.approximate_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string engine = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_engine();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.RegionStat.engine"));
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.RegionRole role = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val));
        } else
          goto handle_unusual;
        continue;
      // map<string, bytes> extensions = 99;
      case 99:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(&_impl_.extensions_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<794>(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* RegionStat::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.RegionStat)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // int64 rcus = 2;
  if (this->_internal_rcus() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_rcus(), target);
  }

  // int64 wcus = 3;
  if (this->_internal_wcus() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_wcus(), target);
  }

  // int64 approximate_bytes = 4;
  if (this->_internal_approximate_bytes() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_approximate_bytes(), target);
  }

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

  // .greptime.v1.meta.RegionRole role = 7;
  if (this->_internal_role() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      7, this->_internal_role(), target);
  }

  // map<string, bytes> extensions = 99;
  if (!this->_internal_extensions().empty()) {
    using MapType = ::_pb::Map<std::string, std::string>;
    using WireHelper = RegionStat_ExtensionsEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_extensions();
    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.RegionStat.ExtensionsEntry.key");
    };

    if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
      for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
        target = WireHelper::InternalSerialize(99, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    } else {
      for (const auto& entry : map_field) {
        target = WireHelper::InternalSerialize(99, 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.RegionStat)
  return target;
}

size_t RegionStat::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.RegionStat)
  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, bytes> extensions = 99;
  total_size += 2 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_extensions_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
      it = this->_internal_extensions().begin();
      it != this->_internal_extensions().end(); ++it) {
    total_size += RegionStat_ExtensionsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // string engine = 6;
  if (!this->_internal_engine().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_engine());
  }

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

  // int64 rcus = 2;
  if (this->_internal_rcus() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_rcus());
  }

  // int64 wcus = 3;
  if (this->_internal_wcus() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_wcus());
  }

  // int64 approximate_bytes = 4;
  if (this->_internal_approximate_bytes() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_approximate_bytes());
  }

  // .greptime.v1.meta.RegionRole role = 7;
  if (this->_internal_role() != 0) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_role());
  }

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

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


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

  _this->_impl_.extensions_.MergeFrom(from._impl_.extensions_);
  if (!from._internal_engine().empty()) {
    _this->_internal_set_engine(from._internal_engine());
  }
  if (from._internal_region_id() != 0) {
    _this->_internal_set_region_id(from._internal_region_id());
  }
  if (from._internal_rcus() != 0) {
    _this->_internal_set_rcus(from._internal_rcus());
  }
  if (from._internal_wcus() != 0) {
    _this->_internal_set_wcus(from._internal_wcus());
  }
  if (from._internal_approximate_bytes() != 0) {
    _this->_internal_set_approximate_bytes(from._internal_approximate_bytes());
  }
  if (from._internal_role() != 0) {
    _this->_internal_set_role(from._internal_role());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void RegionStat::InternalSwap(RegionStat* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.extensions_.InternalSwap(&other->_impl_.extensions_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.engine_, lhs_arena,
      &other->_impl_.engine_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.role_)
      + sizeof(RegionStat::_impl_.role_)
      - PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.region_id_)>(
          reinterpret_cast<char*>(&_impl_.region_id_),
          reinterpret_cast<char*>(&other->_impl_.region_id_));
}

::PROTOBUF_NAMESPACE_ID::Metadata RegionStat::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[6]);
}

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

FlowStat_FlowStatSizeEntry_DoNotUse::FlowStat_FlowStatSizeEntry_DoNotUse() {}
FlowStat_FlowStatSizeEntry_DoNotUse::FlowStat_FlowStatSizeEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void FlowStat_FlowStatSizeEntry_DoNotUse::MergeFrom(const FlowStat_FlowStatSizeEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata FlowStat_FlowStatSizeEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[7]);
}

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

FlowStat_FlowLastExecTimeMapEntry_DoNotUse::FlowStat_FlowLastExecTimeMapEntry_DoNotUse() {}
FlowStat_FlowLastExecTimeMapEntry_DoNotUse::FlowStat_FlowLastExecTimeMapEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void FlowStat_FlowLastExecTimeMapEntry_DoNotUse::MergeFrom(const FlowStat_FlowLastExecTimeMapEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata FlowStat_FlowLastExecTimeMapEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[8]);
}

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

class FlowStat::_Internal {
 public:
};

FlowStat::FlowStat(::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, &FlowStat::ArenaDtor);
  }
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.FlowStat)
}
FlowStat::FlowStat(const FlowStat& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FlowStat* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_.flow_stat_size_)*/{}
    , /*decltype(_impl_.flow_last_exec_time_map_)*/{}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.flow_stat_size_.MergeFrom(from._impl_.flow_stat_size_);
  _this->_impl_.flow_last_exec_time_map_.MergeFrom(from._impl_.flow_last_exec_time_map_);
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.FlowStat)
}

inline void FlowStat::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.flow_stat_size_)*/{::_pbi::ArenaInitialized(), arena}
    , /*decltype(_impl_.flow_last_exec_time_map_)*/{::_pbi::ArenaInitialized(), arena}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void FlowStat::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.flow_stat_size_.Destruct();
  _impl_.flow_stat_size_.~MapField();
  _impl_.flow_last_exec_time_map_.Destruct();
  _impl_.flow_last_exec_time_map_.~MapField();
}

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

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

  _impl_.flow_stat_size_.Clear();
  _impl_.flow_last_exec_time_map_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* FlowStat::_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) {
      // map<uint32, uint64> flow_stat_size = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&_impl_.flow_stat_size_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // map<uint32, int64> flow_last_exec_time_map = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&_impl_.flow_last_exec_time_map_, 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* FlowStat::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.FlowStat)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // map<uint32, uint64> flow_stat_size = 1;
  if (!this->_internal_flow_stat_size().empty()) {
    using MapType = ::_pb::Map<uint32_t, uint64_t>;
    using WireHelper = FlowStat_FlowStatSizeEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_flow_stat_size();

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

  // map<uint32, int64> flow_last_exec_time_map = 2;
  if (!this->_internal_flow_last_exec_time_map().empty()) {
    using MapType = ::_pb::Map<uint32_t, int64_t>;
    using WireHelper = FlowStat_FlowLastExecTimeMapEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_flow_last_exec_time_map();

    if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
      for (const auto& entry : ::_pbi::MapSorterFlat<MapType>(map_field)) {
        target = WireHelper::InternalSerialize(2, entry.first, entry.second, target, stream);
      }
    } else {
      for (const auto& entry : map_field) {
        target = WireHelper::InternalSerialize(2, entry.first, entry.second, 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.FlowStat)
  return target;
}

size_t FlowStat::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.FlowStat)
  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<uint32, uint64> flow_stat_size = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_flow_stat_size_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< uint32_t, uint64_t >::const_iterator
      it = this->_internal_flow_stat_size().begin();
      it != this->_internal_flow_stat_size().end(); ++it) {
    total_size += FlowStat_FlowStatSizeEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // map<uint32, int64> flow_last_exec_time_map = 2;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_flow_last_exec_time_map_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< uint32_t, int64_t >::const_iterator
      it = this->_internal_flow_last_exec_time_map().begin();
      it != this->_internal_flow_last_exec_time_map().end(); ++it) {
    total_size += FlowStat_FlowLastExecTimeMapEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

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

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


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

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

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

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

void FlowStat::InternalSwap(FlowStat* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.flow_stat_size_.InternalSwap(&other->_impl_.flow_stat_size_);
  _impl_.flow_last_exec_time_map_.InternalSwap(&other->_impl_.flow_last_exec_time_map_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FlowStat::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[9]);
}

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

class HeartbeatResponse::_Internal {
 public:
  static const ::greptime::v1::meta::ResponseHeader& header(const HeartbeatResponse* msg);
  static const ::greptime::v1::meta::MailboxMessage& mailbox_message(const HeartbeatResponse* msg);
  static const ::greptime::v1::meta::RegionLease& region_lease(const HeartbeatResponse* msg);
};

const ::greptime::v1::meta::ResponseHeader&
HeartbeatResponse::_Internal::header(const HeartbeatResponse* msg) {
  return *msg->_impl_.header_;
}
const ::greptime::v1::meta::MailboxMessage&
HeartbeatResponse::_Internal::mailbox_message(const HeartbeatResponse* msg) {
  return *msg->_impl_.mailbox_message_;
}
const ::greptime::v1::meta::RegionLease&
HeartbeatResponse::_Internal::region_lease(const HeartbeatResponse* msg) {
  return *msg->_impl_.region_lease_;
}
void HeartbeatResponse::clear_header() {
  if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) {
    delete _impl_.header_;
  }
  _impl_.header_ = nullptr;
}
HeartbeatResponse::HeartbeatResponse(::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.HeartbeatResponse)
}
HeartbeatResponse::HeartbeatResponse(const HeartbeatResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  HeartbeatResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.header_){nullptr}
    , decltype(_impl_.mailbox_message_){nullptr}
    , decltype(_impl_.region_lease_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_header()) {
    _this->_impl_.header_ = new ::greptime::v1::meta::ResponseHeader(*from._impl_.header_);
  }
  if (from._internal_has_mailbox_message()) {
    _this->_impl_.mailbox_message_ = new ::greptime::v1::meta::MailboxMessage(*from._impl_.mailbox_message_);
  }
  if (from._internal_has_region_lease()) {
    _this->_impl_.region_lease_ = new ::greptime::v1::meta::RegionLease(*from._impl_.region_lease_);
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.HeartbeatResponse)
}

inline void HeartbeatResponse::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.header_){nullptr}
    , decltype(_impl_.mailbox_message_){nullptr}
    , decltype(_impl_.region_lease_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void HeartbeatResponse::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.header_;
  if (this != internal_default_instance()) delete _impl_.mailbox_message_;
  if (this != internal_default_instance()) delete _impl_.region_lease_;
}

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

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

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

const char* HeartbeatResponse::_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.ResponseHeader header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_header(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.MailboxMessage mailbox_message = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_mailbox_message(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.RegionLease region_lease = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_region_lease(), 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* HeartbeatResponse::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.HeartbeatResponse)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

  // .greptime.v1.meta.RegionLease region_lease = 3;
  if (this->_internal_has_region_lease()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::region_lease(this),
        _Internal::region_lease(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.HeartbeatResponse)
  return target;
}

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

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

  // .greptime.v1.meta.ResponseHeader header = 1;
  if (this->_internal_has_header()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.header_);
  }

  // .greptime.v1.meta.MailboxMessage mailbox_message = 2;
  if (this->_internal_has_mailbox_message()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.mailbox_message_);
  }

  // .greptime.v1.meta.RegionLease region_lease = 3;
  if (this->_internal_has_region_lease()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.region_lease_);
  }

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

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


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

  if (from._internal_has_header()) {
    _this->_internal_mutable_header()->::greptime::v1::meta::ResponseHeader::MergeFrom(
        from._internal_header());
  }
  if (from._internal_has_mailbox_message()) {
    _this->_internal_mutable_mailbox_message()->::greptime::v1::meta::MailboxMessage::MergeFrom(
        from._internal_mailbox_message());
  }
  if (from._internal_has_region_lease()) {
    _this->_internal_mutable_region_lease()->::greptime::v1::meta::RegionLease::MergeFrom(
        from._internal_region_lease());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata HeartbeatResponse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[10]);
}

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

GrantedRegion_ExtensionsEntry_DoNotUse::GrantedRegion_ExtensionsEntry_DoNotUse() {}
GrantedRegion_ExtensionsEntry_DoNotUse::GrantedRegion_ExtensionsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void GrantedRegion_ExtensionsEntry_DoNotUse::MergeFrom(const GrantedRegion_ExtensionsEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata GrantedRegion_ExtensionsEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[11]);
}

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

class GrantedRegion::_Internal {
 public:
};

GrantedRegion::GrantedRegion(::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, &GrantedRegion::ArenaDtor);
  }
  // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.GrantedRegion)
}
GrantedRegion::GrantedRegion(const GrantedRegion& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  GrantedRegion* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_.extensions_)*/{}
    , decltype(_impl_.region_id_){}
    , decltype(_impl_.role_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.extensions_.MergeFrom(from._impl_.extensions_);
  ::memcpy(&_impl_.region_id_, &from._impl_.region_id_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.role_) -
    reinterpret_cast<char*>(&_impl_.region_id_)) + sizeof(_impl_.role_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.GrantedRegion)
}

inline void GrantedRegion::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.extensions_)*/{::_pbi::ArenaInitialized(), arena}
    , decltype(_impl_.region_id_){uint64_t{0u}}
    , decltype(_impl_.role_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void GrantedRegion::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.extensions_.Destruct();
  _impl_.extensions_.~MapField();
}

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

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

  _impl_.extensions_.Clear();
  ::memset(&_impl_.region_id_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.role_) -
      reinterpret_cast<char*>(&_impl_.region_id_)) + sizeof(_impl_.role_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* GrantedRegion::_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 region_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.region_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.RegionRole role = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val));
        } else
          goto handle_unusual;
        continue;
      // map<string, bytes> extensions = 99;
      case 99:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(&_impl_.extensions_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<794>(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* GrantedRegion::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.GrantedRegion)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // .greptime.v1.meta.RegionRole role = 2;
  if (this->_internal_role() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      2, this->_internal_role(), target);
  }

  // map<string, bytes> extensions = 99;
  if (!this->_internal_extensions().empty()) {
    using MapType = ::_pb::Map<std::string, std::string>;
    using WireHelper = GrantedRegion_ExtensionsEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_extensions();
    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.GrantedRegion.ExtensionsEntry.key");
    };

    if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
      for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
        target = WireHelper::InternalSerialize(99, entry.first, entry.second, target, stream);
        check_utf8(entry);
      }
    } else {
      for (const auto& entry : map_field) {
        target = WireHelper::InternalSerialize(99, 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.GrantedRegion)
  return target;
}

size_t GrantedRegion::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.GrantedRegion)
  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, bytes> extensions = 99;
  total_size += 2 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_extensions_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
      it = this->_internal_extensions().begin();
      it != this->_internal_extensions().end(); ++it) {
    total_size += GrantedRegion_ExtensionsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

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

  // .greptime.v1.meta.RegionRole role = 2;
  if (this->_internal_role() != 0) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_role());
  }

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

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


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

  _this->_impl_.extensions_.MergeFrom(from._impl_.extensions_);
  if (from._internal_region_id() != 0) {
    _this->_internal_set_region_id(from._internal_region_id());
  }
  if (from._internal_role() != 0) {
    _this->_internal_set_role(from._internal_role());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void GrantedRegion::InternalSwap(GrantedRegion* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.extensions_.InternalSwap(&other->_impl_.extensions_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.role_)
      + sizeof(GrantedRegion::_impl_.role_)
      - PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.region_id_)>(
          reinterpret_cast<char*>(&_impl_.region_id_),
          reinterpret_cast<char*>(&other->_impl_.region_id_));
}

::PROTOBUF_NAMESPACE_ID::Metadata GrantedRegion::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[12]);
}

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

class RegionLease::_Internal {
 public:
};

RegionLease::RegionLease(::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.RegionLease)
}
RegionLease::RegionLease(const RegionLease& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  RegionLease* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.regions_){from._impl_.regions_}
    , decltype(_impl_.closeable_region_ids_){from._impl_.closeable_region_ids_}
    , /*decltype(_impl_._closeable_region_ids_cached_byte_size_)*/{0}
    , decltype(_impl_.duration_since_epoch_){}
    , decltype(_impl_.lease_seconds_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.duration_since_epoch_, &from._impl_.duration_since_epoch_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.lease_seconds_) -
    reinterpret_cast<char*>(&_impl_.duration_since_epoch_)) + sizeof(_impl_.lease_seconds_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionLease)
}

inline void RegionLease::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.regions_){arena}
    , decltype(_impl_.closeable_region_ids_){arena}
    , /*decltype(_impl_._closeable_region_ids_cached_byte_size_)*/{0}
    , decltype(_impl_.duration_since_epoch_){uint64_t{0u}}
    , decltype(_impl_.lease_seconds_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void RegionLease::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.regions_.~RepeatedPtrField();
  _impl_.closeable_region_ids_.~RepeatedField();
}

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

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

  _impl_.regions_.Clear();
  _impl_.closeable_region_ids_.Clear();
  ::memset(&_impl_.duration_since_epoch_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.lease_seconds_) -
      reinterpret_cast<char*>(&_impl_.duration_since_epoch_)) + sizeof(_impl_.lease_seconds_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* RegionLease::_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.GrantedRegion regions = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_regions(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // uint64 duration_since_epoch = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.duration_since_epoch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 lease_seconds = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.lease_seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated uint64 closeable_region_ids = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_closeable_region_ids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 32) {
          _internal_add_closeable_region_ids(::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* RegionLease::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.RegionLease)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

  // uint64 lease_seconds = 3;
  if (this->_internal_lease_seconds() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_lease_seconds(), target);
  }

  // repeated uint64 closeable_region_ids = 4;
  {
    int byte_size = _impl_._closeable_region_ids_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt64Packed(
          4, _internal_closeable_region_ids(), 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.RegionLease)
  return target;
}

size_t RegionLease::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.RegionLease)
  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.GrantedRegion regions = 1;
  total_size += 1UL * this->_internal_regions_size();
  for (const auto& msg : this->_impl_.regions_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

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

  // uint64 lease_seconds = 3;
  if (this->_internal_lease_seconds() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_lease_seconds());
  }

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

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


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

  _this->_impl_.regions_.MergeFrom(from._impl_.regions_);
  _this->_impl_.closeable_region_ids_.MergeFrom(from._impl_.closeable_region_ids_);
  if (from._internal_duration_since_epoch() != 0) {
    _this->_internal_set_duration_since_epoch(from._internal_duration_since_epoch());
  }
  if (from._internal_lease_seconds() != 0) {
    _this->_internal_set_lease_seconds(from._internal_lease_seconds());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void RegionLease::InternalSwap(RegionLease* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  _impl_.regions_.InternalSwap(&other->_impl_.regions_);
  _impl_.closeable_region_ids_.InternalSwap(&other->_impl_.closeable_region_ids_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(RegionLease, _impl_.lease_seconds_)
      + sizeof(RegionLease::_impl_.lease_seconds_)
      - PROTOBUF_FIELD_OFFSET(RegionLease, _impl_.duration_since_epoch_)>(
          reinterpret_cast<char*>(&_impl_.duration_since_epoch_),
          reinterpret_cast<char*>(&other->_impl_.duration_since_epoch_));
}

::PROTOBUF_NAMESPACE_ID::Metadata RegionLease::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[13]);
}

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

class AskLeaderRequest::_Internal {
 public:
  static const ::greptime::v1::meta::RequestHeader& header(const AskLeaderRequest* msg);
};

const ::greptime::v1::meta::RequestHeader&
AskLeaderRequest::_Internal::header(const AskLeaderRequest* msg) {
  return *msg->_impl_.header_;
}
void AskLeaderRequest::clear_header() {
  if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) {
    delete _impl_.header_;
  }
  _impl_.header_ = nullptr;
}
AskLeaderRequest::AskLeaderRequest(::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.AskLeaderRequest)
}
AskLeaderRequest::AskLeaderRequest(const AskLeaderRequest& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  AskLeaderRequest* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.header_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_header()) {
    _this->_impl_.header_ = new ::greptime::v1::meta::RequestHeader(*from._impl_.header_);
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.AskLeaderRequest)
}

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

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

inline void AskLeaderRequest::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.header_;
}

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

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

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

const char* AskLeaderRequest::_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.RequestHeader header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_header(), 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* AskLeaderRequest::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.AskLeaderRequest)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .greptime.v1.meta.RequestHeader header = 1;
  if (this->_internal_has_header()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::header(this),
        _Internal::header(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.AskLeaderRequest)
  return target;
}

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

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

  // .greptime.v1.meta.RequestHeader header = 1;
  if (this->_internal_has_header()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.header_);
  }

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

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


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

  if (from._internal_has_header()) {
    _this->_internal_mutable_header()->::greptime::v1::meta::RequestHeader::MergeFrom(
        from._internal_header());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata AskLeaderRequest::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[14]);
}

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

class AskLeaderResponse::_Internal {
 public:
  static const ::greptime::v1::meta::ResponseHeader& header(const AskLeaderResponse* msg);
  static const ::greptime::v1::meta::Peer& leader(const AskLeaderResponse* msg);
};

const ::greptime::v1::meta::ResponseHeader&
AskLeaderResponse::_Internal::header(const AskLeaderResponse* msg) {
  return *msg->_impl_.header_;
}
const ::greptime::v1::meta::Peer&
AskLeaderResponse::_Internal::leader(const AskLeaderResponse* msg) {
  return *msg->_impl_.leader_;
}
void AskLeaderResponse::clear_header() {
  if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) {
    delete _impl_.header_;
  }
  _impl_.header_ = nullptr;
}
void AskLeaderResponse::clear_leader() {
  if (GetArenaForAllocation() == nullptr && _impl_.leader_ != nullptr) {
    delete _impl_.leader_;
  }
  _impl_.leader_ = nullptr;
}
AskLeaderResponse::AskLeaderResponse(::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.AskLeaderResponse)
}
AskLeaderResponse::AskLeaderResponse(const AskLeaderResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  AskLeaderResponse* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.header_){nullptr}
    , decltype(_impl_.leader_){nullptr}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_header()) {
    _this->_impl_.header_ = new ::greptime::v1::meta::ResponseHeader(*from._impl_.header_);
  }
  if (from._internal_has_leader()) {
    _this->_impl_.leader_ = new ::greptime::v1::meta::Peer(*from._impl_.leader_);
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.AskLeaderResponse)
}

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

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

inline void AskLeaderResponse::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.header_;
  if (this != internal_default_instance()) delete _impl_.leader_;
}

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

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

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

const char* AskLeaderResponse::_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.ResponseHeader header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_header(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.meta.Peer leader = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_leader(), 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* AskLeaderResponse::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.AskLeaderResponse)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // .greptime.v1.meta.Peer leader = 2;
  if (this->_internal_has_leader()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::leader(this),
        _Internal::leader(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.AskLeaderResponse)
  return target;
}

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

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

  // .greptime.v1.meta.ResponseHeader header = 1;
  if (this->_internal_has_header()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.header_);
  }

  // .greptime.v1.meta.Peer leader = 2;
  if (this->_internal_has_leader()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.leader_);
  }

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

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


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

  if (from._internal_has_header()) {
    _this->_internal_mutable_header()->::greptime::v1::meta::ResponseHeader::MergeFrom(
        from._internal_header());
  }
  if (from._internal_has_leader()) {
    _this->_internal_mutable_leader()->::greptime::v1::meta::Peer::MergeFrom(
        from._internal_leader());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata AskLeaderResponse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[15]);
}

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

class MailboxMessage::_Internal {
 public:
};

MailboxMessage::MailboxMessage(::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.MailboxMessage)
}
MailboxMessage::MailboxMessage(const MailboxMessage& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  MailboxMessage* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.subject_){}
    , decltype(_impl_.from_){}
    , decltype(_impl_.to_){}
    , decltype(_impl_.id_){}
    , decltype(_impl_.timestamp_millis_){}
    , decltype(_impl_.payload_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.subject_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.subject_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_subject().empty()) {
    _this->_impl_.subject_.Set(from._internal_subject(), 
      _this->GetArenaForAllocation());
  }
  _impl_.from_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.from_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_from().empty()) {
    _this->_impl_.from_.Set(from._internal_from(), 
      _this->GetArenaForAllocation());
  }
  _impl_.to_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.to_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_to().empty()) {
    _this->_impl_.to_.Set(from._internal_to(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.id_, &from._impl_.id_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.timestamp_millis_) -
    reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.timestamp_millis_));
  clear_has_payload();
  switch (from.payload_case()) {
    case kJson: {
      _this->_internal_set_json(from._internal_json());
      break;
    }
    case PAYLOAD_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.MailboxMessage)
}

inline void MailboxMessage::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.subject_){}
    , decltype(_impl_.from_){}
    , decltype(_impl_.to_){}
    , decltype(_impl_.id_){uint64_t{0u}}
    , decltype(_impl_.timestamp_millis_){int64_t{0}}
    , decltype(_impl_.payload_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  _impl_.subject_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.subject_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.from_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.from_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.to_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.to_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  clear_has_payload();
}

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

inline void MailboxMessage::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.subject_.Destroy();
  _impl_.from_.Destroy();
  _impl_.to_.Destroy();
  if (has_payload()) {
    clear_payload();
  }
}

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

void MailboxMessage::clear_payload() {
// @@protoc_insertion_point(one_of_clear_start:greptime.v1.meta.MailboxMessage)
  switch (payload_case()) {
    case kJson: {
      _impl_.payload_.json_.Destroy();
      break;
    }
    case PAYLOAD_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = PAYLOAD_NOT_SET;
}


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

  _impl_.subject_.ClearToEmpty();
  _impl_.from_.ClearToEmpty();
  _impl_.to_.ClearToEmpty();
  ::memset(&_impl_.id_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.timestamp_millis_) -
      reinterpret_cast<char*>(&_impl_.id_)) + sizeof(_impl_.timestamp_millis_));
  clear_payload();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* MailboxMessage::_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 subject = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_subject();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.MailboxMessage.subject"));
        } else
          goto handle_unusual;
        continue;
      // string from = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_from();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.MailboxMessage.from"));
        } else
          goto handle_unusual;
        continue;
      // string to = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_to();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.MailboxMessage.to"));
        } else
          goto handle_unusual;
        continue;
      // int64 timestamp_millis = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _impl_.timestamp_millis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string json = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_json();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.meta.MailboxMessage.json"));
        } 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* MailboxMessage::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.MailboxMessage)
  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 subject = 2;
  if (!this->_internal_subject().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_subject().data(), static_cast<int>(this->_internal_subject().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "greptime.v1.meta.MailboxMessage.subject");
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_subject(), target);
  }

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

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

  // int64 timestamp_millis = 5;
  if (this->_internal_timestamp_millis() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_timestamp_millis(), target);
  }

  // string json = 6;
  if (_internal_has_json()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_json().data(), static_cast<int>(this->_internal_json().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "greptime.v1.meta.MailboxMessage.json");
    target = stream->WriteStringMaybeAliased(
        6, this->_internal_json(), 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.MailboxMessage)
  return target;
}

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

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

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

  // string from = 3;
  if (!this->_internal_from().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_from());
  }

  // string to = 4;
  if (!this->_internal_to().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_to());
  }

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

  // int64 timestamp_millis = 5;
  if (this->_internal_timestamp_millis() != 0) {
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp_millis());
  }

  switch (payload_case()) {
    // string json = 6;
    case kJson: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_json());
      break;
    }
    case PAYLOAD_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  if (!from._internal_subject().empty()) {
    _this->_internal_set_subject(from._internal_subject());
  }
  if (!from._internal_from().empty()) {
    _this->_internal_set_from(from._internal_from());
  }
  if (!from._internal_to().empty()) {
    _this->_internal_set_to(from._internal_to());
  }
  if (from._internal_id() != 0) {
    _this->_internal_set_id(from._internal_id());
  }
  if (from._internal_timestamp_millis() != 0) {
    _this->_internal_set_timestamp_millis(from._internal_timestamp_millis());
  }
  switch (from.payload_case()) {
    case kJson: {
      _this->_internal_set_json(from._internal_json());
      break;
    }
    case PAYLOAD_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void MailboxMessage::InternalSwap(MailboxMessage* 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_.subject_, lhs_arena,
      &other->_impl_.subject_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.from_, lhs_arena,
      &other->_impl_.from_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.to_, lhs_arena,
      &other->_impl_.to_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(MailboxMessage, _impl_.timestamp_millis_)
      + sizeof(MailboxMessage::_impl_.timestamp_millis_)
      - PROTOBUF_FIELD_OFFSET(MailboxMessage, _impl_.id_)>(
          reinterpret_cast<char*>(&_impl_.id_),
          reinterpret_cast<char*>(&other->_impl_.id_));
  swap(_impl_.payload_, other->_impl_.payload_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata MailboxMessage::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once,
      file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[16]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace meta
}  // namespace v1
}  // namespace greptime
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::HeartbeatRequest*
Arena::CreateMaybeMessage< ::greptime::v1::meta::HeartbeatRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::HeartbeatRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::DatanodeWorkloads*
Arena::CreateMaybeMessage< ::greptime::v1::meta::DatanodeWorkloads >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::DatanodeWorkloads >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::FrontendWorkloads*
Arena::CreateMaybeMessage< ::greptime::v1::meta::FrontendWorkloads >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::FrontendWorkloads >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::FlownodeWorkloads*
Arena::CreateMaybeMessage< ::greptime::v1::meta::FlownodeWorkloads >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::FlownodeWorkloads >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::NodeInfo*
Arena::CreateMaybeMessage< ::greptime::v1::meta::NodeInfo >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::NodeInfo >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionStat*
Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionStat >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionStat >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::FlowStat_FlowStatSizeEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::FlowStat_FlowLastExecTimeMapEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::FlowStat*
Arena::CreateMaybeMessage< ::greptime::v1::meta::FlowStat >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::FlowStat >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::HeartbeatResponse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::HeartbeatResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::HeartbeatResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::GrantedRegion_ExtensionsEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::GrantedRegion*
Arena::CreateMaybeMessage< ::greptime::v1::meta::GrantedRegion >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::GrantedRegion >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionLease*
Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionLease >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionLease >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::AskLeaderRequest*
Arena::CreateMaybeMessage< ::greptime::v1::meta::AskLeaderRequest >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::AskLeaderRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::AskLeaderResponse*
Arena::CreateMaybeMessage< ::greptime::v1::meta::AskLeaderResponse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::AskLeaderResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::meta::MailboxMessage*
Arena::CreateMaybeMessage< ::greptime::v1::meta::MailboxMessage >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::meta::MailboxMessage >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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