Package org.apache.flink.runtime.blob
Class BlobClient
- java.lang.Object
-
- org.apache.flink.runtime.blob.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 Summary
Constructors Constructor Description BlobClient(InetSocketAddress serverAddress, org.apache.flink.configuration.Configuration clientConfig)Instantiates a new BLOB client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisClosed()booleanisConnected()PermanentBlobKeyuploadFile(org.apache.flink.api.common.JobID jobId, org.apache.flink.core.fs.Path file)Uploads a single file to thePermanentBlobServiceof the givenBlobServer.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)Uploads the JAR files to thePermanentBlobServiceof theBlobServerat the given address with HA as configured.
-
-
-
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 serverclientConfig- 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
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
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 thePermanentBlobServiceof theBlobServerat the given address with HA as configured.- Parameters:
serverAddress- Server address of theBlobServerclientConfig- Any additional configuration for the blob clientjobId- 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 thePermanentBlobServiceof the givenBlobServer.- 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
-
-