public interface FreenetStore<T extends StorableBlock>
extends java.io.Closeable
| Modifier and Type | Interface and Description |
|---|---|
static class |
FreenetStore.StoreType |
| 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() |
T fetch(byte[] routingKey, byte[] fullKey, boolean dontPromote, boolean canReadClientCache, boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta) throws java.io.IOException
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.canWriteClientCache - Whether we can write the client-cache, for purposes of finding
the pubkey for an SSK.canWriteDatastore - Whether we can write the datastore, for purposes of finding the
pubkey for an SSK.java.io.IOException - If a disk I/O error occurs.void put(T block, byte[] data, byte[] header, boolean overwrite, boolean oldBlock) throws java.io.IOException, KeyCollisionException
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.IOExceptionvoid setMaxKeys(long maxStoreKeys,
boolean shrinkNow)
throws java.io.IOException
maxStoreKeys - The maximum number of keys to be cached.shrinkNow - If false, don't shrink the store immediately.java.io.IOExceptionDatabaseExceptionlong getMaxKeys()
long hits()
long misses()
long writes()
long keyCount()
long getBloomFalsePositive()
boolean probablyInStore(byte[] routingKey)
routingkey - false only if the key does not exist in store.StoreAccessStats getSessionAccessStats()
StoreAccessStats getTotalAccessStats()
boolean start(Ticker ticker, boolean longStart) throws java.io.IOException
java.io.IOExceptionvoid close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablevoid setUserAlertManager(UserAlertManager userAlertManager)
FreenetStore<T> getUnderlyingStore()