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

#include "greptime/v1/index/inverted_index.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 index {
PROTOBUF_CONSTEXPR InvertedIndexMetas_MetasEntry_DoNotUse::InvertedIndexMetas_MetasEntry_DoNotUse(
    ::_pbi::ConstantInitialized) {}
struct InvertedIndexMetas_MetasEntry_DoNotUseDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvertedIndexMetas_MetasEntry_DoNotUseDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvertedIndexMetas_MetasEntry_DoNotUseDefaultTypeInternal() {}
  union {
    InvertedIndexMetas_MetasEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvertedIndexMetas_MetasEntry_DoNotUseDefaultTypeInternal _InvertedIndexMetas_MetasEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR InvertedIndexMetas::InvertedIndexMetas(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.metas_)*/{::_pbi::ConstantInitialized()}
  , /*decltype(_impl_.total_row_count_)*/uint64_t{0u}
  , /*decltype(_impl_.segment_row_count_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct InvertedIndexMetasDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvertedIndexMetasDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvertedIndexMetasDefaultTypeInternal() {}
  union {
    InvertedIndexMetas _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvertedIndexMetasDefaultTypeInternal _InvertedIndexMetas_default_instance_;
PROTOBUF_CONSTEXPR InvertedIndexMeta::InvertedIndexMeta(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.stats_)*/nullptr
  , /*decltype(_impl_.base_offset_)*/uint64_t{0u}
  , /*decltype(_impl_.inverted_index_size_)*/uint64_t{0u}
  , /*decltype(_impl_.relative_fst_offset_)*/0u
  , /*decltype(_impl_.fst_size_)*/0u
  , /*decltype(_impl_.relative_null_bitmap_offset_)*/0u
  , /*decltype(_impl_.null_bitmap_size_)*/0u
  , /*decltype(_impl_.bitmap_type_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct InvertedIndexMetaDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvertedIndexMetaDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvertedIndexMetaDefaultTypeInternal() {}
  union {
    InvertedIndexMeta _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvertedIndexMetaDefaultTypeInternal _InvertedIndexMeta_default_instance_;
PROTOBUF_CONSTEXPR InvertedIndexStats::InvertedIndexStats(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.min_value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.max_value_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.null_count_)*/uint64_t{0u}
  , /*decltype(_impl_.distinct_count_)*/uint64_t{0u}
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct InvertedIndexStatsDefaultTypeInternal {
  PROTOBUF_CONSTEXPR InvertedIndexStatsDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~InvertedIndexStatsDefaultTypeInternal() {}
  union {
    InvertedIndexStats _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InvertedIndexStatsDefaultTypeInternal _InvertedIndexStats_default_instance_;
}  // namespace index
}  // namespace v1
}  // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto[4];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2findex_2finverted_5findex_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2findex_2finverted_5findex_2eproto = nullptr;

const uint32_t TableStruct_greptime_2fv1_2findex_2finverted_5findex_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas_MetasEntry_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::index::InvertedIndexMetas_MetasEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse, value_),
  0,
  1,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas, _impl_.metas_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas, _impl_.total_row_count_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMetas, _impl_.segment_row_count_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.name_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.base_offset_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.inverted_index_size_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.relative_fst_offset_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.fst_size_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.relative_null_bitmap_offset_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.null_bitmap_size_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.stats_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexMeta, _impl_.bitmap_type_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexStats, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexStats, _impl_.null_count_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexStats, _impl_.distinct_count_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexStats, _impl_.min_value_),
  PROTOBUF_FIELD_OFFSET(::greptime::v1::index::InvertedIndexStats, _impl_.max_value_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse)},
  { 10, -1, -1, sizeof(::greptime::v1::index::InvertedIndexMetas)},
  { 19, -1, -1, sizeof(::greptime::v1::index::InvertedIndexMeta)},
  { 34, -1, -1, sizeof(::greptime::v1::index::InvertedIndexStats)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::greptime::v1::index::_InvertedIndexMetas_MetasEntry_DoNotUse_default_instance_._instance,
  &::greptime::v1::index::_InvertedIndexMetas_default_instance_._instance,
  &::greptime::v1::index::_InvertedIndexMeta_default_instance_._instance,
  &::greptime::v1::index::_InvertedIndexStats_default_instance_._instance,
};

