This commit is contained in:
Dominik Werder
2021-04-14 11:38:17 +02:00
parent a6839a487f
commit 06c9963605
11 changed files with 238 additions and 93 deletions

View File

@@ -4,6 +4,7 @@ use serde::{Serialize, Deserialize};
use err::Error;
use std::path::PathBuf;
use chrono::{DateTime, Utc, TimeZone};
use std::sync::Arc;
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -90,7 +91,7 @@ impl ScalarType {
}
#[derive(Clone)]
#[derive(Debug)]
pub struct Node {
pub host: String,
pub port: u16,
@@ -106,9 +107,16 @@ impl Node {
}
#[derive(Clone)]
#[derive(Debug)]
pub struct Cluster {
pub nodes: Vec<Node>,
pub nodes: Vec<Arc<Node>>,
}
#[derive(Debug)]
pub struct NodeConfig {
pub node: Arc<Node>,
pub cluster: Arc<Cluster>,
}
@@ -255,9 +263,9 @@ impl BinSpecDimT {
#[derive(Clone, Debug)]
pub struct PreBinnedPatchGridSpec {
range: NanoRange,
bs: u64,
count: u64,
pub range: NanoRange,
pub bs: u64,
pub count: u64,
}
impl PreBinnedPatchGridSpec {
@@ -317,6 +325,14 @@ pub struct PreBinnedPatchCoord {
pub range: NanoRange,
}
impl PreBinnedPatchCoord {
pub fn bs(&self) -> u64 {
self.range.end - self.range.beg
}
}
pub struct PreBinnedPatchIterator {
spec: PreBinnedPatchGridSpec,
agg_kind: AggKind,