Package org.yamcs.yarch
Class AbstractTableWalker
java.lang.Object
org.yamcs.yarch.AbstractTableWalker
- All Implemented Interfaces:
TableWalker
- Direct Known Subclasses:
RdbTableWalker
Iterator through a table.
Iterates through partitions, can support partition filter (by time and/or value) and and also ranges on primary key.
This class expects raw (byte[]) input for the primary key ranges.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final ExecutionContextprotected final booleanprotected Logprotected longprotected booleanprotected TableDefinitionprotected final YarchDatabaseInstance -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTableWalker(ExecutionContext ctx, TableDefinition tableDefinition, boolean ascending, boolean follow) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected booleaniAscendingFinished(byte[] key, byte[] value, byte[] rangeEnd) protected booleanisDescendingFinished(byte[] key, byte[] value, byte[] rangeStart) protected booleanvoidsetPartitionFilter(TimeInterval partitionTimeFilter, Set<Object> partitionValueFilter) voidsetPrimaryIndexRange(DbRange range) voidwalk(TableVisitor visitor) protected abstract booleanwalkInterval(PartitionManager.Interval interval, DbRange range, TableVisitor visitor) Runs the data in a time interval (corresponding to a time partition) sending data only that conform with the start and end filters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.yamcs.yarch.TableWalker
isBatchUpdates, setBatchUpdates, setSecondaryIndexRange
-
Field Details
-
log
-
tableDefinition
-
ascending
protected final boolean ascending -
follow
protected final boolean follow -
numRecordsRead
protected long numRecordsRead -
running
protected volatile boolean running -
ydb
-
ctx
-
-
Constructor Details
-
AbstractTableWalker
protected AbstractTableWalker(ExecutionContext ctx, TableDefinition tableDefinition, boolean ascending, boolean follow)
-
-
Method Details
-
walk
- Specified by:
walkin interfaceTableWalker- Throws:
StreamSqlException
-
iAscendingFinished
protected boolean iAscendingFinished(byte[] key, byte[] value, byte[] rangeEnd) -
isDescendingFinished
protected boolean isDescendingFinished(byte[] key, byte[] value, byte[] rangeStart) -
setPartitionFilter
- Specified by:
setPartitionFilterin interfaceTableWalker
-
setPrimaryIndexRange
- Specified by:
setPrimaryIndexRangein interfaceTableWalker
-
walkInterval
protected abstract boolean walkInterval(PartitionManager.Interval interval, DbRange range, TableVisitor visitor) throws YarchException, StreamSqlException Runs the data in a time interval (corresponding to a time partition) sending data only that conform with the start and end filters. Returns true if the stop condition is met- Returns:
- returns true if the end condition has been reached.
- Throws:
StreamSqlExceptionYarchException
-
isRunning
protected boolean isRunning() -
close
public void close()- Specified by:
closein interfaceTableWalker
-