const char descriptor_table_protodef_greptime_2fv1_2findex_2finverted_5findex_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n&greptime/v1/index/inverted_index.proto"
  "\022\021greptime.v1.index\"\335\001\n\022InvertedIndexMet"
  "as\022\?\n\005metas\030\001 \003(\01320.greptime.v1.index.In"
  "vertedIndexMetas.MetasEntry\022\027\n\017total_row"
  "_count\030\002 \001(\004\022\031\n\021segment_row_count\030\003 \001(\004\032"
  "R\n\nMetasEntry\022\013\n\003key\030\001 \001(\t\0223\n\005value\030\002 \001("
  "\0132$.greptime.v1.index.InvertedIndexMeta:"
  "\0028\001\"\253\002\n\021InvertedIndexMeta\022\014\n\004name\030\001 \001(\t\022"
  "\023\n\013base_offset\030\002 \001(\004\022\033\n\023inverted_index_s"
  "ize\030\003 \001(\004\022\033\n\023relative_fst_offset\030\004 \001(\r\022\020"
  "\n\010fst_size\030\005 \001(\r\022#\n\033relative_null_bitmap"
  "_offset\030\006 \001(\r\022\030\n\020null_bitmap_size\030\007 \001(\r\022"
  "4\n\005stats\030\010 \001(\0132%.greptime.v1.index.Inver"
  "tedIndexStats\0222\n\013bitmap_type\030\t \001(\0162\035.gre"
  "ptime.v1.index.BitmapType\"f\n\022InvertedInd"
  "exStats\022\022\n\nnull_count\030\001 \001(\004\022\026\n\016distinct_"
  "count\030\002 \001(\004\022\021\n\tmin_value\030\003 \001(\014\022\021\n\tmax_va"
  "lue\030\004 \001(\014*%\n\nBitmapType\022\n\n\006BitVec\020\000\022\013\n\007R"
  "oaring\020\001B=Z;github.com/GreptimeTeam/grep"
  "time-proto/go/greptime/v1/indexb\006proto3"
  ;
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto = {
    false, false, 799, descriptor_table_protodef_greptime_2fv1_2findex_2finverted_5findex_2eproto,
    "greptime/v1/index/inverted_index.proto",
    &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once, nullptr, 0, 4,
    schemas, file_default_instances, TableStruct_greptime_2fv1_2findex_2finverted_5findex_2eproto::offsets,
    file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto, file_level_enum_descriptors_greptime_2fv1_2findex_2finverted_5findex_2eproto,
    file_level_service_descriptors_greptime_2fv1_2findex_2finverted_5findex_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_getter() {
  return &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_greptime_2fv1_2findex_2finverted_5findex_2eproto(&descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto);
namespace greptime {
namespace v1 {
namespace index {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BitmapType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto);
  return file_level_enum_descriptors_greptime_2fv1_2findex_2finverted_5findex_2eproto[0];
}
bool BitmapType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
      return true;
    default:
      return false;
  }
}


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

InvertedIndexMetas_MetasEntry_DoNotUse::InvertedIndexMetas_MetasEntry_DoNotUse() {}
InvertedIndexMetas_MetasEntry_DoNotUse::InvertedIndexMetas_MetasEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void InvertedIndexMetas_MetasEntry_DoNotUse::MergeFrom(const InvertedIndexMetas_MetasEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata InvertedIndexMetas_MetasEntry_DoNotUse::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_getter, &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once,
      file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto[0]);
}

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

class InvertedIndexMetas::_Internal {
 public:
};

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

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.metas_.MergeFrom(from._impl_.metas_);
  ::memcpy(&_impl_.total_row_count_, &from._impl_.total_row_count_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.segment_row_count_) -
    reinterpret_cast<char*>(&_impl_.total_row_count_)) + sizeof(_impl_.segment_row_count_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.index.InvertedIndexMetas)
}

