Class SortedTableVerifier.RangeOwnHelper

java.lang.Object
org.apache.cassandra.io.sstable.format.SortedTableVerifier.RangeOwnHelper
Enclosing class:
SortedTableVerifier<R extends SSTableReaderWithFilter>

public static class SortedTableVerifier.RangeOwnHelper extends Object
Use the fact that check(...) is called with sorted tokens - we keep a pointer in to the normalized ranges and only bump the pointer if the key given is out of range. This is done to avoid calling .contains(..) many times for each key (with vnodes for example)
  • Constructor Details

    • RangeOwnHelper

      public RangeOwnHelper(List<Range<Token>> normalizedRanges)
  • Method Details

    • validate

      public void validate(DecoratedKey key)
      check if the given key is contained in any of the given ranges

      Must be called in sorted order - key should be increasing

      Parameters:
      key - the key
      Throws:
      RuntimeException - if the key is not contained
    • check

      public boolean check(DecoratedKey key)
      check if the given key is contained in any of the given ranges

      Must be called in sorted order - key should be increasing

      Parameters:
      key - the key
      Returns:
      boolean