#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Hello {
#[prost(string, tag = "1")]
pub identity: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub challenge: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, tag = "3")]
pub min_version: u32,
#[prost(uint32, tag = "4")]
pub max_version: u32,
#[prost(uint64, tag = "5")]
pub capabilities: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Auth {
#[prost(bytes = "vec", tag = "1")]
pub proof: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Frame {
#[prost(oneof = "frame::Message", tags = "1, 2, 3, 4")]
pub message: ::core::option::Option<frame::Message>,
}
pub mod frame {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
#[prost(message, tag = "1")]
Hello(super::Hello),
#[prost(message, tag = "2")]
Auth(super::Auth),
#[prost(message, tag = "3")]
Request(super::Request),
#[prost(message, tag = "4")]
Response(super::Response),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Get {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(enumeration = "super::meta::Priority", tag = "2")]
pub priority: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Put {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, optional, tag = "3")]
pub ttl_ms: ::core::option::Option<u64>,
#[prost(enumeration = "super::meta::Priority", tag = "4")]
pub priority: i32,
#[prost(bytes = "vec", optional, tag = "5")]
pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Delete {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(enumeration = "super::meta::Priority", tag = "2")]
pub priority: i32,
#[prost(bytes = "vec", optional, tag = "3")]
pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchGet {
#[prost(string, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "super::meta::Priority", tag = "2")]
pub priority: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPut {
#[prost(message, repeated, tag = "1")]
pub puts: ::prost::alloc::vec::Vec<Put>,
#[prost(enumeration = "super::meta::Priority", tag = "2")]
pub priority: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Query {
#[prost(string, tag = "1")]
pub sql: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub params: ::prost::alloc::vec::Vec<super::meta::QueryCell>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Inspect {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Scan {
#[prost(uint32, tag = "1")]
pub matcher_kind: u32,
#[prost(bytes = "vec", tag = "2")]
pub prefix: ::prost::alloc::vec::Vec<u8>,
#[prost(uint32, tag = "3")]
pub transform_kind: u32,
#[prost(uint32, tag = "4")]
pub prefix_bytes: u32,
#[prost(uint32, tag = "5")]
pub limit: u32,
#[prost(uint64, tag = "6")]
pub offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
#[prost(uint64, tag = "1")]
pub id: u64,
#[prost(oneof = "request::Operation", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
pub operation: ::core::option::Option<request::Operation>,
}
pub mod request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Operation {
#[prost(message, tag = "2")]
Get(super::Get),
#[prost(message, tag = "3")]
Put(super::Put),
#[prost(message, tag = "4")]
Delete(super::Delete),
#[prost(message, tag = "5")]
BatchGet(super::BatchGet),
#[prost(message, tag = "6")]
BatchPut(super::BatchPut),
#[prost(message, tag = "7")]
Query(super::Query),
#[prost(message, tag = "8")]
Inspect(super::Inspect),
#[prost(message, tag = "9")]
Scan(super::Scan),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Error {
#[prost(enumeration = "ErrorCode", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub winner_timestamp_ms: u64,
#[prost(string, tag = "4")]
pub winner_node_id: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub winner_is_tombstone: bool,
#[prost(uint64, tag = "6")]
pub winner_logical_counter: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Value {
#[prost(bytes = "vec", tag = "1")]
pub bytes: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "2")]
pub timestamp_ms: u64,
#[prost(string, tag = "3")]
pub node_id: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "4")]
pub expires_at_ms: ::core::option::Option<u64>,
#[prost(uint64, tag = "5")]
pub logical_counter: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadResult {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<Value>,
#[prost(message, optional, tag = "3")]
pub error: ::core::option::Option<Error>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MutationResult {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<Error>,
#[prost(bytes = "vec", optional, tag = "3")]
pub write_concern: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
#[prost(string, repeated, tag = "1")]
pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub rows: ::prost::alloc::vec::Vec<super::meta::QueryPageRow>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FragmentHealth {
#[prost(uint32, tag = "1")]
pub fragment: u32,
#[prost(uint64, tag = "2")]
pub worker_count: u64,
#[prost(string, repeated, tag = "3")]
pub worker_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, uint64", tag = "4")]
pub restarts: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
#[prost(uint64, tag = "5")]
pub last_reaped: u64,
#[prost(uint64, tag = "6")]
pub shed_high: u64,
#[prost(uint64, tag = "7")]
pub shed_default: u64,
#[prost(uint64, tag = "8")]
pub shed_background: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Placement {
#[prost(uint32, tag = "1")]
pub fragment: u32,
#[prost(string, repeated, tag = "2")]
pub replica_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub state: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Inspection {
#[prost(string, tag = "1")]
pub node_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub peer_addr: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub peer_count: u64,
#[prost(message, repeated, tag = "4")]
pub health: ::prost::alloc::vec::Vec<FragmentHealth>,
#[prost(message, repeated, tag = "5")]
pub placement: ::prost::alloc::vec::Vec<Placement>,
#[prost(bool, tag = "6")]
pub dynamic: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
#[prost(uint64, tag = "1")]
pub id: u64,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<Error>,
#[prost(message, repeated, tag = "3")]
pub reads: ::prost::alloc::vec::Vec<ReadResult>,
#[prost(message, repeated, tag = "4")]
pub mutations: ::prost::alloc::vec::Vec<MutationResult>,
#[prost(message, optional, tag = "5")]
pub query: ::core::option::Option<QueryResult>,
#[prost(message, optional, tag = "6")]
pub inspection: ::core::option::Option<Inspection>,
#[prost(message, repeated, tag = "7")]
pub scans: ::prost::alloc::vec::Vec<super::meta::ScanMatch>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCode {
Unknown = 0,
Invalid = 1,
Backpressure = 2,
Storage = 3,
Unavailable = 4,
Superseded = 5,
Expired = 6,
ShuttingDown = 7,
Query = 8,
Unsupported = 9,
ResourceLimit = 10,
UnknownOutcome = 11,
QueryChanged = 12,
}
impl ErrorCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "ERROR_CODE_UNKNOWN",
Self::Invalid => "ERROR_CODE_INVALID",
Self::Backpressure => "ERROR_CODE_BACKPRESSURE",
Self::Storage => "ERROR_CODE_STORAGE",
Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
Self::Superseded => "ERROR_CODE_SUPERSEDED",
Self::Expired => "ERROR_CODE_EXPIRED",
Self::ShuttingDown => "ERROR_CODE_SHUTTING_DOWN",
Self::Query => "ERROR_CODE_QUERY",
Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
Self::ResourceLimit => "ERROR_CODE_RESOURCE_LIMIT",
Self::UnknownOutcome => "ERROR_CODE_UNKNOWN_OUTCOME",
Self::QueryChanged => "ERROR_CODE_QUERY_CHANGED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERROR_CODE_UNKNOWN" => Some(Self::Unknown),
"ERROR_CODE_INVALID" => Some(Self::Invalid),
"ERROR_CODE_BACKPRESSURE" => Some(Self::Backpressure),
"ERROR_CODE_STORAGE" => Some(Self::Storage),
"ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
"ERROR_CODE_SUPERSEDED" => Some(Self::Superseded),
"ERROR_CODE_EXPIRED" => Some(Self::Expired),
"ERROR_CODE_SHUTTING_DOWN" => Some(Self::ShuttingDown),
"ERROR_CODE_QUERY" => Some(Self::Query),
"ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
"ERROR_CODE_RESOURCE_LIMIT" => Some(Self::ResourceLimit),
"ERROR_CODE_UNKNOWN_OUTCOME" => Some(Self::UnknownOutcome),
"ERROR_CODE_QUERY_CHANGED" => Some(Self::QueryChanged),
_ => None,
}
}
}