Class MNodeLevelCounter

  • Direct Known Subclasses:
    MNodeAboveSGLevelCounter

    public class MNodeLevelCounter
    extends CounterTraverser
    This Traverser implements node count function. On finding a path matching the given pattern, if the path is longer than the specified level, MNodeLevelCounter finds the node of the specified level on the path and counts it. The same node will not be counted more than once.
    • Field Detail

      • targetLevel

        protected int targetLevel
    • Constructor Detail

      • MNodeLevelCounter

        public MNodeLevelCounter​(IMNode startNode,
                                 org.apache.iotdb.commons.path.PartialPath path,
                                 IMTreeStore store,
                                 int targetLevel)
                          throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
    • Method Detail

      • 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