#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Chunk {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(enumeration = "ChunkType", tag = "2")]
pub r#type: i32,
#[prost(string, tag = "3")]
pub logical_series_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "6")]
pub count: i64,
#[prost(int64, tag = "7")]
pub size_in_bytes: i64,
#[prost(int64, tag = "8")]
pub resolution_nanos: i64,
#[prost(message, optional, tag = "9")]
pub storage: ::core::option::Option<ChunkStorage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChunkStorage {
#[prost(oneof = "chunk_storage::Storage", tags = "1")]
pub storage: ::core::option::Option<chunk_storage::Storage>,
}
pub mod chunk_storage {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Storage {
#[prost(message, tag = "1")]
S3(super::S3ChunkStorage),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3ChunkStorage {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchChunksRequest {
#[prost(string, tag = "1")]
pub logical_series_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "4")]
pub resolution_nanos: i64,
#[prost(int32, optional, tag = "5")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, tag = "6")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchChunksResponse {
#[prost(message, repeated, tag = "1")]
pub chunks: ::prost::alloc::vec::Vec<Chunk>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateChunkRequest {
#[prost(enumeration = "ChunkType", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub logical_series_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "5")]
pub count: i64,
#[prost(int64, tag = "6")]
pub size_in_bytes: i64,
#[prost(int64, tag = "7")]
pub resolution_nanos: i64,
#[prost(message, optional, tag = "8")]
pub storage: ::core::option::Option<ChunkStorage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateChunksRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<CreateChunkRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateChunksResponse {
#[prost(string, repeated, tag = "1")]
pub chunk_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteChunksRequest {
#[prost(string, tag = "1")]
pub logical_series_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteChunksResponse {
#[prost(int64, tag = "1")]
pub deleted_chunk_count: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ChunkType {
Unspecified = 0,
ArrowWithRelativeTimestamps = 1,
ArrowWithAbsoluteTimestamps = 2,
}
impl ChunkType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "CHUNK_TYPE_UNSPECIFIED",
Self::ArrowWithRelativeTimestamps => {
"CHUNK_TYPE_ARROW_WITH_RELATIVE_TIMESTAMPS"
}
Self::ArrowWithAbsoluteTimestamps => {
"CHUNK_TYPE_ARROW_WITH_ABSOLUTE_TIMESTAMPS"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHUNK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"CHUNK_TYPE_ARROW_WITH_RELATIVE_TIMESTAMPS" => {
Some(Self::ArrowWithRelativeTimestamps)
}
"CHUNK_TYPE_ARROW_WITH_ABSOLUTE_TIMESTAMPS" => {
Some(Self::ArrowWithAbsoluteTimestamps)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InternalSeriesCacheError {
InvalidRequest = 0,
}
impl InternalSeriesCacheError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::InvalidRequest => "INTERNAL_SERIES_CACHE_ERROR_INVALID_REQUEST",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INTERNAL_SERIES_CACHE_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
_ => None,
}
}
}
pub mod internal_series_cache_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct InternalSeriesCacheServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InternalSeriesCacheServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> InternalSeriesCacheServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InternalSeriesCacheServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
InternalSeriesCacheServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn search_chunks(
&mut self,
request: impl tonic::IntoRequest<super::SearchChunksRequest>,
) -> std::result::Result<
tonic::Response<super::SearchChunksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalseriescache.v1.InternalSeriesCacheService/SearchChunks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalseriescache.v1.InternalSeriesCacheService",
"SearchChunks",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_create_chunks(
&mut self,
request: impl tonic::IntoRequest<super::BatchCreateChunksRequest>,
) -> std::result::Result<
tonic::Response<super::BatchCreateChunksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalseriescache.v1.InternalSeriesCacheService/BatchCreateChunks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalseriescache.v1.InternalSeriesCacheService",
"BatchCreateChunks",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_chunks(
&mut self,
request: impl tonic::IntoRequest<super::DeleteChunksRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteChunksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalseriescache.v1.InternalSeriesCacheService/DeleteChunks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalseriescache.v1.InternalSeriesCacheService",
"DeleteChunks",
),
);
self.inner.unary(req, path, codec).await
}
}
}