Class WriterRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<Writer>
org.apache.drill.exec.physical.impl.WriterRecordBatch
- All Implemented Interfaces:
AutoCloseable
,Iterable<VectorWrapper<?>>
,CloseableRecordBatch
,RecordBatch
,VectorAccessible
- Direct Known Subclasses:
InsertWriterRecordBatch
Write the RecordBatch to the given RecordWriter.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchState
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
-
Field Summary
Fields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabled
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionWriterRecordBatch
(Writer writer, RecordBatch incoming, FragmentContext context, RecordWriter recordWriter) -
Method Summary
Methods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
buildSchema, cancel, checkContinue, getContainer, getContext, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
counter
protected long counter
-
-
Constructor Details
-
WriterRecordBatch
public WriterRecordBatch(Writer writer, RecordBatch incoming, FragmentContext context, RecordWriter recordWriter) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
-
Method Details
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessible
Get the number of records.- Returns:
- number of records
-
cancelIncoming
protected void cancelIncoming()- Specified by:
cancelIncoming
in classAbstractRecordBatch<Writer>
-
getSchema
Description copied from interface:RecordBatch
Gets the current schema of this record batch.May be called only when the most recent call to
RecordBatch.next()
, if any, returnedRecordBatch.IterOutcome.OK_NEW_SCHEMA
orRecordBatch.IterOutcome.OK
.The schema changes when and only when
RecordBatch.next()
returnsRecordBatch.IterOutcome.OK_NEW_SCHEMA
.- Specified by:
getSchema
in interfaceRecordBatch
- Specified by:
getSchema
in interfaceVectorAccessible
- Overrides:
getSchema
in classAbstractRecordBatch<Writer>
- Returns:
- schema of the current batch
-
innerNext
- Specified by:
innerNext
in classAbstractRecordBatch<Writer>
-
addOutputContainerData
protected void addOutputContainerData() -
setupNewSchema
protected void setupNewSchema() -
addOutputSchema
protected void addOutputSchema() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractRecordBatch<Writer>
-
dump
public void dump()Description copied from interface:RecordBatch
Perform dump of this batch's state to logs.
-