Class LocalHistorianProvider.SyncManager
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.tsdb.localhistorian.LocalHistorianProvider.SyncManager
-
- All Implemented Interfaces:
DataSink
,DataStore
,HistoryStorer
- Enclosing class:
- LocalHistorianProvider
protected static class LocalHistorianProvider.SyncManager extends java.lang.Object implements DataStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
LocalHistorianProvider.SyncManager.SyncTransaction
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.gateway.history.DataSink
LOG_NAME_TEMPLATE
-
-
Constructor Summary
Constructors Constructor Description SyncManager(Syncable syncable, HistorianSink sink, SyncIdTracker idTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsData(HistoryFlavor dataType)
Returns whether or not the storer can accept the specified type of data.void
addDataCountChangeListener(java.beans.PropertyChangeListener listener)
Listener will be notified when new data is available for storage.protected void
fireDatacountChanged()
int
getDataCount()
Amount of data in the cache available to be forwarded.java.util.List<DataSinkInformation>
getInfo()
Gets the information for this sink, as well as any below it.long
getOldestTimestamp()
Gets the timestamp of the oldest data, in order to calculate how long data has been present.java.lang.String
getPipelineName()
Returns the name of the store and forward pipeline that this sink belongs to.QuarantineManager
getQuarantineManager()
Returns the quarantine interface for the sink.protected long
getSyncId()
boolean
isAccepting()
Returns whether the data store is accepting data.boolean
isLicensedFor(HistoryFlavor dataType)
Assuming the storer accepts the flavor, is it currently licensed for it? If not, the data will not be stored.protected long
markSyncIdFinished(long id)
void
removeDataCountChangeListener(java.beans.PropertyChangeListener listener)
void
shutdown()
void
startup()
void
storeData(HistoricalData data)
TransactionSet
takeNext(boolean wait, int desiredTransactionSize, java.util.Date olderThan)
Gets the next set of transactions to run.protected HistoricalData
toHistoricalData(java.util.List<PathInfo> pathInfo, ResultDataPoint[] points)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.gateway.history.DataSink
getLogName
-
-
-
-
Constructor Detail
-
SyncManager
public SyncManager(Syncable syncable, HistorianSink sink, SyncIdTracker idTracker)
-
-
Method Detail
-
getSyncId
protected long getSyncId()
-
markSyncIdFinished
protected long markSyncIdFinished(long id)
-
getPipelineName
public java.lang.String getPipelineName()
Description copied from interface:DataSink
Returns the name of the store and forward pipeline that this sink belongs to.- Specified by:
getPipelineName
in interfaceDataSink
-
isAccepting
public boolean isAccepting()
Description copied from interface:DataSink
Returns whether the data store is accepting data.- Specified by:
isAccepting
in interfaceDataSink
-
getInfo
public java.util.List<DataSinkInformation> getInfo()
Description copied from interface:DataSink
Gets the information for this sink, as well as any below it.
-
getQuarantineManager
public QuarantineManager getQuarantineManager()
Description copied from interface:DataSink
Returns the quarantine interface for the sink. If the sink doesn't support quarantined data, can return null.- Specified by:
getQuarantineManager
in interfaceDataSink
-
storeData
public void storeData(HistoricalData data) throws java.lang.Exception
- Specified by:
storeData
in interfaceHistoryStorer
- Throws:
java.lang.Exception
-
acceptsData
public boolean acceptsData(HistoryFlavor dataType)
Description copied from interface:HistoryStorer
Returns whether or not the storer can accept the specified type of data.- Specified by:
acceptsData
in interfaceHistoryStorer
-
isLicensedFor
public boolean isLicensedFor(HistoryFlavor dataType)
Description copied from interface:HistoryStorer
Assuming the storer accepts the flavor, is it currently licensed for it? If not, the data will not be stored.- Specified by:
isLicensedFor
in interfaceHistoryStorer
-
addDataCountChangeListener
public void addDataCountChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface:DataStore
Listener will be notified when new data is available for storage.- Specified by:
addDataCountChangeListener
in interfaceDataStore
-
removeDataCountChangeListener
public void removeDataCountChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removeDataCountChangeListener
in interfaceDataStore
-
fireDatacountChanged
protected void fireDatacountChanged()
-
getDataCount
public int getDataCount()
Description copied from interface:DataStore
Amount of data in the cache available to be forwarded. This value cannot be trusted to be 100% accurate, it could be an estimation, and could return negative values if the cache thinks nothing is available or does not yet know how many points are available.- Specified by:
getDataCount
in interfaceDataStore
-
getOldestTimestamp
public long getOldestTimestamp()
Description copied from interface:DataStore
Gets the timestamp of the oldest data, in order to calculate how long data has been present. Does not look at quarantined data. Returns Long.MaxValue if there is no value available (because that will be in the future, and thus not old).- Specified by:
getOldestTimestamp
in interfaceDataStore
-
takeNext
public TransactionSet takeNext(boolean wait, int desiredTransactionSize, java.util.Date olderThan) throws java.lang.InterruptedException
Description copied from interface:DataStore
Gets the next set of transactions to run.- Specified by:
takeNext
in interfaceDataStore
- Parameters:
wait
- whether to block until data is available. If false, or if an olderThan parameter is provided, will return null if no data is present.desiredTransactionSize
- the desired size of data in the transactions. ONLY A HINT! Stores are free to return whatever they think is best. If -1, it's left to the store's discretion (usually will return 1 at a time)olderThan
- If null, not used. Otherwise only returns data older than the given value. Returns null if there is no old data available.- Throws:
java.lang.InterruptedException
-
toHistoricalData
protected HistoricalData toHistoricalData(java.util.List<PathInfo> pathInfo, ResultDataPoint[] points)
-
-