public class NullFreenetStore<T extends StorableBlock> extends java.lang.Object implements FreenetStore<T>
FreenetStore.StoreType
Constructor and Description |
---|
NullFreenetStore(StoreCallback<T> callback) |
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() |
public NullFreenetStore(StoreCallback<T> callback)
public T fetch(byte[] routingKey, byte[] fullKey, boolean dontPromote, boolean canReadClientCache, boolean canReadSlashdotCache, boolean ignoreOldBlocks, BlockMetadata meta) throws java.io.IOException
FreenetStore
fetch
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 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 boolean probablyInStore(byte[] routingKey)
FreenetStore
probablyInStore
in interface FreenetStore<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 oldBlock) throws java.io.IOException, KeyCollisionException
FreenetStore
put
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.IOException
public void setMaxKeys(long maxStoreKeys, boolean shrinkNow) throws java.io.IOException
FreenetStore
setMaxKeys
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.IOException
public 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 boolean start(Ticker ticker, boolean longStart) throws java.io.IOException
start
in interface FreenetStore<T extends StorableBlock>
java.io.IOException
public void setUserAlertManager(UserAlertManager userAlertManager)
setUserAlertManager
in interface FreenetStore<T extends StorableBlock>
public FreenetStore<T> getUnderlyingStore()
getUnderlyingStore
in interface FreenetStore<T extends StorableBlock>
public void close()
close
in interface FreenetStore<T extends StorableBlock>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable