Class SmartExecutorPersistenceConnector
java.lang.Object
org.gcube.vremanagement.executor.plugin.PluginStateNotification
org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector
- All Implemented Interfaces:
ScheduledTaskPersistence
- Direct Known Subclasses:
OrientDBPersistenceConnector
public abstract class SmartExecutorPersistenceConnector
extends org.gcube.vremanagement.executor.plugin.PluginStateNotification
implements ScheduledTaskPersistence
Model the connector which create or open the connection to DB.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields inherited from class org.gcube.vremanagement.executor.plugin.PluginStateNotification
inputs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()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.abstract 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 parameterbooleanisOrphan(ScheduledTask scheduledTask, boolean sameHost) Methods inherited from class org.gcube.vremanagement.executor.plugin.PluginStateNotification
pluginStateEvolutionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gcube.vremanagement.executor.scheduledtask.ScheduledTaskPersistence
addScheduledTask, getScheduledTask, getScheduledTasks, releaseScheduledTask, releaseScheduledTask, removeScheduledTask, removeScheduledTask, reserveScheduledTask
-
Constructor Details
-
SmartExecutorPersistenceConnector
public SmartExecutorPersistenceConnector()
-
-
Method Details
-
close
Close the connection to DB- Throws:
Exception- if fails
-
getPluginInstanceState
public abstract org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginInstanceState(UUID uuid, Integer iterationNumber) throws org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException, org.gcube.vremanagement.executor.exception.ExecutorException Retrieve the status of the iterationNumber (passed as parameter) of a running/runPluginwhich is/was identified by the UUID passed as parameter- 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
-
countFinalStates
public abstract Map<org.gcube.vremanagement.executor.plugin.PluginState,Long> countFinalStates(Long since) throws org.gcube.vremanagement.executor.exception.ExecutorException Counts the executions of the current Context that reached a final state, by that state: each execution of aPluginrecords its final state once.- 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
-
isOrphan
public boolean isOrphan(ScheduledTask scheduledTask, boolean sameHost) throws org.gcube.vremanagement.executor.exception.ExecutorException - Throws:
org.gcube.vremanagement.executor.exception.ExecutorException
-