Package org.jppf.job.persistence
Interface JobPersistence
- All Known Implementing Classes:
AsynchronousPersistence,CacheablePersistence,DefaultDatabasePersistence,DefaultFilePersistence
public interface JobPersistence
This interface must be implemented by services that perform jobs persistence in the driver.
The configuration of an implementation is performed in the JPPF configuration as follows:
jppf.job.persistence = <persistence_implementation_class_name> [param1 ... paramN]
The implementation class must declare either a no-arg constructor or a constructor that takes a String[] or String... parameter, or both.
The space-separated optional parameters allow setting up the persistence implementation from the JPPF configuration.
They could be used for instance to specify the root directory for a file-based implementation, or JDBC connection parameters, but are not limited to these.
An implementation that only declares a no-args constructor may still receive parameters if it declares a void setParameters(String...params) method.
- Since:
- 6.0
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionvoidDelete the persisted job with the psecified UUID.Get the UUIDs of all persisted job.int[]getTaskPositions(String jobUuid) Get the positions of all the tasks in the specified job.int[]getTaskResultPositions(String jobUuid) Get the positions of all the task results in the specified job.booleanisJobPersisted(String jobUuid) Determine whether a job is persisted, that is, present in the persistence store.load(Collection<PersistenceInfo> infos) Load the specified job elements.voidstore(Collection<PersistenceInfo> infos) Store the specified job elements.
-
Method Details
-
store
Store the specified job elements. All elements are assumed to be part of the same job.- Parameters:
infos- collection of information objects on the job elements to store.- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
load
Load the specified job elements. All elements are assumed to be part of the same job.- Parameters:
infos- information on the persisted job elements to load.- Returns:
- an input stream providing the serialized job header.
- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
getPersistedJobUuids
Get the UUIDs of all persisted job.- Returns:
- a list of strings reprensenting job UUIDs.
- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
getTaskPositions
Get the positions of all the tasks in the specified job.- Parameters:
jobUuid- the uuid of the job for which to find the task positions.- Returns:
- an array of int representing the positions.
- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
getTaskResultPositions
Get the positions of all the task results in the specified job.- Parameters:
jobUuid- the uuid of the job for which to find the task result positions.- Returns:
- an array of int representing the positions.
- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
deleteJob
Delete the persisted job with the psecified UUID.- Parameters:
jobUuid- the UUID of the job to load.- Throws:
JobPersistenceException- if any erorr occurs during the persistence operation.
-
isJobPersisted
Determine whether a job is persisted, that is, present in the persistence store.- Parameters:
jobUuid- the UUID of the job to check.- Returns:
trueif the job is in the persistence store,falseotherwise.- Throws:
JobPersistenceException- if any error occurs while accessing the persistence store.
-