Package org.yamcs.archive
Class CcsdsTmIndex
java.lang.Object
com.google.common.util.concurrent.AbstractService
org.yamcs.AbstractYamcsService
org.yamcs.archive.CcsdsTmIndex
- All Implemented Interfaces:
com.google.common.util.concurrent.Service,TmIndexService,YamcsService,StreamSubscriber
Completeness index of CCSDS telemetry. The structure of the rocksdb records:
key: tbsIndex[4 bytes], 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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsFields inherited from class org.yamcs.AbstractYamcsService
config, log, serviceName, yamcsInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteRecords(long start, long stop) protected voiddoStart()protected voiddoStop()getApids(CcsdsTmIndex ccsdsTmIndex) getIterator(List<Yamcs.NamedObjectId> names, long start, long stop) return an iterator that provides all the index entries between start and stopprotected longGet the generation time for use in the index key.static StringgetWhereCondition(String timeColumnName, TimeInterval interval) voidinit(String yamcsInstance, String serviceName, YConfiguration args) Initialize this service.voidrebuild(TimeInterval interval) voidstreamClosed(Stream stream) Methods inherited from class org.yamcs.AbstractYamcsService
findStream, getConfig, getYamcsInstanceMethods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsyncMethods inherited from interface org.yamcs.yarch.StreamSubscriber
getDescriptionMethods inherited from interface org.yamcs.YamcsService
getSpec, getYamcsInstance
-
Field Details
-
tablespace
-
-
Constructor Details
-
CcsdsTmIndex
public CcsdsTmIndex()
-
-
Method Details
-
init
public void init(String yamcsInstance, String serviceName, YConfiguration args) throws InitException Description copied from interface:YamcsServiceInitialize this service. This is called before the service is started. All operations should finish fast.- Specified by:
initin interfaceYamcsService- Overrides:
initin classAbstractYamcsService- Parameters:
yamcsInstance- The yamcs instance, ornullif this is a global service.serviceName- The service name.args- The configured arguments for this service. IfYamcsService.getSpec()is implemented then this contains the arguments after being validated (including any defaults).- Throws:
InitException- When something goes wrong during the execution of this method.
-
doStart
protected void doStart()- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doStop
protected void doStop()- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
onTuple
- Specified by:
onTuplein interfaceStreamSubscriber
-
getTime
Get the generation time for use in the index key.The default implementations returns the value of the
gentimecolumn from the tuple (set by the data link preprocessor). -
deleteRecords
public void deleteRecords(long start, long stop) - Specified by:
deleteRecordsin interfaceTmIndexService
-
getApids
- Throws:
org.rocksdb.RocksDBException
-
getIterator
Description copied from interface:TmIndexServicereturn an iterator that provides all the index entries between start and stop- Specified by:
getIteratorin interfaceTmIndexService- Parameters:
names- can be used to filter which entries are returned. If null, everything is returned.- Returns:
-
streamClosed
- Specified by:
streamClosedin interfaceStreamSubscriber
-
rebuild
- Throws:
YarchException
-
getWhereCondition
-