Package edu.caltech.nanodb.plannodes
Class SimpleFilterNode
- java.lang.Object
-
- edu.caltech.nanodb.plannodes.PlanNode
-
- edu.caltech.nanodb.plannodes.SelectNode
-
- edu.caltech.nanodb.plannodes.SimpleFilterNode
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SimpleFilterNode extends SelectNode
This select plan node implements a simple filter of a subplan based on a predicate.
-
-
Field Summary
-
Fields inherited from class edu.caltech.nanodb.plannodes.SelectNode
currentTuple, predicate
-
Fields inherited from class edu.caltech.nanodb.plannodes.PlanNode
cost, environment, leftChild, rightChild, schema, stats
-
-
Constructor Summary
Constructors Constructor Description SimpleFilterNode(PlanNode child, Expression predicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
advanceCurrentTuple()
Helper function that advances the current tuple reference in the node.void
cleanUp()
Perform any necessary clean up tasks.protected PlanNode
clone()
Creates a copy of this simple filter node node and its subtree.boolean
equals(java.lang.Object obj)
Returns true if the passed-in object is a SimpleFilterNode with the same predicate and child sub-expression.int
hashCode()
Computes the hashcode of a PlanNode.void
initialize()
Do initialization for the select operation.void
markCurrentPosition()
The simple filter node relies on marking/reset support in its subplan.void
prepare()
This method is responsible for computing critical details about the plan node, such as the schema of the results that are produced, the estimated cost of evaluating the plan node (and its children), and statistics describing the results produced by the plan node.boolean
requiresLeftMarking()
The simple filter node doesn't require any marking from either child.boolean
requiresRightMarking()
The simple filter node doesn't require any marking from either child.void
resetToLastMark()
The simple filter node relies on marking/reset support in its subplan.java.util.List<OrderByExpression>
resultsOrderedBy()
This node's results are sorted if its subplan produces sorted results.boolean
supportsMarking()
This node supports marking if its subplan supports marking.java.lang.String
toString()
Reports this node and its vital parameters as a string.-
Methods inherited from class edu.caltech.nanodb.plannodes.SelectNode
getNextTuple, isTupleSelected
-
Methods inherited from class edu.caltech.nanodb.plannodes.PlanNode
addParentEnvironmentToPlanTree, duplicate, getCost, getEnvironment, getSchema, getStats, printNodeTree, printNodeTree, printNodeTree, printNodeTreeToString, printNodeTreeToString, setEnvironment
-
-
-
-
Constructor Detail
-
SimpleFilterNode
public SimpleFilterNode(PlanNode child, Expression predicate)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Returns true if the passed-in object is a SimpleFilterNode with the same predicate and child sub-expression.
-
hashCode
public int hashCode()
Computes the hashcode of a PlanNode. This method is used to see if two plan nodes CAN be equal.
-
clone
protected PlanNode clone() throws java.lang.CloneNotSupportedException
Creates a copy of this simple filter node node and its subtree. This method is used byPlanNode.duplicate()
to copy a plan tree.- Overrides:
clone
in classSelectNode
- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
Description copied from class:PlanNode
Reports this node and its vital parameters as a string.
-
resultsOrderedBy
public java.util.List<OrderByExpression> resultsOrderedBy()
This node's results are sorted if its subplan produces sorted results.- Specified by:
resultsOrderedBy
in classPlanNode
- Returns:
- If the plan node produces ordered results, this will be a list of objects specifying the ordering. If the node doesn't produce ordered results then the return-value will either be an empty list or it will be null.
-
supportsMarking
public boolean supportsMarking()
This node supports marking if its subplan supports marking.- Overrides:
supportsMarking
in classPlanNode
- Returns:
- true if the node supports position marking, false otherwise.
-
requiresLeftMarking
public boolean requiresLeftMarking()
The simple filter node doesn't require any marking from either child.- Overrides:
requiresLeftMarking
in classPlanNode
- Returns:
- true if the node requires that its left child supports marking, false otherwise.
-
requiresRightMarking
public boolean requiresRightMarking()
The simple filter node doesn't require any marking from either child.- Overrides:
requiresRightMarking
in classPlanNode
- Returns:
- true if the node requires that its right child supports marking, false otherwise.
-
prepare
public void prepare()
Description copied from class:PlanNode
This method is responsible for computing critical details about the plan node, such as the schema of the results that are produced, the estimated cost of evaluating the plan node (and its children), and statistics describing the results produced by the plan node.
-
initialize
public void initialize()
Description copied from class:SelectNode
Do initialization for the select operation. Resets state variables.- Overrides:
initialize
in classSelectNode
-
cleanUp
public void cleanUp()
Description copied from class:PlanNode
Perform any necessary clean up tasks. This should probably be called when we are done with this plan node.
-
advanceCurrentTuple
protected void advanceCurrentTuple()
Description copied from class:SelectNode
Helper function that advances the current tuple reference in the node.- Specified by:
advanceCurrentTuple
in classSelectNode
-
markCurrentPosition
public void markCurrentPosition()
The simple filter node relies on marking/reset support in its subplan.- Overrides:
markCurrentPosition
in classPlanNode
-
resetToLastMark
public void resetToLastMark()
The simple filter node relies on marking/reset support in its subplan.- Overrides:
resetToLastMark
in classPlanNode
-
-