Skip to content

Commit

Permalink
chore: remove unneeded encoding mark for api protocol (#4222)
Browse files Browse the repository at this point in the history
* remove unneeded encoding mark

* fmt

* bump up spu schema
  • Loading branch information
sehz authored Oct 29, 2024
1 parent 573751b commit 688ba94
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/fluvio-spu-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fluvio-spu-schema"
version = "0.16.0"
version = "0.16.1"
edition = "2021"
authors = ["Fluvio Contributors <[email protected]>"]
description = "Fluvio API for SPU"
Expand Down
16 changes: 2 additions & 14 deletions crates/fluvio-spu-schema/src/server/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<ApiVersionsRequest>),

// Kafka compatible requests
#[fluvio(tag = 1)]
ProduceRequest(RequestMessage<DefaultProduceRequest>),
#[fluvio(tag = 2)]
FileFetchRequest(RequestMessage<FileFetchRequest>),
#[fluvio(tag = 3)]
FetchOffsetsRequest(RequestMessage<FetchOffsetsRequest>),
#[fluvio(tag = 4)]
FileStreamFetchRequest(RequestMessage<FileStreamFetchRequest>),
#[fluvio(tag = 5)]
UpdateOffsetsRequest(RequestMessage<UpdateOffsetsRequest>),
#[fluvio(tag = 6)]
UpdateConsumerOffsetRequest(RequestMessage<UpdateConsumerOffsetRequest>),
#[fluvio(tag = 7)]
DeleteConsumerOffsetRequest(RequestMessage<DeleteConsumerOffsetRequest>),
#[fluvio(tag = 8)]
FetchConsumerOffsetsRequest(RequestMessage<FetchConsumerOffsetsRequest>),
#[fluvio(tag = 9)]
StartMirrorRequest(RequestMessage<StartMirrorRequest>),
}

Expand Down
5 changes: 2 additions & 3 deletions crates/fluvio-spu/src/mirroring/home/home_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<UpdateHomeOffsetRequest>),
}

Expand Down
7 changes: 2 additions & 5 deletions crates/fluvio-spu/src/mirroring/remote/remote_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DefaultPartitionSyncRequest>),
// #[fluvio(tag = 1)]
// RejectedOffsetRequest(RequestMessage<RejectOffsetRequest>),
}

impl Default for RemoteMirrorRequest {
Expand Down
6 changes: 2 additions & 4 deletions crates/fluvio-spu/src/replication/follower/peer_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DefaultSyncRequest>),
#[fluvio(tag = 1)]
RejectedOffsetRequest(RequestMessage<RejectOffsetRequest>),
}

Expand Down
5 changes: 1 addition & 4 deletions crates/fluvio-spu/src/replication/leader/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions crates/fluvio-spu/src/replication/leader/peer_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<UpdateOffsetRequest>),
}

Expand Down

0 comments on commit 688ba94

Please sign in to comment.