Class ByteRowKeyComparator

  • All Implemented Interfaces:
    Comparator<byte[]>

    public class ByteRowKeyComparator
    extends Object
    implements Comparator<byte[]>
    Comparator for byte arrays from RowKey.key instances. Comparison logic in this class is very similar to FrameComparisonWidget, but is different because it works on byte[] instead of Frames.
    • Method Detail

      • computeFirstFieldPosition

        public static int computeFirstFieldPosition​(int fieldCount)
        Compute the offset into each key where the first field starts. Public so FrameComparisonWidgetImpl can use it.
      • computeAscDescRunLengths

        public static int[] computeAscDescRunLengths​(List<KeyColumn> keyColumns)
        Given a list of sort columns, compute an array of the number of ascending fields in a run, followed by number of descending fields in a run, followed by ascending, etc. For example: ASC, ASC, DESC, ASC would return [2, 1, 1] and DESC, DESC, ASC would return [0, 2, 1]. Public so FrameComparisonWidgetImpl can use it.
      • compare

        public int compare​(byte[] keyArray1,
                           byte[] keyArray2)
        Specified by:
        compare in interface Comparator<byte[]>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object