It compiles

This commit is contained in:
Dominik Werder
2021-05-20 20:04:21 +02:00
parent 49af7ce561
commit 30be7d1c44
25 changed files with 424 additions and 663 deletions

View File

@@ -1,6 +1,5 @@
use crate::dataopen::open_files;
use crate::dtflags::{ARRAY, BIG_ENDIAN, COMPRESSION, SHAPE};
use crate::eventchunker::EventChunkerConf;
use bytes::{Bytes, BytesMut};
use err::Error;
use futures_core::Stream;
@@ -334,51 +333,6 @@ pub fn file_content_stream(
}
}
pub fn parsed1(
query: &netpod::AggQuerySingleChannel,
node: &Node,
stats_conf: EventChunkerConf,
) -> impl Stream<Item = Result<Bytes, Error>> + Send {
let query = query.clone();
let node = node.clone();
async_stream::stream! {
let filerx = open_files(err::todoval(), err::todoval(), node);
while let Ok(fileres) = filerx.recv().await {
match fileres {
Ok(file) => {
let inp = Box::pin(file_content_stream(file.file.unwrap(), query.buffer_size as usize));
let range = err::todoval();
let max_ts = err::todoval();
let mut chunker = eventchunker::EventChunker::from_event_boundary(inp, err::todoval(), range, stats_conf.clone(), file.path, max_ts);
while let Some(evres) = chunker.next().await {
use eventchunker::EventChunkerItem;
match evres {
Ok(EventChunkerItem::Events(evres)) => {
//let mut buf = BytesMut::with_capacity(16);
// TODO put some interesting information to test
//buf.put_u64_le(0xcafecafe);
//yield Ok(buf.freeze())
for bufopt in evres.decomps {
if let Some(buf) = bufopt {
yield Ok(buf.freeze());
}
}
}
Err(e) => {
yield Err(e)
}
_ => todo!(),
}
}
}
Err(e) => {
yield Err(e);
}
}
}
}
}
pub struct NeedMinBuffer {
inp: Pin<Box<dyn Stream<Item = Result<FileChunkRead, Error>> + Send>>,
need_min: u32,