Skip to content

Commit

Permalink
Update to serde_yaml 0.9 (via renaming Null -> NullSink) (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Feb 7, 2023
1 parent bf89a42 commit 2932326
Show file tree
Hide file tree
Showing 21 changed files with 145 additions and 171 deletions.
31 changes: 2 additions & 29 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions docs/src/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Future transforms won't be added to the public API while in alpha. But in these
| [ConsistentScatter](#consistentscatter) || Alpha |
| [DebugPrinter](#debugprinter) || Alpha |
| [DebugReturner](#debugreturner) || Alpha |
| [Null](#null) || Beta |
| [NullSink](#NullSink) || Beta |
| [ParallelMap](#parallelmap) || Alpha |
| [Protect](#protect) || Alpha |
| [QueryCounter](#querycounter) || Alpha |
Expand Down Expand Up @@ -267,12 +267,12 @@ Delay the transform chain at the position that this transform sits at.
```
-->

### Null
### NullSink

This transform will drop any messages it receives and return an empty response.

```yaml
- Null
- NullSink
```

### ParallelMap
Expand Down Expand Up @@ -531,7 +531,7 @@ The response from the down-chain transform is returned back up-chain but various
# SubchainOnMismatch:
# - QueryTypeFilter:
# filter: Read
# - Null
# - NullSink
# Timeout for sending to the sub chain in microseconds
timeout_micros: 1000
Expand All @@ -542,7 +542,7 @@ The response from the down-chain transform is returned back up-chain but various
chain:
- QueryTypeFilter:
filter: Read
- Null
- NullSink
```

This transfrom emits a metrics [counter](user-guide/observability.md#counter) named `tee_dropped_messages` and the label `chain` as `Tee`.
Expand Down
2 changes: 1 addition & 1 deletion shotover-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ backtrace = "0.3.66"
cql3-parser = { version = "0.3.1", git = "https://github.com/rukai/rust-cql3-parser", branch = "identifier_ref" }
serde = { version = "1.0.111", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.8.21"
serde_yaml = "0.9.17"
bincode = "1.3.1"
num = { version = "0.4.0", features = ["serde"] }
uuid = { version = "1.0.0", features = ["serde", "v4"] }
Expand Down
14 changes: 7 additions & 7 deletions shotover-proxy/benches/benches/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use shotover_proxy::transforms::cassandra::peers_rewrite::CassandraPeersRewrite;
use shotover_proxy::transforms::chain::{TransformChain, TransformChainBuilder};
use shotover_proxy::transforms::debug::returner::{DebugReturner, Response};
use shotover_proxy::transforms::filter::QueryTypeFilter;
use shotover_proxy::transforms::null::Null;
use shotover_proxy::transforms::null::NullSink;
use shotover_proxy::transforms::protect::{KeyManagerConfig, ProtectConfig};
use shotover_proxy::transforms::redis::cluster_ports_rewrite::RedisClusterPortsRewrite;
use shotover_proxy::transforms::redis::timestamp_tagging::RedisTimestampTagger;
Expand All @@ -25,7 +25,7 @@ fn criterion_benchmark(c: &mut Criterion) {

{
let chain = TransformChainBuilder::new(
vec![TransformBuilder::Null(Null::default())],
vec![TransformBuilder::NullSink(NullSink::default())],
"bench".to_string(),
);
let wrapper = Wrapper::new_with_chain_name(
Expand All @@ -34,7 +34,7 @@ fn criterion_benchmark(c: &mut Criterion) {
"127.0.0.1:6379".parse().unwrap(),
);

group.bench_function("null", |b| {
group.bench_function("NullSink", |b| {
b.to_async(&rt).iter_batched(
|| BenchInput {
chain: chain.clone().build(),
Expand Down Expand Up @@ -147,7 +147,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let chain = TransformChainBuilder::new(
vec![
TransformBuilder::RedisClusterPortsRewrite(RedisClusterPortsRewrite::new(2004)),
TransformBuilder::Null(Null::default()),
TransformBuilder::NullSink(NullSink::default()),
],
"bench".to_string(),
);
Expand Down Expand Up @@ -185,7 +185,7 @@ fn criterion_benchmark(c: &mut Criterion) {
.get_transform(),
)
.unwrap(),
TransformBuilder::Null(Null::default()),
TransformBuilder::NullSink(NullSink::default()),
],
"bench".to_string(),
);
Expand Down Expand Up @@ -222,7 +222,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let chain = TransformChainBuilder::new(
vec![
TransformBuilder::CassandraPeersRewrite(CassandraPeersRewrite::new(9042)),
TransformBuilder::Null(Null::default()),
TransformBuilder::NullSink(NullSink::default()),
],
"bench".into(),
);
Expand Down Expand Up @@ -293,7 +293,7 @@ fn criterion_benchmark(c: &mut Criterion) {
.get_transform(),
)
.unwrap(),
TransformBuilder::Null(Null::default()),
TransformBuilder::NullSink(NullSink::default()),
],
"bench".into(),
);
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/config/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ chain_config:
# For a list of possible transforms: https://docs.shotover.io/transforms/#transforms_1
- DebugPrinter

# A Null transform, drops all messages it receives.
# A NullSink transform, drops all messages it receives.
# You will want to replace this with a sink transform to send the message to a database.
# For a list of possible transforms: https://docs.shotover.io/transforms/#transforms_1
- Null
- NullSink

# A list of mappings from source name -> transform chain name.
source_to_chain_mapping:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ sources:
listen_addr: "127.0.0.1:9042"
chain_config:
main_chain:
- Null
- NullSink
source_to_chain_mapping:
cassandra_prod: main_chain
2 changes: 1 addition & 1 deletion shotover-proxy/example-configs/null-redis/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ chain_config:
redis_chain:
- QueryCounter:
name: redis-chain
- Null
- NullSink
source_to_chain_mapping:
redis_prod: redis_chain
Loading

0 comments on commit 2932326

Please sign in to comment.