syntax = "proto2";
package oneflow;

message LoadServerRequest {
  required string addr = 1;
  optional int64 rank = 2 [default = -1];
}

message LoadServerResponse {
}

message BarrierRequest {
  required string name = 1;
  required int32 num = 2;
}

message BarrierResponse {
}

enum TryLockResult {
  kLocked = 0;
  kDone = 1;
  kDoing = 2;
}

message TryLockRequest {
  required string name = 1;
}

message TryLockResponse {
  required TryLockResult result = 1;
}

message NotifyDoneRequest {
  required string name = 1;
}

message NotifyDoneResponse {
}

message WaitUntilDoneRequest {
  required string name = 1;
}

message WaitUntilDoneResponse {
}

message PushKVRequest {
  required string key = 1;
  required bytes val = 2;
}

message PushKVResponse {
}

message ClearKVRequest {
  required string key = 1;
}

message ClearKVResponse {
}

message PullKVRequest {
  required string key = 1;
}

message PullKVResponse {
  required bytes val = 1;
}

message ClearRequest {
}

message ClearResponse {
}

message IncreaseCountRequest {
  required string key = 1;
  required int32 val = 2;
}

message IncreaseCountResponse {
  required int32 val = 1;
}

message EraseCountRequest {
  required string key = 1;
}

message EraseCountResponse {
}