inline void InvertedIndexMetas::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_.metas_)*/{::_pbi::ArenaInitialized(), arena}
    , decltype(_impl_.total_row_count_){uint64_t{0u}}
    , decltype(_impl_.segment_row_count_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* InvertedIndexMetas::_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<string, .greptime.v1.index.InvertedIndexMeta> metas = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&_impl_.metas_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // uint64 total_row_count = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.total_row_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 segment_row_count = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.segment_row_count_ = ::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* InvertedIndexMetas::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.index.InvertedIndexMetas)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // map<string, .greptime.v1.index.InvertedIndexMeta> metas = 1;
  if (!this->_internal_metas().empty()) {
    using MapType = ::_pb::Map<std::string, ::greptime::v1::index::InvertedIndexMeta>;
    using WireHelper = InvertedIndexMetas_MetasEntry_DoNotUse::Funcs;
    const auto& map_field = this->_internal_metas();
    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.index.InvertedIndexMetas.MetasEntry.key");
    };

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

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

  // uint64 segment_row_count = 3;
  if (this->_internal_segment_row_count() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_segment_row_count(), 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.index.InvertedIndexMetas)
  return target;
}

size_t InvertedIndexMetas::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.index.InvertedIndexMetas)
  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, .greptime.v1.index.InvertedIndexMeta> metas = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_metas_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::greptime::v1::index::InvertedIndexMeta >::const_iterator
      it = this->_internal_metas().begin();
      it != this->_internal_metas().end(); ++it) {
    total_size += InvertedIndexMetas_MetasEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

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

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

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

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


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

  _this->_impl_.metas_.MergeFrom(from._impl_.metas_);
  if (from._internal_total_row_count() != 0) {
    _this->_internal_set_total_row_count(from._internal_total_row_count());
  }
  if (from._internal_segment_row_count() != 0) {
    _this->_internal_set_segment_row_count(from._internal_segment_row_count());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata InvertedIndexMetas::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_getter, &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once,
      file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto[1]);
}

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

class InvertedIndexMeta::_Internal {
 public:
  static const ::greptime::v1::index::InvertedIndexStats& stats(const InvertedIndexMeta* msg);
};

const ::greptime::v1::index::InvertedIndexStats&
InvertedIndexMeta::_Internal::stats(const InvertedIndexMeta* msg) {
  return *msg->_impl_.stats_;
}
InvertedIndexMeta::InvertedIndexMeta(::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.index.InvertedIndexMeta)
}
InvertedIndexMeta::InvertedIndexMeta(const InvertedIndexMeta& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  InvertedIndexMeta* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.name_){}
    , decltype(_impl_.stats_){nullptr}
    , decltype(_impl_.base_offset_){}
    , decltype(_impl_.inverted_index_size_){}
    , decltype(_impl_.relative_fst_offset_){}
    , decltype(_impl_.fst_size_){}
    , decltype(_impl_.relative_null_bitmap_offset_){}
    , decltype(_impl_.null_bitmap_size_){}
    , decltype(_impl_.bitmap_type_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_name().empty()) {
    _this->_impl_.name_.Set(from._internal_name(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_stats()) {
    _this->_impl_.stats_ = new ::greptime::v1::index::InvertedIndexStats(*from._impl_.stats_);
  }
  ::memcpy(&_impl_.base_offset_, &from._impl_.base_offset_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.bitmap_type_) -
    reinterpret_cast<char*>(&_impl_.base_offset_)) + sizeof(_impl_.bitmap_type_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.index.InvertedIndexMeta)
}

