public class CcsdsTmIndex extends Object implements TmIndex
key: apid[2bytes], start time[8 bytes], start seq count[2 bytes] value: end time[8bytes], end seq count[2 bytes], num packets [4 bytes]FIXME: because the sequence count wraps around, there is a bug in case packets with the same timestamp and wrapped around sequence counts are received - see testApidIndexSameTimeAndWraparound for failing test. the old TokyoCabinet based indexer didn't use the sequence count as part of the key but allowed multiple records with the same key. To replicate this in RocksDB, one would need to have the RocksDB entries composed of all records with the same startime
| Modifier and Type | Class and Description |
|---|---|
class |
CcsdsTmIndex.CcsdsTmIndexRestHandler |
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
CcsdsTmIndex(String filename)
Used when started standalone
|
CcsdsTmIndex(String instance,
boolean readonly)
if readonly is specified, it is open only for reading
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPacket(short apid,
long instant,
short seq) |
void |
close() |
void |
deleteRecords(long start,
long stop) |
IndexIterator |
getIterator(List<Yamcs.NamedObjectId> names,
long start,
long stop)
return an iterator that provides all the index entries between start and stop
|
static void |
main(String[] args)
Print the content of the index files
|
void |
onTuple(Stream stream,
Tuple tuple) |
void |
printApidDb() |
void |
printApidDb(short apid,
long start,
long stop) |
CompletableFuture<Void> |
rebuild(TimeInterval interval) |
void |
streamClosed(Stream stream) |
public CcsdsTmIndex(String instance, boolean readonly) throws IOException
IOExceptionpublic CcsdsTmIndex(String filename) throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic void onTuple(Stream stream, Tuple tuple)
onTuple in interface StreamSubscriberpublic void addPacket(short apid,
long instant,
short seq)
throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic void close()
throws IOException
close in interface TmIndexIOExceptionpublic void deleteRecords(long start,
long stop)
deleteRecords in interface TmIndexpublic void printApidDb()
public void printApidDb(short apid,
long start,
long stop)
public static void main(String[] args) throws Exception
args - Exceptionpublic IndexIterator getIterator(List<Yamcs.NamedObjectId> names, long start, long stop)
TmIndexgetIterator in interface TmIndexnames - can be used to filter which entries are returned. If null, everything is returned.public void streamClosed(Stream stream)
streamClosed in interface StreamSubscriberpublic CompletableFuture<Void> rebuild(TimeInterval interval) throws YarchException
YarchExceptionCopyright © 2018 Space Applications Services. All rights reserved.