archiver-appliance / epicsarchiverap

This is an implementation of an archiver for EPICS control systems that aims to archive millions of PVs.
Other
38 stars 37 forks source link

Fixing a bug where a year change is not caught when the postprocessors return raw events. #118

Closed rjwills28 closed 3 years ago

rjwills28 commented 3 years ago

We noticed an issue when plotting archived data that spans a year change. It occurs when the Optimized post-processor is used but in the condition where the number of events < number of bins requested. In this case no binning is needed so the raw events are returned in an ArrayList. This form of ArrayList has no method to identify or catch a year change. This means that instead of sending 2020-12-31... 2021-01-01, it sends 2020-12-31... 2020-01-01.

This PR fixes this issue in the Optimized and OptimizedWithLastSample postprocessors by wrapping the ArrayList in an ArrayListCollectorEventStream object , which contains an iterator and next() method to catch year changes and return this.