From e1042b3f4dded6b9e6e35f152aadc8e5ae1012fe Mon Sep 17 00:00:00 2001 From: imDema Date: Thu, 30 May 2024 16:19:04 +0200 Subject: [PATCH] Avro as optional feature --- Cargo.toml | 9 +++++++-- src/operator/sink/mod.rs | 1 + src/operator/source/mod.rs | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f3bfc2d..42d5d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,11 @@ homepage = "https://github.com/deib-polimi/renoir" readme = "README.md" [features] -default = ["clap", "ssh", "timestamp",] +default = ["clap", "ssh", "timestamp", "avro"] timestamp = [] ssh = ["ssh2", "whoami", "shell-escape", "sha2", "base64"] tokio = ["dep:tokio", "futures", "tokio/net", "tokio/io-util", "tokio/time", "tokio/rt-multi-thread", "tokio/macros"] +avro = ["dep:apache-avro"] profiler = [] [dependencies] @@ -78,7 +79,7 @@ indexmap = "2.2.6" tracing = { version = "0.1.40", features = ["log"] } quick_cache = "0.5.1" dashmap = "5.5.3" -apache-avro = { version = "0.16.0", features = ["derive"] } +apache-avro = { version = "0.16.0", features = ["derive"], optional = true } dyn-clone = "1.0.17" [dev-dependencies] @@ -104,6 +105,10 @@ nexmark = { version = "0.2.0", features = ["serde"] } name = "nexmark" required-features = ["timestamp"] +[[example]] +name = "avro_rw" +required-features = ["avro"] + [[example]] name = "rolling_top_words" required-features = ["timestamp"] diff --git a/src/operator/sink/mod.rs b/src/operator/sink/mod.rs index 59b3fcf..7bece85 100644 --- a/src/operator/sink/mod.rs +++ b/src/operator/sink/mod.rs @@ -5,6 +5,7 @@ use std::sync::{Arc, Mutex}; +#[cfg(feature = "avro")] pub(super) mod avro; pub(super) mod collect; pub(super) mod collect_channel; diff --git a/src/operator/source/mod.rs b/src/operator/source/mod.rs index a4f7640..048f7f4 100644 --- a/src/operator/source/mod.rs +++ b/src/operator/source/mod.rs @@ -3,6 +3,7 @@ pub use self::csv::*; #[cfg(feature = "tokio")] pub use async_stream::*; +#[cfg(feature = "avro")] pub use avro::*; pub use channel::*; pub use file::*; @@ -13,6 +14,7 @@ use crate::{block::Replication, operator::Operator}; #[cfg(feature = "tokio")] mod async_stream; +#[cfg(feature = "avro")] mod avro; mod channel; mod csv;