// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: Coordination.proto

#include "Coordination.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>
extern PROTOBUF_INTERNAL_EXPORT_Coordination_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DrillbitEndpoint_Coordination_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_Coordination_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Roles_Coordination_2eproto;
namespace exec {
class DrillbitEndpointDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DrillbitEndpoint> _instance;
} _DrillbitEndpoint_default_instance_;
class DrillServiceInstanceDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DrillServiceInstance> _instance;
} _DrillServiceInstance_default_instance_;
class RolesDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Roles> _instance;
} _Roles_default_instance_;
}  // namespace exec
static void InitDefaultsscc_info_DrillServiceInstance_Coordination_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::exec::_DrillServiceInstance_default_instance_;
    new (ptr) ::exec::DrillServiceInstance();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::exec::DrillServiceInstance::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DrillServiceInstance_Coordination_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_DrillServiceInstance_Coordination_2eproto}, {
      &scc_info_DrillbitEndpoint_Coordination_2eproto.base,}};

static void InitDefaultsscc_info_DrillbitEndpoint_Coordination_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::exec::_DrillbitEndpoint_default_instance_;
    new (ptr) ::exec::DrillbitEndpoint();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::exec::DrillbitEndpoint::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DrillbitEndpoint_Coordination_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_DrillbitEndpoint_Coordination_2eproto}, {
      &scc_info_Roles_Coordination_2eproto.base,}};

static void InitDefaultsscc_info_Roles_Coordination_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::exec::_Roles_default_instance_;
    new (ptr) ::exec::Roles();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::exec::Roles::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Roles_Coordination_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Roles_Coordination_2eproto}, {}};

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_Coordination_2eproto[3];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_Coordination_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_Coordination_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_Coordination_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, address_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, user_port_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, control_port_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, data_port_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, roles_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, version_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, state_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillbitEndpoint, http_port_),
  0,
  3,
  4,
  5,
  2,
  1,
  6,
  7,
  PROTOBUF_FIELD_OFFSET(::exec::DrillServiceInstance, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillServiceInstance, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::exec::DrillServiceInstance, id_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillServiceInstance, registrationtimeutc_),
  PROTOBUF_FIELD_OFFSET(::exec::DrillServiceInstance, endpoint_),
  0,
  2,
  1,
  PROTOBUF_FIELD_OFFSET(::exec::Roles, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::exec::Roles, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::exec::Roles, sql_query_),
  PROTOBUF_FIELD_OFFSET(::exec::Roles, logical_plan_),
  PROTOBUF_FIELD_OFFSET(::exec::Roles, physical_plan_),
  PROTOBUF_FIELD_OFFSET(::exec::Roles, java_executor_),
  PROTOBUF_FIELD_OFFSET(::exec::Roles, distributed_cache_),
  0,
  1,
  2,
  3,
  4,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 13, sizeof(::exec::DrillbitEndpoint)},
  { 21, 29, sizeof(::exec::DrillServiceInstance)},
  { 32, 42, sizeof(::exec::Roles)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::exec::_DrillbitEndpoint_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::exec::_DrillServiceInstance_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::exec::_Roles_default_instance_),
};

