syntax = "proto3";
package coerce.sharding;
message AllocateShard {
uint32 shard_id = 1;
bool rebalancing = 2;
}
message RemoteShard {
uint32 shard_id = 1;
uint64 node_id = 2;
}
message ShardAllocated {
RemoteShard shard = 1;
}
message ShardReallocating {
uint32 shard_id = 1;
}
message StopShard {
uint32 shard_id = 1;
uint64 origin_node_id = 2;
string request_id = 3;
}
message ShardStopped {
uint32 shard_id = 1;
uint64 origin_node_id = 2;
bool is_successful = 3;
}
message AllocateShardResult {
enum Type {
ALLOCATED = 0;
ALREADY_ALLOCATED = 1;
NOT_ALLOCATED = 2;
ERR = 3;
}
enum AllocateShardErr {
UNKNOWN = 0;
PERSISTENCE = 1;
}
Type result_type = 1;
RemoteShard allocation = 2;
AllocateShardErr err = 3;
}
message RemoteEntityRequest {
message Recipe {
bytes recipe = 1;
}
string request_id = 1;
string actor_id = 2;
string message_type = 3;
bytes message = 4;
Recipe recipe = 5;
uint64 origin_node = 6;
}
enum EntityState {
IDLE = 0;
ACTIVE = 1;
PASSIVATED = 2;
}
message StartEntity {
string actor_id = 1;
bytes recipe = 2;
}
message PassivateEntity {
string actor_id = 1;
}
message RemoveEntity {
string actor_id = 1;
}
message ShardStateSnapshot {
message Entity {
string actor_id = 1;
bytes recipe = 2;
EntityState state = 3;
}
uint32 shard_id = 1;
uint64 node_id = 2;
repeated Entity entities = 3;
}
enum ShardHostStatus {
UNKNOWN = 0;
STARTING = 1;
READY = 2;
UNAVAILABLE = 3;
}
message GetShardingStats {
}
message NodeStats {
uint64 node_id = 1;
uint64 shard_count = 2;
ShardHostStatus status = 3;
}
message ShardingStats {
string entity_type = 1;
uint64 total_shards = 2;
repeated RemoteShard shards = 3;
repeated NodeStats nodes = 4;
}
message GetShardStats {
}
message ShardStats {
uint32 shard_id = 1;
uint64 node_id = 2;
repeated string entities = 3;
}