IBM / sliding-window-aggregators

Reference implementations of sliding window aggregation algorithms
Apache License 2.0
43 stars 16 forks source link

Add Rust implementation for FlatFIT #25

Closed segeljakt closed 4 years ago

segeljakt commented 4 years ago

This is a Rust implementation of the dynamic FlatFIT algorithm based on your C++ implementation. I went with std::vec::Vec for storing the internal buffer, but I think it might be possible to also use std::vec::VecDeque.

segeljakt commented 4 years ago

It contains unsafe code in 2 places. 1) for not having to initialise elements when rescaling the buffer, 2) for being able to update the buffer during queries.

segeljakt commented 4 years ago

I updated it now so 2) is no longer unsafe. Now it will use RefCell which does a runtime check for ownership. It has a very small overhead, let me know if you want me to rollback.