inline void InvertedIndexMeta::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.name_){}
    , decltype(_impl_.stats_){nullptr}
    , decltype(_impl_.base_offset_){uint64_t{0u}}
    , decltype(_impl_.inverted_index_size_){uint64_t{0u}}
    , decltype(_impl_.relative_fst_offset_){0u}
    , decltype(_impl_.fst_size_){0u}
    , decltype(_impl_.relative_null_bitmap_offset_){0u}
    , decltype(_impl_.null_bitmap_size_){0u}
    , decltype(_impl_.bitmap_type_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void InvertedIndexMeta::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.name_.Destroy();
  if (this != internal_default_instance()) delete _impl_.stats_;
}

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

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

  _impl_.name_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && _impl_.stats_ != nullptr) {
    delete _impl_.stats_;
  }
  _impl_.stats_ = nullptr;
  ::memset(&_impl_.base_offset_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.bitmap_type_) -
      reinterpret_cast<char*>(&_impl_.base_offset_)) + sizeof(_impl_.bitmap_type_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* InvertedIndexMeta::_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 name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.index.InvertedIndexMeta.name"));
        } else
          goto handle_unusual;
        continue;
      // uint64 base_offset = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.base_offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 inverted_index_size = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.inverted_index_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 relative_fst_offset = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.relative_fst_offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 fst_size = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _impl_.fst_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 relative_null_bitmap_offset = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _impl_.relative_null_bitmap_offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 null_bitmap_size = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _impl_.null_bitmap_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.index.InvertedIndexStats stats = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_stats(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .greptime.v1.index.BitmapType bitmap_type = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_bitmap_type(static_cast<::greptime::v1::index::BitmapType>(val));
        } 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* InvertedIndexMeta::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.index.InvertedIndexMeta)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

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

  // uint32 relative_fst_offset = 4;
  if (this->_internal_relative_fst_offset() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_relative_fst_offset(), target);
  }

  // uint32 fst_size = 5;
  if (this->_internal_fst_size() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_fst_size(), target);
  }

  // uint32 relative_null_bitmap_offset = 6;
  if (this->_internal_relative_null_bitmap_offset() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_relative_null_bitmap_offset(), target);
  }

  // uint32 null_bitmap_size = 7;
  if (this->_internal_null_bitmap_size() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_null_bitmap_size(), target);
  }

  // .greptime.v1.index.InvertedIndexStats stats = 8;
  if (this->_internal_has_stats()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::stats(this),
        _Internal::stats(this).GetCachedSize(), target, stream);
  }

  // .greptime.v1.index.BitmapType bitmap_type = 9;
  if (this->_internal_bitmap_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      9, this->_internal_bitmap_type(), 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.index.InvertedIndexMeta)
  return target;
}

size_t InvertedIndexMeta::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.index.InvertedIndexMeta)
  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 name = 1;
  if (!this->_internal_name().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }

  // .greptime.v1.index.InvertedIndexStats stats = 8;
  if (this->_internal_has_stats()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.stats_);
  }

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

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

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

  // uint32 fst_size = 5;
  if (this->_internal_fst_size() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_fst_size());
  }

  // uint32 relative_null_bitmap_offset = 6;
  if (this->_internal_relative_null_bitmap_offset() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_relative_null_bitmap_offset());
  }

  // uint32 null_bitmap_size = 7;
  if (this->_internal_null_bitmap_size() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_null_bitmap_size());
  }

  // .greptime.v1.index.BitmapType bitmap_type = 9;
  if (this->_internal_bitmap_type() != 0) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_bitmap_type());
  }

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

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


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

  if (!from._internal_name().empty()) {
    _this->_internal_set_name(from._internal_name());
  }
  if (from._internal_has_stats()) {
    _this->_internal_mutable_stats()->::greptime::v1::index::InvertedIndexStats::MergeFrom(
        from._internal_stats());
  }
  if (from._internal_base_offset() != 0) {
    _this->_internal_set_base_offset(from._internal_base_offset());
  }
  if (from._internal_inverted_index_size() != 0) {
    _this->_internal_set_inverted_index_size(from._internal_inverted_index_size());
  }
  if (from._internal_relative_fst_offset() != 0) {
    _this->_internal_set_relative_fst_offset(from._internal_relative_fst_offset());
  }
  if (from._internal_fst_size() != 0) {
    _this->_internal_set_fst_size(from._internal_fst_size());
  }
  if (from._internal_relative_null_bitmap_offset() != 0) {
    _this->_internal_set_relative_null_bitmap_offset(from._internal_relative_null_bitmap_offset());
  }
  if (from._internal_null_bitmap_size() != 0) {
    _this->_internal_set_null_bitmap_size(from._internal_null_bitmap_size());
  }
  if (from._internal_bitmap_type() != 0) {
    _this->_internal_set_bitmap_type(from._internal_bitmap_type());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void InvertedIndexMeta::InternalSwap(InvertedIndexMeta* 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_.name_, lhs_arena,
      &other->_impl_.name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(InvertedIndexMeta, _impl_.bitmap_type_)
      + sizeof(InvertedIndexMeta::_impl_.bitmap_type_)
      - PROTOBUF_FIELD_OFFSET(InvertedIndexMeta, _impl_.stats_)>(
          reinterpret_cast<char*>(&_impl_.stats_),
          reinterpret_cast<char*>(&other->_impl_.stats_));
}

::PROTOBUF_NAMESPACE_ID::Metadata InvertedIndexMeta::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_getter, &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once,
      file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto[2]);
}

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

class InvertedIndexStats::_Internal {
 public:
};

