Class OrientDBPersistenceConnector
java.lang.Object
org.gcube.vremanagement.executor.plugin.PluginStateNotification
org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector
org.gcube.vremanagement.executor.persistence.orientdb.OrientDBPersistenceConnector
- All Implemented Interfaces:
ScheduledTaskPersistence
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected com.orientechnologies.orient.core.db.ODatabasePoolprotected static final Stringprotected static final Stringprotected final Stringprotected static final Stringprotected static final StringFields inherited from class org.gcube.vremanagement.executor.plugin.PluginStateNotification
inputs -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScheduledTask(ScheduledTask scheduledTask) Create a Scheduled Task on persistencevoidclose()Close the connection to DBcountFinalStates(Long since) Counts the executions of the current Context that reached a final state, by that state: each execution of aPluginrecords its final state once.org.gcube.vremanagement.executor.plugin.PluginStateEvolutiongetPluginInstanceState(UUID uuid, Integer iterationNumber) Retrieve the status of the iterationNumber (passed as parameter) of a running/runPluginwhich is/was identified by the UUID passed as parametergetScheduledTask(UUID uuid) Return the Scheduled Task if any, null otherwiseprotected com.orientechnologies.orient.core.record.impl.ODocumentgetScheduledTaskDocument(UUID uuid) getScheduledTasks(Collection<String> plugins) Retrieve from the #SmartExecutorPersistenceConnector the orphaned Scheduled tasksvoidpluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution, Exception exception) protected voidprepareConnection(SmartExecutorPersistenceConfiguration configuration) voidreleaseScheduledTask(UUID uuid) Release the Scheduled Task leaving it as orphan on persistencevoidreleaseScheduledTask(ScheduledTask scheduledTask) Release the Scheduled Task leaving it as orphan on persistencevoidremoveScheduledTask(UUID uuid) Remove from persistence the Scheduled Task.voidremoveScheduledTask(ScheduledTask scheduledTask) Remove from persistence the Scheduled Task.voidreserveScheduledTask(ScheduledTask scheduledTask) Reserve an orphan Scheduled tasksstatic voidshutdown()
-
Field Details
-
CONTEXT
- See Also:
-
UUID
- See Also:
-
ITERATION
- See Also:
-
TIMESTAMP
- See Also:
-
PLUGIN_STATE
- See Also:
-
COUNT
- See Also:
-
PLUGIN_NAMES
- See Also:
-
RUN_ON
- See Also:
-
oDatabasePool
protected com.orientechnologies.orient.core.db.ODatabasePool oDatabasePool
-
-
Constructor Details
-
OrientDBPersistenceConnector
public OrientDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) throws Exception - Throws:
Exception
-
-
Method Details
-
prepareConnection
protected void prepareConnection(SmartExecutorPersistenceConfiguration configuration) throws Exception - Throws:
Exception
-
close
Description copied from class:SmartExecutorPersistenceConnectorClose the connection to DB- Specified by:
closein classSmartExecutorPersistenceConnector- Throws:
Exception- if fails
-
getPluginInstanceState
public org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginInstanceState(UUID uuid, Integer iterationNumber) throws org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException, org.gcube.vremanagement.executor.exception.ExecutorException Description copied from class:SmartExecutorPersistenceConnectorRetrieve the status of the iterationNumber (passed as parameter) of a running/runPluginwhich is/was identified by the UUID passed as parameter- Specified by:
getPluginInstanceStatein classSmartExecutorPersistenceConnector- Parameters:
uuid- the execution identifier of the running/runPluginiterationNumber- the iterationNumber (null to get the last)- Returns:
- the actual/last
PluginStateof the Plugin - Throws:
org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException- if the plugin instance is not foundorg.gcube.vremanagement.executor.exception.ExecutorException- if the operation fails
-
pluginStateEvolution
public void pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution, Exception exception) throws Exception - Specified by:
pluginStateEvolutionin classorg.gcube.vremanagement.executor.plugin.PluginStateNotification- Throws:
Exception
-
countFinalStates
public Map<org.gcube.vremanagement.executor.plugin.PluginState,Long> countFinalStates(Long since) throws org.gcube.vremanagement.executor.exception.ExecutorException Description copied from class:SmartExecutorPersistenceConnectorCounts the executions of the current Context that reached a final state, by that state: each execution of aPluginrecords its final state once.- Specified by:
countFinalStatesin classSmartExecutorPersistenceConnector- Parameters:
since- only the executions that reached their final state at this time or later, in milliseconds since the epoch;nullcounts all the executions in the database- Returns:
- the number of executions by final state, with every final state present
- Throws:
org.gcube.vremanagement.executor.exception.ExecutorException- if the operation fails
-
addScheduledTask
Description copied from interface:ScheduledTaskPersistenceCreate a Scheduled Task on persistence- Parameters:
scheduledTask- to create on persistence- Throws:
SchedulePersistenceException- if fails
-
getScheduledTasks
public List<ScheduledTask> getScheduledTasks(Collection<String> plugins) throws SchedulePersistenceException Description copied from interface:ScheduledTaskPersistenceRetrieve from the #SmartExecutorPersistenceConnector the orphaned Scheduled tasks- Returns:
- the list of orphaned Scheduled
- Throws:
SchedulePersistenceException- if fails
-
getScheduledTaskDocument
protected com.orientechnologies.orient.core.record.impl.ODocument getScheduledTaskDocument(UUID uuid) throws SchedulePersistenceException - Throws:
SchedulePersistenceException
-
getScheduledTask
Description copied from interface:ScheduledTaskPersistenceReturn the Scheduled Task if any, null otherwise- Parameters:
uuid- which identify the Scheduled Task- Returns:
- LaunchParameter of the Scheduled task if any, null otherwise
- Throws:
SchedulePersistenceException- if fails
-
reserveScheduledTask
Description copied from interface:ScheduledTaskPersistenceReserve an orphan Scheduled tasks- Throws:
SchedulePersistenceException- if fails
-
removeScheduledTask
Description copied from interface:ScheduledTaskPersistenceRemove from persistence the Scheduled Task.- Parameters:
uuid- the uuid which (will) identify the task on the SmartExecutor instance- Throws:
SchedulePersistenceException
-
removeScheduledTask
Description copied from interface:ScheduledTaskPersistenceRemove from persistence the Scheduled Task.- Throws:
SchedulePersistenceException
-
releaseScheduledTask
Description copied from interface:ScheduledTaskPersistenceRelease the Scheduled Task leaving it as orphan on persistence- Parameters:
uuid- the uuid which (will) identify the task on the SmartExecutor instance- Throws:
SchedulePersistenceException
-
releaseScheduledTask
Description copied from interface:ScheduledTaskPersistenceRelease the Scheduled Task leaving it as orphan on persistence- Throws:
SchedulePersistenceException
-
shutdown
public static void shutdown()
-