/**
 * Copyright (C) 2015-2018 Lightbend Inc. <https://www.lightbend.com>
 */

option java_package = "akka.cluster.sharding.protobuf.msg";
option optimize_for = SPEED;

message CoordinatorState {

  message ShardEntry {
    required string shardId = 1;
    required string regionRef = 2;
  }
  
  repeated ShardEntry shards = 1;
  repeated string regions = 2;
  repeated string regionProxies = 3;
  repeated string unallocatedShards = 4; 
}

message ActorRefMessage {
  required string ref = 1;
}

message ShardIdMessage {
  required string shard = 1;
}

message ShardHomeAllocated {
  required string shard = 1;
  required string region = 2;
}

message ShardHome {
  required string shard = 1;
  required string region = 2;
}

message EntityState {
  repeated string entities = 1;
}

message EntityStarted {
  required string entityId = 1;
}

message EntityStopped {
  required string entityId = 1;
}

message ShardStats {
    required string shard = 1;
    required int32 entityCount = 2;
}

message ShardRegionStats {
  repeated MapFieldEntry stats = 1;
}

message MapFieldEntry {
    optional string key = 1;
    optional int32 value = 2;
}

message StartEntity {
    required string entityId = 1;
}

message StartEntityAck {
    required string entityId = 1;
    required string shardId = 2;
}
