Package org.apache.flink.runtime.blob
Class BlobUtils
- java.lang.Object
-
- org.apache.flink.runtime.blob.BlobUtils
-
public class BlobUtils extends Object
Utility class to work with blob data.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
calculateMessageDigest(File file)
static BlobCacheService
createBlobCacheService(Configuration configuration, Reference<File> fallbackStorageDirectory, BlobView blobView, InetSocketAddress serverAddress)
Creates theBlobCacheService
from the given configuration, fallback storage directory, blob view and blob server address.static BlobServer
createBlobServer(Configuration configuration, Reference<File> fallbackStorageDirectory, BlobStore blobStore)
Creates theBlobServer
from the given configuration, fallback storage directory and blob store.static BlobStoreService
createBlobStoreFromConfig(Configuration config)
Creates a BlobStore based on the parameters set in the configuration.
-
-
-
Method Detail
-
createBlobStoreFromConfig
public static BlobStoreService createBlobStoreFromConfig(Configuration config) throws IOException
Creates a BlobStore based on the parameters set in the configuration.- Parameters:
config
- configuration to use- Returns:
- a (distributed) blob store for high availability
- Throws:
IOException
- thrown if the (distributed) file storage cannot be created
-
createBlobServer
public static BlobServer createBlobServer(Configuration configuration, Reference<File> fallbackStorageDirectory, BlobStore blobStore) throws IOException
Creates theBlobServer
from the given configuration, fallback storage directory and blob store.- Parameters:
configuration
- for the BlobServerfallbackStorageDirectory
- fallback storage directory that is used if no other directory has been explicitly configuredblobStore
- blob store to use for this blob server- Returns:
- new blob server instance
- Throws:
IOException
- if we could not create the blob storage directory
-
createBlobCacheService
public static BlobCacheService createBlobCacheService(Configuration configuration, Reference<File> fallbackStorageDirectory, BlobView blobView, @Nullable InetSocketAddress serverAddress) throws IOException
Creates theBlobCacheService
from the given configuration, fallback storage directory, blob view and blob server address.- Parameters:
configuration
- for the BlobCacheServicefallbackStorageDirectory
- fallback storage directoryblobView
- blob viewserverAddress
- blob server address- Returns:
- new blob cache service instance
- Throws:
IOException
- if we could not create the blob storage directory
-
calculateMessageDigest
public static byte[] calculateMessageDigest(File file) throws IOException
- Throws:
IOException
-
-