Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename cargo feature "redis" -> "valkey" #1836

Merged
merged 2 commits into from
Nov 26, 2024
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
10 changes: 5 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ linker = "aarch64-linux-gnu-gcc"

[alias]
# Can run every benchmark
windsock = "test --release --bench windsock --features kafka,alpha-transforms,kafka-cpp-driver-tests,cassandra,redis --"
windsock-debug = "test --bench windsock --features kafka,alpha-transforms,kafka-cpp-driver-tests,cassandra,redis --"
windsock = "test --release --bench windsock --features kafka,alpha-transforms,kafka-cpp-driver-tests,cassandra,valkey --"
windsock-debug = "test --bench windsock --features kafka,alpha-transforms,kafka-cpp-driver-tests,cassandra,valkey --"

# Can only run benchmarks specific to the protocol but compiles a lot faster
windsock-valkey = "test --release --bench windsock --no-default-features --features redis,alpha-transforms --"
windsock-valkey = "test --release --bench windsock --no-default-features --features valkey,alpha-transforms --"
windsock-kafka = "test --release --bench windsock --no-default-features --features kafka,alpha-transforms,kafka-cpp-driver-tests --"
windsock-cassandra = "test --release --bench windsock --no-default-features --features cassandra,alpha-transforms --"

# Compile benches in docker to ensure compiled libc version is compatible with the EC2 instances libc
windsock-cloud-docker = "run --package windsock-cloud-docker -- redis,cassandra,kafka"
windsock-cloud-docker-valkey = "run --package windsock-cloud-docker -- redis"
windsock-cloud-docker = "run --package windsock-cloud-docker -- valkey,cassandra,kafka"
windsock-cloud-docker-valkey = "run --package windsock-cloud-docker -- valkey"
windsock-cloud-docker-kafka = "run --package windsock-cloud-docker -- kafka"
windsock-cloud-docker-cassandra = "run --package windsock-cloud-docker -- cassandra"
6 changes: 3 additions & 3 deletions custom-transforms-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ redis.workspace = true
pretty_assertions.workspace = true

[features]
redis = ["shotover/redis"]
default = ["redis"]
valkey = ["shotover/valkey"]
default = ["valkey"]

[[test]]
name = "test"
required-features = ["redis"]
required-features = ["valkey"]
4 changes: 2 additions & 2 deletions custom-transforms-example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use shotover::runner::Shotover;

#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod valkey_get_rewrite;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
shotover::import_transform!(valkey_get_rewrite::ValkeyGetRewriteConfig);

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ pretty_assertions.workspace = true
alpha-transforms = ["shotover/alpha-transforms"]
cassandra = ["shotover/cassandra"]
kafka = ["shotover/kafka"]
redis = ["shotover/redis"]
valkey = ["shotover/valkey"]
opensearch = ["shotover/opensearch"]
cassandra-cpp-driver-tests = ["test-helpers/cassandra-cpp-driver-tests"]
kafka-cpp-driver-tests = ["test-helpers/kafka-cpp-driver-tests"]
default = ["cassandra", "kafka", "redis", "opensearch"]
default = ["cassandra", "kafka", "valkey", "opensearch"]

[[bench]]
name = "windsock"
Expand Down
6 changes: 3 additions & 3 deletions shotover-proxy/benches/windsock/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg_attr(
any(
not(feature = "cassandra"),
not(feature = "redis"),
not(feature = "valkey"),
not(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))
),
allow(dead_code, unused_imports, unused_variables, unused_mut)
Expand All @@ -16,7 +16,7 @@ mod common;
mod kafka;
mod profilers;
mod shotover;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod valkey;

