Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.db
Class DecoratedKey<T extends Token>

    java.lang.Object
      org.apache.cassandra.db.RowPosition
          org.apache.cassandra.db.DecoratedKey<T>

All Implemented Interfaces:
  java.lang.Comparable<RowPosition>, RingPosition<RowPosition>

    public class DecoratedKey<T extends Token>

extends RowPosition

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).

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.cassandra.db.RowPosition
`RowPosition.Kind, RowPosition.RowPositionSerializer`

Field Summary
`static java.util.Comparator<DecoratedKey>` | `comparator`
`java.nio.ByteBuffer` | `key`
`T` | `token`

Constructor Summary
`DecoratedKey(T token, java.nio.ByteBuffer key)`

Method Summary
`int` | `compareTo(RowPosition pos)`
`boolean` | `equals(java.lang.Object obj)`
`T` | `getToken()`
`int` | `hashCode()`
`boolean` | `isMinimum(IPartitioner partitioner)`
`RowPosition.Kind` | `kind()`
`java.lang.String` | `toString()`

Methods inherited from class org.apache.cassandra.db.RowPosition
`forKey, isMinimum, serializer`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### comparator

    public static final java.util.Comparator<DecoratedKey> comparator

### token

    public final T extends Token token

### key

    public final java.nio.ByteBuffer key

Constructor Detail

### DecoratedKey

    public DecoratedKey(T token,
                        java.nio.ByteBuffer key)

Method Detail

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### compareTo

    public int compareTo(RowPosition pos)

### isMinimum

    public boolean isMinimum(IPartitioner partitioner)

### kind

    public RowPosition.Kind kind()

  Specified by:
    `kind` in class `RowPosition`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getToken

    public T getToken()

  Specified by:
    `getToken` in interface `RingPosition<RowPosition>`
  Specified by:
    `getToken` in class `RowPosition`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 The Apache Software Foundation