public abstract class RelationalNode extends Object implements Cloneable, BatchCollector.BatchProducer
Modifier and Type | Field and Description |
---|---|
protected int |
childCount |
Modifier | Constructor and Description |
---|---|
protected |
RelationalNode() |
|
RelationalNode(int nodeID) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBatchRow(List<?> row) |
void |
addChild(RelationalNode child) |
abstract Object |
clone()
All the implementation of Cloneable interface need to implement clone() method.
|
void |
close() |
void |
closeDirect() |
protected void |
copyTo(RelationalNode target) |
static Map<Expression,Integer> |
createLookupMap(List<? extends Expression> elements)
Useful function to build an element lookup map from an element list.
|
protected int |
getBatchSize() |
TupleBuffer |
getBuffer(int maxRows)
return the final tuple buffer or null if not available
|
protected TupleBuffer |
getBufferDirect(int maxRows)
For subclasses to override if they wish to return a buffer rather than batches.
|
protected BufferManager |
getBufferManager() |
int |
getChildCount() |
RelationalNode[] |
getChildren() |
protected String |
getClassName()
Helper for the toString to get the class name from the full class name.
|
protected String |
getConnectionID() |
CommandContext |
getContext() |
protected ProcessorDataManager |
getDataManager() |
PlanNode |
getDescriptionProperties() |
List<? extends Expression> |
getElements() |
Number |
getEstimateNodeCardinality() |
int |
getID() |
RelationalNodeStatistics |
getNodeStatistics() |
protected void |
getNodeString(StringBuffer str) |
List<? extends Expression> |
getOutputElements()
Get list of resolved elements describing output columns for this plan.
|
RelationalNode |
getParent() |
static int[] |
getProjectionIndexes(Map<? extends Expression,Integer> tupleElements,
List<? extends Expression> projectElements)
Helper method for all the node that will filter the elements needed for the next node.
|
boolean |
hasBuffer()
Return true if the node provides a final buffer via getBuffer
|
protected boolean |
hasPendingRows() |
void |
initialize(CommandContext context,
BufferManager bufferManager,
ProcessorDataManager dataMgr) |
protected boolean |
isBatchFull() |
boolean |
isClosed()
Check if the node has been already closed
|
boolean |
isLastBatch() |
TupleBatch |
nextBatch()
Wrapper for nextBatchDirect that does performance timing - callers
should always call this rather than nextBatchDirect().
|
protected abstract TupleBatch |
nextBatchDirect()
Template method for subclasses to implement.
|
String |
nodeToString()
Just print single node to string instead of node+recursive plan.
|
void |
open() |
static <T> List<T> |
projectTuple(int[] indexes,
List<T> tupleValues) |
static <T> List<T> |
projectTuple(int[] indexes,
List<T> tupleValues,
boolean omitMissing) |
protected TupleBatch |
pullBatch() |
Boolean |
requiresTransaction(boolean transactionalReads) |
void |
reset() |
void |
setContext(CommandContext context) |
void |
setElements(List<? extends Expression> elements) |
void |
setEstimateDepAccessCardinality(Number depAccessEstimate) |
void |
setEstimateDepJoinCost(Number estimateDepJoinCost) |
void |
setEstimateJoinCost(Number estimateJoinCost) |
void |
setEstimateNodeCardinality(Number estimateNodeCardinality) |
void |
setEstimateNodeSetSize(Number setSizeEstimate) |
void |
setID(int nodeID) |
void |
setParent(RelationalNode parent) |
protected void |
terminateBatches() |
String |
toString()
Print plantree structure starting at this node
|
static void |
unwrapException(TeiidRuntimeException e) |
protected RelationalNode()
public RelationalNode(int nodeID)
public int getChildCount()
public boolean isLastBatch()
public void setContext(CommandContext context)
public void initialize(CommandContext context, BufferManager bufferManager, ProcessorDataManager dataMgr)
public CommandContext getContext()
public int getID()
public void setID(int nodeID)
protected BufferManager getBufferManager()
protected ProcessorDataManager getDataManager()
protected String getConnectionID()
protected int getBatchSize()
public void reset()
public void setElements(List<? extends Expression> elements)
public List<? extends Expression> getOutputElements()
BatchCollector.BatchProducer
getOutputElements
in interface BatchCollector.BatchProducer
public List<? extends Expression> getElements()
public RelationalNode getParent()
public void setParent(RelationalNode parent)
public RelationalNode[] getChildren()
public void addChild(RelationalNode child)
protected void addBatchRow(List<?> row)
protected void terminateBatches()
protected boolean isBatchFull()
protected boolean hasPendingRows()
protected TupleBatch pullBatch()
public void open() throws TeiidComponentException, TeiidProcessingException
public final TupleBatch nextBatch() throws BlockedException, TeiidComponentException, TeiidProcessingException
nextBatch
in interface BatchCollector.BatchProducer
BlockedException
TeiidComponentException
TeiidProcessingException
- for business rule exception, related
to user input or modelingprotected abstract TupleBatch nextBatchDirect() throws BlockedException, TeiidComponentException, TeiidProcessingException
BlockedException
TeiidComponentException
TeiidProcessingException
- if exception related to user input occuredpublic final void close() throws TeiidComponentException
close
in interface BatchCollector.BatchProducer
TeiidComponentException
public void closeDirect()
public boolean isClosed()
public static int[] getProjectionIndexes(Map<? extends Expression,Integer> tupleElements, List<? extends Expression> projectElements)
public static <T> List<T> projectTuple(int[] indexes, List<T> tupleValues, boolean omitMissing)
public static Map<Expression,Integer> createLookupMap(List<? extends Expression> elements)
elements
- List of elementspublic String toString()
public String nodeToString()
protected void getNodeString(StringBuffer str)
protected String getClassName()
public abstract Object clone()
protected void copyTo(RelationalNode target)
public PlanNode getDescriptionProperties()
public RelationalNodeStatistics getNodeStatistics()
public void setEstimateNodeCardinality(Number estimateNodeCardinality)
public void setEstimateNodeSetSize(Number setSizeEstimate)
public void setEstimateDepAccessCardinality(Number depAccessEstimate)
public void setEstimateDepJoinCost(Number estimateDepJoinCost)
public void setEstimateJoinCost(Number estimateJoinCost)
public Number getEstimateNodeCardinality()
public boolean hasBuffer()
hasBuffer
in interface BatchCollector.BatchProducer
public final TupleBuffer getBuffer(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException
getBuffer
in interface BatchCollector.BatchProducer
TeiidProcessingException
TeiidComponentException
BlockedException
protected TupleBuffer getBufferDirect(int maxRows) throws BlockedException, TeiidComponentException, TeiidProcessingException
maxRows
- BlockedException
TeiidComponentException
TeiidProcessingException
public static void unwrapException(TeiidRuntimeException e) throws TeiidComponentException, TeiidProcessingException
public Boolean requiresTransaction(boolean transactionalReads)
transactionalReads
- Copyright © 2020. All rights reserved.