public ISchemaReader<IDeviceSchemaInfo> getTableDeviceReader(
      final PartialPath pattern, final BiFunction<Integer, String, Binary> attributeProvider)
      throws MetadataException {

    final EntityCollector<IDeviceSchemaInfo, IMemMNode> collector =
        new EntityCollector<IDeviceSchemaInfo, IMemMNode>(rootNode, pattern, store, false, null) {
          @Override
          protected boolean acceptFullMatchedNode(final IMemMNode node) {
            return node.isDevice() && !node.getAsDeviceMNode().isPreDeactivateSelfOrTemplate();
          }

          @Override
          protected IDeviceSchemaInfo collectEntity(final IDeviceMNode<IMemMNode> node) {
            final ShowDevicesResult result =
                new ShowDevicesResult(
                    null,
                    node.isAlignedNullable(),
                    node.getSchemaTemplateId(),
                    node.getPartialPath().getNodes());
            result.setAttributeProvider(
                k ->
                    attributeProvider.apply(
                        ((TableDeviceInfo<IMemMNode>) node.getDeviceInfo()).getAttributePointer(),
                        k));
            return result;
          }
        };
    return new ISchemaReader<IDeviceSchemaInfo>() {

      @Override
      public boolean isSuccess() {
        return collector.isSuccess();
      }

      @Override
      public Throwable getFailure() {
        return collector.getFailure();
      }

      @Override
      public void close() {
        collector.close();
      }

      @Override
      public ListenableFuture<?> isBlocked() {
        return NOT_BLOCKED;
      }

      @Override
      public boolean hasNext() {
        return collector.hasNext();
      }

      @Override
      public IDeviceSchemaInfo next() {
        return collector.next();
      }
    };
  }
Get node by the path

@return last node in given seriesPath
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java