public class PrefixKeyHashingScheme extends java.lang.Object implements KeyHashingScheme
KeyHashingScheme decorator that simply adds
a known prefix to the results of another KeyHashingScheme.
Primarily useful for namespacing a shared memcached cluster, for
example.| Constructor and Description |
|---|
PrefixKeyHashingScheme(java.lang.String prefix,
KeyHashingScheme backingScheme)
Creates a new
KeyHashingScheme that prepends the given
prefix to the results of hashes from the given backing scheme. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
hash(java.lang.String storageKey)
Maps a storage key to a cache key.
|
public PrefixKeyHashingScheme(java.lang.String prefix,
KeyHashingScheme backingScheme)
KeyHashingScheme that prepends the given
prefix to the results of hashes from the given backing scheme.
Users should be aware that memcached has a fixed maximum key
length, so the combination of this prefix plus the results of
the backing hashing scheme must still fit within these limits.prefix - backingScheme - public java.lang.String hash(java.lang.String storageKey)
KeyHashingSchemehash in interface KeyHashingSchemestorageKey - what the higher-level HTTP cache wants to use
as its key for looking up cache entries