Skip to content

Commit

Permalink
feat(conn-pkg): use types for compression in conn pkg (#4197)
Browse files Browse the repository at this point in the history
* feat: use types for compression in conn pkg

* fix: use ref for compression enum

* feat: update compression instances

* fix: version

* feat: use serde lowercase

* fix: clippy

* revert: fluvio crate updates
  • Loading branch information
EstebanBorai authored Sep 27, 2024
1 parent 8b3da39 commit f08c65e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/fluvio-connector-common/src/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub async fn producer_from_config(config: &ConnectorConfig) -> Result<(Fluvio, T
};

// Compression
if let Some(compression) = producer_params.compression {
config_builder = config_builder.compression(compression)
if let Some(compression) = &producer_params.compression {
config_builder = config_builder.compression(compression.clone())
};

// Batch size
Expand Down
1 change: 0 additions & 1 deletion crates/fluvio-connector-package/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fluvio-controlplane-metadata = { path = "../fluvio-controlplane-metadata/", defa
fluvio-smartengine = { path = "../fluvio-smartengine", default-features = false, features = [
"transformation",
] }
fluvio-compression = { path = "../fluvio-compression" }
fluvio-types = { path = "../fluvio-types" }
bytesize-serde = "0.2.1"

Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-connector-package/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub use bytesize::ByteSize;

pub use fluvio_controlplane_metadata::topic::config as topic_config;
pub use fluvio_smartengine::transformation::TransformationStep;
pub use fluvio_compression::Compression;
pub use fluvio_types::PartitionId;
pub use fluvio_types::compression::Compression;

use crate::metadata::Direction;

Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ events = ["event-listener"]
event-listener = { workspace = true, optional = true }
thiserror = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true }
serde = { workspace = true, features = ["derive"], default-features = false }
toml = { workspace = true, features = ["display", "preserve_order", "parse"] }

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion crates/fluvio-types/src/compression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#[derive(Clone, Debug, Eq, PartialEq)]
use serde::{Serialize, Deserialize};

#[derive(Clone, Debug, Deserialize, Eq, Serialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum Compression {
None,
Gzip,
Expand Down

0 comments on commit f08c65e

Please sign in to comment.