Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ publish = false
[dependencies]
# The version requirements of these must match the version requirement of protoc-rs used to
# generate the code
tonic = "0.13"
prost = "0.13"
prost-types = "0.13"
tonic = "0.14"
prost = "0.14"
tonic-prost = "0.14"
prost-types = "0.14"

[lib]
path = "rust/lib.rs"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ clean:
PROTOC_VERSION := 29.2
PROTOC_GEN_GO_VERSION := 1.36.2
PROTOC_GEN_GO_GRPC_VERSION := 1.5.1
PROTOC_RS_VERSION := 0.5.0
PROTOC_RS_VERSION := 0.6.0

# Checks the versions of the installed tools, making sure they are what we expect
.PHONY: check-tools
Expand Down
17 changes: 9 additions & 8 deletions rust/beegfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// The "legacy" BeeGFS numeric Id-NodeType combination that can be used to identify an entity like
/// a node or target. Because each entity type has its own id space (meaning a combination is not
/// globally unique), the entity type must be known in addition to uniquely identify an entity.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LegacyId {
/// BeeGFS numeric id.
/// Required, 0 is invalid.
Expand All @@ -17,12 +17,13 @@ pub struct LegacyId {
/// Contains all identifiers used to uniquely identify an entity like a node or a target. Mainly
/// meant for communication with management as management has access to all the information. This
/// message should be used in two ways:
/// 1) In a request message (to the management), only _one_ of the fields needs to be set (each is
/// enough to identify an entity (legacy_id with extra knowledge).
/// 2) In a response message (from the management), _all_ fields should be set. The request processor
/// should have all info about an entity available. If that isn't the case, leaving fields empty is
/// allowed.
#[derive(Clone, PartialEq, ::prost::Message)]
///
/// 1. In a request message (to the management), only *one* of the fields needs to be set (each is
/// enough to identify an entity (legacy_id with extra knowledge).
/// 1. In a response message (from the management), *all* fields should be set. The request processor
/// should have all info about an entity available. If that isn't the case, leaving fields empty is
/// allowed.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EntityIdSet {
/// The global, unique entity id. Identifies an entity from all types without any additional
/// context.
Expand All @@ -32,7 +33,7 @@ pub struct EntityIdSet {
/// The user definable globally unique alias of an entity. Identifies an entity from all types
/// without any additional context.
/// Optional or Required, depending on the use case. Aliases must start with letter and contain
/// only \[a-zA-Z0-9_-.\].
/// only \[a-zA-Z0-9\_-.\].
#[prost(string, optional, tag = "2")]
pub alias: ::core::option::Option<::prost::alloc::string::String>,
/// The "legacy" style numeric Id-NodeType combination. The entity type must be known in addition
Expand Down
50 changes: 25 additions & 25 deletions rust/beeremote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub struct JobRequest {
}
/// Nested message and enum types in `JobRequest`.
pub mod job_request {
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GenerationStatus {
#[prost(enumeration = "generation_status::State", tag = "1")]
pub state: i32,
Expand Down Expand Up @@ -224,7 +224,7 @@ pub struct Job {
}
/// Nested message and enum types in `Job`.
pub mod job {
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Status {
#[prost(enumeration = "State", tag = "1")]
pub state: i32,
Expand Down Expand Up @@ -472,7 +472,7 @@ pub struct UpdateJobsResponse {
/// With the MapStore used as a wrapper around the BadgerDB k/v store we don't
/// have to duplicate all information and can use the Metadata field of the
/// MapStore to create references to data stored in other MapStores.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetJobsRequest {
#[prost(bool, tag = "4")]
pub include_work_requests: bool,
Expand All @@ -493,14 +493,14 @@ pub struct GetJobsRequest {
}
/// Nested message and enum types in `GetJobsRequest`.
pub mod get_jobs_request {
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueryIdAndPath {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Query {
/// Returns at most one Job.
#[prost(message, tag = "1")]
Expand Down Expand Up @@ -528,21 +528,21 @@ pub struct UpdateWorkRequest {
}
/// We use our own empty message instead of google.protobuf.Empty to ensure backwards
/// compatibility should we need to add fields in the future.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateWorkResponse {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetRstConfigRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRstConfigResponse {
#[prost(message, repeated, tag = "1")]
pub rsts: ::prost::alloc::vec::Vec<super::flex::RemoteStorageTarget>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStubContentsRequest {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStubContentsResponse {
#[prost(uint32, optional, tag = "1")]
pub rst_id: ::core::option::Option<u32>,
Expand Down Expand Up @@ -657,7 +657,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/SubmitJob",
);
Expand All @@ -681,7 +681,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/UpdatePaths",
);
Expand All @@ -705,7 +705,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/UpdateJobs",
);
Expand All @@ -729,7 +729,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/GetJobs",
);
Expand Down Expand Up @@ -762,7 +762,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/UpdateWork",
);
Expand All @@ -786,7 +786,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/GetRSTConfig",
);
Expand All @@ -810,7 +810,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/GetStubContents",
);
Expand All @@ -834,7 +834,7 @@ pub mod bee_remote_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beeremote.BeeRemote/GetCapabilities",
);
Expand Down Expand Up @@ -1041,7 +1041,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = SubmitJobSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1087,7 +1087,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = UpdatePathsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1132,7 +1132,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = UpdateJobsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1178,7 +1178,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = GetJobsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1223,7 +1223,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = UpdateWorkSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1268,7 +1268,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = GetRSTConfigSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1313,7 +1313,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = GetStubContentsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down Expand Up @@ -1361,7 +1361,7 @@ pub mod bee_remote_server {
let inner = self.inner.clone();
let fut = async move {
let method = GetCapabilitiesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down
14 changes: 7 additions & 7 deletions rust/beewatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// API. Those should only affect the serialization format between the meta and watch services, and
/// should adhere to standard protocol buffer best practices. Notably minor updates should be
/// additive and not remove or change the meaning of existing fields.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Event {
#[prost(uint64, tag = "1")]
pub seq_id: u64,
Expand All @@ -20,7 +20,7 @@ pub struct Event {
}
/// Nested message and enum types in `Event`.
pub mod event {
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum EventData {
#[prost(message, tag = "11")]
V1(super::V1Event),
Expand All @@ -29,7 +29,7 @@ pub mod event {
}
}
/// The v1 event format is the legacy format from BeeGFS v7.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct V1Event {
#[prost(enumeration = "v1_event::Type", tag = "1")]
pub r#type: i32,
Expand Down Expand Up @@ -121,7 +121,7 @@ pub mod v1_event {
}
}
/// The v2 event format was introduced in BeeGFS v8.
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct V2Event {
#[prost(enumeration = "v2_event::Type", tag = "1")]
pub r#type: i32,
Expand Down Expand Up @@ -236,7 +236,7 @@ pub mod v2_event {
}
}
/// Response messages allow the subscribers to acknowledge events they have processed and request a graceful shutdown.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Response {
#[prost(uint64, tag = "1")]
pub completed_seq: u64,
Expand Down Expand Up @@ -349,7 +349,7 @@ pub mod subscriber_client {
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/beewatch.Subscriber/ReceiveEvents",
);
Expand Down Expand Up @@ -492,7 +492,7 @@ pub mod subscriber_server {
let inner = self.inner.clone();
let fut = async move {
let method = ReceiveEventsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
Expand Down
Loading
Loading