Class RowKeyReader

java.lang.Object
org.apache.druid.frame.key.RowKeyReader

public class RowKeyReader extends Object
Embeds the logic to read RowKey from a particular signature of row-based frame. Stateless and immutable.
  • Method Details

    • create

      public static RowKeyReader create(RowSignature signature, FrameType frameType)
      Creates a new RowKeyReader.
    • read

      public Object read(RowKey key, int fieldNumber)
      Read a value out of a key. This operation is potentially costly and should not be done for every row. Implementations need not be optimized, and may do more work than strictly necessary in order to keep implementation simple.
    • read

      public List<Object> read(RowKey key)
      Read all values out of a key, as a list of objects. This operation is potentially costly and should not be done for every row. Implementations need not be optimized, and may do more work than strictly necessary in order to keep implementation simple.
    • hasMultipleValues

      public boolean hasMultipleValues(RowKey key, int fieldNumber)
      Determine if a particular field of a particular key has multiple values. Faster than calling read(RowKey, int).
    • trimmedKeyReader

      public RowKeyReader trimmedKeyReader(int trimmedFieldCount)
      Trims the key reader to a particular fieldCount. Used to read keys trimmed by trim(RowKey, int).
    • trim

      public RowKey trim(RowKey key, int trimmedFieldCount)
      Trim a key to a particular fieldCount. The returned key may be a copy, but is not guaranteed to be.
    • fieldEndPosition

      public static int fieldEndPosition(byte[] keyBytes, int fieldNumber)