Package org.apache.flink.fs.gs.storage
Class GSBlobStorageImpl
java.lang.Object
org.apache.flink.fs.gs.storage.GSBlobStorageImpl
- All Implemented Interfaces:
GSBlobStorage
BlobStorage implementation for Google storage.
-
Constructor Summary
ConstructorsConstructorDescriptionGSBlobStorageImpl(com.google.cloud.storage.Storage storage) Constructs a GSBlobStorage instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompose(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.delete(Iterable<GSBlobIdentifier> blobIdentifiers) Deletes blobs.getMetadata(GSBlobIdentifier blobIdentifier) Gets blob metadata.Lists all the blobs in a bucket matching a given prefix.writeBlob(GSBlobIdentifier blobIdentifier) Creates a write channel with the default chunk size.writeBlob(GSBlobIdentifier blobIdentifier, org.apache.flink.configuration.MemorySize chunkSize) Creates a write channel with the specified chunk size.
-
Constructor Details
-
GSBlobStorageImpl
public GSBlobStorageImpl(com.google.cloud.storage.Storage storage) Constructs a GSBlobStorage instance.- Parameters:
storage- The wrapped Google Storage instance.
-
-
Method Details
-
writeBlob
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
Description copied from interface:GSBlobStorageCreate an empty blob.- Specified by:
createBlobin interfaceGSBlobStorage- Parameters:
blobIdentifier- The blob to create
-
getMetadata
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
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
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
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.
-