public class SQLRecordingV8 extends SQLRecordingV7
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SQLRecordingV8.SQLRecordingParametersV8
A subclass of SQLRecordingParameters that adds more parameters.
|
protected static class |
SQLRecordingV8.TokenInfo
The class used in the port queues to contain the port event write id
and data md5.
|
SQLRecording.PortDirection| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_execAnnotation
Value of execution annotation parameter.
|
protected boolean |
_executionHadAnError
True if executionError is called
|
protected java.util.Map<KeplerLSID,java.lang.Integer> |
_executionLSIDtoIdMap |
protected java.lang.String |
_nextExecLSIDStr
Value of next execution LSID parameter.
|
protected PortConnector<SQLRecordingV8.TokenInfo> |
_portConnector
Class for token dependencies.
|
protected java.sql.PreparedStatement |
_psAssocDataInsert |
protected java.sql.PreparedStatement |
_psAssocDataInsertNoDataId |
protected java.sql.PreparedStatement |
_psChangeExecutionLSID |
protected java.sql.PreparedStatement |
_psChangeExecutionReferralList |
protected java.sql.PreparedStatement |
_psChangeExecutionType |
protected java.sql.PreparedStatement |
_psChangeWorkflowName |
protected java.sql.PreparedStatement |
_psDataInsert |
protected java.sql.PreparedStatement |
_psDataMD5Query |
protected java.sql.PreparedStatement |
_psDeleteData |
protected java.sql.PreparedStatement |
_psDeleteExecutions |
protected java.sql.PreparedStatement |
_psDeleteTagForExecIdAndURN |
protected java.sql.PreparedStatement |
_psDeleteTags |
protected java.sql.PreparedStatement |
_psDeleteWorkflowsForNoExecutions |
protected java.sql.PreparedStatement |
_psErrorInsert |
protected java.sql.PreparedStatement |
_psGetAssociatedDataDataIdsToDeleteQuery |
protected java.sql.PreparedStatement |
_psGetAssociatedDataDataIdsToNotDeleteQuery |
protected java.sql.PreparedStatement |
_psGetPortEventDataIdsToDeleteQuery |
protected java.sql.PreparedStatement |
_psGetPortEventDataIdsToNotDeleteQuery |
protected java.sql.PreparedStatement |
_psGetTagForExecIdAndURN |
protected java.sql.PreparedStatement |
_psGetWfContentsIdsToDeleteQuery |
protected java.sql.PreparedStatement |
_psGetWfContentsIdsToNotDeleteQuery |
protected java.sql.PreparedStatement |
_psParameterExecInsert |
protected java.sql.PreparedStatement |
_psPortEventInsert |
protected java.sql.PreparedStatement |
_psPortEventInsertWithChecksum |
protected java.sql.PreparedStatement |
_psTagInsert |
protected java.sql.PreparedStatement |
_psWorkflowIdsForNoExecutions |
protected Queryable |
_queryable
Queryable connection.
|
protected int |
_wfLastExecId
The most recently completed workflow execution id.
|
protected KeplerLSID |
_wfLSID
The current workflow id.
|
static int |
MAX_PORT_EVENT_DATA_LENGTH
The maximum length of the data stored in the port_event table.
|
_evolId, _psParameterValueQuery, _psWorkflowChangeInsert, _workflowChangeTimeStack_dbParams, _dbType, _entityCacheTable, _fireStateTable, _maxDataSize, _maxParameterValueSize, _needReconnectDB, _needReconnectWF, _params, _psActionInsert, _psActorFireStart, _psActorFireStop, _psActorInsert, _psDirectorInsert, _psEntityInsert, _psEntityQuery, _psLinkInsert, _psParameterInsert, _psPortInsert, _psRelationInsert, _psTokenFlowInsert, _psWorkflowExecStart, _psWorkflowExecStop, _psWorkflowInsert, _psWorkflowQuery, _schema, _wfExecId, _wfId, _wfNameStr, _wfUserStr, DATA_NONE, DATA_TRUNCATED, DATA_VALID, SUCCESS, WORKFLOW_ALREADY_EXISTS, WORKFLOW_DOES_NOT_EXIST_containerFullName, _containerLSID, _containerName, _debugPrint, _debugWriter, _machineStr, _recorder, _recorderContainer, _stateSerializer| Constructor and Description |
|---|
SQLRecordingV8() |
| Modifier and Type | Method and Description |
|---|---|
protected org.kepler.provenance.sql.RegEntity |
_addEntity(int containerId,
RegEntity.EntityType type,
java.lang.String fullName,
java.lang.String displayName,
int prevId)
Add a new row to the entity table.
|
protected void |
_addWorkflow()
Add a new row to the workflow table.
|
protected void |
_addWorkflowChange()
Create a new row in the workflow_change table.
|
protected java.lang.String |
_changeEntityFullName(java.lang.String name)
Modify a NamedObj's full name.
|
protected void |
_changeWorkflowNameColumn(java.lang.String newName)
Change the workflow.name column for the current workflow.
|
protected void |
_changeWorkflowNameColumn(java.lang.String newName,
KeplerLSID lsid)
Change the workflow.name column for a specific LSID.
|
protected java.lang.String |
_checkData(byte[] data)
Adds data to the data table if not already there.
|
protected java.lang.String |
_checkData(java.io.File file)
Adds data to the data table if not already there.
|
protected java.lang.String |
_checkForFileData(Token token)
See if a token contains a valid filename.
|
protected void |
_checkWorkflowName()
Check validity of workflow name parameter.
|
protected void |
_createPreparedStatements()
Initialize the prepared statements.
|
protected Schema |
_createSchema()
Create a Schema to reflect the v8 schema.
|
protected void |
_dbReset()
Reset when we use a different db connection.
|
protected int |
_getContainerId(Nameable namedObj)
Find the container id of an entity.
|
protected int |
_getMaxTokenDataSize()
Get the maximum size of token data that can be stored in the
database.
|
protected int |
_getWorkflowId()
Get the internal workflow id.
|
protected void |
_nullPreparedStatements()
Set our prepared statements to null.
|
protected void |
_reconnectDatabase(boolean resetDB)
Reconnect to the database.
|
protected void |
_reconnectWorkflow()
Re-acquire the current workflow id.
|
protected void |
_recordActorFireStop(int fireId,
Actor actor,
java.util.Date timestamp)
Record the end of an actor fire and attempt to serialize the actor's
state.
|
protected void |
_recordFiringEvent(Actor actor,
FiringEvent.FiringEventType type,
java.util.Date timestamp)
Record a specific type of firing for an actor.
|
protected void |
_recordPortEvent(IOPort port,
int fireId,
int rwfireId,
boolean isRead,
int channel,
Token token,
IOPort destPort,
java.util.Date timestamp)
Record a specific type of firing for an actor.
|
protected void |
_regPortReal(TypedIOPort port,
org.kepler.provenance.sql.RegEntity re)
Add a port to the port table.
|
protected void |
_updateParameterExecTable()
Add all the parameter ids to the parameter_exec table.
|
protected void |
_wfReset()
Reset when we use a different workflow.
|
void |
addFileForExecution(java.util.Map<java.lang.String,java.lang.String> metadataMap,
java.io.File file,
int execId)
Associate the contents of a file with the most recent workflow execution.
|
void |
addFileForLastExecution(java.util.Map<java.lang.String,java.lang.String> metadataMap,
java.io.File file)
Associate the contents of a file with the most recent workflow execution.
|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
boolean |
changeExecutionLSID(int execId,
KeplerLSID newExecLSID,
Queryable q)
Change execution LSID for an execution Id.
|
boolean |
changeExecutionType(KeplerLSID executionLSID,
WorkflowRun.type type)
Change the execution type.
|
boolean |
checkIfTagAlreadyInserted(int execId,
java.lang.String urn) |
void |
customProvEvent(ProvenanceEvent event)
Record a custom provenance event.
|
int |
deleteExecutions(java.util.List<KeplerLSID> lsidList)
Delete executions given a list of execution LSIDs.
|
int |
deleteWorkflowsWithNoExecutions()
Delete workflows from the database that have no executions.
|
void |
executionError(Nameable source,
java.lang.Throwable throwable,
KeplerLSID executionLSID)
An actor threw an exception.
|
void |
executionStart(KeplerLSID executionLSID,
java.util.Date timestamp)
Record the starting of workflow execution.
|
void |
executionStop(KeplerLSID executionLSID,
java.util.Date timestamp)
Record the stopping of workflow execution.
|
RecordingParameters |
generateParameters(NamedObj no)
Add Parameters for ProvenanceRecorder.
|
Queryable |
getQueryable(boolean allowReconnectWF)
Get a Queryable connected to the Recording output.
|
void |
insertAnyHuskRunReferralList(WorkflowRun run) |
boolean |
insertHuskRun(KARFile karFile,
WorkflowRun run)
If run's exec LSID does not already exist in provenance, insert WorkflowRun
into provenance.
|
boolean |
insertPreviewRun(WorkflowRun run)
If run's exec LSID does not already exist in provenance, insert WorkflowRun
into provenance.
|
void |
insertTag(java.lang.String type,
java.lang.String tagStr,
java.lang.String urnStr,
int execId)
Insert a new row into the tag table.
|
void |
insertWorkflowTags(int execId)
Parse workflow moml for tags, and insert them, associated with execID
|
void |
refillPortEvent(IOPortRefillEvent event)
Record a port refill event.
|
boolean |
regContents()
Returns true if workflow contents should be registered.
|
boolean |
regLink(NamedObj endPoint1,
NamedObj endPoint2)
Register a link between two endpoints.
|
boolean |
regParameter(NamedObj parameter)
Register a parameter.
|
boolean |
regPort(TypedIOPort port)
Register a port or portparameter.
|
boolean |
regRelation(IORelation relation)
Register a relation.
|
void |
renamedWorkflow(NamedObj namedObj,
KeplerLSID oldLSID,
KeplerLSID newLSID,
java.lang.String oldName,
java.lang.String newName)
A workflow was renamed.
|
void |
tagAdded(TagEvent event)
A tag was added, insert it
|
void |
tagRemoved(TagEvent event)
A tag was removed.
|
_errorReset, _possibleWorkflowChangeStart, _possibleWorkflowChangeStop, evolutionStart, evolutionStop, specificationStart, specificationStop_checkConnection, _checkEntity, _checkParameters, _getMaxParameterValueSize, _getWorkflowId, _regActorDirector, _regParameterReal, _updateWorkflowID, actorFire, disconnect, executionImported, executionStart, executionStop, portEvent, regActor, regDirector_debug, _debug, _debugWrite, _debugWrite, _error, _getExceptionMessage, _getNameableFullName, _needWorkflowContents, _updateContainerName, _warn, actorFire, executionError, executionImported, executionStart, executionStart, executionStop, executionStop, getContainer, portEvent, remove, removeLink, removeStateSerializer, rename, setContainer, setContainerLSID, setContainerName, setDebugWriter, setStateSerializerprotected PortConnector<SQLRecordingV8.TokenInfo> _portConnector
protected java.sql.PreparedStatement _psDataInsert
protected java.sql.PreparedStatement _psDataMD5Query
protected java.sql.PreparedStatement _psPortEventInsert
protected java.sql.PreparedStatement _psPortEventInsertWithChecksum
protected java.sql.PreparedStatement _psChangeWorkflowName
protected java.sql.PreparedStatement _psChangeExecutionLSID
protected java.sql.PreparedStatement _psChangeExecutionReferralList
protected java.sql.PreparedStatement _psChangeExecutionType
protected java.sql.PreparedStatement _psAssocDataInsert
protected java.sql.PreparedStatement _psAssocDataInsertNoDataId
protected java.sql.PreparedStatement _psErrorInsert
protected java.sql.PreparedStatement _psDeleteExecutions
protected java.sql.PreparedStatement _psDeleteData
protected java.sql.PreparedStatement _psGetWfContentsIdsToDeleteQuery
protected java.sql.PreparedStatement _psGetWfContentsIdsToNotDeleteQuery
protected java.sql.PreparedStatement _psGetAssociatedDataDataIdsToDeleteQuery
protected java.sql.PreparedStatement _psGetAssociatedDataDataIdsToNotDeleteQuery
protected java.sql.PreparedStatement _psGetPortEventDataIdsToDeleteQuery
protected java.sql.PreparedStatement _psGetPortEventDataIdsToNotDeleteQuery
protected java.sql.PreparedStatement _psGetTagForExecIdAndURN
protected java.sql.PreparedStatement _psTagInsert
protected java.sql.PreparedStatement _psDeleteTagForExecIdAndURN
protected java.sql.PreparedStatement _psDeleteTags
protected java.sql.PreparedStatement _psParameterExecInsert
protected java.sql.PreparedStatement _psDeleteWorkflowsForNoExecutions
protected java.sql.PreparedStatement _psWorkflowIdsForNoExecutions
protected Queryable _queryable
protected int _wfLastExecId
protected java.lang.String _execAnnotation
protected java.lang.String _nextExecLSIDStr
protected KeplerLSID _wfLSID
protected boolean _executionHadAnError
protected java.util.Map<KeplerLSID,java.lang.Integer> _executionLSIDtoIdMap
public static final int MAX_PORT_EVENT_DATA_LENGTH
public SQLRecordingV8() throws RecordingException
RecordingExceptionpublic void addFileForLastExecution(java.util.Map<java.lang.String,java.lang.String> metadataMap, java.io.File file) throws RecordingException
addFileForLastExecution in class RecordingRecordingExceptionpublic void addFileForExecution(java.util.Map<java.lang.String,java.lang.String> metadataMap, java.io.File file, int execId) throws RecordingException
RecordingExceptionpublic void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class SQLRecordingIllegalActionExceptionpublic RecordingParameters generateParameters(NamedObj no) throws IllegalActionException, NameDuplicationException
generateParameters in class SQLRecordingIllegalActionExceptionNameDuplicationExceptionpublic boolean regPort(TypedIOPort port) throws RecordingException
regPort in class SQLRecordingRecordingExceptionpublic void executionStart(KeplerLSID executionLSID, java.util.Date timestamp) throws RecordingException
executionStart in class RecordingRecordingExceptionpublic void executionError(Nameable source, java.lang.Throwable throwable, KeplerLSID executionLSID) throws RecordingException
executionError in class RecordingRecordingExceptionpublic void executionStop(KeplerLSID executionLSID, java.util.Date timestamp) throws RecordingException
executionStop in class RecordingRecordingExceptionpublic boolean regContents() throws RecordingException
regContents in class RecordingRecordingExceptionpublic boolean regLink(NamedObj endPoint1, NamedObj endPoint2) throws RecordingException
regLink in class SQLRecordingendPoint1 - first endpoint.endPoint2 - second endpoint.RecordingExceptionpublic boolean regParameter(NamedObj parameter) throws RecordingException
regNNN() method. This can be user-level
parameters (e.g., Parameter, StringParameter, etc.) or
internal to Kepler (e.g., _location, semanticType000, etc.).
(A "parameter" corresponds to a property in the MoML).regParameter in class SQLRecordingV7RecordingExceptionpublic boolean regRelation(IORelation relation) throws RecordingException
regRelation in class SQLRecordingRecordingExceptionpublic void refillPortEvent(IOPortRefillEvent event) throws RecordingException
refillPortEvent in class RecordingRecordingExceptionpublic Queryable getQueryable(boolean allowReconnectWF) throws QueryException, RecordingException
getQueryable in class RecordingallowReconnectWF - - false if you want to force no _reconnectWFQueryException - may be thrown if Queryable not implemented
for the Recording type.RecordingExceptionpublic void renamedWorkflow(NamedObj namedObj, KeplerLSID oldLSID, KeplerLSID newLSID, java.lang.String oldName, java.lang.String newName) throws RecordingException
renamedWorkflow in class RecordingnamedObj - the workflowoldLSID - the previous LSIDnewLSID - the new LSIDoldName - the previous namenewName - the new nameRecordingExceptionWorkflowRenameListenerpublic int deleteExecutions(java.util.List<KeplerLSID> lsidList) throws RecordingException
lsidList - RecordingExceptionpublic int deleteWorkflowsWithNoExecutions() throws RecordingException
RecordingExceptionpublic void tagAdded(TagEvent event) throws RecordingException
tagAdded in class RecordingRecordingExceptionpublic void insertWorkflowTags(int execId)
runLsid - public void insertTag(java.lang.String type, java.lang.String tagStr, java.lang.String urnStr, int execId) throws RecordingException
RecordingExceptionpublic boolean checkIfTagAlreadyInserted(int execId, java.lang.String urn)
public void customProvEvent(ProvenanceEvent event) throws RecordingException
customProvEvent in class RecordingRecordingExceptionpublic void tagRemoved(TagEvent event) throws RecordingException
tagRemoved in class RecordingRecordingExceptionpublic boolean insertPreviewRun(WorkflowRun run) throws RecordingException
karFile - run - RecordingExceptionpublic boolean insertHuskRun(KARFile karFile, WorkflowRun run) throws RecordingException
karFile - run - RecordingExceptionpublic void insertAnyHuskRunReferralList(WorkflowRun run)
protected org.kepler.provenance.sql.RegEntity _addEntity(int containerId, RegEntity.EntityType type, java.lang.String fullName, java.lang.String displayName, int prevId) throws RecordingException, java.sql.SQLException
_addEntity in class SQLRecordingV7RecordingExceptionjava.sql.SQLExceptionprotected void _addWorkflow() throws RecordingException
_addWorkflow in class SQLRecordingV7RecordingExceptionprotected void _addWorkflowChange() throws RecordingException
_addWorkflowChange in class SQLRecordingV7RecordingExceptionprotected java.lang.String _changeEntityFullName(java.lang.String name)
_changeEntityFullName in class SQLRecordingprotected void _checkWorkflowName() throws RecordingException
_checkWorkflowName in class SQLRecordingRecordingExceptionprotected void _createPreparedStatements() throws java.sql.SQLException
_createPreparedStatements in class SQLRecordingV7java.sql.SQLExceptionprotected Schema _createSchema()
_createSchema in class SQLRecordingV7protected int _getMaxTokenDataSize() throws java.sql.SQLException
_getMaxTokenDataSize in class SQLRecordingjava.sql.SQLExceptionprotected int _getWorkflowId() throws RecordingException
_getWorkflowId in class SQLRecordingRecordingExceptionprotected int _getContainerId(Nameable namedObj) throws RecordingException
_getContainerId in class SQLRecordingRecordingExceptionprotected void _nullPreparedStatements()
_nullPreparedStatements in class SQLRecordingV7protected void _reconnectDatabase(boolean resetDB) throws RecordingException
_reconnectDatabase in class SQLRecordingRecordingExceptionprotected void _reconnectWorkflow() throws RecordingException
_reconnectWorkflow in class SQLRecordingRecordingExceptionprotected void _changeWorkflowNameColumn(java.lang.String newName) throws RecordingException
RecordingExceptionprotected void _changeWorkflowNameColumn(java.lang.String newName, KeplerLSID lsid) throws RecordingException
RecordingExceptionpublic boolean changeExecutionLSID(int execId, KeplerLSID newExecLSID, Queryable q) throws RecordingException
changeExecutionLSID in class RecordingexecId - newExecLSID - RecordingExceptionpublic boolean changeExecutionType(KeplerLSID executionLSID, WorkflowRun.type type) throws RecordingException
executionLSID - type - RecordingExceptionprotected void _regPortReal(TypedIOPort port, org.kepler.provenance.sql.RegEntity re) throws RecordingException
_regPortReal in class SQLRecordingRecordingExceptionprotected void _recordFiringEvent(Actor actor, FiringEvent.FiringEventType type, java.util.Date timestamp) throws RecordingException
_recordFiringEvent in class SQLRecordingRecordingExceptionprotected void _recordActorFireStop(int fireId, Actor actor, java.util.Date timestamp) throws java.sql.SQLException
java.sql.SQLExceptionprotected void _recordPortEvent(IOPort port, int fireId, int rwfireId, boolean isRead, int channel, Token token, IOPort destPort, java.util.Date timestamp) throws RecordingException
_recordPortEvent in class SQLRecordingRecordingExceptionprotected java.lang.String _checkData(byte[] data) throws RecordingException
RecordingExceptionprotected java.lang.String _checkData(java.io.File file) throws RecordingException
RecordingExceptionprotected java.lang.String _checkForFileData(Token token) throws RecordingException
RecordingExceptionprotected void _dbReset() throws RecordingException
_dbReset in class SQLRecordingRecordingExceptionprotected void _wfReset()
_wfReset in class SQLRecordingV7protected void _updateParameterExecTable() throws RecordingException
RecordingException