Package org.apache.druid.frame.key
Class RowKeyReader
- java.lang.Object
-
- org.apache.druid.frame.key.RowKeyReader
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RowKeyReader
create(RowSignature signature)
Creates a newRowKeyReader
.static int
fieldEndPosition(byte[] keyBytes, int fieldNumber)
boolean
hasMultipleValues(RowKey key, int fieldNumber)
Determine if a particular field of a particular key has multiple values.List<Object>
read(RowKey key)
Read all values out of a key, as a list of objects.Object
read(RowKey key, int fieldNumber)
Read a value out of a key.RowKey
trim(RowKey key, int trimmedFieldCount)
Trim a key to a particular fieldCount.RowKeyReader
trimmedKeyReader(int trimmedFieldCount)
Trims the key reader to a particular fieldCount.
-
-
-
Method Detail
-
create
public static RowKeyReader create(RowSignature signature)
Creates a newRowKeyReader
.
-
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 callingread(RowKey, int)
.
-
trimmedKeyReader
public RowKeyReader trimmedKeyReader(int trimmedFieldCount)
Trims the key reader to a particular fieldCount. Used to read keys trimmed bytrim(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)
-
-