public class OrientDBPersistenceConnector extends SmartExecutorPersistenceConnector
| Modifier and Type | Field and Description |
|---|---|
protected String |
ITERATION |
protected static int |
LAST |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected com.orientechnologies.orient.core.db.OPartitionedDatabasePool |
oPartitionedDatabasePool |
protected String |
RUN_ON |
protected String |
SCOPE |
protected String |
TIMESTAMP |
protected String |
UUID |
| Constructor and Description |
|---|
OrientDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addScheduledTask(ScheduledTask scheduledTask)
Create a Scheduled Task on persistence
|
void |
close()
Close the connection to DB
|
org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
getLastPluginInstanceState(UUID uuid)
Retrieve the status of the iterationNumber of the last running/run
Plugin which is/was identified
by the UUID passed as parameter |
List<ScheduledTask> |
getOrphanScheduledTasks(Collection<? extends org.gcube.vremanagement.executor.plugin.PluginDeclaration> pluginDeclarations)
Retrieve from the #SmartExecutorPersistenceConnector the orphaned
Scheduled tasks
|
org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
getPluginInstanceState(UUID uuid,
int iterationNumber)
Retrieve the status of the iterationNumber (passed as parameter) of a running/run
Plugin which is/was identified
by the UUID passed as parameter |
protected org.gcube.vremanagement.executor.plugin.PluginStateEvolution |
getPluginStateEvolution(UUID uuid,
int iterationNumber) |
ScheduledTask |
getScheduledTask(UUID uuid)
Return the Scheduled Task if any, null otherwise
|
protected com.orientechnologies.orient.core.record.impl.ODocument |
getScheduledTaskDocument(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx db,
UUID uuid) |
void |
pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution,
Exception exception) |
protected void |
prepareConnection(SmartExecutorPersistenceConfiguration configuration) |
protected void |
prepareObjectMapper() |
void |
releaseScheduledTask(ScheduledTask scheduledTask)
Release the Scheduled Task leaving it as orphan on persistence
|
void |
releaseScheduledTask(UUID uuid)
Release the Scheduled Task leaving it as orphan on persistence
|
void |
removeScheduledTask(ScheduledTask scheduledTask)
Remove from persistence the Scheduled Task.
|
void |
removeScheduledTask(UUID uuid)
Remove from persistence the Scheduled Task.
|
void |
reserveScheduledTask(ScheduledTask scheduledTask)
Reserve an orphan Scheduled tasks
|
isOrphanprotected static final int LAST
protected final String SCOPE
protected final String UUID
protected final String ITERATION
protected final String TIMESTAMP
protected final String RUN_ON
protected com.orientechnologies.orient.core.db.OPartitionedDatabasePool oPartitionedDatabasePool
protected com.fasterxml.jackson.databind.ObjectMapper mapper
public OrientDBPersistenceConnector(SmartExecutorPersistenceConfiguration configuration) throws Exception
Exceptionprotected void prepareConnection(SmartExecutorPersistenceConfiguration configuration) throws Exception
Exceptionprotected void prepareObjectMapper()
public void close()
throws Exception
SmartExecutorPersistenceConnectorclose in class SmartExecutorPersistenceConnectorException - if failsprotected org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginStateEvolution(UUID uuid, int iterationNumber) throws Exception
Exceptionpublic org.gcube.vremanagement.executor.plugin.PluginStateEvolution getPluginInstanceState(UUID uuid, int iterationNumber) throws Exception
SmartExecutorPersistenceConnectorPlugin which is/was identified
by the UUID passed as parametergetPluginInstanceState in class SmartExecutorPersistenceConnectoruuid - the execution identifier of the running/run PluginiterationNumber - thePluginState of the PluginException - if failspublic org.gcube.vremanagement.executor.plugin.PluginStateEvolution getLastPluginInstanceState(UUID uuid) throws Exception
SmartExecutorPersistenceConnectorPlugin which is/was identified
by the UUID passed as parametergetLastPluginInstanceState in class SmartExecutorPersistenceConnectoruuid - the execution identifier of the running/run PluginPluginState of the PluginException - if failspublic void pluginStateEvolution(org.gcube.vremanagement.executor.plugin.PluginStateEvolution pluginStateEvolution,
Exception exception)
throws Exception
pluginStateEvolution in class org.gcube.vremanagement.executor.plugin.PluginStateNotificationExceptionpublic void addScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
ScheduledTaskPersistencescheduledTask - to create on persistenceSchedulePersistenceException - if failspublic List<ScheduledTask> getOrphanScheduledTasks(Collection<? extends org.gcube.vremanagement.executor.plugin.PluginDeclaration> pluginDeclarations) throws SchedulePersistenceException
ScheduledTaskPersistenceSchedulePersistenceException - if failsprotected com.orientechnologies.orient.core.record.impl.ODocument getScheduledTaskDocument(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx db,
UUID uuid)
throws SchedulePersistenceException
SchedulePersistenceExceptionpublic ScheduledTask getScheduledTask(UUID uuid) throws SchedulePersistenceException
ScheduledTaskPersistenceuuid - which identify the Scheduled TaskSchedulePersistenceException - if failspublic void reserveScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
ScheduledTaskPersistenceSchedulePersistenceException - if failspublic void removeScheduledTask(UUID uuid) throws SchedulePersistenceException
ScheduledTaskPersistenceuuid - the uuid which (will) identify the task on the SmartExecutor
instanceSchedulePersistenceExceptionpublic void removeScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
ScheduledTaskPersistenceSchedulePersistenceExceptionpublic void releaseScheduledTask(UUID uuid) throws SchedulePersistenceException
ScheduledTaskPersistenceuuid - the uuid which (will) identify the task on the SmartExecutor
instanceSchedulePersistenceExceptionpublic void releaseScheduledTask(ScheduledTask scheduledTask) throws SchedulePersistenceException
ScheduledTaskPersistenceSchedulePersistenceExceptionCopyright © 2017. All Rights Reserved.