June 14th, 2013

I just had an aha moment reading the C* source code and seeing that DecoratedKey extends RowPositon, and the constructor looks like this:
public DecoratedKey(Token token, ByteBuffer key)
/* see https://github.com/apache/cassandra/blob/cassandra-1.2/src/java/org/apache/cassandra/db/DecoratedKey.java

*/ What I was trying to figure out is — What exactly is encapsulated by RowPosition, and now I know. A Token, created by the Paritioner (default Murmur3Partitioner in C* 1.2) and the PartitionKey itself. The Murmur3Partitioner creates a hash of the key and that becomes the Token. After conversations with Sam Tunnicliffe, and Aleksey Yeschenko I further realized that there are two ways to view any PartitionKey: as a RowKey (if you are looking at it from the point of view of the Memtable/SSTable, or as a Token, if you are looking at it as a Partitioner, or the Cluster itself. Yay! That’s all for now. Laurent