Package com.illumon.iris.binarystore
Class BinaryRowV2
java.lang.Object
com.illumon.iris.binarystore.BinaryRowV2
- All Implemented Interfaces:
Row
public class BinaryRowV2 extends Object implements Row
This class implements row writing for the V2 binary log format.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BinaryRowV2.BinaryStoreRowSetter<T>
class
BinaryRowV2.FlagSetter
-
Field Summary
Fields Modifier and Type Field Description protected ByteBuffer
dataBuffer
protected Map<String,BinaryRowV2.BinaryStoreRowSetter>
setters
protected BinaryStoreWriterV2
writer
-
Constructor Summary
Constructors Constructor Description BinaryRowV2(BinaryStoreWriterV2 writer, String[] columnNames, SupportedType[] columnTypes, Object[] typeMetadata)
-
Method Summary
Modifier and Type Method Description String
getColumnPartitionValue()
For rows that are to be used with file managers that allow dynamic column partition selection, retrieve the column partition value.BinaryRowV2.FlagSetter
getFlagSetter()
RowSetter
getSetter(String name)
Gets a setter for a column.ByteBuffer
populateBuffer()
Populate the internal data buffer with column values.void
reset()
Reset the internal buffer.void
setColumnPartitionValue(String columnPartitionValue)
For rows that are to be used with file managers that allow dynamic column partition selection, set the column partition value.void
setFlags(Row.Flags flags)
protected void
writeAndReset()
Write a row to the underlying stream and reset the internal buffer.void
writeRow()
Writes out a new row (values set using setters).
-
Field Details
-
Constructor Details
-
BinaryRowV2
public BinaryRowV2(BinaryStoreWriterV2 writer, String[] columnNames, SupportedType[] columnTypes, Object[] typeMetadata)
-
-
Method Details
-
getSetter
Description copied from interface:Row
Gets a setter for a column. -
populateBuffer
Populate the internal data buffer with column values. This assumes that all appropriate row setters have been called.- Returns:
- the data buffer just populated
- Throws:
IOException
-
writeRow
Description copied from interface:Row
Writes out a new row (values set using setters).- Specified by:
writeRow
in interfaceRow
- Throws:
IOException
- problem writing the row
-
writeAndReset
Write a row to the underlying stream and reset the internal buffer.populateBuffer()
must have been previously called.- Throws:
IOException
- if an error occurred during write.
-
reset
public void reset()Reset the internal buffer. Note that unless the buffer has been populated and written, the data is lost. -
setFlags
-
setColumnPartitionValue
Description copied from interface:Row
For rows that are to be used with file managers that allow dynamic column partition selection, set the column partition value.- Specified by:
setColumnPartitionValue
in interfaceRow
- Parameters:
columnPartitionValue
- the column partition value
-
getColumnPartitionValue
Description copied from interface:Row
For rows that are to be used with file managers that allow dynamic column partition selection, retrieve the column partition value.- Specified by:
getColumnPartitionValue
in interfaceRow
- Returns:
- the previously-set column partition value
-
getFlagSetter
-