actordb-protocol 0.11.0

Language-neutral peer and application wire contracts for ActorDB
Documentation
syntax = "proto3";
package actordb.rpc.v1;
import "meta.proto";

// Typed unary RPC contract. Authentication and authorization belong to adapters.
service ActorDb { rpc Call(Request) returns (Response); }

message Get { string key = 1; meta.Priority priority = 2; }
message Put {
  string key = 1;
  bytes value = 2;
  optional uint64 ttl_ms = 3;
  meta.Priority priority = 4;
  optional bytes write_concern = 5;
}
message Delete { string key = 1; meta.Priority priority = 2; optional bytes write_concern = 3; }
message BatchGet { repeated string keys = 1; meta.Priority priority = 2; }
message BatchPut { repeated Put puts = 1; meta.Priority priority = 2; }
message Query { string sql = 1; repeated meta.QueryCell params = 2; }
message Inspect {}
message Scan {
  uint32 matcher_kind = 1;
  bytes prefix = 2;
  uint32 transform_kind = 3;
  uint32 prefix_bytes = 4;
  uint32 limit = 5;
  uint64 offset = 6;
}
message Request {
  oneof operation {
    Get get = 2;
    Put put = 3;
    Delete delete = 4;
    BatchGet batch_get = 5;
    BatchPut batch_put = 6;
    Query query = 7;
    Inspect inspect = 8;
    Scan scan = 9;
  }
  // Required logical table namespace. Tables share the node and peer listener
  // while isolating their key, cache, query, and durable storage state.
  string table = 1;
}
enum ErrorCode {
  ERROR_CODE_UNKNOWN = 0;
  ERROR_CODE_INVALID = 1;
  ERROR_CODE_BACKPRESSURE = 2;
  ERROR_CODE_STORAGE = 3;
  ERROR_CODE_UNAVAILABLE = 4;
  ERROR_CODE_SUPERSEDED = 5;
  ERROR_CODE_EXPIRED = 6;
  ERROR_CODE_SHUTTING_DOWN = 7;
  ERROR_CODE_QUERY = 8;
  ERROR_CODE_UNSUPPORTED = 9;
  ERROR_CODE_RESOURCE_LIMIT = 10;
  ERROR_CODE_UNKNOWN_OUTCOME = 11;
  ERROR_CODE_QUERY_CHANGED = 12;
}
message Error {
  ErrorCode code = 1;
  string message = 2;
  uint64 winner_timestamp_ms = 3;
  string winner_node_id = 4;
  bool winner_is_tombstone = 5;
  uint64 winner_logical_counter = 6;
}
message Value {
  bytes bytes = 1;
  uint64 timestamp_ms = 2;
  string node_id = 3;
  optional uint64 expires_at_ms = 4;
  uint64 logical_counter = 5;
}
message ReadResult { string key = 1; Value value = 2; Error error = 3; }
message MutationResult { string key = 1; Error error = 2; optional bytes write_concern = 3; }
message QueryRow { repeated meta.QueryCell cells = 1; }
message QueryResult { repeated string columns = 1; repeated QueryRow rows = 2; }
message FragmentHealth {
  uint32 fragment = 1;
  uint64 worker_count = 2;
  repeated string worker_names = 3;
  map<string, uint64> restarts = 4;
  uint64 shed_high = 6;
  uint64 shed_default = 7;
  uint64 shed_background = 8;
}
message Placement {
  uint32 fragment = 1;
  repeated string replica_ids = 2;
  string state = 3;
}
message Inspection {
  string node_id = 1;
  string peer_addr = 2;
  uint64 peer_count = 3;
  repeated FragmentHealth health = 4;
  repeated Placement placement = 5;
  bool dynamic = 6;
}
message Response {
  Error error = 1;
  repeated ReadResult reads = 2;
  repeated MutationResult mutations = 3;
  QueryResult query = 4;
  Inspection inspection = 5;
  repeated meta.ScanMatch scans = 6;
}