public class BasicTSKeyConverter extends com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
EntryKeyConverter
used with Basic TransiStore types.
In addition class implements encoding and decoding of the entry keys
(of type BasicTSKey
): uses BasicTSConstants.TS_QUERY_PARAM_PARTITION_ID
in addition to path
(which is regular filename).
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.storemate.shared.hash.BlockHasher32 |
_hasher
Object we use for calculating high-quality hash codes, both for routing (for keys)
and for content.
|
static int |
DEFAULT_KEY_HEADER_LENGTH
Keys have 2-byte fixed prefix which just contains length of partition id.
|
static int |
MAX_PARTITION_ID_BYTE_LENGTH |
Modifier | Constructor and Description |
---|---|
protected |
BasicTSKeyConverter() |
protected |
BasicTSKeyConverter(com.fasterxml.storemate.shared.hash.BlockHasher32 blockHasher) |
Modifier and Type | Method and Description |
---|---|
<B extends com.fasterxml.clustermate.api.RequestPathBuilder> |
appendToPath(B b,
BasicTSKey key) |
BasicTSKey |
construct(byte[] rawKey) |
BasicTSKey |
construct(byte[] rawKey,
int offset,
int length) |
BasicTSKey |
construct(String path)
Method called to construct a
BasicTSKey
that does not have group id. |
BasicTSKey |
construct(String fullKey,
int partitionIdLengthInBytes)
Method called to construct an instance given concatenated key (consisting
of partition id followed by path), and length indicator for splitting
parts as necessary.
|
BasicTSKey |
construct(String partitionId,
String path)
Method called to construct a
BasicTSKey given a two-part
path; partition id as prefix, and additional path contextual path. |
int |
contentHashFor(com.fasterxml.storemate.shared.ByteContainer bytes) |
com.fasterxml.storemate.shared.hash.IncrementalHasher32 |
createStreamingContentHasher() |
static BasicTSKeyConverter |
defaultInstance()
Accessor for getting default converter instance.
|
<P extends com.fasterxml.clustermate.api.DecodableRequestPath> |
extractFromPath(P path) |
String |
keyToString(BasicTSKey key) |
protected int |
rawHashForRouting(BasicTSKey key,
com.fasterxml.storemate.shared.hash.BlockHasher32 hasher) |
BasicTSKey |
rawToEntryKey(com.fasterxml.storemate.shared.StorableKey rawKey) |
String |
rawToString(com.fasterxml.storemate.shared.StorableKey key) |
int |
routingHashFor(BasicTSKey key)
Method called to figure out raw hash code to use for routing request
regarding given content key.
|
com.fasterxml.storemate.shared.StorableKey |
storableKey(String fullPath,
int partitionIdLengthInBytes) |
BasicTSKey |
stringToKey(String external) |
public static final int DEFAULT_KEY_HEADER_LENGTH
public static final int MAX_PARTITION_ID_BYTE_LENGTH
protected final com.fasterxml.storemate.shared.hash.BlockHasher32 _hasher
protected BasicTSKeyConverter()
protected BasicTSKeyConverter(com.fasterxml.storemate.shared.hash.BlockHasher32 blockHasher)
public static BasicTSKeyConverter defaultInstance()
public BasicTSKey construct(byte[] rawKey)
construct
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public BasicTSKey construct(byte[] rawKey, int offset, int length)
construct
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public BasicTSKey rawToEntryKey(com.fasterxml.storemate.shared.StorableKey rawKey)
rawToEntryKey
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public BasicTSKey stringToKey(String external)
stringToKey
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public String keyToString(BasicTSKey key)
keyToString
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public int routingHashFor(BasicTSKey key)
routingHashFor
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public String rawToString(com.fasterxml.storemate.shared.StorableKey key)
rawToString
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public BasicTSKey construct(String path)
BasicTSKey
that does not have group id.public BasicTSKey construct(String fullKey, int partitionIdLengthInBytes)
fullKey
- Full concatenated id.partitionIdLengthInBytes
- Length of partition id included before pathpublic BasicTSKey construct(String partitionId, String path)
BasicTSKey
given a two-part
path; partition id as prefix, and additional path contextual path.public com.fasterxml.storemate.shared.StorableKey storableKey(String fullPath, int partitionIdLengthInBytes)
public <B extends com.fasterxml.clustermate.api.RequestPathBuilder> B appendToPath(B b, BasicTSKey key)
appendToPath
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public <P extends com.fasterxml.clustermate.api.DecodableRequestPath> BasicTSKey extractFromPath(P path)
extractFromPath
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
protected int rawHashForRouting(BasicTSKey key, com.fasterxml.storemate.shared.hash.BlockHasher32 hasher)
public int contentHashFor(com.fasterxml.storemate.shared.ByteContainer bytes)
contentHashFor
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
public com.fasterxml.storemate.shared.hash.IncrementalHasher32 createStreamingContentHasher()
createStreamingContentHasher
in class com.fasterxml.clustermate.api.EntryKeyConverter<BasicTSKey>
Copyright © 2013 FasterXML. All Rights Reserved.