From 5fddfad249f0f33c43ec43deffface7869b2ee7c Mon Sep 17 00:00:00 2001 From: Dominik Werder Date: Wed, 9 Jun 2021 21:04:56 +0200 Subject: [PATCH] Remove MinMaxAvgScalarEventBatchGen --- disk/src/agg/binnedt4.rs | 61 +--------------- disk/src/agg/enp.rs | 2 +- disk/src/binned/prebinned.rs | 2 +- disk/src/decode.rs | 136 ++--------------------------------- disk/src/frame/makeframe.rs | 9 +-- 5 files changed, 8 insertions(+), 202 deletions(-) diff --git a/disk/src/agg/binnedt4.rs b/disk/src/agg/binnedt4.rs index d9f4912..870c311 100644 --- a/disk/src/agg/binnedt4.rs +++ b/disk/src/agg/binnedt4.rs @@ -6,7 +6,7 @@ use crate::binned::{ FilterFittingInside, MinMaxAvgAggregator, MinMaxAvgBins, NumOps, RangeCompletableItem, RangeOverlapInfo, ReadPbv, ReadableFromFile, SingleXBinAggregator, }; -use crate::decode::{EventValues, MinMaxAvgScalarEventBatchGen}; +use crate::decode::EventValues; use crate::frame::makeframe::Framable; use crate::Sitemty; use err::Error; @@ -25,11 +25,6 @@ pub struct DefaultBinsTimeBinner { _m1: PhantomData, } -pub trait Aggregator3Tdim { - type InputValue; - type OutputValue; -} - pub trait TimeBinnableTypeAggregator: Send { type Input: TimeBinnableType; type Output: TimeBinnableType; @@ -218,57 +213,3 @@ where } } } - -pub struct MinMaxAvgScalarEventBatchGenAggregator -where - NTY: NumOps, -{ - _m1: PhantomData, -} - -impl TimeBinnableTypeAggregator for MinMaxAvgScalarEventBatchGenAggregator -where - NTY: NumOps, -{ - type Input = MinMaxAvgScalarEventBatchGen; - type Output = MinMaxAvgScalarEventBatchGen; - - fn range(&self) -> &NanoRange { - todo!() - } - - fn ingest(&mut self, item: &Self::Input) { - todo!() - } - - fn result(self) -> Self::Output { - todo!() - } -} - -impl ReadableFromFile for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn read_from_file(file: File) -> Result, Error> { - todo!() - } - - fn from_buf(buf: &[u8]) -> Result { - todo!() - } -} - -// TODO this is just dummy, do I use this in the refactored code? -impl TimeBinnableType for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - // TODO Output is just dummy, because this type is probably unused anyways. - type Output = MinMaxAvgScalarEventBatchGen; - type Aggregator = MinMaxAvgScalarEventBatchGenAggregator; - - fn aggregator(range: NanoRange) -> Self::Aggregator { - todo!() - } -} diff --git a/disk/src/agg/enp.rs b/disk/src/agg/enp.rs index e460602..c0ea46c 100644 --- a/disk/src/agg/enp.rs +++ b/disk/src/agg/enp.rs @@ -4,7 +4,7 @@ use crate::binned::{ EventsNodeProcessor, FilterFittingInside, MinMaxAvgBins, NumOps, PushableIndex, RangeOverlapInfo, ReadPbv, ReadableFromFile, WithLen, WithTimestamps, }; -use crate::decode::{EventValues, MinMaxAvgScalarEventBatchGen}; +use crate::decode::EventValues; use err::Error; use netpod::NanoRange; use serde::de::DeserializeOwned; diff --git a/disk/src/binned/prebinned.rs b/disk/src/binned/prebinned.rs index afbcc7d..f34b0b9 100644 --- a/disk/src/binned/prebinned.rs +++ b/disk/src/binned/prebinned.rs @@ -10,7 +10,7 @@ use crate::binned::{EventsNodeProcessor, NumOps, PushableIndex, RangeCompletable use crate::cache::node_ix_for_patch; use crate::decode::{ BigEndian, Endianness, EventValueFromBytes, EventValueShape, EventValuesDim0Case, EventValuesDim1Case, - LittleEndian, NumFromBytes, ProcAA, ProcBB, + LittleEndian, NumFromBytes, }; use crate::frame::makeframe::{Framable, FrameType}; use crate::Sitemty; diff --git a/disk/src/decode.rs b/disk/src/decode.rs index 3d0519e..3985fd3 100644 --- a/disk/src/decode.rs +++ b/disk/src/decode.rs @@ -119,36 +119,13 @@ impl EventValuesDim0Case { } } -// TODO get rid of this dummy: -pub struct ProcAA { - _m1: PhantomData, -} - -impl EventsNodeProcessor for ProcAA -where - NTY: NumOps, -{ - type Input = NTY; - type Output = EventValues; - - fn process(_inp: EventValues) -> Self::Output { - todo!() - } -} - impl EventValueShape for EventValuesDim0Case where NTY: NumOps + NumFromBytes, { type NumXAggToSingleBin = Identity; - // TODO: - type NumXAggToNBins = ProcAA; -} - -impl WithTimestamps for ProcAA { - fn ts(&self, ix: usize) -> u64 { - todo!() - } + // TODO is this sufficient? + type NumXAggToNBins = Identity; } pub struct EventValuesDim1Case { @@ -162,118 +139,13 @@ impl EventValuesDim1Case { } } -pub struct ProcBB { - _m1: PhantomData, -} - -// TODO still in use or can go away? -#[derive(Serialize, Deserialize)] -pub struct MinMaxAvgScalarEventBatchGen { - pub tss: Vec, - pub mins: Vec>, - pub maxs: Vec>, - pub avgs: Vec>, -} - -impl MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - pub fn empty() -> Self { - Self { - tss: vec![], - mins: vec![], - maxs: vec![], - avgs: vec![], - } - } -} - -impl WithTimestamps for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn ts(&self, ix: usize) -> u64 { - self.tss[ix] - } -} - -impl FilterFittingInside for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn filter_fitting_inside(self, fit_range: NanoRange) -> Option { - todo!() - } -} - -impl WithLen for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn len(&self) -> usize { - todo!() - } -} - -impl Appendable for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn empty() -> Self { - todo!() - } - - fn append(&mut self, src: &Self) { - todo!() - } -} - -impl RangeOverlapInfo for MinMaxAvgScalarEventBatchGen -where - NTY: NumOps, -{ - fn ends_before(&self, range: NanoRange) -> bool { - todo!() - } - - fn ends_after(&self, range: NanoRange) -> bool { - todo!() - } - - fn starts_after(&self, range: NanoRange) -> bool { - todo!() - } -} - -impl Framable for Result>>, Error> -where - NTY: NumOps + Serialize, -{ - fn make_frame(&self) -> Result { - make_frame(self) - } -} - -impl EventsNodeProcessor for ProcBB -where - NTY: NumOps, -{ - type Input = Vec; - type Output = MinMaxAvgScalarEventBatchGen; - - fn process(inp: EventValues) -> Self::Output { - err::todoval() - } -} - impl EventValueShape for EventValuesDim1Case where NTY: NumOps + NumFromBytes, { type NumXAggToSingleBin = WaveXBinner; - // TODO: - type NumXAggToNBins = ProcBB; + // TODO implement this method: + type NumXAggToNBins = WaveXBinner; } // TODO add pulse. diff --git a/disk/src/frame/makeframe.rs b/disk/src/frame/makeframe.rs index 4b25d15..83a98fc 100644 --- a/disk/src/frame/makeframe.rs +++ b/disk/src/frame/makeframe.rs @@ -3,7 +3,7 @@ use crate::agg::eventbatch::MinMaxAvgScalarEventBatch; use crate::agg::scalarbinbatch::MinMaxAvgScalarBinBatch; use crate::agg::streams::StreamItem; use crate::binned::{MinMaxAvgBins, NumOps, RangeCompletableItem}; -use crate::decode::{EventValues, MinMaxAvgScalarEventBatchGen}; +use crate::decode::EventValues; use crate::frame::inmem::InMemoryFrame; use crate::raw::EventQueryJsonStringFrame; use crate::Sitemty; @@ -76,13 +76,6 @@ impl FrameType for Sitemty { const FRAME_TYPE_ID: u32 = 0x300; } -impl FrameType for Sitemty> -where - NTY: NumOps, -{ - const FRAME_TYPE_ID: u32 = 0x400 + NTY::SUB; -} - impl FrameType for Sitemty> where NTY: NumOps,