public class PrefixMappedItemCache extends Object
GoogleCloudStorageItemInfo that maintains indexes based on
the item's bucket and object name. In addition to caching StorageResourceId to item
mappings, it provides options for storing groups of items under similar bucket and object name
prefixes.| Constructor and Description |
|---|
PrefixMappedItemCache(Duration maxEntryAge)
Creates a new
PrefixMappedItemCache. |
| Modifier and Type | Method and Description |
|---|---|
GoogleCloudStorageItemInfo |
getItem(StorageResourceId id)
Gets the cached item associated with the given resource id.
|
void |
invalidateAll()
Invalidates all entries in the cache.
|
void |
invalidateBucket(String bucket)
Invalidates all cached items and lists associated with the given bucket.
|
boolean |
isPrefixCached(StorageResourceId id)
Checks whether any items with specified prefix are in the cache.
|
GoogleCloudStorageItemInfo |
putItem(GoogleCloudStorageItemInfo item)
Inserts an item into the cache.
|
GoogleCloudStorageItemInfo |
removeItem(StorageResourceId id)
Removes the item from the cache.
|
public PrefixMappedItemCache(Duration maxEntryAge)
PrefixMappedItemCache.maxEntryAge - time after which entries in cache expire.public GoogleCloudStorageItemInfo getItem(StorageResourceId id)
id - the resource id of the item to get.public GoogleCloudStorageItemInfo putItem(GoogleCloudStorageItemInfo item)
item - the item to insert. The item must have a valid resource id.public GoogleCloudStorageItemInfo removeItem(StorageResourceId id)
id - the resource id of the item to remove.public boolean isPrefixCached(StorageResourceId id)
id - the prefix resource id of the cached items to check.public void invalidateBucket(String bucket)
bucket - the bucket to invalidate. This must not be null.public void invalidateAll()
Copyright © 2023. All rights reserved.