From 688ba94de398623c57d36988cc8410efc1442d2b Mon Sep 17 00:00:00 2001 From: Sehz Date: Mon, 28 Oct 2024 22:03:26 -0700 Subject: [PATCH] chore: remove unneeded encoding mark for api protocol (#4222) * remove unneeded encoding mark * fmt * bump up spu schema --- Cargo.lock | 2 +- crates/fluvio-spu-schema/Cargo.toml | 2 +- crates/fluvio-spu-schema/src/server/api.rs | 16 ++-------------- crates/fluvio-spu/src/mirroring/home/home_api.rs | 5 ++--- .../src/mirroring/remote/remote_api.rs | 7 ++----- .../src/replication/follower/peer_api.rs | 6 ++---- .../src/replication/leader/connection.rs | 5 +---- .../src/replication/leader/peer_api.rs | 5 ++--- 8 files changed, 13 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d563ee9d38..53f52f79b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "fluvio-spu-schema" -version = "0.16.0" +version = "0.16.1" dependencies = [ "bytes", "derive_builder", diff --git a/crates/fluvio-spu-schema/Cargo.toml b/crates/fluvio-spu-schema/Cargo.toml index 0e616c65e7..827d5ff725 100644 --- a/crates/fluvio-spu-schema/Cargo.toml +++ b/crates/fluvio-spu-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-spu-schema" -version = "0.16.0" +version = "0.16.1" edition = "2021" authors = ["Fluvio Contributors "] description = "Fluvio API for SPU" diff --git a/crates/fluvio-spu-schema/src/server/api.rs b/crates/fluvio-spu-schema/src/server/api.rs index fb4d12f549..63664955eb 100644 --- a/crates/fluvio-spu-schema/src/server/api.rs +++ b/crates/fluvio-spu-schema/src/server/api.rs @@ -8,7 +8,7 @@ use std::fmt; use tracing::trace; use fluvio_protocol::bytes::Buf; -use fluvio_protocol::{Encoder, Decoder}; +use fluvio_protocol::Decoder; use fluvio_protocol::api::ApiMessage; use fluvio_protocol::api::api_decode; use fluvio_protocol::api::RequestHeader; @@ -29,30 +29,18 @@ use super::mirror::StartMirrorRequest; #[allow(clippy::large_enum_variant)] /// Request to Spu Server -#[derive(Debug, Encoder)] +#[derive(Debug)] pub enum SpuServerRequest { - /// list of versions supported - #[fluvio(tag = 0)] ApiVersionsRequest(RequestMessage), - // Kafka compatible requests - #[fluvio(tag = 1)] ProduceRequest(RequestMessage), - #[fluvio(tag = 2)] FileFetchRequest(RequestMessage), - #[fluvio(tag = 3)] FetchOffsetsRequest(RequestMessage), - #[fluvio(tag = 4)] FileStreamFetchRequest(RequestMessage), - #[fluvio(tag = 5)] UpdateOffsetsRequest(RequestMessage), - #[fluvio(tag = 6)] UpdateConsumerOffsetRequest(RequestMessage), - #[fluvio(tag = 7)] DeleteConsumerOffsetRequest(RequestMessage), - #[fluvio(tag = 8)] FetchConsumerOffsetsRequest(RequestMessage), - #[fluvio(tag = 9)] StartMirrorRequest(RequestMessage), } diff --git a/crates/fluvio-spu/src/mirroring/home/home_api.rs b/crates/fluvio-spu/src/mirroring/home/home_api.rs index d4f058aa6a..8d6d01ee62 100644 --- a/crates/fluvio-spu/src/mirroring/home/home_api.rs +++ b/crates/fluvio-spu/src/mirroring/home/home_api.rs @@ -4,16 +4,15 @@ use std::convert::TryInto; use tracing::trace; use fluvio_protocol::bytes::Buf; -use fluvio_protocol::{Encoder, Decoder}; +use fluvio_protocol::Decoder; use fluvio_protocol::api::{RequestMessage, ApiMessage, RequestHeader}; use super::api_key::MirrorHomeApiEnum; use super::update_offsets::UpdateHomeOffsetRequest; /// Requests from home to remote -#[derive(Debug, Encoder)] +#[derive(Debug)] pub enum HomeMirrorRequest { - #[fluvio(tag = 0)] UpdateHomeOffset(RequestMessage), } diff --git a/crates/fluvio-spu/src/mirroring/remote/remote_api.rs b/crates/fluvio-spu/src/mirroring/remote/remote_api.rs index f064897458..7516fa80fc 100644 --- a/crates/fluvio-spu/src/mirroring/remote/remote_api.rs +++ b/crates/fluvio-spu/src/mirroring/remote/remote_api.rs @@ -4,18 +4,15 @@ use std::convert::TryInto; use tracing::trace; use fluvio_protocol::bytes::Buf; -use fluvio_protocol::{Encoder, Decoder}; +use fluvio_protocol::Decoder; use fluvio_protocol::api::{RequestMessage, ApiMessage, RequestHeader}; use super::api_key::MirrorRemoteApiEnum; use super::sync::DefaultPartitionSyncRequest; -#[derive(Debug, Encoder)] +#[derive(Debug)] pub enum RemoteMirrorRequest { - #[fluvio(tag = 0)] SyncRecords(RequestMessage), - // #[fluvio(tag = 1)] - // RejectedOffsetRequest(RequestMessage), } impl Default for RemoteMirrorRequest { diff --git a/crates/fluvio-spu/src/replication/follower/peer_api.rs b/crates/fluvio-spu/src/replication/follower/peer_api.rs index 56821373fa..b31cc92009 100644 --- a/crates/fluvio-spu/src/replication/follower/peer_api.rs +++ b/crates/fluvio-spu/src/replication/follower/peer_api.rs @@ -4,18 +4,16 @@ use std::convert::TryInto; use tracing::trace; use fluvio_protocol::bytes::Buf; -use fluvio_protocol::{Encoder, Decoder}; +use fluvio_protocol::Decoder; use fluvio_protocol::api::{RequestMessage, ApiMessage, RequestHeader}; use super::api_key::FollowerPeerApiEnum; use super::sync::DefaultSyncRequest; use super::reject_request::RejectOffsetRequest; -#[derive(Debug, Encoder)] +#[derive(Debug)] pub enum FollowerPeerRequest { - #[fluvio(tag = 0)] SyncRecords(RequestMessage), - #[fluvio(tag = 1)] RejectedOffsetRequest(RequestMessage), } diff --git a/crates/fluvio-spu/src/replication/leader/connection.rs b/crates/fluvio-spu/src/replication/leader/connection.rs index 85e3279bf9..60aff5b5be 100644 --- a/crates/fluvio-spu/src/replication/leader/connection.rs +++ b/crates/fluvio-spu/src/replication/leader/connection.rs @@ -9,10 +9,7 @@ use fluvio_socket::{FluvioSink, SocketError, FluvioStream}; use fluvio_protocol::api::RequestMessage; use fluvio_types::SpuId; -use crate::{ - core::DefaultSharedGlobalContext, - replication::follower::sync::{FileSyncRequest}, -}; +use crate::{core::DefaultSharedGlobalContext, replication::follower::sync::FileSyncRequest}; use super::LeaderPeerApiEnum; use super::LeaderPeerRequest; diff --git a/crates/fluvio-spu/src/replication/leader/peer_api.rs b/crates/fluvio-spu/src/replication/leader/peer_api.rs index 9415cb83ff..86bfd68957 100644 --- a/crates/fluvio-spu/src/replication/leader/peer_api.rs +++ b/crates/fluvio-spu/src/replication/leader/peer_api.rs @@ -4,15 +4,14 @@ use std::convert::TryInto; use tracing::trace; use fluvio_protocol::bytes::Buf; -use fluvio_protocol::{Encoder, Decoder}; +use fluvio_protocol::Decoder; use fluvio_protocol::api::{RequestMessage, ApiMessage, RequestHeader}; use super::LeaderPeerApiEnum; use super::UpdateOffsetRequest; -#[derive(Debug, Encoder)] +#[derive(Debug)] pub enum LeaderPeerRequest { - #[fluvio(tag = 0)] UpdateOffsets(RequestMessage), }