From fb875f81d603585e788cef1cef7a67b964c651da Mon Sep 17 00:00:00 2001 From: Dominik Werder Date: Wed, 10 May 2023 09:41:56 +0200 Subject: [PATCH] Update deps --- .cargo/cargo-lock | 26 ++++++++++++++++++++------ dbconn/Cargo.toml | 2 +- httpret/Cargo.toml | 2 +- httpret/src/channelconfig.rs | 33 ++++----------------------------- nodenet/Cargo.toml | 2 +- scyllaconn/Cargo.toml | 2 +- scyllaconn/src/scyllaconn.rs | 9 +++++++-- 7 files changed, 35 insertions(+), 41 deletions(-) diff --git a/.cargo/cargo-lock b/.cargo/cargo-lock index 2d81970..44b2666 100644 --- a/.cargo/cargo-lock +++ b/.cargo/cargo-lock @@ -2394,6 +2394,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.7.0" @@ -2602,9 +2611,9 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "scylla" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9d4ef7fb24d95d30c4a8da782bb2afead3a8b66f32c805bb82a03722d7be33" +checksum = "530af73ae66ea56dcc2dd6a8900b442c31da0f068923ea41e0b0f3d0703b067c" dependencies = [ "arc-swap", "async-trait", @@ -2620,6 +2629,7 @@ dependencies = [ "num-bigint", "num_enum", "rand", + "rand_pcg", "scylla-cql", "scylla-macros", "smallvec", @@ -2634,9 +2644,9 @@ dependencies = [ [[package]] name = "scylla-cql" -version = "0.0.3" +version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6972061cbcc83754b4243d007ae51c1a1345a950b368cbdaad0186eac8799203" +checksum = "0fc8568c89b1d70547881610ad2423157267d57552edb4861e6bd4394e53f26c" dependencies = [ "async-trait", "bigdecimal", @@ -2655,10 +2665,11 @@ dependencies = [ [[package]] name = "scylla-macros" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03b3a19daa79085439113c746d2946e5e6effd2d9039bf092bb08df915487b2" +checksum = "32d777dadbf7163d1524ea4f5a095146298d263a686febb96d022cf46d06df32" dependencies = [ + "proc-macro2", "quote", "syn 1.0.109", ] @@ -3476,6 +3487,9 @@ name = "uuid" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +dependencies = [ + "getrandom", +] [[package]] name = "valuable" diff --git a/dbconn/Cargo.toml b/dbconn/Cargo.toml index 31b9da3..f7537e1 100644 --- a/dbconn/Cargo.toml +++ b/dbconn/Cargo.toml @@ -19,7 +19,7 @@ futures-util = "0.3.25" bytes = "1.3" pin-project = "1" #dashmap = "3" -scylla = "0.7" +scylla = "0.8.1" async-channel = "1.8.0" chrono = "0.4" regex = "1.7.0" diff --git a/httpret/Cargo.toml b/httpret/Cargo.toml index 16b4629..f412447 100644 --- a/httpret/Cargo.toml +++ b/httpret/Cargo.toml @@ -21,7 +21,7 @@ tracing-futures = "0.2" async-channel = "1.8.0" itertools = "0.10.1" chrono = "0.4.23" -scylla = "0.7" +scylla = "0.8.1" md-5 = "0.10" regex = "1.7" err = { path = "../err" } diff --git a/httpret/src/channelconfig.rs b/httpret/src/channelconfig.rs index 32b40ac..31332ee 100644 --- a/httpret/src/channelconfig.rs +++ b/httpret/src/channelconfig.rs @@ -24,7 +24,6 @@ use netpod::ACCEPT_ALL; use netpod::APP_JSON; use query::api4::binned::BinnedQuery; use query::api4::events::PlainEventsQuery; -use scylla::batch::Consistency; use scylla::frame::response::cql_to_rust::FromRowError as ScyFromRowError; use scylla::transport::errors::NewSessionError as ScyNewSessionError; use scylla::transport::errors::QueryError as ScyQueryError; @@ -267,13 +266,7 @@ impl ScyllaConfigsHisto { .scylla .as_ref() .ok_or_else(|| Error::with_public_msg_no_trace(format!("No Scylla configured")))?; - let scy = scylla::SessionBuilder::new() - .known_nodes(&scyco.hosts) - .use_keyspace(&scyco.keyspace, true) - .default_consistency(Consistency::One) - .build() - .await - .err_conv()?; + let scy = scyllaconn::create_scy_session(scyco).await?; let res = scy .query( "select scalar_type, shape_dims, series from series_by_channel where facility = ? allow filtering", @@ -388,13 +381,7 @@ impl ScyllaChannelsWithType { .scylla .as_ref() .ok_or_else(|| Error::with_public_msg_no_trace(format!("No Scylla configured")))?; - let scy = scylla::SessionBuilder::new() - .known_nodes(&scyco.hosts) - .use_keyspace(&scyco.keyspace, true) - .default_consistency(Consistency::One) - .build() - .await - .err_conv()?; + let scy = scyllaconn::create_scy_session(scyco).await?; let res = scy .query( "select channel_name, series from series_by_channel where facility = ? and scalar_type = ? and shape_dims = ? allow filtering", @@ -553,13 +540,7 @@ impl ScyllaChannelsActive { .scylla .as_ref() .ok_or_else(|| Error::with_public_msg_no_trace(format!("No Scylla configured")))?; - let scy = scylla::SessionBuilder::new() - .known_nodes(&scyco.hosts) - .use_keyspace(&scyco.keyspace, true) - .default_consistency(Consistency::One) - .build() - .await - .err_conv()?; + let scy = scyllaconn::create_scy_session(scyco).await?; // Database stores tsedge/ts_msp in units of (10 sec), and we additionally map to the grid. let tsedge = q.tsedge / 10 / (6 * 2) * (6 * 2); info!( @@ -756,13 +737,7 @@ impl ScyllaSeriesTsMsp { .scylla .as_ref() .ok_or_else(|| Error::with_public_msg_no_trace(format!("No Scylla configured")))?; - let scy = scylla::SessionBuilder::new() - .known_nodes(&scyco.hosts) - .use_keyspace(&scyco.keyspace, true) - .default_consistency(Consistency::One) - .build() - .await - .err_conv()?; + let scy = scyllaconn::create_scy_session(scyco).await?; let mut ts_msps = Vec::new(); let mut res = scy .query_iter("select ts_msp from ts_msp where series = ?", (q.series as i64,)) diff --git a/nodenet/Cargo.toml b/nodenet/Cargo.toml index 99948ef..bcc8034 100644 --- a/nodenet/Cargo.toml +++ b/nodenet/Cargo.toml @@ -19,7 +19,7 @@ byteorder = "1.4.3" futures-util = "0.3.14" tracing = "0.1.25" hex = "0.4.3" -scylla = "0.7" +scylla = "0.8.1" tokio-postgres = "0.7.7" wasmer = { version = "3.2.0", default-features = false, features = ["sys", "cranelift"] } err = { path = "../err" } diff --git a/scyllaconn/Cargo.toml b/scyllaconn/Cargo.toml index beb069b..09cd365 100644 --- a/scyllaconn/Cargo.toml +++ b/scyllaconn/Cargo.toml @@ -21,7 +21,7 @@ chrono = { version = "0.4.19", features = ["serde"] } crc32fast = "1.3.2" futures-util = "0.3.24" async-channel = "1.8.0" -scylla = "0.7" +scylla = "0.8.1" tokio-postgres = { version = "0.7.7", features = ["with-chrono-0_4", "with-serde_json-1"] } err = { path = "../err" } netpod = { path = "../netpod" } diff --git a/scyllaconn/src/scyllaconn.rs b/scyllaconn/src/scyllaconn.rs index f4d9d98..c235355 100644 --- a/scyllaconn/src/scyllaconn.rs +++ b/scyllaconn/src/scyllaconn.rs @@ -6,9 +6,9 @@ pub mod status; use err::Error; use errconv::ErrConv; -use netpod::range::evrange::NanoRange; use netpod::range::evrange::SeriesRange; use netpod::ScyllaConfig; +use scylla::execution_profile::ExecutionProfileBuilder; use scylla::statement::Consistency; use scylla::Session as ScySession; use std::sync::Arc; @@ -32,7 +32,12 @@ pub async fn create_scy_session(scyconf: &ScyllaConfig) -> Result