syntax = "proto2";

option java_multiple_files = true;
option java_package = "alluxio.grpc";
option java_outer_classname = "VersionProto";

package alluxio.grpc.version;


enum ServiceType {
  UNKNOWN_SERVICE = 0;
  FILE_SYSTEM_MASTER_CLIENT_SERVICE = 1;
  FILE_SYSTEM_MASTER_WORKER_SERVICE = 2;
  FILE_SYSTEM_MASTER_JOB_SERVICE = 3;
  BLOCK_MASTER_CLIENT_SERVICE = 4;
  BLOCK_MASTER_WORKER_SERVICE = 5;
  META_MASTER_CONFIG_SERVICE = 6;
  META_MASTER_CLIENT_SERVICE = 7;
  META_MASTER_MASTER_SERVICE = 8;
  METRICS_MASTER_CLIENT_SERVICE = 9;
  JOB_MASTER_CLIENT_SERVICE = 10;
  JOB_MASTER_WORKER_SERVICE = 11;
  FILE_SYSTEM_WORKER_WORKER_SERVICE = 12;
  JOURNAL_MASTER_CLIENT_SERVICE = 13;
  TABLE_MASTER_CLIENT_SERVICE = 14;
  META_MASTER_BACKUP_MESSAGING_SERVICE = 15;
}

message GetServiceVersionPRequest {
  optional ServiceType serviceType = 1;
}
message GetServiceVersionPResponse {
  optional int64 version = 1;
}

service ServiceVersionClientService {

  /**
   * Returns the version of the master service.
   * NOTE: The version should be updated every time a backwards incompatible API change occurs.
   */
  rpc getServiceVersion(GetServiceVersionPRequest) returns (GetServiceVersionPResponse);
}
