Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-242

Implement method to "evenly" split a Range

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 0.4
    • Component/s: None
    • Labels:
      None

      Description

      Two tickets currently depend on being able to deterministically split a Range object into two "even" Ranges.

      This can be accomplished with RandomPartitioner/BigIntegerToken by taking the average of the tokens, but the OrderPreservingPartitioner/StringToken implementation uses a Java Collator to define the sort order of Tokens, which means that they are not necessarily sorted in byte/char order.

      Collator.getCollationKey(String).toByteArray() gets you a sortable byte array, but there is no publicly accessible API for converting a similar byte array back into a String.

        Attachments

        1. CASSANDRA-242_part-1.diff
          26 kB
          Stu Hood
        2. CASSANDRA-242_part-1.diff
          26 kB
          Stu Hood
        3. CASSANDRA-242_part-2.diff
          11 kB
          Stu Hood
        4. CASSANDRA-242_part-2.diff
          12 kB
          Stu Hood
        5. CASSANDRA-242.diff
          34 kB
          Stu Hood
        6. CASSANDRA-242.diff
          34 kB
          Stu Hood
        7. CASSANDRA-242.diff
          34 kB
          Stu Hood
        8. CASSANDRA-242.diff
          34 kB
          Stu Hood
        9. CASSANDRA-242.diff
          8 kB
          Stu Hood

          Issue Links

            Activity

              People

              • Assignee:
                stuhood Stu Hood
                Reporter:
                stuhood Stu Hood
                Authors:
                Stu Hood
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: