Class MergingRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<MergingReceiverPOP>
org.apache.drill.exec.physical.impl.mergereceiver.MergingRecordBatch
- All Implemented Interfaces:
AutoCloseable,Iterable<VectorWrapper<?>>,CloseableRecordBatch,RecordBatch,VectorAccessible
public class MergingRecordBatch
extends AbstractRecordBatch<MergingReceiverPOP>
implements RecordBatch
Merges pre-sorted record batches from remote senders.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumclassA Node contains a reference to a single value in a specific incoming batch.Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchStateNested 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, oContext, popConfig, state, stats, unionTypeEnabledFields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionMergingRecordBatch(ExchangeFragmentContext context, MergingReceiverPOP config, RawFragmentBatchProvider[] fragProviders) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcancel()Informs child operators that no more data is needed.protected voidvoidclose()voiddump()Perform dump of this batch's state to logs.Gets the FragmentContext of the current query fragment.intGet the number of records.Gets the current schema of this record batch.Methods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
checkContinue, getContainer, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.drill.exec.record.RecordBatch
getContainer, getOutgoingContainer, getValueAccessorById, getValueVectorId, getWritableBatch, nextMethods inherited from interface org.apache.drill.exec.record.VectorAccessible
getSelectionVector2, getSelectionVector4
-
Constructor Details
-
MergingRecordBatch
public MergingRecordBatch(ExchangeFragmentContext context, MergingReceiverPOP config, RawFragmentBatchProvider[] fragProviders) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
-
Method Details
-
innerNext
- Specified by:
innerNextin classAbstractRecordBatch<MergingReceiverPOP>
-
getContext
Description copied from interface:RecordBatchGets the FragmentContext of the current query fragment. Useful for reporting failure information or other query-level information.- Specified by:
getContextin interfaceRecordBatch- Overrides:
getContextin classAbstractRecordBatch<MergingReceiverPOP>
-
getSchema
Description copied from interface:RecordBatchGets 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_SCHEMAorRecordBatch.IterOutcome.OK.The schema changes when and only when
RecordBatch.next()returnsRecordBatch.IterOutcome.OK_NEW_SCHEMA.- Specified by:
getSchemain interfaceRecordBatch- Specified by:
getSchemain interfaceVectorAccessible- Overrides:
getSchemain classAbstractRecordBatch<MergingReceiverPOP>- Returns:
- schema of the current batch
-
buildSchema
public void buildSchema()- Overrides:
buildSchemain classAbstractRecordBatch<MergingReceiverPOP>
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessibleGet the number of records.- Specified by:
getRecordCountin interfaceVectorAccessible- Returns:
- number of records
-
cancel
public void cancel()Description copied from interface:RecordBatchInforms child operators that no more data is needed. Only called for "normal" cancellation to avoid unnecessary compute in any worker threads. For the error case, the fragment executor will call close() on each child automatically.The operator which triggers the cancel MUST send a
NONEstatus downstream, or throw an exception. It is not legal to callnext()on an operator after calling itscancel()method.- Specified by:
cancelin interfaceRecordBatch- Overrides:
cancelin classAbstractRecordBatch<MergingReceiverPOP>
-
cancelIncoming
protected void cancelIncoming()- Specified by:
cancelIncomingin classAbstractRecordBatch<MergingReceiverPOP>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractRecordBatch<MergingReceiverPOP>
-
dump
public void dump()Description copied from interface:RecordBatchPerform dump of this batch's state to logs.- Specified by:
dumpin interfaceRecordBatch
-