Package io.trino.plugin.kafka.encoder
Class AbstractRowEncoder
- java.lang.Object
-
- io.trino.plugin.kafka.encoder.AbstractRowEncoder
-
- All Implemented Interfaces:
RowEncoder,Closeable,AutoCloseable
- Direct Known Subclasses:
AvroRowEncoder,CsvRowEncoder,JsonRowEncoder,RawRowEncoder
public abstract class AbstractRowEncoder extends Object implements RowEncoder
-
-
Field Summary
Fields Modifier and Type Field Description protected List<EncoderColumnHandle>columnHandlesprotected intcurrentColumnIndexThe current column index for appending values to the row encoder.protected ConnectorSessionsession
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRowEncoder(ConnectorSession session, List<EncoderColumnHandle> columnHandles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendArray(List<Object> value)protected voidappendBoolean(boolean value)protected voidappendByte(byte value)protected voidappendByteBuffer(ByteBuffer value)voidappendColumnValue(Block block, int position)Adds the value from the given block/position to the row being encodedprotected voidappendDouble(double value)protected voidappendFloat(float value)protected voidappendInt(int value)protected voidappendLong(long value)protected voidappendMap(Map<Object,Object> value)protected voidappendNullValue()protected voidappendRow(List<Object> value)protected voidappendShort(short value)protected voidappendSqlDate(SqlDate value)protected voidappendSqlTime(SqlTime value)protected voidappendSqlTimestamp(SqlTimestamp value)protected voidappendSqlTimestampWithTimeZone(SqlTimestampWithTimeZone value)protected voidappendSqlTimeWithTimeZone(SqlTimeWithTimeZone value)protected voidappendString(String value)voidclose()protected voidresetColumnIndex()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.trino.plugin.kafka.encoder.RowEncoder
toByteArray
-
-
-
-
Field Detail
-
session
protected final ConnectorSession session
-
columnHandles
protected final List<EncoderColumnHandle> columnHandles
-
currentColumnIndex
protected int currentColumnIndex
The current column index for appending values to the row encoder. Gets incremented by appendColumnValue and set back to zero when the encoder is reset.
-
-
Constructor Detail
-
AbstractRowEncoder
protected AbstractRowEncoder(ConnectorSession session, List<EncoderColumnHandle> columnHandles)
-
-
Method Detail
-
appendColumnValue
public void appendColumnValue(Block block, int position)
Description copied from interface:RowEncoderAdds the value from the given block/position to the row being encoded- Specified by:
appendColumnValuein interfaceRowEncoder
-
appendNullValue
protected void appendNullValue()
-
appendLong
protected void appendLong(long value)
-
appendInt
protected void appendInt(int value)
-
appendShort
protected void appendShort(short value)
-
appendByte
protected void appendByte(byte value)
-
appendDouble
protected void appendDouble(double value)
-
appendFloat
protected void appendFloat(float value)
-
appendBoolean
protected void appendBoolean(boolean value)
-
appendString
protected void appendString(String value)
-
appendByteBuffer
protected void appendByteBuffer(ByteBuffer value)
-
appendSqlDate
protected void appendSqlDate(SqlDate value)
-
appendSqlTime
protected void appendSqlTime(SqlTime value)
-
appendSqlTimeWithTimeZone
protected void appendSqlTimeWithTimeZone(SqlTimeWithTimeZone value)
-
appendSqlTimestamp
protected void appendSqlTimestamp(SqlTimestamp value)
-
appendSqlTimestampWithTimeZone
protected void appendSqlTimestampWithTimeZone(SqlTimestampWithTimeZone value)
-
resetColumnIndex
protected void resetColumnIndex()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-