Interface RowDecoder
- All Known Implementing Classes:
BinaryRowDecoder
,TextRowDecoder
public interface RowDecoder
Row decoder interface
-
Method Summary
Modifier and TypeMethodDescription<T> T
decode
(Codec<T> codec, Calendar calendar, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) Decode data according to data type.boolean
decodeBoolean
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to boolean.byte
decodeByte
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to byte.decodeDate
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Date.double
decodeDouble
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to double.float
decodeFloat
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to float.int
decodeInt
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to int.long
decodeLong
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to long.short
decodeShort
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to short.decodeString
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to String.decodeTime
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Time.decodeTimestamp
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Timestamp.defaultDecode
(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to data type.int
setPosition
(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList) Position the read index on buffer to data at indicated index.boolean
wasNull
(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength) Indicate if last decoded value was null
-
Method Details
-
wasNull
Indicate if last decoded value was null- Parameters:
nullBitmap
- null bitmapfieldIndex
- field indexfieldLength
- field length- Returns:
- true if last value was null
-
setPosition
int setPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList) Position the read index on buffer to data at indicated index.- Parameters:
newIndex
- new data indexfieldIndex
- current field indexmaxIndex
- maximum indexrowBuf
- row buffernullBitmap
- null bitmapmetadataList
- metadata list- Returns:
- new index to read data
-
decode
<T> T decode(Codec<T> codec, Calendar calendar, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws SQLException Decode data according to data type.- Type Parameters:
T
- Codec default return type- Parameters:
codec
- current codeccalendar
- calendarrowBuf
- row bufferfieldLength
- field lengthmetadataList
- metadatasfieldIndex
- field indexcontext
- connection context- Returns:
- default object according to metadata
- Throws:
SQLException
- if any decoding error occurs
-
defaultDecode
Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Decode data according to data type.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if any decoding error occurs
-
decodeByte
byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to byte.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to byte value
-
decodeBoolean
boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to boolean.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to boolean value
-
decodeDate
Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Decode data according to Date.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendar- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Date value
-
decodeTime
Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Decode data according to Time.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Time value
-
decodeTimestamp
Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Decode data according to Timestamp.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to Timestamp value
-
decodeShort
short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to short.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to short value
-
decodeInt
int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to int.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to int value
-
decodeString
String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Decode data according to String.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection Context- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to String value
-
decodeLong
long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to long.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to long value
-
decodeFloat
float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to float.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to float value
-
decodeDouble
double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Decode data according to double.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
SQLException
- if data type cannot be decoded to double value
-