Interface CuratorCacheStorage
- All Superinterfaces:
CuratorCacheAccessor
Interface for maintaining data in a
CuratorCache-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset the storage to zero entriesstatic CuratorCacheStorageReturn a new storage instance that does not retain the data bytes.Return an entry from storageAdd an entry to storage and return any previous entry at that pathRemove the entry from storage and return any previous entry at that pathintsize()Return the current number of entries in storagestatic CuratorCacheStoragestandard()Return a new standard storage instancestream()Return a stream over the storage entries.
-
Method Details
-
standard
Return a new standard storage instance- Returns:
- storage instance
-
dataNotCached
Return a new storage instance that does not retain the data bytes. i.e. ChildData objects returned by this storage will always returnnullforChildData.getData().- Returns:
- storage instance that does not retain data bytes
-
put
Add an entry to storage and return any previous entry at that path- Parameters:
data- entry to add- Returns:
- previous entry or
empty()
-
remove
Remove the entry from storage and return any previous entry at that path- Parameters:
path- path to remove- Returns:
- previous entry or
empty()
-
clear
void clear()Reset the storage to zero entries -
get
Return an entry from storage- Specified by:
getin interfaceCuratorCacheAccessor- Parameters:
path- path to get- Returns:
- entry or
empty()
-
size
int size()Return the current number of entries in storage- Specified by:
sizein interfaceCuratorCacheAccessor- Returns:
- number of entries
-
stream
Return a stream over the storage entries. Note: for a standard storage instance, the stream behaves like a stream returned byConcurrentHashMap.entrySet()- Specified by:
streamin interfaceCuratorCacheAccessor- Returns:
- stream over entries
-