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
Modifier and TypeFieldDescriptionprotected final boolean
protected final ExecutionContext
protected final boolean
protected Log
protected long
protected boolean
protected TableDefinition
protected final YarchDatabaseInstance
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTableWalker
(ExecutionContext ctx, TableDefinition tableDefinition, boolean ascending, boolean follow) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected boolean
iAscendingFinished
(byte[] key, byte[] value, byte[] rangeEnd) protected boolean
isDescendingFinished
(byte[] key, byte[] value, byte[] rangeStart) protected boolean
void
setPartitionFilter
(TimeInterval partitionTimeFilter, Set<Object> partitionValueFilter) void
setPrimaryIndexRange
(DbRange range) void
walk
(TableVisitor visitor) protected abstract boolean
walkInterval
(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, wait
Methods 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:
walk
in 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:
setPartitionFilter
in interfaceTableWalker
-
setPrimaryIndexRange
- Specified by:
setPrimaryIndexRange
in 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:
StreamSqlException
YarchException
-
isRunning
protected boolean isRunning() -
close
public void close()- Specified by:
close
in interfaceTableWalker
-