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(java.util.List<StorageResourceId> sources,
StorageResourceId destination,
CreateObjectOptions options)
Composes inputs into a single GCS object.
|
void |
deleteBuckets(java.util.List<java.lang.String> bucketNames)
Deletes a list of buckets.
|
void |
deleteObjects(java.util.List<StorageResourceId> fullObjectNames)
Deletes the given objects.
|
GoogleCloudStorageItemInfo |
getItemInfo(StorageResourceId resourceId)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
java.util.List<GoogleCloudStorageItemInfo> |
getItemInfos(java.util.List<StorageResourceId> resourceIds)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
void |
invalidateCache() |
java.util.List<GoogleCloudStorageItemInfo> |
listBucketInfo()
Gets a list of GoogleCloudStorageItemInfo for all buckets of this project.
|
java.util.List<GoogleCloudStorageItemInfo> |
listObjectInfo(java.lang.String bucketName,
java.lang.String objectNamePrefix,
java.lang.String delimiter)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
java.util.List<GoogleCloudStorageItemInfo> |
listObjectInfo(java.lang.String bucketName,
java.lang.String objectNamePrefix,
java.lang.String delimiter,
long maxResults)
This function may return cached copies of GoogleCloudStorageItemInfo.
|
GoogleCloudStorage.ListPage<GoogleCloudStorageItemInfo> |
listObjectInfoPage(java.lang.String bucketName,
java.lang.String objectNamePrefix,
java.lang.String delimiter,
java.lang.String pageToken)
The same semantics as
GoogleCloudStorage.listObjectInfo(java.lang.String, java.lang.String, java.lang.String), but returns only result of single list request
(1 page). |
java.util.List<GoogleCloudStorageItemInfo> |
updateItems(java.util.List<UpdatableItemInfo> itemInfoList)
Attempt to update metadata of the objects referenced within the passed itemInfo objects.
|
compose, copy, create, create, create, create, createEmptyObject, createEmptyObject, createEmptyObjects, createEmptyObjects, getDelegate, getOptions, listBucketNames, listObjectNames, listObjectNames, open, open, waitForBucketEmptypublic 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 void deleteBuckets(java.util.List<java.lang.String> bucketNames)
throws java.io.IOException
GoogleCloudStoragedeleteBuckets in interface GoogleCloudStoragedeleteBuckets in class ForwardingGoogleCloudStoragebucketNames - name of the buckets to deletejava.io.FileNotFoundException - if the given bucket does not existjava.io.IOException - on IO errorpublic void deleteObjects(java.util.List<StorageResourceId> fullObjectNames) throws java.io.IOException
GoogleCloudStoragedeleteObjects in interface GoogleCloudStoragedeleteObjects in class ForwardingGoogleCloudStoragefullObjectNames - names of objects to delete with their respective bucketNames.java.io.FileNotFoundException - if the given object does not existjava.io.IOException - if object exists but cannot be deletedpublic java.util.List<GoogleCloudStorageItemInfo> listBucketInfo() throws java.io.IOException
GoogleCloudStoragelistBucketInfo in interface GoogleCloudStoragelistBucketInfo in class ForwardingGoogleCloudStoragejava.io.IOExceptionpublic java.util.List<GoogleCloudStorageItemInfo> listObjectInfo(java.lang.String bucketName, java.lang.String objectNamePrefix, java.lang.String delimiter) throws java.io.IOException
listObjectInfo in interface GoogleCloudStoragelistObjectInfo in class ForwardingGoogleCloudStoragebucketName - bucket nameobjectNamePrefix - object name prefix or null if all objects in the bucket are desireddelimiter - delimiter to use (typically "/"), otherwise nulljava.io.IOException - on IO errorpublic java.util.List<GoogleCloudStorageItemInfo> listObjectInfo(java.lang.String bucketName, java.lang.String objectNamePrefix, java.lang.String delimiter, long maxResults) throws java.io.IOException
listObjectInfo in interface GoogleCloudStoragelistObjectInfo in class ForwardingGoogleCloudStoragebucketName - bucket nameobjectNamePrefix - object name prefix or null if all objects in the bucket are desireddelimiter - delimiter to use (typically "/"), otherwise nullmaxResults - maximum number of results to return, unlimited if negative or zerojava.io.IOException - on IO errorpublic GoogleCloudStorage.ListPage<GoogleCloudStorageItemInfo> listObjectInfoPage(java.lang.String bucketName, java.lang.String objectNamePrefix, java.lang.String delimiter, java.lang.String pageToken) throws java.io.IOException
GoogleCloudStorageGoogleCloudStorage.listObjectInfo(java.lang.String, 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 desireddelimiter - delimiter to use (typically "/"), otherwise nullpageToken - the page tokenGoogleCloudStorage.ListPage object with listed GoogleCloudStorageItemInfos and next page
token if anyjava.io.IOException - on IO errorpublic GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws java.io.IOException
getItemInfo in interface GoogleCloudStoragegetItemInfo in class ForwardingGoogleCloudStorageresourceId - identifies either root, a Bucket, or a StorageObjectjava.io.IOException - on IO errorpublic java.util.List<GoogleCloudStorageItemInfo> getItemInfos(java.util.List<StorageResourceId> resourceIds) throws java.io.IOException
getItemInfos in interface GoogleCloudStoragegetItemInfos in class ForwardingGoogleCloudStorageresourceIds - names of the GCS StorageObjects or Buckets for which to retrieve info.java.io.IOException - on IO errorpublic java.util.List<GoogleCloudStorageItemInfo> updateItems(java.util.List<UpdatableItemInfo> itemInfoList) throws java.io.IOException
GoogleCloudStorageupdateItems in interface GoogleCloudStorageupdateItems in class ForwardingGoogleCloudStoragejava.io.IOException - on IO errorpublic void close()
GoogleCloudStorageclose in interface GoogleCloudStorageclose in class ForwardingGoogleCloudStoragepublic GoogleCloudStorageItemInfo composeObjects(java.util.List<StorageResourceId> sources, StorageResourceId destination, CreateObjectOptions options) throws java.io.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 ForwardingGoogleCloudStoragejava.io.IOExceptionpublic void invalidateCache()
Copyright © 2019. All rights reserved.