public class CHKStore extends StoreCallback<CHKBlock>
store
Constructor and Description |
---|
CHKStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
collisionPossible()
Can the same key be valid for two different StorableBlocks?
|
CHKBlock |
construct(byte[] data,
byte[] headers,
byte[] routingKey,
byte[] fullKey,
boolean canReadClientCache,
boolean canReadSlashdotCache,
BlockMetadata meta,
DSAPublicKey ignored)
Construct a StorableBlock from the data, headers, and optionally routing key or full key.
|
boolean |
constructNeedsKey()
Whether we need the key in order to reconstruct a block.
|
int |
dataLength()
Length of a data block.
|
CHKBlock |
fetch(NodeCHK chk,
boolean dontPromote,
boolean ignoreOldBlocks,
BlockMetadata meta) |
int |
fullKeyLength()
Length of a full key.
|
int |
headerLength()
Length of a header block.
|
void |
put(CHKBlock b,
boolean isOldBlock) |
byte[] |
routingKeyFromFullKey(byte[] keyBuf)
Generate a routing key from a full key
|
int |
routingKeyLength()
Length of a routing key.
|
boolean |
storeFullKeys()
Whether we should create a .keys file to keep full keys in in order to reconstruct.
|
getBloomFalsePositive, getMaxKeys, getSessionAccessStats, getStore, getTotalAccessStats, getTotalBlockSize, hits, keyCount, misses, setMaxKeys, setStore, writes
public boolean collisionPossible()
StoreCallback
collisionPossible
in class StoreCallback<CHKBlock>
public CHKBlock construct(byte[] data, byte[] headers, byte[] routingKey, byte[] fullKey, boolean canReadClientCache, boolean canReadSlashdotCache, BlockMetadata meta, DSAPublicKey ignored) throws KeyVerifyException
StoreCallback
construct
in class StoreCallback<CHKBlock>
KeyVerifyException
public CHKBlock fetch(NodeCHK chk, boolean dontPromote, boolean ignoreOldBlocks, BlockMetadata meta) throws java.io.IOException
java.io.IOException
public void put(CHKBlock b, boolean isOldBlock) throws java.io.IOException
java.io.IOException
public int dataLength()
StoreCallback
dataLength
in class StoreCallback<CHKBlock>
public int fullKeyLength()
StoreCallback
fullKeyLength
in class StoreCallback<CHKBlock>
public int headerLength()
StoreCallback
headerLength
in class StoreCallback<CHKBlock>
public int routingKeyLength()
StoreCallback
routingKeyLength
in class StoreCallback<CHKBlock>
public boolean storeFullKeys()
StoreCallback
storeFullKeys
in class StoreCallback<CHKBlock>
public boolean constructNeedsKey()
StoreCallback
constructNeedsKey
in class StoreCallback<CHKBlock>
public byte[] routingKeyFromFullKey(byte[] keyBuf)
StoreCallback
routingKeyFromFullKey
in class StoreCallback<CHKBlock>