const char descriptor_table_protodef_Coordination_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\022Coordination.proto\022\004exec\"\212\002\n\020DrillbitE"
  "ndpoint\022\017\n\007address\030\001 \001(\t\022\021\n\tuser_port\030\002 "
  "\001(\005\022\024\n\014control_port\030\003 \001(\005\022\021\n\tdata_port\030\004"
  " \001(\005\022\032\n\005roles\030\005 \001(\0132\013.exec.Roles\022\017\n\007vers"
  "ion\030\006 \001(\t\022+\n\005state\030\007 \001(\0162\034.exec.Drillbit"
  "Endpoint.State\022\021\n\thttp_port\030\010 \001(\005\"<\n\005Sta"
  "te\022\013\n\007STARTUP\020\000\022\n\n\006ONLINE\020\001\022\r\n\tQUIESCENT"
  "\020\002\022\013\n\007OFFLINE\020\003\"i\n\024DrillServiceInstance\022"
  "\n\n\002id\030\001 \001(\t\022\033\n\023registrationTimeUTC\030\002 \001(\003"
  "\022(\n\010endpoint\030\003 \001(\0132\026.exec.DrillbitEndpoi"
  "nt\"\227\001\n\005Roles\022\027\n\tsql_query\030\001 \001(\010:\004true\022\032\n"
  "\014logical_plan\030\002 \001(\010:\004true\022\033\n\rphysical_pl"
  "an\030\003 \001(\010:\004true\022\033\n\rjava_executor\030\004 \001(\010:\004t"
  "rue\022\037\n\021distributed_cache\030\005 \001(\010:\004trueB3\n\033"
  "org.apache.drill.exec.protoB\022Coordinatio"
  "nProtosH\001"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_Coordination_2eproto_deps[1] = {
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_Coordination_2eproto_sccs[3] = {
  &scc_info_DrillServiceInstance_Coordination_2eproto.base,
  &scc_info_DrillbitEndpoint_Coordination_2eproto.base,
  &scc_info_Roles_Coordination_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Coordination_2eproto_once;
static bool descriptor_table_Coordination_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Coordination_2eproto = {
  &descriptor_table_Coordination_2eproto_initialized, descriptor_table_protodef_Coordination_2eproto, "Coordination.proto", 609,
  &descriptor_table_Coordination_2eproto_once, descriptor_table_Coordination_2eproto_sccs, descriptor_table_Coordination_2eproto_deps, 3, 0,
  schemas, file_default_instances, TableStruct_Coordination_2eproto::offsets,
  file_level_metadata_Coordination_2eproto, 3, file_level_enum_descriptors_Coordination_2eproto, file_level_service_descriptors_Coordination_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_Coordination_2eproto = (  ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_Coordination_2eproto), true);
namespace exec {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DrillbitEndpoint_State_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_Coordination_2eproto);
  return file_level_enum_descriptors_Coordination_2eproto[0];
}
bool DrillbitEndpoint_State_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr DrillbitEndpoint_State DrillbitEndpoint::STARTUP;
constexpr DrillbitEndpoint_State DrillbitEndpoint::ONLINE;
constexpr DrillbitEndpoint_State DrillbitEndpoint::QUIESCENT;
constexpr DrillbitEndpoint_State DrillbitEndpoint::OFFLINE;
constexpr DrillbitEndpoint_State DrillbitEndpoint::State_MIN;
constexpr DrillbitEndpoint_State DrillbitEndpoint::State_MAX;
constexpr int DrillbitEndpoint::State_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)

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

void DrillbitEndpoint::InitAsDefaultInstance() {
  ::exec::_DrillbitEndpoint_default_instance_._instance.get_mutable()->roles_ = const_cast< ::exec::Roles*>(
      ::exec::Roles::internal_default_instance());
}
class DrillbitEndpoint::_Internal {
 public:
  using HasBits = decltype(std::declval<DrillbitEndpoint>()._has_bits_);
  static void set_has_address(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_user_port(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_control_port(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_data_port(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static const ::exec::Roles& roles(const DrillbitEndpoint* msg);
  static void set_has_roles(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_state(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_http_port(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
};

const ::exec::Roles&
DrillbitEndpoint::_Internal::roles(const DrillbitEndpoint* msg) {
  return *msg->roles_;
}
DrillbitEndpoint::DrillbitEndpoint()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:exec.DrillbitEndpoint)
}
DrillbitEndpoint::DrillbitEndpoint(const DrillbitEndpoint& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_address()) {
    address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.address_);
  }
  version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_version()) {
    version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
  }
  if (from._internal_has_roles()) {
    roles_ = new ::exec::Roles(*from.roles_);
  } else {
    roles_ = nullptr;
  }
  ::memcpy(&user_port_, &from.user_port_,
    static_cast<size_t>(reinterpret_cast<char*>(&http_port_) -
    reinterpret_cast<char*>(&user_port_)) + sizeof(http_port_));
  // @@protoc_insertion_point(copy_constructor:exec.DrillbitEndpoint)
}

void DrillbitEndpoint::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DrillbitEndpoint_Coordination_2eproto.base);
  address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&roles_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&http_port_) -
      reinterpret_cast<char*>(&roles_)) + sizeof(http_port_));
}

DrillbitEndpoint::~DrillbitEndpoint() {
  // @@protoc_insertion_point(destructor:exec.DrillbitEndpoint)
  SharedDtor();
}

void DrillbitEndpoint::SharedDtor() {
  address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete roles_;
}

void DrillbitEndpoint::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const DrillbitEndpoint& DrillbitEndpoint::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DrillbitEndpoint_Coordination_2eproto.base);
  return *internal_default_instance();
}


