Package org.apache.flink.fs.gs.storage
Class GSBlobStorageImpl
- java.lang.Object
-
- org.apache.flink.fs.gs.storage.GSBlobStorageImpl
-
- All Implemented Interfaces:
GSBlobStorage
public class GSBlobStorageImpl extends Object implements GSBlobStorage
BlobStorage implementation for Google storage.
-
-
Constructor Summary
Constructors Constructor Description GSBlobStorageImpl(com.google.cloud.storage.Storage storage)Constructs a GSBlobStorage instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompose(List<GSBlobIdentifier> sourceBlobIdentifiers, GSBlobIdentifier targetBlobIdentifier)Composes multiple blobs into one.voidcopy(GSBlobIdentifier sourceBlobIdentifier, GSBlobIdentifier targetBlobIdentifier)Copies from a source blob id to a target blob id.voidcreateBlob(GSBlobIdentifier blobIdentifier)Create an empty blob.List<Boolean>delete(Iterable<GSBlobIdentifier> blobIdentifiers)Deletes blobs.Optional<GSBlobStorage.BlobMetadata>getMetadata(GSBlobIdentifier blobIdentifier)Gets blob metadata.List<GSBlobIdentifier>list(String bucketName, String objectPrefix)Lists all the blobs in a bucket matching a given prefix.GSBlobStorage.WriteChannelwriteBlob(GSBlobIdentifier blobIdentifier)Creates a write channel with the default chunk size.GSBlobStorage.WriteChannelwriteBlob(GSBlobIdentifier blobIdentifier, org.apache.flink.configuration.MemorySize chunkSize)Creates a write channel with the specified chunk size.
-
-
-
Method Detail
-
writeBlob
public GSBlobStorage.WriteChannel writeBlob(GSBlobIdentifier blobIdentifier)
Description copied from interface:GSBlobStorageCreates a write channel with the default chunk size.- Specified by:
writeBlobin interfaceGSBlobStorage- Parameters:
blobIdentifier- The blob identifier to which to write- Returns:
- The WriteChannel helper
-
writeBlob
public GSBlobStorage.WriteChannel writeBlob(GSBlobIdentifier blobIdentifier, org.apache.flink.configuration.MemorySize chunkSize)
Description copied from interface:GSBlobStorageCreates a write channel with the specified chunk size.- Specified by:
writeBlobin interfaceGSBlobStorage- Parameters:
blobIdentifier- The blob identifier to which to writechunkSize- The chunk size, must be > 0- Returns:
- The WriteChannel helper
-
createBlob
public void createBlob(GSBlobIdentifier blobIdentifier)
Description copied from interface:GSBlobStorageCreate an empty blob.- Specified by:
createBlobin interfaceGSBlobStorage- Parameters:
blobIdentifier- The blob to create
-
getMetadata
public Optional<GSBlobStorage.BlobMetadata> getMetadata(GSBlobIdentifier blobIdentifier)
Description copied from interface:GSBlobStorageGets blob metadata.- Specified by:
getMetadatain interfaceGSBlobStorage- Parameters:
blobIdentifier- The blob identifier- Returns:
- The blob metadata, if the blob exists. Empty if the blob doesn't exist.
-
list
public List<GSBlobIdentifier> list(String bucketName, String objectPrefix)
Description copied from interface:GSBlobStorageLists all the blobs in a bucket matching a given prefix.- Specified by:
listin interfaceGSBlobStorage- Parameters:
bucketName- The bucket nameobjectPrefix- The object prefix- Returns:
- The found blobs ids
-
copy
public void copy(GSBlobIdentifier sourceBlobIdentifier, GSBlobIdentifier targetBlobIdentifier)
Description copied from interface:GSBlobStorageCopies from a source blob id to a target blob id. Does not delete the source blob.- Specified by:
copyin interfaceGSBlobStorage- Parameters:
sourceBlobIdentifier- The source blob identifiertargetBlobIdentifier- The target glob identifier
-
compose
public void compose(List<GSBlobIdentifier> sourceBlobIdentifiers, GSBlobIdentifier targetBlobIdentifier)
Description copied from interface:GSBlobStorageComposes multiple blobs into one. Does not delete any of the source blobs.- Specified by:
composein interfaceGSBlobStorage- Parameters:
sourceBlobIdentifiers- The source blob identifiers to combine, max of 32targetBlobIdentifier- The target blob identifier
-
delete
public List<Boolean> delete(Iterable<GSBlobIdentifier> blobIdentifiers)
Description copied from interface:GSBlobStorageDeletes blobs. Note that this does not fail if blobs don't exist.- Specified by:
deletein interfaceGSBlobStorage- Parameters:
blobIdentifiers- The blob identifiers to delete- Returns:
- The results of each delete operation.
-
-