WIP on client and clean up the binned range data structures

This commit is contained in:
Dominik Werder
2021-04-29 09:46:13 +02:00
parent bd70738e74
commit de952a6e64
13 changed files with 327 additions and 98 deletions

View File

@@ -10,7 +10,7 @@ use futures_core::Stream;
use futures_util::{FutureExt, StreamExt, TryStreamExt};
use netpod::log::*;
use netpod::{
AggKind, BinSpecDimT, Channel, NanoRange, NodeConfig, PreBinnedPatchCoord, PreBinnedPatchIterator,
AggKind, BinSpecDimT, BinnedRange, Channel, NanoRange, NodeConfig, PreBinnedPatchCoord, PreBinnedPatchIterator,
PreBinnedPatchRange,
};
use std::future::{ready, Future};
@@ -135,12 +135,13 @@ impl PreBinnedValueStream {
// TODO use a ctor, remove from BinSpecDimT the redundant variable.
// If given a timestamp range, verify that it divides.
// For ranges, use a range type.
let spec = BinSpecDimT {
let _spec = BinSpecDimT {
bs: self.patch_coord.bin_t_len(),
ts1: self.patch_coord.patch_beg(),
ts2: self.patch_coord.patch_end(),
count,
};
let range = BinnedRange::covering_range(evq.range.clone(), count).unwrap();
let s1 = MergedFromRemotes::new(evq, self.node_config.cluster.clone());
let s2 = s1
.map(|k| {
@@ -151,7 +152,7 @@ impl PreBinnedValueStream {
}
k
})
.into_binned_t(spec)
.into_binned_t(range)
.map_ok({
let mut a = MinMaxAvgScalarBinBatch::empty();
move |k| {