void DrillbitEndpoint::Clear() {
// @@protoc_insertion_point(message_clear_start:exec.DrillbitEndpoint)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      address_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      version_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(roles_ != nullptr);
      roles_->Clear();
    }
  }
  if (cached_has_bits & 0x000000f8u) {
    ::memset(&user_port_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&http_port_) -
        reinterpret_cast<char*>(&user_port_)) + sizeof(http_port_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

const char* DrillbitEndpoint::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional string address = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_address();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "exec.DrillbitEndpoint.address");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 user_port = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_user_port(&has_bits);
          user_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 control_port = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_control_port(&has_bits);
          control_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 data_port = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_data_port(&has_bits);
          data_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .exec.Roles roles = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_roles(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string version = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
          auto str = _internal_mutable_version();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "exec.DrillbitEndpoint.version");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .exec.DrillbitEndpoint.State state = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::exec::DrillbitEndpoint_State_IsValid(val))) {
            _internal_set_state(static_cast<::exec::DrillbitEndpoint_State>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional int32 http_port = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
          _Internal::set_has_http_port(&has_bits);
          http_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* DrillbitEndpoint::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:exec.DrillbitEndpoint)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string address = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_address().data(), static_cast<int>(this->_internal_address().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "exec.DrillbitEndpoint.address");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_address(), target);
  }

  // optional int32 user_port = 2;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_user_port(), target);
  }

  // optional int32 control_port = 3;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_control_port(), target);
  }

  // optional int32 data_port = 4;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_data_port(), target);
  }

  // optional .exec.Roles roles = 5;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        5, _Internal::roles(this), target, stream);
  }

  // optional string version = 6;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_version().data(), static_cast<int>(this->_internal_version().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "exec.DrillbitEndpoint.version");
    target = stream->WriteStringMaybeAliased(
        6, this->_internal_version(), target);
  }

  // optional .exec.DrillbitEndpoint.State state = 7;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      7, this->_internal_state(), target);
  }

  // optional int32 http_port = 8;
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_http_port(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:exec.DrillbitEndpoint)
  return target;
}

size_t DrillbitEndpoint::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:exec.DrillbitEndpoint)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional string address = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_address());
    }

    // optional string version = 6;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_version());
    }

    // optional .exec.Roles roles = 5;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *roles_);
    }

    // optional int32 user_port = 2;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_user_port());
    }

    // optional int32 control_port = 3;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_control_port());
    }

    // optional int32 data_port = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_data_port());
    }

    // optional .exec.DrillbitEndpoint.State state = 7;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_state());
    }

    // optional int32 http_port = 8;
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_http_port());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DrillbitEndpoint::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:exec.DrillbitEndpoint)
  GOOGLE_DCHECK_NE(&from, this);
  const DrillbitEndpoint* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DrillbitEndpoint>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:exec.DrillbitEndpoint)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:exec.DrillbitEndpoint)
    MergeFrom(*source);
  }
}

void DrillbitEndpoint::MergeFrom(const DrillbitEndpoint& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:exec.DrillbitEndpoint)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.address_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_mutable_roles()->::exec::Roles::MergeFrom(from._internal_roles());
    }
    if (cached_has_bits & 0x00000008u) {
      user_port_ = from.user_port_;
    }
    if (cached_has_bits & 0x00000010u) {
      control_port_ = from.control_port_;
    }
    if (cached_has_bits & 0x00000020u) {
      data_port_ = from.data_port_;
    }
    if (cached_has_bits & 0x00000040u) {
      state_ = from.state_;
    }
    if (cached_has_bits & 0x00000080u) {
      http_port_ = from.http_port_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void DrillbitEndpoint::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:exec.DrillbitEndpoint)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void DrillbitEndpoint::CopyFrom(const DrillbitEndpoint& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:exec.DrillbitEndpoint)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void DrillbitEndpoint::InternalSwap(DrillbitEndpoint* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  address_.Swap(&other->address_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  version_.Swap(&other->version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(roles_, other->roles_);
  swap(user_port_, other->user_port_);
  swap(control_port_, other->control_port_);
  swap(data_port_, other->data_port_);
  swap(state_, other->state_);
  swap(http_port_, other->http_port_);
}

::PROTOBUF_NAMESPACE_ID::Metadata DrillbitEndpoint::GetMetadata() const {
  return GetMetadataStatic();
}


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

void DrillServiceInstance::InitAsDefaultInstance() {
  ::exec::_DrillServiceInstance_default_instance_._instance.get_mutable()->endpoint_ = const_cast< ::exec::DrillbitEndpoint*>(
      ::exec::DrillbitEndpoint::internal_default_instance());
}
class DrillServiceInstance::_Internal {
 public:
  using HasBits = decltype(std::declval<DrillServiceInstance>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_registrationtimeutc(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::exec::DrillbitEndpoint& endpoint(const DrillServiceInstance* msg);
  static void set_has_endpoint(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::exec::DrillbitEndpoint&
DrillServiceInstance::_Internal::endpoint(const DrillServiceInstance* msg) {
  return *msg->endpoint_;
}
DrillServiceInstance::DrillServiceInstance()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:exec.DrillServiceInstance)
}
DrillServiceInstance::DrillServiceInstance(const DrillServiceInstance& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_id()) {
    id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.id_);
  }
  if (from._internal_has_endpoint()) {
    endpoint_ = new ::exec::DrillbitEndpoint(*from.endpoint_);
  } else {
    endpoint_ = nullptr;
  }
  registrationtimeutc_ = from.registrationtimeutc_;
  // @@protoc_insertion_point(copy_constructor:exec.DrillServiceInstance)
}

void DrillServiceInstance::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DrillServiceInstance_Coordination_2eproto.base);
  id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&endpoint_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&registrationtimeutc_) -
      reinterpret_cast<char*>(&endpoint_)) + sizeof(registrationtimeutc_));
}

DrillServiceInstance::~DrillServiceInstance() {
  // @@protoc_insertion_point(destructor:exec.DrillServiceInstance)
  SharedDtor();
}

void DrillServiceInstance::SharedDtor() {
  id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete endpoint_;
}

void DrillServiceInstance::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const DrillServiceInstance& DrillServiceInstance::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DrillServiceInstance_Coordination_2eproto.base);
  return *internal_default_instance();
}


void DrillServiceInstance::Clear() {
// @@protoc_insertion_point(message_clear_start:exec.DrillServiceInstance)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      id_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(endpoint_ != nullptr);
      endpoint_->Clear();
    }
  }
  registrationtimeutc_ = PROTOBUF_LONGLONG(0);
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

const char* DrillServiceInstance::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional string id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_id();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "exec.DrillServiceInstance.id");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 registrationTimeUTC = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_registrationtimeutc(&has_bits);
          registrationtimeutc_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .exec.DrillbitEndpoint endpoint = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_endpoint(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* DrillServiceInstance::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:exec.DrillServiceInstance)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string id = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_id().data(), static_cast<int>(this->_internal_id().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "exec.DrillServiceInstance.id");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_id(), target);
  }

  // optional int64 registrationTimeUTC = 2;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_registrationtimeutc(), target);
  }

  // optional .exec.DrillbitEndpoint endpoint = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::endpoint(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:exec.DrillServiceInstance)
  return target;
}

size_t DrillServiceInstance::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:exec.DrillServiceInstance)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string id = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_id());
    }

    // optional .exec.DrillbitEndpoint endpoint = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *endpoint_);
    }

    // optional int64 registrationTimeUTC = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_registrationtimeutc());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DrillServiceInstance::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:exec.DrillServiceInstance)
  GOOGLE_DCHECK_NE(&from, this);
  const DrillServiceInstance* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DrillServiceInstance>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:exec.DrillServiceInstance)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:exec.DrillServiceInstance)
    MergeFrom(*source);
  }
}

