Package org.apache.flink.runtime.blob
Class BlobCacheService
- java.lang.Object
-
- org.apache.flink.runtime.blob.BlobCacheService
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BlobService
,TaskExecutorBlobService
public class BlobCacheService extends Object implements TaskExecutorBlobService
The BLOB cache provides access to BLOB services for permanent and transient BLOBs.
-
-
Constructor Summary
Constructors Constructor Description BlobCacheService(org.apache.flink.configuration.Configuration blobClientConfig, File storageDir, BlobView blobView, InetSocketAddress serverAddress)
BlobCacheService(org.apache.flink.configuration.Configuration blobClientConfig, org.apache.flink.util.Reference<File> storageDir, BlobView blobView, InetSocketAddress serverAddress)
Instantiates a new BLOB cache.BlobCacheService(PermanentBlobCache permanentBlobCache, TransientBlobCache transientBlobCache)
Instantiates a new BLOB cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
PermanentBlobCache
getPermanentBlobService()
Returns a BLOB service for accessing permanent BLOBs.int
getPort()
Returns the port of the BLOB server that this BLOB service is working with.TransientBlobCache
getTransientBlobService()
Returns a BLOB service for accessing transient BLOBs.void
setBlobServerAddress(InetSocketAddress blobServerAddress)
Sets the address of theBlobServer
.
-
-
-
Constructor Detail
-
BlobCacheService
public BlobCacheService(org.apache.flink.configuration.Configuration blobClientConfig, File storageDir, BlobView blobView, @Nullable InetSocketAddress serverAddress) throws IOException
- Throws:
IOException
-
BlobCacheService
public BlobCacheService(org.apache.flink.configuration.Configuration blobClientConfig, org.apache.flink.util.Reference<File> storageDir, BlobView blobView, @Nullable InetSocketAddress serverAddress) throws IOException
Instantiates a new BLOB cache.- Parameters:
blobClientConfig
- global configurationstorageDir
- storage directory for the cached blobsblobView
- (distributed) blob store file system to retrieve files from firstserverAddress
- address of theBlobServer
to use for fetching files from ornull
if none yet- Throws:
IOException
- thrown if the (local or distributed) file storage cannot be created or is not usable
-
BlobCacheService
public BlobCacheService(PermanentBlobCache permanentBlobCache, TransientBlobCache transientBlobCache)
Instantiates a new BLOB cache.- Parameters:
permanentBlobCache
- BLOB cache to use for permanent BLOBstransientBlobCache
- BLOB cache to use for transient BLOBs
-
-
Method Detail
-
getPermanentBlobService
public PermanentBlobCache getPermanentBlobService()
Description copied from interface:BlobService
Returns a BLOB service for accessing permanent BLOBs.- Specified by:
getPermanentBlobService
in interfaceBlobService
- Specified by:
getPermanentBlobService
in interfaceTaskExecutorBlobService
- Returns:
- BLOB service
-
getTransientBlobService
public TransientBlobCache getTransientBlobService()
Description copied from interface:BlobService
Returns a BLOB service for accessing transient BLOBs.- Specified by:
getTransientBlobService
in interfaceBlobService
- Returns:
- BLOB service
-
setBlobServerAddress
public void setBlobServerAddress(InetSocketAddress blobServerAddress)
Sets the address of theBlobServer
.- Specified by:
setBlobServerAddress
in interfaceTaskExecutorBlobService
- Parameters:
blobServerAddress
- address of theBlobServer
.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getPort
public int getPort()
Description copied from interface:BlobService
Returns the port of the BLOB server that this BLOB service is working with.- Specified by:
getPort
in interfaceBlobService
- Returns:
- the port of the blob server.
-
-