use cloud::CloudResources;
Expand Down Expand Up @@ -54,7 +54,7 @@ fn main() {
benches.extend(cassandra::benches());
#[cfg(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))]
benches.extend(kafka::benches());
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
benches.extend(valkey::benches());

Windsock::new(benches, cloud::AwsCloud::new_boxed(), &["release"]).run();
Expand Down
10 changes: 5 additions & 5 deletions shotover-proxy/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ mod cassandra_int_tests;
mod kafka_int_tests;
#[cfg(all(feature = "alpha-transforms", feature = "opensearch"))]
mod opensearch_int_tests;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod runner;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod transforms;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod valkey_int_tests;

pub fn shotover_process(topology_path: &str) -> ShotoverProcessBuilder {
Expand All @@ -24,9 +24,9 @@ pub fn shotover_process(topology_path: &str) -> ShotoverProcessBuilder {
}

#[cfg(target_os = "macos")]
#[cfg(any(feature = "cassandra", feature = "redis"))]
#[cfg(any(feature = "cassandra", feature = "valkey"))]
const CONNECTION_REFUSED_OS_ERROR: i32 = 61;

#[cfg(not(target_os = "macos"))]
#[cfg(any(feature = "cassandra", feature = "redis"))]
#[cfg(any(feature = "cassandra", feature = "valkey"))]
const CONNECTION_REFUSED_OS_ERROR: i32 = 111;
6 changes: 3 additions & 3 deletions shotover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kafka = [
"dep:base64",
"dep:sasl",
]
redis = [
valkey = [
"dep:redis-protocol",
"dep:csv",
"dep:crc16",
Expand All @@ -44,7 +44,7 @@ opensearch = [
"dep:http",
"dep:httparse",
]
default = ["cassandra", "redis", "kafka", "opensearch"]
default = ["cassandra", "valkey", "kafka", "opensearch"]

[dependencies]
atomic_enum = "0.3.0"
Expand Down Expand Up @@ -141,4 +141,4 @@ pretty_assertions.workspace = true
[[bench]]
name = "benches"
harness = false
required-features = ["cassandra", "redis", "kafka"]
required-features = ["cassandra", "valkey", "kafka"]
4 changes: 2 additions & 2 deletions shotover/src/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod cassandra;
pub mod kafka;
#[cfg(feature = "opensearch")]
pub mod opensearch;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
pub mod valkey;

#[derive(Eq, PartialEq, Copy, Clone)]
Expand Down Expand Up @@ -58,7 +58,7 @@ pub enum CodecState {
Cassandra {
compression: Compression,
},
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Valkey,
#[cfg(feature = "kafka")]
Kafka(KafkaCodecState),
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/config/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Topology {
}
}

#[cfg(all(test, feature = "redis", feature = "cassandra"))]
#[cfg(all(test, feature = "valkey", feature = "cassandra"))]
mod topology_tests {
use crate::config::chain::TransformChainConfig;
use crate::config::topology::Topology;
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl DummyResponseInserter {
}
}

#[cfg(all(test, feature = "redis"))]
#[cfg(all(test, feature = "valkey"))]
mod tests {
use super::DummyResponseInserter;
use crate::frame::{Frame, ValkeyFrame};
Expand Down
28 changes: 14 additions & 14 deletions shotover/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use cassandra_protocol::compression::Compression;
use kafka::KafkaFrame;
#[cfg(feature = "opensearch")]
pub use opensearch::OpenSearchFrame;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
pub use redis_protocol::resp2::types::BytesFrame as ValkeyFrame;
use std::fmt::{Display, Formatter, Result as FmtResult};

Expand All @@ -23,13 +23,13 @@ pub mod cassandra;
pub mod kafka;
#[cfg(feature = "opensearch")]
pub mod opensearch;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
pub mod valkey;
pub mod value;

#[derive(PartialEq, Debug, Clone, Copy)]
pub enum MessageType {
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Valkey,
#[cfg(feature = "cassandra")]
Cassandra,
Expand All @@ -45,7 +45,7 @@ impl MessageType {
match self {
#[cfg(feature = "cassandra")]
MessageType::Cassandra => false,
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
MessageType::Valkey => true,
#[cfg(feature = "kafka")]
MessageType::Kafka => true,
Expand All @@ -59,7 +59,7 @@ impl MessageType {
match self {
#[cfg(feature = "cassandra")]
MessageType::Cassandra => "cql",
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
MessageType::Valkey => "redis",
#[cfg(feature = "kafka")]
MessageType::Kafka => "kafka",
Expand All @@ -75,7 +75,7 @@ impl From<&CodecState> for MessageType {
match value {
#[cfg(feature = "cassandra")]
CodecState::Cassandra { .. } => Self::Cassandra,
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
CodecState::Valkey => Self::Valkey,
#[cfg(feature = "kafka")]
CodecState::Kafka { .. } => Self::Kafka,
Expand All @@ -93,7 +93,7 @@ impl Frame {
Frame::Cassandra(_) => CodecState::Cassandra {
compression: Compression::None,
},
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Frame::Valkey(_) => CodecState::Valkey,
#[cfg(feature = "kafka")]
Frame::Kafka(_) => CodecState::Kafka(KafkaCodecState {
Expand All @@ -111,7 +111,7 @@ impl Frame {
pub enum Frame {
#[cfg(feature = "cassandra")]
Cassandra(CassandraFrame),
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Valkey(ValkeyFrame),
#[cfg(feature = "kafka")]
Kafka(KafkaFrame),
Expand All @@ -133,7 +133,7 @@ impl Frame {
MessageType::Cassandra => {
CassandraFrame::from_bytes(bytes, codec_state.as_cassandra()).map(Frame::Cassandra)
}
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
MessageType::Valkey => redis_protocol::resp2::decode::decode_bytes(&bytes)
.map(|x| Frame::Valkey(x.unwrap().0))
.map_err(|e| anyhow!("{e:?}")),
Expand All @@ -149,7 +149,7 @@ impl Frame {

pub fn name(&self) -> &'static str {
match self {
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Frame::Valkey(_) => "Valkey",
#[cfg(feature = "cassandra")]
Frame::Cassandra(_) => "Cassandra",
Expand All @@ -165,7 +165,7 @@ impl Frame {
match self {
#[cfg(feature = "cassandra")]
Frame::Cassandra(_) => MessageType::Cassandra,
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Frame::Valkey(_) => MessageType::Valkey,
#[cfg(feature = "kafka")]
Frame::Kafka(_) => MessageType::Kafka,
Expand All @@ -175,7 +175,7 @@ impl Frame {
}
}

#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
pub fn valkey(&mut self) -> Result<&mut ValkeyFrame> {
match self {
Frame::Valkey(frame) => Ok(frame),
Expand All @@ -197,7 +197,7 @@ impl Frame {
}
}

#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
pub fn into_valkey(self) -> Result<ValkeyFrame> {
match self {
Frame::Valkey(frame) => Ok(frame),
Expand Down Expand Up @@ -238,7 +238,7 @@ impl Display for Frame {
match self {
#[cfg(feature = "cassandra")]
Frame::Cassandra(frame) => write!(f, "Cassandra {}", frame),
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
Frame::Valkey(frame) => write!(f, "Valkey {:?}", frame),
#[cfg(feature = "kafka")]
Frame::Kafka(frame) => write!(f, "Kafka {}", frame),
Expand Down
2 changes: 1 addition & 1 deletion shotover/src/frame/value.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Generic representations of data types that appear in messages
#[cfg(feature = "cassandra")]
pub mod cassandra;
#[cfg(feature = "redis")]
#[cfg(feature = "valkey")]
mod valkey;

use bigdecimal::BigDecimal;
Expand Down
4 changes: 2 additions & 2 deletions shotover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ If we absolutely need unsafe code, it should be isolated within a separate small
#![cfg_attr(
any(
not(feature = "cassandra"),
not(feature = "redis"),
not(feature = "valkey"),
not(feature = "kafka"),
not(feature = "opensearch"),
),
allow(dead_code, unused_imports, unused_variables, unused_mut)
)]
#[cfg(all(
not(feature = "cassandra"),
not(feature = "redis"),
not(feature = "valkey"),
not(feature = "kafka"),
not(feature = "opensearch"),
))]
Expand Down
Loading
Loading