public class PerformanceCachingGoogleCloudStorage extends ForwardingGoogleCloudStorage
GoogleCloudStorage.getItemInfo(StorageResourceId) and GoogleCloudStorage.getItemInfo(StorageResourceId). This provides faster access to recently
queried data in the scope of this instance. Because the data is cached, modifications made
outside of this instance may not be immediately reflected.GoogleCloudStorage.ListPage<T>MAX_COMPOSE_OBJECTS, MAX_RESULTS_UNLIMITED, PATH_DELIMITER| Constructor and Description |
|---|
PerformanceCachingGoogleCloudStorage(GoogleCloudStorage delegate,
PerformanceCachingGoogleCloudStorageOptions options)
Creates a wrapper around a GoogleCloudStorage instance, caching calls that create, update,
remove, and query for GoogleCloudStorageItemInfo.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases resources used by this instance.
|
GoogleCloudStorageItemInfo |
composeObjects(List<StorageResourceId> sources,
StorageResourceId destination,
CreateObjectOptions options)
Composes inputs into a single GCS object.
|
WritableByteChannel |
create(StorageResourceId resourceId,
CreateObjectOptions options)
Creates and opens an object for writing.
|
void |
deleteBuckets(List<String> bucketNames)
Deletes a list of buckets.
|
void |
deleteObjects(List<StorageResourceId> resourceIds)
Deletes the given objects.
|
GoogleCloudStorageItemInfo |
getItemInfo(StorageResourceId resourceId)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
List<GoogleCloudStorageItemInfo> |
getItemInfos(List<StorageResourceId> resourceIds)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
void |
invalidateCache() |
List<GoogleCloudStorageItemInfo> |
listBucketInfo()
Gets a list of GoogleCloudStorageItemInfo for all buckets of this project.
|
List<GoogleCloudStorageItemInfo> |
listObjectInfo(String bucketName,
String objectNamePrefix,
ListObjectOptions listOptions)
This function may return cached copies of
GoogleCloudStorageItemInfo. |
GoogleCloudStorage.ListPage<GoogleCloudStorageItemInfo> |
listObjectInfoPage(String bucketName,
String objectNamePrefix,
ListObjectOptions listOptions,
String pageToken)
The same semantics as
GoogleCloudStorage.listObjectInfo(java.lang.String, java.lang.String), but returns only result of single list request
(1 page). |
List<GoogleCloudStorageItemInfo> |
updateItems(List<UpdatableItemInfo> itemInfoList)
Attempt to update metadata of the objects referenced within the passed itemInfo objects.
|
compose, copy, copy, createBucket, createEmptyObject, createEmptyObject, createEmptyObjects, createEmptyObjects, deleteFolders, getDelegate, getOptions, isHnBucket, listBucketNames, listFolderInfoForPrefixPage, open, renameHnFolderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createBucket, listObjectInfo, listObjectInfoPage, openpublic PerformanceCachingGoogleCloudStorage(GoogleCloudStorage delegate, PerformanceCachingGoogleCloudStorageOptions options)
GoogleCloudStorage.getItemInfo(StorageResourceId) and GoogleCloudStorage.getItemInfo(StorageResourceId). This provides faster access to recently
queried data in the scope of this instance. Because the data is cached, modifications made
outside of this instance may not be immediately reflected.delegate - the GoogleCloudStorage instance to wrap and delegate calls to.options - the options to configure this cache with.public WritableByteChannel create(StorageResourceId resourceId, CreateObjectOptions options) throws IOException
GoogleCloudStorageresourceId
contains a known generationId or a generationId of 0, it is used instead of any "overwrite"
settings in the provided CreateObjectOptions (overwrite will only succeed if the
provided generationId matches the existing object, where a generationId of 0 indicates no
existing object expected).create in interface GoogleCloudStoragecreate in class ForwardingGoogleCloudStorageresourceId - identifies a StorageObjectoptions - Options to use when creating the objectIOException - on IO errorpublic void deleteBuckets(List<String> bucketNames) throws IOException
GoogleCloudStoragedeleteBuckets in interface GoogleCloudStoragedeleteBuckets in class ForwardingGoogleCloudStoragebucketNames - name of the buckets to deleteFileNotFoundException - if the given bucket does not existIOException - on IO errorpublic void deleteObjects(List<StorageResourceId> resourceIds) throws IOException
GoogleCloudStoragedeleteObjects in interface GoogleCloudStoragedeleteObjects in class ForwardingGoogleCloudStorageresourceIds - names of objects to delete with their respective bucketNames.FileNotFoundException - if the given object does not existIOException - if object exists but cannot be deletedpublic List<GoogleCloudStorageItemInfo> listBucketInfo() throws IOException
GoogleCloudStoragelistBucketInfo in interface GoogleCloudStoragelistBucketInfo in class ForwardingGoogleCloudStorageIOExceptionpublic List<GoogleCloudStorageItemInfo> listObjectInfo(String bucketName, String objectNamePrefix, ListObjectOptions listOptions) throws IOException
GoogleCloudStorageItemInfo.listObjectInfo in interface GoogleCloudStoragelistObjectInfo in class ForwardingGoogleCloudStoragebucketName - bucket nameobjectNamePrefix - object name prefix or null if all objects in the bucket are desiredlistOptions - options to use when listing objectsIOException - on IO errorpublic GoogleCloudStorage.ListPage<GoogleCloudStorageItemInfo> listObjectInfoPage(String bucketName, String objectNamePrefix, ListObjectOptions listOptions, String pageToken) throws IOException
GoogleCloudStorageGoogleCloudStorage.listObjectInfo(java.lang.String, java.lang.String), but returns only result of single list request
(1 page).listObjectInfoPage in interface GoogleCloudStoragelistObjectInfoPage in class ForwardingGoogleCloudStoragebucketName - bucket nameobjectNamePrefix - object name prefix or null if all objects in the bucket are desiredlistOptions - options to use when listing objectspageToken - the page tokenGoogleCloudStorage.ListPage object with listed GoogleCloudStorageItemInfos and next page
token if anyIOException - on IO errorpublic GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException
getItemInfo in interface GoogleCloudStoragegetItemInfo in class ForwardingGoogleCloudStorageresourceId - identifies either root, a Bucket, or a StorageObjectIOException - on IO errorpublic List<GoogleCloudStorageItemInfo> getItemInfos(List<StorageResourceId> resourceIds) throws IOException
getItemInfos in interface GoogleCloudStoragegetItemInfos in class ForwardingGoogleCloudStorageresourceIds - names of the GCS StorageObjects or Buckets for which to retrieve info.IOException - on IO errorpublic List<GoogleCloudStorageItemInfo> updateItems(List<UpdatableItemInfo> itemInfoList) throws IOException
GoogleCloudStorageupdateItems in interface GoogleCloudStorageupdateItems in class ForwardingGoogleCloudStorageIOException - on IO errorpublic GoogleCloudStorageItemInfo composeObjects(List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options) throws IOException
GoogleCloudStorageoptions. Overwrite semantics for the destination object will follow the
same semantics as GoogleCloudStorage.create(StorageResourceId, CreateObjectOptions). See GoogleCloudStorage.create(StorageResourceId) for the behavior if StorageResourceId.getGenerationId() is
explicitly set. The bucket must be the same for all sources and the destination.composeObjects in interface GoogleCloudStoragecomposeObjects in class ForwardingGoogleCloudStorageIOExceptionpublic void close()
GoogleCloudStorageclose in interface GoogleCloudStorageclose in class ForwardingGoogleCloudStoragepublic void invalidateCache()
Copyright © 2024. All rights reserved.