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, Configuration clientConfig)
Instantiates a new BLOB client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isClosed()
boolean
isConnected()
PermanentBlobKey
uploadFile(JobID jobId, Path file)
Uploads a single file to thePermanentBlobService
of the givenBlobServer
.static List<PermanentBlobKey>
uploadFiles(InetSocketAddress serverAddress, Configuration clientConfig, JobID jobId, List<Path> files)
Uploads the JAR files to thePermanentBlobService
of theBlobServer
at the given address with HA as configured.
-
-
-
Constructor Detail
-
BlobClient
public BlobClient(InetSocketAddress serverAddress, 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
isClosed
public boolean isClosed()
-
isConnected
public boolean isConnected()
-
uploadFiles
public static List<PermanentBlobKey> uploadFiles(InetSocketAddress serverAddress, Configuration clientConfig, JobID jobId, List<Path> files) throws IOException
Uploads the JAR files to thePermanentBlobService
of theBlobServer
at the given address with HA as configured.- Parameters:
serverAddress
- Server address of theBlobServer
clientConfig
- 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(JobID jobId, Path file) throws IOException
Uploads a single file to thePermanentBlobService
of 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
-
-