Class 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.
    • 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: CollectorTraverser
        extends traversal with limit restriction
        Overrides:
        traverse in class CollectorTraverser<T>
        Parameters:
        node - current node that match the targetName in given path
        idx - the index of targetName in given path
        level - 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: Traverser
        internal match: root.sg internal match root.sg.**(pattern)
        Specified by:
        processInternalMatchedMNode in class Traverser
        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: Traverser
        full match: root.sg.d full match root.sg.**(pattern)
        Specified by:
        processFullMatchedMNode in class Traverser
        Returns:
        whether this branch of recursive traversal should stop; if true, stop
      • transferToResult

        protected abstract void transferToResult​(IMNode node)
      • setTargetLevel

        public void setTargetLevel​(int targetLevel)