package exec.bit.data;

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

import "ExecutionProtos.proto";
import "Coordination.proto";
import "UserBitShared.proto";

enum RpcType {
  HANDSHAKE = 0;
  ACK = 1;
  GOODBYE = 2;
  REQ_RECORD_BATCH = 3; // send record batch, returns Ack

  // both bit request and response
  SASL_MESSAGE = 4;
}

message BitClientHandshake{
  optional int32 rpc_version = 1;
  optional exec.shared.RpcChannel channel = 2 [default = BIT_DATA];
}

message BitServerHandshake{
  optional int32 rpc_version = 1;
  repeated string authenticationMechanisms = 2;
}

message FragmentRecordBatch{
  optional exec.shared.QueryId query_id = 1;
  optional int32 receiving_major_fragment_id = 2;
  repeated int32 receiving_minor_fragment_id = 3; 
  optional int32 sending_major_fragment_id = 4;
  optional int32 sending_minor_fragment_id = 5;
  optional exec.shared.RecordBatchDef def = 6;
  optional bool isLastBatch = 7;
}
