Package com.mchange.v1.cachedstore
Interface WritableCachedStore
-
- All Superinterfaces:
CachedStore
public interface WritableCachedStore extends CachedStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WritableCachedStore.Manager
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearPendingWrites()
Clears any pending (unflushed or failed) writes and removes.void
flushWrites()
flushes writes to back end, IN NO PARTICULAR ORDER! (If you write a key twice, the second write reliably supercedes the first, however.) If this method fails, you can use getFailedWrites() to see what keys could not be written.java.util.Set
getFailedWrites()
void
remove(java.lang.Object key)
void
reset()
Clears (WITHOUT WRITING) any pending (unflushed or failed) writes and removes, and any cached reads.void
sync()
flushes writes and then clears cached reads.void
write(java.lang.Object key, java.lang.Object value)
-
Methods inherited from interface com.mchange.v1.cachedstore.CachedStore
find
-
-
-
-
Method Detail
-
write
void write(java.lang.Object key, java.lang.Object value) throws CachedStoreException
- Throws:
CachedStoreException
-
remove
void remove(java.lang.Object key) throws CachedStoreException
- Throws:
CachedStoreException
-
flushWrites
void flushWrites() throws CacheFlushException
flushes writes to back end, IN NO PARTICULAR ORDER! (If you write a key twice, the second write reliably supercedes the first, however.) If this method fails, you can use getFailedWrites() to see what keys could not be written. Values that failed to write are still "pending": they will attempt to write on the next flush, and will still be read from the cache. Use clearPendingWrites() to avoid seeing or writing these values again.- Throws:
CacheFlushException
-
getFailedWrites
java.util.Set getFailedWrites() throws CachedStoreException
- Returns:
- null if all attempts to write to backend storage have succeeded, an unmodifiable Set of keys otherwise. failedWrites includes keys for whom a call to write or remove initially succeeded, but an attempt to flush the write to storage failed. A failed write may be any of an attempted first write, overwrite, or remove.
- Throws:
CachedStoreException
-
clearPendingWrites
void clearPendingWrites() throws CachedStoreException
Clears any pending (unflushed or failed) writes and removes.- Throws:
CachedStoreException
-
reset
void reset() throws CachedStoreException
Clears (WITHOUT WRITING) any pending (unflushed or failed) writes and removes, and any cached reads.- Specified by:
reset
in interfaceCachedStore
- Throws:
CachedStoreException
-
sync
void sync() throws CachedStoreException
flushes writes and then clears cached reads. On successful completion, the cache and the back-end store will be in sync with one another.- Throws:
CachedStoreException
-
-