public class ProxyFreenetStore<T extends StorableBlock> extends java.lang.Object implements FreenetStore<T>
FreenetStore.StoreType| Modifier and Type | Field and Description |
|---|---|
protected FreenetStore<T> |
backDatastore |
| Constructor and Description |
|---|
ProxyFreenetStore(FreenetStore<T> backDatastore) |
| 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.
|
long |
getBloomFalsePositive() |
long |
getMaxKeys() |
StoreAccessStats |
getSessionAccessStats() |
StoreAccessStats |
getTotalAccessStats() |
FreenetStore<T> |
getUnderlyingStore() |
long |
hits() |
long |
keyCount() |
long |
misses() |
boolean |
probablyInStore(byte[] routingKey)
Check if a routing key probably
|
void |
put(T block,
byte[] data,
byte[] header,
boolean overwrite,
boolean oldBlock)
Store a block.
|
void |
setMaxKeys(long maxStoreKeys,
boolean shrinkNow)
Change the store size.
|
void |
setUserAlertManager(UserAlertManager userAlertManager) |
boolean |
start(Ticker ticker,
boolean longStart) |
long |
writes() |
protected final FreenetStore<T extends StorableBlock> backDatastore
public ProxyFreenetStore(FreenetStore<T> backDatastore)
public long getBloomFalsePositive()
getBloomFalsePositive in interface FreenetStore<T extends StorableBlock>public long getMaxKeys()
getMaxKeys in interface FreenetStore<T extends StorableBlock>public long hits()
hits in interface FreenetStore<T extends StorableBlock>public long keyCount()
keyCount in interface FreenetStore<T extends StorableBlock>public long misses()
misses in interface FreenetStore<T extends StorableBlock>public void setMaxKeys(long maxStoreKeys,
boolean shrinkNow)
throws java.io.IOException
FreenetStoresetMaxKeys in interface FreenetStore<T extends StorableBlock>maxStoreKeys - The maximum number of keys to be cached.shrinkNow - If false, don't shrink the store immediately.java.io.IOExceptionpublic long writes()
writes in interface FreenetStore<T extends StorableBlock>public StoreAccessStats getSessionAccessStats()
getSessionAccessStats in interface FreenetStore<T extends StorableBlock>public StoreAccessStats getTotalAccessStats()
getTotalAccessStats in interface FreenetStore<T extends StorableBlock>public void setUserAlertManager(UserAlertManager userAlertManager)
setUserAlertManager in interface FreenetStore<T extends StorableBlock>public FreenetStore<T> getUnderlyingStore()
getUnderlyingStore in interface FreenetStore<T extends StorableBlock>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>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 void put(T block, byte[] data, byte[] header, boolean overwrite, boolean oldBlock) throws java.io.IOException, KeyCollisionException
FreenetStoreput in interface FreenetStore<T extends StorableBlock>overwrite - If true, overwrite old content rather than throwing a
KeyCollisionException.oldBlock - 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 probablyInStore(byte[] routingKey)
FreenetStoreprobablyInStore in interface FreenetStore<T extends StorableBlock>false only if the key does not exist in store.public boolean start(Ticker ticker, boolean longStart) throws java.io.IOException
start in interface FreenetStore<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.AutoCloseable