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

AbstractColumnFamilyInputFormat is incorrectly interpreting token values when building ColumnFamilySplit

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.2.0 beta 1
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

      The SplitCallable.call method in AbstractColumnFamilyInputFormat has the following code for building ColumnFamilySplits:

                  for (TokenRange subSplit : subSplits.keySet())
                  {
                      List<TokenRange> ranges = subSplit.unwrap();
                      for (TokenRange subrange : ranges)
                      {
                          ColumnFamilySplit split =
                                  new ColumnFamilySplit(
                                          subrange.getStart().toString().substring(2),
                                          subrange.getEnd().toString().substring(2),
                                          subSplits.get(subSplit),
                                          endpoints);
      
                          logger.debug("adding {}", split);
                          splits.add(split);
                      }
                  }
      

      The subrange.getStart().toString().substring(2) works for the OrderPreservingPartitioner because the toString for the OPPToken in the java driver returns a hex value preceded by 0x. It doesn't work for the Murmur3Partitioner because the toString for the M3PToken returns Long.toString.

      As a result the tokens lose their first 2 digits.

        Attachments

        1. 9381-1.txt
          2 kB
          Philip Thompson

          Activity

            People

            • Assignee:
              philipthompson Philip Thompson
              Reporter:
              mike_tr_adamson Mike Adamson
              Authors:
              Philip Thompson
              Reviewers:
              Mike Adamson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: