Class DecoratedKey

  • All Implemented Interfaces:
    java.lang.Comparable<PartitionPosition>, PartitionPosition, RingPosition<PartitionPosition>, IFilter.FilterKey
    Direct Known Subclasses:
    BufferDecoratedKey, NativeDecoratedKey

    public abstract class DecoratedKey
    extends java.lang.Object
    implements PartitionPosition, IFilter.FilterKey
    Represents a decorated key, handy for certain operations where just working with strings gets slow. We do a lot of sorting of DecoratedKeys, so for speed, we assume that tokens correspond one-to-one with keys. This is not quite correct in the case of RandomPartitioner (which uses MD5 to hash keys to tokens); if this matters, you can subclass RP to use a stronger hash, or use a non-lossy tokenization scheme (as in the OrderPreservingPartitioner classes).