public class TagHistoryDatasourceSink extends AbstractDatasourceSink
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkEnabled |
faulted, faultError, faultTime
LOG_NAME_TEMPLATE, ROOT_LOGGER
Constructor and Description |
---|
TagHistoryDatasourceSink(GatewayContext context,
SQLTagHistoryProviderRecord profile,
TagHistorianSettingsRecord settings) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Integer |
_getProviderId(java.lang.String providerId) |
boolean |
acceptsData(HistoryFlavor dataType)
Returns whether or not the storer can accept the specified type of data.
|
protected com.google.common.collect.Multimap<java.lang.String,HistoricalTagValue> |
breakupByPartition(ScanclassHistorySet theData) |
protected void |
checkTables() |
protected PartitionManager |
createPartitionManager() |
protected java.lang.String |
getDescriptionKey() |
protected int |
getIdOfScanclassName(java.lang.String providerName,
java.lang.String scName)
Gets the id of the given SC name, inserting if necessary.
|
protected java.lang.String |
getKeyForTagIdCache(int providerId,
java.lang.String path) |
protected PartitionManager |
getPartitionManager() |
protected int |
getProviderId(java.lang.String providerName,
boolean create)
Returns the id of the specified provider, for this system.
|
protected int |
getSystemId()
Get the id of the driver.
|
protected java.util.Map<java.lang.String,HistoricalTagInfo> |
getTagIds(ScanclassHistorySet data) |
protected void |
initialize() |
protected void |
insertProviderName(java.lang.String providerName) |
protected void |
insertTagValues(SRConnection conn,
ScanclassHistorySet theData)
Actually inserts the tag values in to the Tag Value table.
|
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 boolean |
isOurProviderId(java.lang.Integer value)
Returns whether the provider id is from this driver *
|
protected void |
loadProviderIds() |
protected void |
loadTagIdCache() |
protected void |
retireTags(java.util.List<HistoricalTagInfo> toRetire) |
protected void |
retireTags(SRConnection conn,
java.util.List<TagPath> paths)
Marks the given paths as retired, and removes them from the cache.
|
void |
setDatasourceName(java.lang.String dataSource) |
void |
shutdown() |
protected void |
startMaintenanceTasks()
If a maintenance task is defined, and we've been initialized (determined by the presence of Partition Manager),
will register the tag with the execution engine.
|
protected void |
startOptimizeEngine() |
void |
startup() |
protected void |
stopMaintenanceTasks() |
protected void |
storeDataToDatasource(SRConnection conn,
HistoricalData data)
Stores the given data against the connection which has been pre-setup to execute in a transaction.
|
protected void |
storeScanClassSet(SRConnection conn,
ScanclassHistorySet data) |
protected void |
storeValueToOptimized(HistoricalTagValue v,
int tagid,
long ts) |
protected boolean |
tryToInit()
Initialization is really complex in this class because we don't really want to initialize until data comes in.
|
protected void |
updateSCExecRecord(SRConnection conn,
java.lang.String provName,
java.lang.String scName,
int rate,
java.util.Date execTime)
This class updates the scan class execution table.
|
void |
updateSettings(SQLTagHistoryProviderRecord profile,
TagHistorianSettingsRecord settings) |
protected void |
updateSystemName(java.lang.String newName) |
protected boolean |
useSCE(ScanclassHistorySet data) |
getContext, getDatasource, getDatasourceName, getInfo, getQueryCache, runFirstTimeChecks, storeData, storeToDatasource, useBatching, useGeneratedKeys
createLogger, getLogger, getLogName, getPipelineName, getQuarantineManager, isFaulted, isInitialized, isStarted, setFaulted, setInitialized, uninitialize
public TagHistoryDatasourceSink(GatewayContext context, SQLTagHistoryProviderRecord profile, TagHistorianSettingsRecord settings)
public void updateSettings(SQLTagHistoryProviderRecord profile, TagHistorianSettingsRecord settings)
public void setDatasourceName(java.lang.String dataSource)
setDatasourceName
in class AbstractDatasourceSink
protected java.lang.String getDescriptionKey()
getDescriptionKey
in class AbstractDatasourceSink
public boolean acceptsData(HistoryFlavor dataType)
HistoryStorer
public boolean isLicensedFor(HistoryFlavor dataType)
HistoryStorer
protected boolean tryToInit()
tryToInit
in class AbstractSink
public void startup()
startup
in interface DataSink
startup
in class AbstractSink
protected void initialize() throws java.lang.Exception
initialize
in class AbstractSink
java.lang.Exception
protected void startOptimizeEngine()
protected PartitionManager createPartitionManager() throws java.lang.Exception
java.lang.Exception
public void shutdown()
shutdown
in interface DataSink
shutdown
in class AbstractSink
public boolean isAccepting()
DataSink
isAccepting
in interface DataSink
isAccepting
in class AbstractDatasourceSink
protected PartitionManager getPartitionManager()
protected boolean useSCE(ScanclassHistorySet data)
protected void storeDataToDatasource(SRConnection conn, HistoricalData data) throws java.lang.Exception
storeDataToDatasource
in class AbstractDatasourceSink
java.lang.Exception
protected void storeScanClassSet(SRConnection conn, ScanclassHistorySet data) throws java.lang.Exception
java.lang.Exception
protected void loadProviderIds() throws java.lang.Exception
java.lang.Exception
protected void insertProviderName(java.lang.String providerName) throws java.lang.Exception
java.lang.Exception
protected java.lang.Integer _getProviderId(java.lang.String providerId)
protected boolean isOurProviderId(java.lang.Integer value)
protected int getSystemId() throws java.lang.Exception
conn
- systemName
- java.lang.Exception
protected void updateSystemName(java.lang.String newName)
protected int getProviderId(java.lang.String providerName, boolean create) throws java.lang.Exception
java.lang.Exception
protected void startMaintenanceTasks()
protected void stopMaintenanceTasks()
protected void updateSCExecRecord(SRConnection conn, java.lang.String provName, java.lang.String scName, int rate, java.util.Date execTime) throws java.lang.Exception
conn
- scName
- rate
- execTime
- java.lang.Exception
protected int getIdOfScanclassName(java.lang.String providerName, java.lang.String scName) throws java.lang.Exception
conn
- scName
- java.lang.Exception
protected java.lang.String getKeyForTagIdCache(int providerId, java.lang.String path)
protected void loadTagIdCache() throws java.lang.Exception
java.lang.Exception
protected java.util.Map<java.lang.String,HistoricalTagInfo> getTagIds(ScanclassHistorySet data) throws java.lang.Exception
java.lang.Exception
protected void retireTags(SRConnection conn, java.util.List<TagPath> paths) throws java.lang.Exception
conn
- paths
- java.lang.Exception
protected void retireTags(java.util.List<HistoricalTagInfo> toRetire) throws java.lang.Exception
java.lang.Exception
protected void insertTagValues(SRConnection conn, ScanclassHistorySet theData) throws java.lang.Exception
conn
- theData
- scid
- java.lang.Exception
protected com.google.common.collect.Multimap<java.lang.String,HistoricalTagValue> breakupByPartition(ScanclassHistorySet theData) throws java.lang.Exception
java.lang.Exception
protected void storeValueToOptimized(HistoricalTagValue v, int tagid, long ts)
protected void checkTables() throws java.lang.Exception
java.lang.Exception