Class BlobClient

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class BlobClient
    extends Object
    implements Closeable
    The BLOB client can communicate with the BLOB server and either upload (PUT), download (GET), or delete (DELETE) BLOBs.
    • Constructor Detail

      • BlobClient

        public BlobClient​(InetSocketAddress serverAddress,
                          org.apache.flink.configuration.Configuration clientConfig)
                   throws IOException
        Instantiates a new BLOB client.
        Parameters:
        serverAddress - the network address of the BLOB server
        clientConfig - additional configuration like SSL parameters required to connect to the blob server
        Throws:
        IOException - thrown if the connection to the BLOB server could not be established
    • Method Detail

      • isClosed

        public boolean isClosed()
      • isConnected

        public boolean isConnected()
      • uploadFiles

        public static List<PermanentBlobKey> uploadFiles​(InetSocketAddress serverAddress,
                                                         org.apache.flink.configuration.Configuration clientConfig,
                                                         org.apache.flink.api.common.JobID jobId,
                                                         List<org.apache.flink.core.fs.Path> files)
                                                  throws IOException
        Uploads the JAR files to the PermanentBlobService of the BlobServer at the given address with HA as configured.
        Parameters:
        serverAddress - Server address of the BlobServer
        clientConfig - Any additional configuration for the blob client
        jobId - ID of the job this blob belongs to (or null if job-unrelated)
        files - List of files to upload
        Throws:
        IOException - if the upload fails
      • uploadFile

        public PermanentBlobKey uploadFile​(org.apache.flink.api.common.JobID jobId,
                                           org.apache.flink.core.fs.Path file)
                                    throws IOException
        Uploads a single file to the PermanentBlobService of the given BlobServer.
        Parameters:
        jobId - ID of the job this blob belongs to (or null if job-unrelated)
        file - file to upload
        Throws:
        IOException - if the upload fails