Remove stats agg kind
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use items::numops::NumOps;
|
||||
use items::scalarevents::ScalarEvents;
|
||||
use items::waveevents::WaveEvents;
|
||||
use items::EventsNodeProcessor;
|
||||
use items::{numops::NumOps, statsevents::StatsEvents};
|
||||
use netpod::{AggKind, Shape};
|
||||
use netpod::AggKind;
|
||||
use netpod::Shape;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct Identity<NTY> {
|
||||
@@ -24,38 +24,3 @@ where
|
||||
inp
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Stats1Scalar {}
|
||||
|
||||
impl EventsNodeProcessor for Stats1Scalar {
|
||||
type Input = StatsEvents;
|
||||
type Output = StatsEvents;
|
||||
|
||||
fn create(_shape: Shape, _agg_kind: AggKind) -> Self {
|
||||
Self {}
|
||||
}
|
||||
|
||||
fn process(&self, inp: Self::Input) -> Self::Output {
|
||||
inp
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Stats1Wave<NTY> {
|
||||
_m1: PhantomData<NTY>,
|
||||
}
|
||||
|
||||
impl<NTY> EventsNodeProcessor for Stats1Wave<NTY>
|
||||
where
|
||||
NTY: NumOps,
|
||||
{
|
||||
type Input = WaveEvents<NTY>;
|
||||
type Output = StatsEvents;
|
||||
|
||||
fn create(_shape: Shape, _agg_kind: AggKind) -> Self {
|
||||
Self { _m1: PhantomData }
|
||||
}
|
||||
|
||||
fn process(&self, _inp: Self::Input) -> Self::Output {
|
||||
err::todoval()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,6 @@ where
|
||||
type NumXAggToSingleBin: EventsNodeProcessor<Input = <Self as EventValueFromBytes<NTY, END>>::Batch>;
|
||||
type NumXAggToNBins: EventsNodeProcessor<Input = <Self as EventValueFromBytes<NTY, END>>::Batch>;
|
||||
type NumXAggPlain: EventsNodeProcessor<Input = <Self as EventValueFromBytes<NTY, END>>::Batch>;
|
||||
type NumXAggToStats1: EventsNodeProcessor<Input = <Self as EventValueFromBytes<NTY, END>>::Batch>;
|
||||
}
|
||||
|
||||
pub struct EventValuesDim0Case<NTY> {
|
||||
@@ -191,7 +190,6 @@ where
|
||||
// TODO is this sufficient?
|
||||
type NumXAggToNBins = Identity<NTY>;
|
||||
type NumXAggPlain = Identity<NTY>;
|
||||
type NumXAggToStats1 = Identity<NTY>;
|
||||
}
|
||||
|
||||
pub struct EventValuesDim1Case<NTY> {
|
||||
@@ -212,7 +210,6 @@ where
|
||||
type NumXAggToSingleBin = WaveXBinner<NTY>;
|
||||
type NumXAggToNBins = WaveNBinner<NTY>;
|
||||
type NumXAggPlain = WavePlainProc<NTY>;
|
||||
type NumXAggToStats1 = crate::agg::enp::Stats1Wave<NTY>;
|
||||
}
|
||||
|
||||
pub struct EventsDecodedStream<NTY, END, EVS>
|
||||
@@ -341,6 +338,53 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EventsDynStream {
|
||||
events_full: EventChunkerMultifile,
|
||||
done: bool,
|
||||
complete: bool,
|
||||
}
|
||||
|
||||
impl EventsDynStream {
|
||||
pub fn new(events_full: EventChunkerMultifile) -> Self {
|
||||
Self {
|
||||
events_full,
|
||||
done: false,
|
||||
complete: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Stream for EventsDynStream {
|
||||
type Item = Sitemty<Box<dyn items_0::Events>>;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
|
||||
use Poll::*;
|
||||
loop {
|
||||
break if self.complete {
|
||||
panic!("poll_next on complete")
|
||||
} else if self.done {
|
||||
self.complete = true;
|
||||
Ready(None)
|
||||
} else {
|
||||
match self.events_full.poll_next_unpin(cx) {
|
||||
Ready(Some(Ok(k))) => {
|
||||
todo!()
|
||||
}
|
||||
Ready(Some(Err(e))) => {
|
||||
self.done = true;
|
||||
Ready(Some(Err(e)))
|
||||
}
|
||||
Ready(None) => {
|
||||
self.done = true;
|
||||
continue;
|
||||
}
|
||||
Pending => Pending,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EventsItemStream {
|
||||
inp: Pin<Box<dyn Stream<Item = Sitemty<EventFull>>>>,
|
||||
done: bool,
|
||||
|
||||
@@ -135,11 +135,6 @@ macro_rules! pipe4 {
|
||||
<$evs<$nty> as EventValueShape<$nty, $end>>::NumXAggPlain::create($shape, $agg_kind),
|
||||
$event_blobs,
|
||||
),
|
||||
AggKind::Stats1 => make_num_pipeline_stream_evs::<$nty, $end, $evs<$nty>, _>(
|
||||
$evsv,
|
||||
<$evs<$nty> as EventValueShape<$nty, $end>>::NumXAggToStats1::create($shape, $agg_kind),
|
||||
$event_blobs,
|
||||
),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user