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

Implement method to "evenly" split a Range

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 0.4
    • None
    • 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.diff
          8 kB
          Stu Hood
        2. CASSANDRA-242.diff
          34 kB
          Stu Hood
        3. CASSANDRA-242.diff
          34 kB
          Stu Hood
        4. CASSANDRA-242.diff
          34 kB
          Stu Hood
        5. CASSANDRA-242.diff
          34 kB
          Stu Hood
        6. CASSANDRA-242_part-2.diff
          12 kB
          Stu Hood
        7. CASSANDRA-242_part-2.diff
          11 kB
          Stu Hood
        8. CASSANDRA-242_part-1.diff
          26 kB
          Stu Hood
        9. CASSANDRA-242_part-1.diff
          26 kB
          Stu Hood

        Issue Links

          Activity

            People

              stuhood Stu Hood
              stuhood Stu Hood
              Stu Hood
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: