//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package exec;

option java_package = "org.apache.drill.exec.proto";
option java_outer_classname = "CoordinationProtos";
option optimize_for = SPEED;

message DrillbitEndpoint{
  optional string address = 1;
  optional int32 user_port = 2;
  optional int32 control_port = 3;
  optional int32 data_port = 4;
  optional Roles roles = 5;
  optional string version = 6;
  enum State {
      STARTUP = 0;
      ONLINE = 1;
      QUIESCENT = 2;
      OFFLINE = 3;
  }
  optional State state = 7;
  optional int32 http_port = 8;
}

message DrillServiceInstance{
  optional string id = 1;
  optional int64 registrationTimeUTC = 2;
  optional DrillbitEndpoint endpoint = 3;
}

message Roles{
	optional bool sql_query = 1 [default = true];
	optional bool logical_plan = 2 [default = true];
	optional bool physical_plan = 3 [default = true];
	optional bool java_executor = 4 [default = true];
	optional bool distributed_cache = 5 [default = true];
}
