Compiles and local test get_binned_binary runs through with cache ignore
This commit is contained in:
@@ -37,7 +37,7 @@ impl Agg3 {
|
||||
}
|
||||
}
|
||||
|
||||
fn ingest(&mut self, item: &mut MinMaxAvgScalarEventBatch) {
|
||||
fn ingest(&mut self, item: &MinMaxAvgScalarEventBatch) {
|
||||
for i1 in 0..item.tss.len() {
|
||||
let ts = item.tss[i1];
|
||||
if ts < self.range.beg {
|
||||
@@ -185,11 +185,7 @@ impl BinnedT3Stream {
|
||||
// TODO cycle_current_bin enqueues the bin, can I return here instead?
|
||||
None
|
||||
} else {
|
||||
let mut item = item;
|
||||
err::todo();
|
||||
// TODO ingest the data into Agg3
|
||||
let item = item;
|
||||
//if ag.ends_after(&item) {
|
||||
ag.ingest(&item);
|
||||
if item.ends_after(ag.range.clone()) {
|
||||
self.left =
|
||||
Some(Ready(Some(Ok(StreamItem::DataItem(RangeCompletableItem::Data(item))))));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::agg::binnedt::{AggregatableTdim, AggregatorTdim};
|
||||
use crate::agg::scalarbinbatch::MinMaxAvgScalarBinBatch;
|
||||
use crate::agg::streams::StreamItem;
|
||||
use crate::agg::streams::{Appendable, StreamItem};
|
||||
use crate::agg::AggregatableXdim1Bin;
|
||||
use crate::binned::{BinnedStreamKind, MakeBytesFrame, RangeCompletableItem, RangeOverlapInfo};
|
||||
use crate::binned::{BinnedStreamKind, MakeBytesFrame, RangeCompletableItem, RangeOverlapInfo, WithTimestamps};
|
||||
use crate::frame::makeframe::make_frame;
|
||||
use bytes::{BufMut, Bytes, BytesMut};
|
||||
use err::Error;
|
||||
@@ -279,3 +279,16 @@ impl RangeOverlapInfo for MinMaxAvgScalarEventBatch {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Appendable for MinMaxAvgScalarEventBatch {
|
||||
fn empty() -> Self {
|
||||
Self::empty()
|
||||
}
|
||||
|
||||
fn append(&mut self, src: &Self) {
|
||||
self.tss.extend_from_slice(&src.tss);
|
||||
self.mins.extend_from_slice(&src.mins);
|
||||
self.maxs.extend_from_slice(&src.maxs);
|
||||
self.avgs.extend_from_slice(&src.avgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::agg::binnedt::{AggregatableTdim, AggregatorTdim};
|
||||
use crate::agg::streams::{Bins, StreamItem};
|
||||
use crate::agg::streams::{Appendable, Bins, StreamItem};
|
||||
use crate::agg::{AggregatableXdim1Bin, Fits, FitsInside};
|
||||
use crate::binned::{BinnedStreamKind, MakeBytesFrame, RangeCompletableItem};
|
||||
use crate::frame::makeframe::make_frame;
|
||||
@@ -316,3 +316,18 @@ impl MakeBytesFrame for Result<StreamItem<RangeCompletableItem<MinMaxAvgScalarBi
|
||||
Ok(make_frame(self)?.freeze())
|
||||
}
|
||||
}
|
||||
|
||||
impl Appendable for MinMaxAvgScalarBinBatch {
|
||||
fn empty() -> Self {
|
||||
Self::empty()
|
||||
}
|
||||
|
||||
fn append(&mut self, src: &Self) {
|
||||
self.ts1s.extend_from_slice(&src.ts1s);
|
||||
self.ts2s.extend_from_slice(&src.ts2s);
|
||||
self.counts.extend_from_slice(&src.counts);
|
||||
self.mins.extend_from_slice(&src.mins);
|
||||
self.maxs.extend_from_slice(&src.maxs);
|
||||
self.avgs.extend_from_slice(&src.avgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ pub trait Bins {
|
||||
fn bin_count(&self) -> u32;
|
||||
}
|
||||
|
||||
// TODO this is meant for bins, count them, collect range-complete, and deliver these
|
||||
// information also to the client.
|
||||
pub trait Collected {
|
||||
fn new(bin_count_exp: u32) -> Self;
|
||||
fn timed_out(&mut self, k: bool);
|
||||
@@ -36,3 +38,8 @@ pub trait ToJsonResult {
|
||||
type Output;
|
||||
fn to_json_result(&self) -> Result<Self::Output, Error>;
|
||||
}
|
||||
|
||||
pub trait Appendable {
|
||||
fn empty() -> Self;
|
||||
fn append(&mut self, src: &Self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user