Towards filling in more missing pieces

This commit is contained in:
Dominik Werder
2021-05-04 18:24:30 +02:00
parent bf08893a98
commit be36dcce89
6 changed files with 73 additions and 66 deletions

View File

@@ -1,4 +1,4 @@
use crate::agg::scalarbinbatch::MinMaxAvgScalarBinBatch;
use crate::agg::MinMaxAvgScalarBinBatchStreamItem;
use crate::cache::pbvfs::{PreBinnedItem, PreBinnedValueFetchedStream};
use crate::cache::{CacheUsage, PreBinnedQuery};
use err::Error;
@@ -12,7 +12,7 @@ use std::pin::Pin;
use std::task::{Context, Poll};
pub struct BinnedStream {
inp: Pin<Box<dyn Stream<Item = Result<MinMaxAvgScalarBinBatch, Error>> + Send>>,
inp: Pin<Box<dyn Stream<Item = Result<MinMaxAvgScalarBinBatchStreamItem, Error>> + Send>>,
}
impl BinnedStream {
@@ -57,10 +57,14 @@ impl BinnedStream {
Fits::Inside
| Fits::PartlyGreater
| Fits::PartlyLower
| Fits::PartlyLowerAndGreater => Some(Ok(k)),
| Fits::PartlyLowerAndGreater => Some(Ok(MinMaxAvgScalarBinBatchStreamItem::Values(k))),
_ => None,
}
}
Ok(PreBinnedItem::RangeComplete) => Some(Ok(MinMaxAvgScalarBinBatchStreamItem::RangeComplete)),
Ok(PreBinnedItem::EventDataReadStats(stats)) => {
Some(Ok(MinMaxAvgScalarBinBatchStreamItem::EventDataReadStats(stats)))
}
Err(e) => {
error!("observe error in stream {:?}", e);
Some(Err(e))
@@ -69,7 +73,7 @@ impl BinnedStream {
ready(g)
}
})
.map(|k| k)
//.map(|k| k)
.into_binned_t(range);
Self { inp: Box::pin(inp) }
}
@@ -77,7 +81,7 @@ impl BinnedStream {
impl Stream for BinnedStream {
// TODO make this generic over all possible things
type Item = Result<MinMaxAvgScalarBinBatch, Error>;
type Item = Result<MinMaxAvgScalarBinBatchStreamItem, Error>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
self.inp.poll_next_unpin(cx)