/** * Schedule storing (or replacing) a key in the cache. * * @param key * key to store. * @param value * new value to store. * @throws DhtException * a prior flush failed. */ public void put(CacheKey key, byte[] value) throws DhtException { modify(CacheService.Change.put(key, value)); }
/** * Schedule storing (or replacing) a key in the cache. * * @param key * key to store. * @param value * new value to store. * @throws DhtException * a prior flush failed. */ public void put(CacheKey key, byte[] value) throws DhtException { modify(CacheService.Change.put(key, value)); }
/** * Schedule removal of a key from the cache. * <p> * Unlike {@link #removeAfterFlush(CacheKey)}, these removals can be flushed * when the cache buffer is full, potentially before any corresponding * removal is written to the underlying database. * * @param key * key to remove. * @throws DhtException * a prior flush failed. */ public void remove(CacheKey key) throws DhtException { modify(CacheService.Change.remove(key)); }
/** * Schedule removal of a key from the cache. * <p> * Unlike {@link #removeAfterFlush(CacheKey)}, these removals can be flushed * when the cache buffer is full, potentially before any corresponding * removal is written to the underlying database. * * @param key * key to remove. * @throws DhtException * a prior flush failed. */ public void remove(CacheKey key) throws DhtException { modify(CacheService.Change.remove(key)); }
public void flush() throws DhtException { dbBuffer.flush(); if (afterFlush != null) { for (CacheService.Change op : afterFlush) modify(op); afterFlush = null; } super.flush(); }
public void flush() throws DhtException { dbBuffer.flush(); if (afterFlush != null) { for (CacheService.Change op : afterFlush) modify(op); afterFlush = null; } super.flush(); }