Class BufferDecoratedKey

    • Constructor Detail

      • BufferDecoratedKey

        public BufferDecoratedKey​(Token token,
                                  java.nio.ByteBuffer key)
    • Method Detail

      • getKey

        public java.nio.ByteBuffer getKey()
        Specified by:
        getKey in class DecoratedKey
      • fromByteComparable

        public static BufferDecoratedKey fromByteComparable​(ByteComparable byteComparable,
                                                            ByteComparable.Version version,
                                                            IPartitioner partitioner)
        A factory method that translates the given byte-comparable representation to a BufferDecoratedKey instance. If the given byte comparable doesn't represent the encoding of a buffer decorated key, anything from a wide variety of throwables may be thrown (e.g. AssertionError, IndexOutOfBoundsException, IllegalStateException, etc.).
        Parameters:
        byteComparable - A byte-comparable representation (presumably of a BufferDecoratedKey instance).
        version - The encoding version used for the given byte comparable.
        partitioner - The partitioner of the encoded decorated key. Needed in order to correctly decode the token bytes of the key.
        Returns:
        A new BufferDecoratedKey instance, corresponding to the given byte-comparable representation. If we were to call DecoratedKey.asComparableBytes(Version) on the returned object, we should get a ByteSource equal to the one of the input byte comparable.