Package org.apache.flink.runtime.blob
Class BlobClient
java.lang.Object
org.apache.flink.runtime.blob.BlobClient
- All Implemented Interfaces:
Closeable,AutoCloseable
The BLOB client can communicate with the BLOB server and either upload (PUT), download (GET), or
delete (DELETE) BLOBs.
-
Constructor Summary
ConstructorsConstructorDescriptionBlobClient(InetSocketAddress serverAddress, org.apache.flink.configuration.Configuration clientConfig) Instantiates a new BLOB client. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisClosed()booleanuploadFile(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 Details
-
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 Details
-
close
- 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
-