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 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

      List<String> getPersistedJobUuids() throws JobPersistenceException
      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

      int[] getTaskPositions(String jobUuid) throws JobPersistenceException
      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

      int[] getTaskResultPositions(String jobUuid) throws JobPersistenceException
      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

      void deleteJob(String jobUuid) throws JobPersistenceException
      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

      boolean isJobPersisted(String jobUuid) throws JobPersistenceException
      Determine whether a job is persisted, that is, present in the persistence store.
      Parameters:
      jobUuid - the UUID of the job to check.
      Returns:
      true if the job is in the persistence store, false otherwise.
      Throws:
      JobPersistenceException - if any error occurs while accessing the persistence store.