public abstract class StoreCallback<T extends StorableBlock>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected FreenetStore<T> |
store |
Constructor and Description |
---|
StoreCallback() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
collisionPossible()
Can the same key be valid for two different StorableBlocks?
|
abstract T |
construct(byte[] data,
byte[] headers,
byte[] routingKey,
byte[] fullKey,
boolean canReadClientCache,
boolean canReadSlashdotCache,
BlockMetadata meta,
DSAPublicKey knownPubKey)
Construct a StorableBlock from the data, headers, and optionally routing key or full key.
|
abstract boolean |
constructNeedsKey()
Whether we need the key in order to reconstruct a block.
|
abstract int |
dataLength()
Length of a data block.
|
abstract int |
fullKeyLength()
Length of a full key.
|
long |
getBloomFalsePositive() |
long |
getMaxKeys() |
StoreAccessStats |
getSessionAccessStats() |
FreenetStore<T> |
getStore() |
StoreAccessStats |
getTotalAccessStats()
Overall session access stats.
|
int |
getTotalBlockSize() |
abstract int |
headerLength()
Length of a header block.
|
long |
hits() |
long |
keyCount() |
long |
misses() |
abstract byte[] |
routingKeyFromFullKey(byte[] keyBuf)
Generate a routing key from a full key
|
abstract int |
routingKeyLength()
Length of a routing key.
|
void |
setMaxKeys(long maxStoreKeys,
boolean shrinkNow) |
void |
setStore(FreenetStore<T> store)
Called when first connecting to a FreenetStore.
|
abstract boolean |
storeFullKeys()
Whether we should create a .keys file to keep full keys in in order to reconstruct.
|
long |
writes() |
protected FreenetStore<T extends StorableBlock> store
public abstract int dataLength()
public abstract int headerLength()
public abstract int routingKeyLength()
public abstract boolean storeFullKeys()
public abstract boolean constructNeedsKey()
public abstract int fullKeyLength()
public abstract boolean collisionPossible()
public void setStore(FreenetStore<T> store)
public FreenetStore<T> getStore()
public abstract T construct(byte[] data, byte[] headers, byte[] routingKey, byte[] fullKey, boolean canReadClientCache, boolean canReadSlashdotCache, BlockMetadata meta, DSAPublicKey knownPubKey) throws KeyVerifyException
KeyVerifyException
public void setMaxKeys(long maxStoreKeys, boolean shrinkNow) throws java.io.IOException
java.io.IOException
public long getMaxKeys()
public long hits()
public long misses()
public long writes()
public long keyCount()
public long getBloomFalsePositive()
public abstract byte[] routingKeyFromFullKey(byte[] keyBuf)
public StoreAccessStats getSessionAccessStats()
public StoreAccessStats getTotalAccessStats()
public int getTotalBlockSize()