public interface IBasicStorage
Storage for one or more data streams coming from a single source.
(for instance, the source can be a sensor, a service or a process)
This also supports storing lineage information if a description of the
data source is provided.
Modifier and Type | Method and Description |
---|---|
void |
addRecordStore(java.lang.String name,
DataComponent recordStructure,
DataEncoding recommendedEncoding)
Adds a data store for a new record type in this storage
|
DataBlock |
getDataBlock(DataKey key)
Retrieves raw data block with the specified key
|
java.util.Iterator<DataBlock> |
getDataBlockIterator(IDataFilter filter)
Gets iterator of raw data blocks matching the specified filter
|
AbstractProcess |
getDataSourceDescriptionAtTime(double time)
Retrieves data source description valid at specified time
|
java.util.List<AbstractProcess> |
getDataSourceDescriptionHistory(double startTime,
double endTime)
Retrieves history of data source description for the given time period
|
int[] |
getEstimatedRecordCounts(java.lang.String recordType,
double[] timeStamps)
Retrieves record counts within bins defined by the given time stamps.
|
AbstractProcess |
getLatestDataSourceDescription()
Retrieves latest data source description (i.e.
|
int |
getNumMatchingRecords(IDataFilter filter,
long maxCount)
Computes the (potentially approximate) number of records matching the
given filter.
Since the returned value can be approximate and the number of matching records can change before or even during the actual call to getRecordIterator(IDataFilter) , the exact number of records can
only be obtained by counting the records returned by the iterator next()
function. |
int |
getNumRecords(java.lang.String recordType)
Helper method to retrieve the total number of method for the specified
record type
|
java.util.Iterator<? extends IDataRecord> |
getRecordIterator(IDataFilter filter)
Gets iterator of records matching the specified filter
|
double[] |
getRecordsTimeRange(java.lang.String recordType)
Retrieves time range spanned by all records of the specified type
|
java.util.Map<java.lang.String,? extends IRecordStoreInfo> |
getRecordStores()
Gets the list of available record types in this storage
|
boolean |
isReadSupported() |
boolean |
isWriteSupported() |
void |
removeDataSourceDescription(double time)
Removes data source description valid at specified time
|
void |
removeDataSourceDescriptionHistory(double startTime,
double endTime)
Removes data source descriptions whose validity periods lie within the given time period
|
void |
removeRecord(DataKey key)
Removes record with the specified key
|
int |
removeRecords(IDataFilter filter)
Removes all records matching the filter
|
void |
storeDataSourceDescription(AbstractProcess process)
Stores a new data source description into storage.
|
void |
storeRecord(DataKey key,
DataBlock data)
Persists data block in storage
|
void |
updateDataSourceDescription(AbstractProcess process)
Update the data source description in storage.
|
void |
updateRecord(DataKey key,
DataBlock data)
Updates record with specified key with new data
|
AbstractProcess getLatestDataSourceDescription()
java.util.List<AbstractProcess> getDataSourceDescriptionHistory(double startTime, double endTime)
startTime
- lower bound of the time periodendTime
- upper bound of the time periodAbstractProcess getDataSourceDescriptionAtTime(double time)
time
- void storeDataSourceDescription(AbstractProcess process)
process
- SensorML process description to storevoid updateDataSourceDescription(AbstractProcess process)
process
- SensorML process description to updatevoid removeDataSourceDescription(double time)
time
- any time falling within the validity period of the description version to removevoid removeDataSourceDescriptionHistory(double startTime, double endTime)
startTime
- lower bound of the time periodendTime
- upper bound of the time periodjava.util.Map<java.lang.String,? extends IRecordStoreInfo> getRecordStores()
void addRecordStore(java.lang.String name, DataComponent recordStructure, DataEncoding recommendedEncoding)
name
- name of record type (should match output name of the data source)recordStructure
- SWE data component describing the record structurerecommendedEncoding
- recommended encoding for this record typeint getNumRecords(java.lang.String recordType)
recordType
- name of record typedouble[] getRecordsTimeRange(java.lang.String recordType)
recordType
- name of record typeint[] getEstimatedRecordCounts(java.lang.String recordType, double[] timeStamps)
recordType
- name of record typetimeStamps
- DataBlock getDataBlock(DataKey key)
key
- Record keyjava.util.Iterator<DataBlock> getDataBlockIterator(IDataFilter filter)
filter
- filtering parametersjava.util.Iterator<? extends IDataRecord> getRecordIterator(IDataFilter filter)
filter
- filtering parametersint getNumMatchingRecords(IDataFilter filter, long maxCount)
getRecordIterator(IDataFilter)
, the exact number of records can
only be obtained by counting the records returned by the iterator next()
function.filter
- filtering parametersmaxCount
- counting will stop once this threshold is reachedvoid storeRecord(DataKey key, DataBlock data)
key
- key object to associate to recorddata
- actual record datavoid updateRecord(DataKey key, DataBlock data)
key
- key of record to updatedata
- new data block to assign to the recordvoid removeRecord(DataKey key)
key
- record keyint removeRecords(IDataFilter filter)
filter
- filtering parametersboolean isReadSupported()
boolean isWriteSupported()