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

AbstractColumnFamilyInputFormat is incorrectly interpreting token values when building ColumnFamilySplit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.2.0 beta 1
    • None
    • None
    • 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

            philipthompson Philip Thompson
            mike_tr_adamson Mike Adamson
            Philip Thompson
            Mike Adamson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: