Channel inserts through common scylla workers

This commit is contained in:
Dominik Werder
2022-05-25 10:46:09 +02:00
parent 277597400e
commit f5f1b23466
9 changed files with 365 additions and 344 deletions
+2 -2
View File
@@ -1,6 +1,7 @@
use clap::Parser;
use daqingest::{ChannelAccess, DaqIngestOpts, SubCmd};
use err::Error;
use log::*;
pub fn main() -> Result<(), Error> {
let opts = DaqIngestOpts::parse();
@@ -21,7 +22,6 @@ pub fn main() -> Result<(), Error> {
f.run().await?
}
SubCmd::ChannelAccess(k) => match k {
ChannelAccess::CaChannel(_) => todo!(),
ChannelAccess::CaSearch(k) => netfetch::ca::ca_search(k.into()).await?,
ChannelAccess::CaConfig(k) => netfetch::ca::ca_connect(k.into()).await?,
},
@@ -31,7 +31,7 @@ pub fn main() -> Result<(), Error> {
match res {
Ok(k) => Ok(k),
Err(e) => {
log::error!("Catched: {:?}", e);
error!("Catched: {:?}", e);
Err(e)
}
}
+1 -28
View File
@@ -1,7 +1,7 @@
pub mod query;
use clap::Parser;
use netfetch::ca::{CaConnectOpts, ListenFromFileOpts};
use netfetch::ca::ListenFromFileOpts;
use netfetch::zmtp::ZmtpClientOpts;
#[derive(Debug, Parser)]
@@ -76,37 +76,10 @@ pub struct BsreadDump {
#[derive(Debug, Parser)]
pub enum ChannelAccess {
CaChannel(CaChannel),
CaConfig(CaConfig),
CaSearch(CaConfig),
}
#[derive(Debug, Parser)]
pub struct CaChannel {
#[clap(long)]
pub channel: Vec<String>,
#[clap(long)]
pub addr_bind: String,
#[clap(long)]
pub addr_conn: String,
}
impl From<CaChannel> for CaConnectOpts {
fn from(k: CaChannel) -> Self {
Self {
channels: k.channel,
search: vec!["255.255.255.255".into()],
addr_bind: k.addr_bind.parse().expect("can not parse address"),
addr_conn: k.addr_conn.parse().expect("can not parse address"),
max_simul: 113,
timeout: 2000,
abort_after_search: 0,
pg_pass: "".into(),
array_truncate: 512,
}
}
}
#[derive(Debug, Parser)]
pub struct CaConfig {
pub config: String,