InvertedIndexStats::InvertedIndexStats(::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.index.InvertedIndexStats)
}
InvertedIndexStats::InvertedIndexStats(const InvertedIndexStats& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  InvertedIndexStats* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.min_value_){}
    , decltype(_impl_.max_value_){}
    , decltype(_impl_.null_count_){}
    , decltype(_impl_.distinct_count_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.min_value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.min_value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_min_value().empty()) {
    _this->_impl_.min_value_.Set(from._internal_min_value(), 
      _this->GetArenaForAllocation());
  }
  _impl_.max_value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.max_value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_max_value().empty()) {
    _this->_impl_.max_value_.Set(from._internal_max_value(), 
      _this->GetArenaForAllocation());
  }
  ::memcpy(&_impl_.null_count_, &from._impl_.null_count_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.distinct_count_) -
    reinterpret_cast<char*>(&_impl_.null_count_)) + sizeof(_impl_.distinct_count_));
  // @@protoc_insertion_point(copy_constructor:greptime.v1.index.InvertedIndexStats)
}

inline void InvertedIndexStats::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.min_value_){}
    , decltype(_impl_.max_value_){}
    , decltype(_impl_.null_count_){uint64_t{0u}}
    , decltype(_impl_.distinct_count_){uint64_t{0u}}
    , /*decltype(_impl_._cached_size_)*/{}
  };
  _impl_.min_value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.min_value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  _impl_.max_value_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.max_value_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void InvertedIndexStats::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.min_value_.Destroy();
  _impl_.max_value_.Destroy();
}

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

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

  _impl_.min_value_.ClearToEmpty();
  _impl_.max_value_.ClearToEmpty();
  ::memset(&_impl_.null_count_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.distinct_count_) -
      reinterpret_cast<char*>(&_impl_.null_count_)) + sizeof(_impl_.distinct_count_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* InvertedIndexStats::_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 null_count = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.null_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 distinct_count = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.distinct_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes min_value = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_min_value();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes max_value = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_max_value();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

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

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

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

  // bytes max_value = 4;
  if (!this->_internal_max_value().empty()) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_max_value(), 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.index.InvertedIndexStats)
  return target;
}

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

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

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

  // bytes max_value = 4;
  if (!this->_internal_max_value().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_max_value());
  }

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

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

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

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


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

  if (!from._internal_min_value().empty()) {
    _this->_internal_set_min_value(from._internal_min_value());
  }
  if (!from._internal_max_value().empty()) {
    _this->_internal_set_max_value(from._internal_max_value());
  }
  if (from._internal_null_count() != 0) {
    _this->_internal_set_null_count(from._internal_null_count());
  }
  if (from._internal_distinct_count() != 0) {
    _this->_internal_set_distinct_count(from._internal_distinct_count());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void InvertedIndexStats::InternalSwap(InvertedIndexStats* 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_.min_value_, lhs_arena,
      &other->_impl_.min_value_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.max_value_, lhs_arena,
      &other->_impl_.max_value_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(InvertedIndexStats, _impl_.distinct_count_)
      + sizeof(InvertedIndexStats::_impl_.distinct_count_)
      - PROTOBUF_FIELD_OFFSET(InvertedIndexStats, _impl_.null_count_)>(
          reinterpret_cast<char*>(&_impl_.null_count_),
          reinterpret_cast<char*>(&other->_impl_.null_count_));
}

::PROTOBUF_NAMESPACE_ID::Metadata InvertedIndexStats::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_getter, &descriptor_table_greptime_2fv1_2findex_2finverted_5findex_2eproto_once,
      file_level_metadata_greptime_2fv1_2findex_2finverted_5findex_2eproto[3]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace index
}  // namespace v1
}  // namespace greptime
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse*
Arena::CreateMaybeMessage< ::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::index::InvertedIndexMetas_MetasEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::index::InvertedIndexMetas*
Arena::CreateMaybeMessage< ::greptime::v1::index::InvertedIndexMetas >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::index::InvertedIndexMetas >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::index::InvertedIndexMeta*
Arena::CreateMaybeMessage< ::greptime::v1::index::InvertedIndexMeta >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::index::InvertedIndexMeta >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::index::InvertedIndexStats*
Arena::CreateMaybeMessage< ::greptime::v1::index::InvertedIndexStats >(Arena* arena) {
  return Arena::CreateMessageInternal< ::greptime::v1::index::InvertedIndexStats >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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