Class Verifier.RangeOwnHelper

  • Enclosing class:
    Verifier

    public static class Verifier.RangeOwnHelper
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      RangeOwnHelper​(java.util.List<Range<Token>> normalizedRanges)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RangeOwnHelper

        public RangeOwnHelper​(java.util.List<Range<Token>> normalizedRanges)
    • Method Detail

      • 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:
        java.lang.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