Interface PermanentBlobService

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
JobPermanentBlobService
All Known Implementing Classes:
BlobServer, PermanentBlobCache

public interface PermanentBlobService extends Closeable
A service to retrieve permanent binary large objects (BLOBs).

These may include per-job BLOBs that are covered by high-availability (HA) mode, e.g. a job's JAR files or (parts of) an off-loaded TaskDeploymentDescriptor or files in the DistributedCache.

  • Method Summary

    Modifier and Type
    Method
    Description
    getFile(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key)
    Returns the path to a local copy of the file associated with the provided job ID and blob key.
    default byte[]
    readFile(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key)
    Returns the content of the file for the BLOB with the provided job ID the blob key.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getFile

      File getFile(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key) throws IOException
      Returns the path to a local copy of the file associated with the provided job ID and blob key.
      Parameters:
      jobId - ID of the job this blob belongs to
      key - BLOB key associated with the requested file
      Returns:
      The path to the file.
      Throws:
      FileNotFoundException - if the BLOB does not exist;
      IOException - if any other error occurs when retrieving the file
    • readFile

      default byte[] readFile(org.apache.flink.api.common.JobID jobId, PermanentBlobKey key) throws IOException
      Returns the content of the file for the BLOB with the provided job ID the blob key.

      Compared to getFile, readFile will attempt to read the entire file after retrieving it. If file reading and file retrieving is done in the same WRITE lock, it can avoid the scenario that the path to the file is deleted concurrently by other threads when the file is retrieved but not read yet.

      Parameters:
      jobId - ID of the job this blob belongs to
      key - BLOB key associated with the requested file
      Returns:
      The content of the BLOB.
      Throws:
      FileNotFoundException - if the BLOB does not exist;
      IOException - if any other error occurs when retrieving the file.