[ https://issues.apache.org/jira/browse/CASSANDRA-1034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sylvain Lebresne updated CASSANDRA-1034: ---------------------------------------- Attachment: 0003-unit-test-v2.patch 0002-Remove-assumption-that-token-and-keys-are-one-to-one-v2.patch 0001-Generify-AbstractBounds-v2.patch I've tried finding a better encapsulation for the 'fake' keys of the patch. The idea being to restrict DK to 'true' row key, i.e. the ones that can be written on disk and create a new class (Token.KeyBound) to represent the two "fake" key for each token representing the smallest/biggest key having the token. To make it work together, they share the new RowPosition interface. Some of the methods accepts a RowPosition (instead of DecoratedKey) to indicate that it can accept a 'fake' key for purpose of selecting true keys. So for instance SSTableReader.getPosition() accepts a RowPosition. However, SSTableReader.getCachedPosition() only accepts a DK, because the key cache can only contain a "true" row key. Anyway, I actually end up liking this. With that, we never ever create a DK with a null key (nor even an empty one, which wouldn't be a true key either). This is more clear and avoids mistakes. Unfortunately the patch got bigger :( > Remove assumption that Key to Token is one-to-one > ------------------------------------------------- > > Key: CASSANDRA-1034 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1034 > Project: Cassandra > Issue Type: Bug > Reporter: Stu Hood > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 1.1 > > Attachments: 0001-Generify-AbstractBounds-v2.patch, > 0001-Generify-AbstractBounds.patch, > 0002-Remove-assumption-that-token-and-keys-are-one-to-one-v2.patch, > 0002-Remove-assumption-that-token-and-keys-are-one-to-one.patch, > 0003-unit-test-v2.patch, 0003-unit-test.patch, 1034_v1.txt, > CASSANDRA-1034.patch > > > get_range_slices assumes that Tokens do not collide and converts a KeyRange > to an AbstractBounds. For RandomPartitioner, this assumption isn't safe, and > would lead to a very weird heisenberg. > Converting AbstractBounds to use a DecoratedKey would solve this, because the > byte[] key portion of the DecoratedKey can act as a tiebreaker. > Alternatively, we could make DecoratedKey extend Token, and then use > DecoratedKeys in places where collisions are unacceptable. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira