Class AbstractFixedWidthWriter.BaseFixedWidthWriter
java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriter
org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriterImpl
org.apache.drill.exec.vector.accessor.writer.BaseScalarWriter
org.apache.drill.exec.vector.accessor.writer.AbstractFixedWidthWriter
org.apache.drill.exec.vector.accessor.writer.AbstractFixedWidthWriter.BaseFixedWidthWriter
- All Implemented Interfaces:
ColumnWriter
,ScalarWriter
,ValueWriter
,WriterEvents
,WriterPosition
- Direct Known Subclasses:
AbstractFixedWidthWriter.BaseIntWriter
,ColumnAccessors.BigIntColumnWriter
,ColumnAccessors.DateColumnWriter
,ColumnAccessors.Decimal18ColumnWriter
,ColumnAccessors.Decimal28SparseColumnWriter
,ColumnAccessors.Decimal38SparseColumnWriter
,ColumnAccessors.Decimal9ColumnWriter
,ColumnAccessors.Float4ColumnWriter
,ColumnAccessors.Float8ColumnWriter
,ColumnAccessors.IntervalColumnWriter
,ColumnAccessors.IntervalDayColumnWriter
,ColumnAccessors.IntervalYearColumnWriter
,ColumnAccessors.TimeColumnWriter
,ColumnAccessors.TimeStampColumnWriter
,ColumnAccessors.UInt4ColumnWriter
,ColumnAccessors.UInt8ColumnWriter
- Enclosing class:
- AbstractFixedWidthWriter
public abstract static class AbstractFixedWidthWriter.BaseFixedWidthWriter
extends AbstractFixedWidthWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractFixedWidthWriter
AbstractFixedWidthWriter.BaseFixedWidthWriter, AbstractFixedWidthWriter.BaseIntWriter
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriterImpl
AbstractScalarWriterImpl.ScalarObjectWriter
Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.writer.WriterEvents
WriterEvents.ColumnWriterListener, WriterEvents.State
-
Field Summary
Fields inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractFixedWidthWriter
lastWriteIndex
Fields inherited from class org.apache.drill.exec.vector.accessor.writer.BaseScalarWriter
capacity, drillBuf, emptyValue, listener, MIN_BUFFER_SIZE
Fields inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriterImpl
schema, vectorIndex
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
fillEmpties
(int writeIndex) Fill empties.protected final int
Determine the write index, growing, overflowing and back-filling the vector as needed.protected final int
prepareWrite
(int writeIndex) Methods inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractFixedWidthWriter
dump, endWrite, lastWriteIndex, mandatoryResize, postRollover, preRollover, resize, restartRow, setBuffer, setLastWriteIndex, setValueCount, skipNulls, startWrite, width
Methods inherited from class org.apache.drill.exec.vector.accessor.writer.BaseScalarWriter
appendBytes, bindListener, bindSchema, canExpand, nullable, overflowed, realloc, setBoolean, setBytes, setDate, setDecimal, setDouble, setFloat, setInt, setLong, setNull, setPeriod, setString, setTime, setTimestamp
Methods inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriterImpl
bindIndex, endArrayValue, isProjected, rowStartIndex, saveRow, schema, startRow, type, vector, writeIndex
Methods inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriter
conversionError, extendedType, setObject, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.vector.accessor.ColumnWriter
copy
Methods inherited from interface org.apache.drill.exec.vector.accessor.ScalarWriter
setDefaultValue, valueType
Methods inherited from interface org.apache.drill.exec.vector.accessor.ValueWriter
setValue
-
Constructor Details
-
BaseFixedWidthWriter
public BaseFixedWidthWriter()
-
-
Method Details
-
prepareWrite
protected final int prepareWrite()Determine the write index, growing, overflowing and back-filling the vector as needed.This is a bit tricky. This method has side effects, by design. The current vector buffer, and buffer address, will change in this method when a vector grows or overflows. So, don't use this method in inline calls of the form
vector.getBuffer().doSomething(prepareWrite());
The buffer obtained by getBuffer() can be different than the current buffer after prepareWrite().- Returns:
- the index at which to write the current value
-
prepareWrite
protected final int prepareWrite(int writeIndex) -
fillEmpties
protected final void fillEmpties(int writeIndex) Fill empties. This is required because the allocated memory is not zero-filled. Also allows filling a non-nullable vector with a defined default value.- Specified by:
fillEmpties
in classAbstractFixedWidthWriter
-