Class MNodeCollector<T>
- java.lang.Object
-
- org.apache.iotdb.db.metadata.mtree.traverser.Traverser
-
- org.apache.iotdb.db.metadata.mtree.traverser.collector.CollectorTraverser<T>
-
- org.apache.iotdb.db.metadata.mtree.traverser.collector.MNodeCollector<T>
-
- Direct Known Subclasses:
MNodeAboveSGCollector
public abstract class MNodeCollector<T> extends CollectorTraverser<T>
This class defines any node in MTree as potential target node. On finding a path matching the given pattern, if a level is specified and the path is longer than the specified level, MNodeLevelCounter finds the node of the specified level on the path and process it. The same node will not be processed more than once. If a level is not given, the current node is processed.
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalSchemaProcessor.StorageGroupFilterstorageGroupFilterprotected inttargetLevel-
Fields inherited from class org.apache.iotdb.db.metadata.mtree.traverser.collector.CollectorTraverser
count, curOffset, hasLimit, limit, offset, resultSet
-
Fields inherited from class org.apache.iotdb.db.metadata.mtree.traverser.Traverser
isInTemplate, isPrefixMatch, isPrefixStart, nodes, shouldTraverseTemplate, startIndex, startLevel, startNode, store, templateMap, traverseContext
-
-
Constructor Summary
Constructors Constructor Description MNodeCollector(IMNode startNode, org.apache.iotdb.commons.path.PartialPath path, IMTreeStore store)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanprocessFullMatchedMNode(IMNode node, int idx, int level)full match: root.sg.d full match root.sg.**(pattern)protected booleanprocessInternalMatchedMNode(IMNode node, int idx, int level)internal match: root.sg internal match root.sg.**(pattern)voidsetStorageGroupFilter(LocalSchemaProcessor.StorageGroupFilter storageGroupFilter)voidsetTargetLevel(int targetLevel)protected abstract voidtransferToResult(IMNode node)protected voidtraverse(IMNode node, int idx, int level)extends traversal with limit restriction-
Methods inherited from class org.apache.iotdb.db.metadata.mtree.traverser.collector.CollectorTraverser
getCurOffset, getResult, setLimit, setOffset, setResultSet
-
Methods inherited from class org.apache.iotdb.db.metadata.mtree.traverser.Traverser
getCurrentPartialPath, getCurrentPathNodes, getStorageGroupNodeInTraversePath, getUpperTemplate, processMultiLevelWildcard, processNameMatch, processOneLevelWildcard, setPrefixMatch, setTemplateMap, traverse
-
-
-
-
Field Detail
-
storageGroupFilter
protected LocalSchemaProcessor.StorageGroupFilter storageGroupFilter
-
targetLevel
protected int targetLevel
-
-
Constructor Detail
-
MNodeCollector
public MNodeCollector(IMNode startNode, org.apache.iotdb.commons.path.PartialPath path, IMTreeStore store) throws org.apache.iotdb.commons.exception.MetadataException
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
-
Method Detail
-
traverse
protected void traverse(IMNode node, int idx, int level) throws org.apache.iotdb.commons.exception.MetadataException
Description copied from class:CollectorTraverserextends traversal with limit restriction- Overrides:
traversein classCollectorTraverser<T>- Parameters:
node- current node that match the targetName in given pathidx- the index of targetName in given pathlevel- the level of current node in MTree- Throws:
org.apache.iotdb.commons.exception.MetadataException- some result process may throw MetadataException
-
processInternalMatchedMNode
protected boolean processInternalMatchedMNode(IMNode node, int idx, int level)
Description copied from class:Traverserinternal match: root.sg internal match root.sg.**(pattern)- Specified by:
processInternalMatchedMNodein classTraverser- Returns:
- whether this branch of recursive traversal should stop; if true, stop
-
processFullMatchedMNode
protected boolean processFullMatchedMNode(IMNode node, int idx, int level)
Description copied from class:Traverserfull match: root.sg.d full match root.sg.**(pattern)- Specified by:
processFullMatchedMNodein classTraverser- Returns:
- whether this branch of recursive traversal should stop; if true, stop
-
transferToResult
protected abstract void transferToResult(IMNode node)
-
setStorageGroupFilter
public void setStorageGroupFilter(LocalSchemaProcessor.StorageGroupFilter storageGroupFilter)
-
setTargetLevel
public void setTargetLevel(int targetLevel)
-
-