-
public interface DiskStorageStorage for files in the cache. Responsible for maintaining state (count, size, watch file existence, reachability)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDiskStorage.DiskDumpInfoEntrypublic classDiskStorage.DiskDumpInfopublic interfaceDiskStorage.Entrypublic interfaceDiskStorage.InserterThis is a builder-like interface returned when calling insert. It holds all the operationscarried through an insert operation: - writing data - committing - clean up
-
Method Summary
Modifier and Type Method Description abstract booleanisEnabled()is this storage enabled? abstract booleanisExternal()is this storage external? abstract BinaryResourcegetResource(String resourceId, Object debugInfo)Get the resource with the specified name abstract booleancontains(String resourceId, Object debugInfo)Does a resource with this name exist? abstract booleantouch(String resourceId, Object debugInfo)Does a resource with this name exist? abstract voidpurgeUnexpectedResources()abstract DiskStorage.Inserterinsert(String resourceId, Object debugInfo)Creates a temporary resource for writing content. abstract Collection<DiskStorage.Entry>getEntries()Get all entries currently in the storage abstract longremove(DiskStorage.Entry entry)Remove the resource represented by the entry abstract longremove(String resourceId)Remove the resource with specified id abstract voidclearAll()Clear all contents of the storage abstract DiskStorage.DiskDumpInfogetDumpInfo()abstract StringgetStorageName()Get the storage's name, which should be unique -
-
Method Detail
-
isEnabled
abstract boolean isEnabled()
is this storage enabled?
-
isExternal
abstract boolean isExternal()
is this storage external?
-
getResource
@Nullable() abstract BinaryResource getResource(String resourceId, Object debugInfo)
Get the resource with the specified name
- Parameters:
resourceId- id of the resourcedebugInfo- helper object for debugging
-
contains
abstract boolean contains(String resourceId, Object debugInfo)
Does a resource with this name exist?
- Parameters:
resourceId- id of the resourcedebugInfo- helper object for debugging
-
touch
abstract boolean touch(String resourceId, Object debugInfo)
Does a resource with this name exist? If so, update the last-accessed time for the resource
- Parameters:
resourceId- id of the resourcedebugInfo- helper object for debugging
-
purgeUnexpectedResources
abstract void purgeUnexpectedResources()
-
insert
abstract DiskStorage.Inserter insert(String resourceId, Object debugInfo)
Creates a temporary resource for writing content. Split from commit() in order to allowconcurrent writing of cache entries. This entry will not be available to cache clients untilcommit() is called passing in the resource returned from this method.
- Parameters:
resourceId- id of the resourcedebugInfo- helper object for debugging
-
getEntries
abstract Collection<DiskStorage.Entry> getEntries()
Get all entries currently in the storage
-
remove
abstract long remove(DiskStorage.Entry entry)
Remove the resource represented by the entry
- Parameters:
entry- entry of the resource to delete
-
clearAll
abstract void clearAll()
Clear all contents of the storage
-
getDumpInfo
abstract DiskStorage.DiskDumpInfo getDumpInfo()
-
getStorageName
abstract String getStorageName()
Get the storage's name, which should be unique
-
-
-
-