A KeyCodec is a {@link String} {@link Codec} that is taskedwith the optimal performance of encoding and decoding String keys for use by connector implementations that support such extended mechanisms.
This interface is projected to be implemented by a key caching mechanism suitable for employment in usage scenarios where a finite set of keys is repeatedly employed to accomplish domain specific tasks.
For example, a common Redis pattern is the use of atomic counters to increment IDs. Whenever this pattern is used, the key for the ID(s) will be repeatedly encoded and decoded by a non-optimized client which can not make indiscriminate decisions regarding such optimizations.
A key cache, implementing {@link KeyCodec}, for example, can be used to indicate to the client that for keys, the default codec (which is basically delegating to {@link String}'s {@link String#getBytes()} and {@link String#String(byte[],int,int)}) should not be used and that the client should use the object implementing this to accomplish the same task.
This is just a marker interface beyond that. @author Joubin Houshyar (alphazero@sensesay.net) @version alpha.0, Apr 15, 2009 @since alpha.0
|
|
|
|
|
|
|
|
|
|