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 BlobCacheServicecreateBlobCacheService(org.apache.flink.configuration.Configuration configuration, org.apache.flink.util.Reference<File> fallbackStorageDirectory, BlobView blobView, InetSocketAddress serverAddress)Creates theBlobCacheServicefrom the given configuration, fallback storage directory, blob view and blob server address.static BlobServercreateBlobServer(org.apache.flink.configuration.Configuration configuration, org.apache.flink.util.Reference<File> fallbackStorageDirectory, BlobStore blobStore)Creates theBlobServerfrom the given configuration, fallback storage directory and blob store.static BlobStoreServicecreateBlobStoreFromConfig(org.apache.flink.configuration.Configuration config)Creates a BlobStore based on the parameters set in the configuration.
-
-
-
Method Detail
-
createBlobStoreFromConfig
public static BlobStoreService createBlobStoreFromConfig(org.apache.flink.configuration.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(org.apache.flink.configuration.Configuration configuration, org.apache.flink.util.Reference<File> fallbackStorageDirectory, BlobStore blobStore) throws IOException
Creates theBlobServerfrom 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(org.apache.flink.configuration.Configuration configuration, org.apache.flink.util.Reference<File> fallbackStorageDirectory, BlobView blobView, @Nullable InetSocketAddress serverAddress) throws IOException
Creates theBlobCacheServicefrom 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
-
-