public class CachingFreenetStore<T extends StorableBlock> extends ProxyFreenetStore<T>
FreenetStore.StoreTypebackDatastore| Constructor and Description |
|---|
CachingFreenetStore(StoreCallback<T> callback,
FreenetStore<T> backDatastore,
CachingFreenetStoreTracker tracker) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
T |
fetch(byte[] routingKey,
byte[] fullKey,
boolean dontPromote,
boolean canReadClientCache,
boolean canReadSlashdotCache,
boolean ignoreOldBlocks,
BlockMetadata meta)
Retrieve a block.
|
boolean |
probablyInStore(byte[] routingKey)
Check if a routing key probably
|
void |
put(T block,
byte[] data,
byte[] header,
boolean overwrite,
boolean isOldBlock)
Store a block.
|
boolean |
start(Ticker ticker,
boolean longStart) |
getBloomFalsePositive, getMaxKeys, getSessionAccessStats, getTotalAccessStats, getUnderlyingStore, hits, keyCount, misses, setMaxKeys, setUserAlertManager, writespublic CachingFreenetStore(StoreCallback<T> callback, FreenetStore<T> backDatastore, CachingFreenetStoreTracker tracker)
public T fetch(byte[] routingKey, byte[] fullKey, boolean dontPromote, boolean canReadClientCache, boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta) throws java.io.IOException
FreenetStorefetch in interface FreenetStore<T extends StorableBlock>fetch in class ProxyFreenetStore<T extends StorableBlock>routingKey - The routing key i.e. the database key under which the block is stored.dontPromote - If true, don't promote the block to the top of the LRU.canReadClientCache - Whether we can read the client-cache, for purposes of finding
the pubkey for an SSK.java.io.IOException - If a disk I/O error occurs.public boolean probablyInStore(byte[] routingKey)
FreenetStoreprobablyInStore in interface FreenetStore<T extends StorableBlock>probablyInStore in class ProxyFreenetStore<T extends StorableBlock>false only if the key does not exist in store.public void put(T block, byte[] data, byte[] header, boolean overwrite, boolean isOldBlock) throws java.io.IOException, KeyCollisionException
FreenetStoreput in interface FreenetStore<T extends StorableBlock>put in class ProxyFreenetStore<T extends StorableBlock>overwrite - If true, overwrite old content rather than throwing a
KeyCollisionException.isOldBlock - If true, the block really shouldn't be in the datastore, but we are storing
it anyway; it should not have the new block flag, so it should be excluded
from Bloom filter sharing.KeyCollisionException - If the key already exists and callback.collisionPossible() is
true.java.io.IOExceptionpublic boolean start(Ticker ticker, boolean longStart) throws java.io.IOException
start in interface FreenetStore<T extends StorableBlock>start in class ProxyFreenetStore<T extends StorableBlock>java.io.IOExceptionpublic void close()
close in interface FreenetStore<T extends StorableBlock>close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class ProxyFreenetStore<T extends StorableBlock>