Class SegmentIterator

java.lang.Object
org.yamcs.parameterarchive.SegmentIterator
All Implemented Interfaces:
AutoCloseable, ParchiveIterator<ParameterValueSegment>, PeekingIterator<ParameterValueSegment>

public class SegmentIterator extends Object implements ParchiveIterator<ParameterValueSegment>
For a given simple parameter id and group id, iterates over all segments in the parameter archive (across all partitions).

Provides objects of type ParameterValueSegment which contain multiple values of one parameter - suitable to be used for bulk processing (e.g. downsampling or averaging).

The ParameterIterator can be used to iterate over parameters value by value (at the expense of consuming more memory)

This iterator works like a Rocks iterator (with isValid(), next(), and value()) not like a java one. The advantage is that one can look at the current value multiple times. This property is used when merging the iterators using a priority queue.

The iterator has to be closed if it is not used until the end, otherwise a rocks iterator may be left hanging

Note about the raw values retrieval: the retrieval assumes that if raw values are requested, the parameter has raw values (this can be known from the type associated to the parameter id).

Thus, if the raw values are requested and not found in the archive, the engineering values are returned as raw values. This is an optimisation done in case the two are equal.

The iterator also sends data from RealtimeFiller if that is enabled.