void DrillServiceInstance::MergeFrom(const DrillServiceInstance& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:exec.DrillServiceInstance)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.id_);
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_endpoint()->::exec::DrillbitEndpoint::MergeFrom(from._internal_endpoint());
    }
    if (cached_has_bits & 0x00000004u) {
      registrationtimeutc_ = from.registrationtimeutc_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void DrillServiceInstance::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:exec.DrillServiceInstance)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void DrillServiceInstance::CopyFrom(const DrillServiceInstance& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:exec.DrillServiceInstance)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void DrillServiceInstance::InternalSwap(DrillServiceInstance* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  id_.Swap(&other->id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(endpoint_, other->endpoint_);
  swap(registrationtimeutc_, other->registrationtimeutc_);
}

::PROTOBUF_NAMESPACE_ID::Metadata DrillServiceInstance::GetMetadata() const {
  return GetMetadataStatic();
}


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

void Roles::InitAsDefaultInstance() {
}
class Roles::_Internal {
 public:
  using HasBits = decltype(std::declval<Roles>()._has_bits_);
  static void set_has_sql_query(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_logical_plan(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_physical_plan(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_java_executor(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_distributed_cache(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

Roles::Roles()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:exec.Roles)
}
Roles::Roles(const Roles& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&sql_query_, &from.sql_query_,
    static_cast<size_t>(reinterpret_cast<char*>(&distributed_cache_) -
    reinterpret_cast<char*>(&sql_query_)) + sizeof(distributed_cache_));
  // @@protoc_insertion_point(copy_constructor:exec.Roles)
}

void Roles::SharedCtor() {
  sql_query_ = true;
  logical_plan_ = true;
  physical_plan_ = true;
  java_executor_ = true;
  distributed_cache_ = true;
}

Roles::~Roles() {
  // @@protoc_insertion_point(destructor:exec.Roles)
  SharedDtor();
}

void Roles::SharedDtor() {
}

void Roles::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Roles& Roles::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Roles_Coordination_2eproto.base);
  return *internal_default_instance();
}


void Roles::Clear() {
// @@protoc_insertion_point(message_clear_start:exec.Roles)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    sql_query_ = true;
    logical_plan_ = true;
    physical_plan_ = true;
    java_executor_ = true;
    distributed_cache_ = true;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

const char* Roles::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional bool sql_query = 1 [default = true];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_sql_query(&has_bits);
          sql_query_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool logical_plan = 2 [default = true];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_logical_plan(&has_bits);
          logical_plan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool physical_plan = 3 [default = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_physical_plan(&has_bits);
          physical_plan_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool java_executor = 4 [default = true];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_java_executor(&has_bits);
          java_executor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool distributed_cache = 5 [default = true];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
          _Internal::set_has_distributed_cache(&has_bits);
          distributed_cache_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Roles::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:exec.Roles)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional bool sql_query = 1 [default = true];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_sql_query(), target);
  }

  // optional bool logical_plan = 2 [default = true];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_logical_plan(), target);
  }

  // optional bool physical_plan = 3 [default = true];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_physical_plan(), target);
  }

  // optional bool java_executor = 4 [default = true];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_java_executor(), target);
  }

  // optional bool distributed_cache = 5 [default = true];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_distributed_cache(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:exec.Roles)
  return target;
}

size_t Roles::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:exec.Roles)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    // optional bool sql_query = 1 [default = true];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 + 1;
    }

    // optional bool logical_plan = 2 [default = true];
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 + 1;
    }

    // optional bool physical_plan = 3 [default = true];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 + 1;
    }

    // optional bool java_executor = 4 [default = true];
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 + 1;
    }

    // optional bool distributed_cache = 5 [default = true];
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Roles::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:exec.Roles)
  GOOGLE_DCHECK_NE(&from, this);
  const Roles* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Roles>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:exec.Roles)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:exec.Roles)
    MergeFrom(*source);
  }
}

void Roles::MergeFrom(const Roles& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:exec.Roles)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      sql_query_ = from.sql_query_;
    }
    if (cached_has_bits & 0x00000002u) {
      logical_plan_ = from.logical_plan_;
    }
    if (cached_has_bits & 0x00000004u) {
      physical_plan_ = from.physical_plan_;
    }
    if (cached_has_bits & 0x00000008u) {
      java_executor_ = from.java_executor_;
    }
    if (cached_has_bits & 0x00000010u) {
      distributed_cache_ = from.distributed_cache_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Roles::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:exec.Roles)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Roles::CopyFrom(const Roles& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:exec.Roles)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void Roles::InternalSwap(Roles* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  swap(sql_query_, other->sql_query_);
  swap(logical_plan_, other->logical_plan_);
  swap(physical_plan_, other->physical_plan_);
  swap(java_executor_, other->java_executor_);
  swap(distributed_cache_, other->distributed_cache_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Roles::GetMetadata() const {
  return GetMetadataStatic();
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace exec
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::exec::DrillbitEndpoint* Arena::CreateMaybeMessage< ::exec::DrillbitEndpoint >(Arena* arena) {
  return Arena::CreateInternal< ::exec::DrillbitEndpoint >(arena);
}
template<> PROTOBUF_NOINLINE ::exec::DrillServiceInstance* Arena::CreateMaybeMessage< ::exec::DrillServiceInstance >(Arena* arena) {
  return Arena::CreateInternal< ::exec::DrillServiceInstance >(arena);
}
template<> PROTOBUF_NOINLINE ::exec::Roles* Arena::CreateMaybeMessage< ::exec::Roles >(Arena* arena) {
  return Arena::CreateInternal< ::exec::Roles >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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