This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch for_tsbs
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3b44b8f8e6c8301022d44415b2e382367d2ce1fd
Merge: 44314b1511 2aa2228780
Author: Beyyes <[email protected]>
AuthorDate: Thu Apr 27 17:51:14 2023 +0800

    merge with master

 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |   43 +-
 .../org/apache/iotdb/db/qp/sql/PathParser.g4       |   14 +-
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  |    8 +-
 .../consensus/request/ConfigPhysicalPlan.java      |   10 +-
 .../consensus/request/ConfigPhysicalPlanType.java  |    3 +
 .../consensus/request/auth/AuthorPlan.java         |   29 +-
 ...lotListPlan.java => CountTimeSlotListPlan.java} |   52 +-
 .../read/partition/GetSeriesSlotListPlan.java      |   18 +-
 .../read/partition/GetTimeSlotListPlan.java        |   44 +-
 .../request/read/region/GetRegionIdPlan.java       |   46 +-
 .../write/template/ExtendSchemaTemplatePlan.java   |   58 +
 ...egionIdResp.java => CountTimeSlotListResp.java} |   19 +-
 .../response/partition/GetRegionIdResp.java        |    2 +-
 .../response/partition/GetSeriesSlotListResp.java  |    2 +-
 .../response/partition/GetTimeSlotListResp.java    |    2 +-
 .../confignode/manager/ClusterQuotaManager.java    |   18 +-
 .../confignode/manager/ClusterSchemaManager.java   |   88 +-
 .../iotdb/confignode/manager/ConfigManager.java    |   44 +-
 .../apache/iotdb/confignode/manager/IManager.java  |   40 +-
 .../confignode/manager/PermissionManager.java      |    3 +-
 .../manager/consensus/ConsensusManager.java        |   12 +-
 .../iotdb/confignode/manager/load/LoadManager.java |    8 +-
 .../manager/load/balancer/RouteBalancer.java       |   21 +-
 .../load/balancer/router/RegionRouteMap.java       |    5 +
 .../confignode/manager/load/cache/LoadCache.java   |   15 +-
 .../load/cache/region/RegionGroupCache.java        |    4 +
 .../manager/load/service/StatisticsService.java    |  115 +-
 .../load/subscriber/IClusterStatusSubscriber.java  |   19 +-
 .../manager/load/subscriber/RouteChangeEvent.java  |   74 +
 .../subscriber/StatisticsChangeEvent.java}         |   26 +-
 .../iotdb/confignode/manager/observer/IEvent.java  |   21 -
 .../manager/partition/PartitionManager.java        |   60 +-
 .../manager/pipe/PipePluginCoordinator.java        |    2 +-
 .../iotdb/confignode/persistence/AuthorInfo.java   |   34 +-
 .../persistence/executor/ConfigPlanExecutor.java   |    6 +
 .../partition/DatabasePartitionTable.java          |   23 +-
 .../persistence/partition/PartitionInfo.java       |  128 +-
 .../persistence/pipe/PipePluginInfo.java           |   37 +-
 .../confignode/persistence/quota/QuotaInfo.java    |   36 +-
 .../persistence/schema/ClusterSchemaInfo.java      |   12 +
 .../persistence/schema/TemplateTable.java          |   47 +
 .../impl/pipe/plugin/DropPipePluginProcedure.java  |    6 +-
 .../thrift/ConfigNodeRPCServiceProcessor.java      |   64 +-
 .../request/ConfigPhysicalPlanSerDeTest.java       |   27 +-
 .../confignode/persistence/AuthorInfoTest.java     |   30 +-
 .../iotdb/confignode/persistence/PipeInfoTest.java |    2 +-
 .../pipe/plugin/CreatePipePluginProcedureTest.java |    2 +-
 .../iotdb/consensus/ratis/SnapshotStorage.java     |    8 +-
 docs/UserGuide/Cluster/Cluster-Maintenance.md      |  176 +-
 docs/UserGuide/Operate-Metadata/Template.md        |   15 +-
 .../UserGuide/QuickStart/Command-Line-Interface.md |   49 +-
 docs/UserGuide/Reference/Common-Config-Manual.md   |   11 +-
 docs/zh/UserGuide/API/Programming-Go-Native-API.md |    1 +
 docs/zh/UserGuide/Cluster/Cluster-Maintenance.md   |  177 +-
 docs/zh/UserGuide/Operate-Metadata/Template.md     |   14 +
 .../UserGuide/QuickStart/Command-Line-Interface.md |   48 +-
 .../zh/UserGuide/Reference/Common-Config-Manual.md |    9 +
 grafana-plugin/README.md                           |   63 +-
 grafana-plugin/src/plugin.json                     |    2 +-
 .../iotdb/it/env/cluster/AbstractNodeWrapper.java  |    1 +
 .../iotdb/it/env/cluster/MppCommonConfig.java      |    6 +
 .../it/env/cluster/MppSharedCommonConfig.java      |    7 +
 .../iotdb/it/env/remote/RemoteCommonConfig.java    |    5 +
 .../org/apache/iotdb/itbase/env/CommonConfig.java  |    2 +
 .../confignode/it/IoTDBClusterAuthorityIT.java     |   88 +-
 .../it/partition/IoTDBPartitionGetterIT.java       |   96 +-
 .../db/it/IoTDBSyntaxConventionIdentifierIT.java   |   40 +
 .../iotdb/db/it/query/IoTDBPaginationIT.java       |   59 +-
 .../iotdb/db/it/quotas/IoTDBSpaceQuotaIT.java      |  535 ++++
 .../db/it/schema/IoTDBAutoCreateSchemaIT.java      |    1 +
 .../it/schema/IoTDBCreateAlignedTimeseriesIT.java  |    1 +
 .../db/it/schema/IoTDBCreateStorageGroupIT.java    |    1 +
 .../db/it/schema/IoTDBCreateTimeseriesIT.java      |    1 +
 .../db/it/schema/IoTDBDeactivateTemplateIT.java    |    1 +
 .../it/schema/IoTDBDeleteAlignedTimeseriesIT.java  |    1 +
 .../db/it/schema/IoTDBDeleteStorageGroupIT.java    |    1 +
 .../db/it/schema/IoTDBDeleteTimeseriesIT.java      |    1 +
 .../iotdb/db/it/schema/IoTDBExtendTemplateIT.java  |  223 ++
 .../iotdb/db/it/schema/IoTDBMetadataFetchIT.java   |    1 +
 .../iotdb/db/it/schema/IoTDBSchemaTemplateIT.java  |    5 +-
 .../db/it/schema/IoTDBSortedShowTimeseriesIT.java  |    1 +
 .../apache/iotdb/db/it/schema/IoTDBTagAlterIT.java |    1 +
 .../org/apache/iotdb/db/it/schema/IoTDBTagIT.java  |    1 +
 .../session/it/IoTDBSessionSchemaTemplateIT.java   |  116 +-
 .../{db/it/schema => util}/AbstractSchemaIT.java   |    4 +-
 .../resources/conf/iotdb-common.properties         |    9 +
 .../commons/auth/authorizer/BasicAuthorizer.java   |   35 +-
 .../iotdb/commons/auth/authorizer/IAuthorizer.java |   33 +-
 .../commons/auth/authorizer/OpenIdAuthorizer.java  |    3 +-
 .../iotdb/commons/auth/entity/PathPrivilege.java   |   29 +-
 .../org/apache/iotdb/commons/auth/entity/Role.java |   13 +-
 .../org/apache/iotdb/commons/auth/entity/User.java |   13 +-
 .../iotdb/commons/auth/role/BasicRoleManager.java  |    5 +-
 .../iotdb/commons/auth/role/IRoleManager.java      |    6 +-
 .../iotdb/commons/auth/user/BasicUserManager.java  |    5 +-
 .../iotdb/commons/auth/user/IUserManager.java      |    6 +-
 .../apache/iotdb/commons/conf/CommonConfig.java    |   10 +
 .../iotdb/commons/conf/CommonDescriptor.java       |    8 +
 .../apache/iotdb/commons/conf/IoTDBConstant.java   |   32 +-
 .../commons/partition/DataPartitionTable.java      |   45 +-
 .../commons/partition/SchemaPartitionTable.java    |   10 +
 .../commons/partition/SeriesPartitionTable.java    |   32 +-
 .../pipe/plugin/builtin/BuiltinPipePlugin.java     |   55 +
 .../builtin/connector/DoNothingConnector.java      |   72 +
 .../builtin/processor/DoNothingProcessor.java      |   68 +
 .../meta/ConfigNodePipePluginMetaKeeper.java       |   25 +-
 .../plugin/meta/DataNodePipePluginMetaKeeper.java  |   28 +-
 .../commons/pipe/plugin/meta/PipePluginMeta.java   |   65 +-
 .../pipe/plugin/meta/PipePluginMetaKeeper.java     |   62 +-
 .../commons/pipe/task/meta/PipeStaticMeta.java     |   24 +-
 .../org/apache/iotdb/commons/utils/AuthUtils.java  |   96 +-
 .../org/apache/iotdb/commons/utils/IOUtils.java    |    8 +-
 .../org/apache/iotdb/db/audit/AuditLogger.java     |    8 +-
 .../org/apache/iotdb/db/auth/AuthorityChecker.java |   10 +-
 .../apache/iotdb/db/auth/AuthorizerManager.java    |   15 +-
 .../iotdb/db/auth/ClusterAuthorityFetcher.java     |   38 +-
 .../apache/iotdb/db/auth/IAuthorityFetcher.java    |    3 +-
 .../apache/iotdb/db/client/ConfigNodeClient.java   |   44 +
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |   18 +-
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |    6 +
 .../performer/impl/FastCompactionPerformer.java    |   11 +-
 .../impl/ReadPointCompactionPerformer.java         |    3 +
 .../execute/utils/MultiTsFileDeviceIterator.java   |    4 +-
 .../fast/AlignedSeriesCompactionExecutor.java      |    3 +-
 .../readchunk/SingleSeriesCompactionExecutor.java  |   38 +-
 .../utils/writer/AbstractCompactionWriter.java     |    7 +-
 .../iotdb/db/engine/storagegroup/DataRegion.java   |   62 +-
 .../template/TemplateImcompatibeException.java     |    5 +
 .../db/metadata/cache/DataNodeDevicePathCache.java |   69 +
 .../db/metadata/cache/DataNodeSchemaCache.java     |  225 +-
 .../cache/DeviceUsingTemplateSchemaCache.java      |  177 ++
 ...SchemaCache.java => TimeSeriesSchemaCache.java} |  103 +-
 .../metadata/cache/dualkeycache/IDualKeyCache.java |    4 +
 .../dualkeycache/impl/CacheEntryGroupImpl.java     |    2 +-
 .../cache/dualkeycache/impl/DualKeyCacheImpl.java  |  102 +-
 .../mtree/store/disk/cache/CacheMemoryManager.java |    4 +-
 .../store/disk/schemafile/SchemaFileConfig.java    |    2 +-
 .../mtree/store/disk/schemafile/SegmentedPage.java |    1 +
 .../store/disk/schemafile/pagemgr/PageManager.java |   90 +-
 .../metadata/rescon/MemSchemaEngineStatistics.java |   26 +-
 .../schemaregion/SchemaRegionSchemaFileImpl.java   |   15 +-
 .../metadata/template/ClusterTemplateManager.java  |   11 +
 .../iotdb/db/metadata/template/Template.java       |   16 +-
 ...teType.java => TemplateAlterOperationType.java} |   21 +-
 .../template/TemplateInternalRPCUpdateType.java    |    5 +-
 .../metadata/template/TemplateInternalRPCUtil.java |   10 +
 .../template/alter/TemplateAlterInfo.java}         |   26 +-
 .../template/alter/TemplateAlterOperationUtil.java |   51 +
 .../template/alter/TemplateExtendInfo.java         |  161 ++
 .../db/mpp/common/header/ColumnHeaderConstant.java |   13 +-
 .../db/mpp/common/header/DatasetHeaderFactory.java |    4 +
 .../iotdb/db/mpp/execution/QueryStateMachine.java  |   78 +-
 .../execution/exchange/MPPDataExchangeManager.java |    8 +-
 .../execution/exchange/sink/LocalSinkChannel.java  |    7 +
 .../execution/exchange/sink/ShuffleSinkHandle.java |    7 +-
 .../mpp/execution/exchange/sink/SinkChannel.java   |   23 +-
 .../execution/exchange/source/SourceHandle.java    |   25 +-
 .../operator/schema/SchemaCountOperator.java       |   23 +-
 .../operator/schema/source/DeviceSchemaSource.java |   12 +
 .../operator/schema/source/ISchemaSource.java      |    4 +
 .../operator/schema/source/NodeSchemaSource.java   |   10 +
 .../schema/source/PathsUsingTemplateSource.java    |   10 +
 .../schema/source/TimeSeriesSchemaSource.java      |   12 +
 .../execution/operator/source/SeriesScanUtil.java  |   24 +-
 .../iotdb/db/mpp/metric/QueryMetricsManager.java   |  148 +-
 .../iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java  |   72 +-
 .../db/mpp/plan/analyze/ExpressionAnalyzer.java    |   11 +-
 .../iotdb/db/mpp/plan/analyze/ExpressionUtils.java |    3 +-
 .../analyze/schema/AutoCreateSchemaExecutor.java   |  254 +-
 .../plan/analyze/schema/ClusterSchemaFetcher.java  |  180 +-
 .../db/mpp/plan/analyze/schema/ISchemaFetcher.java |    2 -
 .../plan/analyze/schema/NormalSchemaFetcher.java   |  203 ++
 .../plan/analyze/schema/TemplateSchemaFetcher.java |  246 ++
 .../db/mpp/plan/execution/QueryExecution.java      |   27 +-
 .../plan/execution/config/ConfigTaskVisitor.java   |   15 +
 .../config/executor/ClusterConfigTaskExecutor.java |  120 +-
 .../config/executor/IConfigTaskExecutor.java       |    8 +
 ...lotListTask.java => CountTimeSlotListTask.java} |   38 +-
 .../config/metadata/GetTimeSlotListTask.java       |    9 +-
 .../config/metadata/ShowPipePluginsTask.java       |   18 +-
 .../metadata/template/AlterSchemaTemplateTask.java |   45 +
 .../config/sys/quota/ShowSpaceQuotaTask.java       |    7 +-
 .../config/sys/quota/ShowThrottleQuotaTask.java    |   34 +-
 .../iotdb/db/mpp/plan/parser/ASTVisitor.java       |  201 +-
 .../db/mpp/plan/parser/StatementGenerator.java     |   52 +-
 .../db/mpp/plan/planner/LogicalPlanBuilder.java    |    8 +
 .../db/mpp/plan/planner/OperatorTreeGenerator.java |   12 +-
 .../plan/node/load/LoadSingleTsFileNode.java       |   59 +-
 .../planner/plan/node/load/LoadTsFileNode.java     |   16 +-
 .../source/AlignedSeriesAggregationScanNode.java   |   50 +-
 .../plan/node/source/AlignedSeriesScanNode.java    |    4 +
 .../node/source/SeriesAggregationScanNode.java     |   50 +-
 .../node/source/SeriesAggregationSourceNode.java   |   49 +-
 .../planner/plan/node/source/SeriesScanNode.java   |    4 +
 .../planner/plan/parameter/SeriesScanOptions.java  |    5 +-
 .../scheduler/load/LoadTsFileDispatcherImpl.java   |   20 +-
 .../plan/scheduler/load/LoadTsFileScheduler.java   |  201 +-
 .../iotdb/db/mpp/plan/statement/StatementType.java |    1 +
 .../db/mpp/plan/statement/StatementVisitor.java    |   12 +
 ...tement.java => CountTimeSlotListStatement.java} |   59 +-
 .../statement/metadata/GetRegionIdStatement.java   |   54 +-
 .../metadata/GetSeriesSlotListStatement.java       |   20 +-
 .../metadata/GetTimeSlotListStatement.java         |   46 +-
 .../template/AlterSchemaTemplateStatement.java     |   85 +
 .../org/apache/iotdb/db/pipe/agent/PipeAgent.java  |    9 +-
 .../db/pipe/agent/plugin/PipePluginAgent.java      |   67 +-
 .../db/pipe/agent/runtime/PipeRuntimeAgent.java    |   17 +-
 .../iotdb/db/pipe/agent/task/PipeTaskAgent.java    |   19 +-
 .../db/pipe/agent/task/PipeTaskRegionAgent.java    |   22 -
 .../core/connector/PipeConnectorContainer.java     |   22 -
 .../pipe/core/connector/PipeConnectorManager.java  |   22 -
 .../connector/PipeConnectorSubtaskLifeCycle.java   |   98 +
 .../connector/PipeConnectorSubtaskManager.java     |  107 +
 .../execution/executor/PipeSubtaskExecutor.java    |   12 +-
 .../pipe/task/callable/PipeProcessorSubtask.java   |   37 -
 .../db/pipe/task/stage/PipeTaskCollectorStage.java |   41 +-
 .../db/pipe/task/stage/PipeTaskConnectorStage.java |  109 +-
 .../db/pipe/task/stage/PipeTaskProcessorStage.java |   38 +-
 .../iotdb/db/pipe/task/stage/PipeTaskStage.java    |   34 +-
 .../task/{callable => subtask}/DecoratingLock.java |    2 +-
 .../{callable => subtask}/PipeAssignerSubtask.java |    7 +-
 .../subtask/PipeConnectorSubtask.java}             |   44 +-
 .../subtask/PipeProcessorSubtask.java}             |   38 +-
 .../task/{callable => subtask}/PipeSubtask.java    |    8 +-
 .../iotdb/db/protocol/mqtt/MPPPublishHandler.java  |    5 +-
 .../v1/handler/StatementConstructionHandler.java   |    5 +-
 .../v2/handler/StatementConstructionHandler.java   |    5 +-
 .../iotdb/db/query/context/QueryContext.java       |    2 +-
 .../iotdb/db/query/reader/chunk/MemPageReader.java |   12 +-
 .../java/org/apache/iotdb/db/service/DataNode.java |    6 +
 .../impl/DataNodeInternalRPCServiceImpl.java       |   21 +-
 .../iotdb/db/auth/AuthorizerManagerTest.java       |   26 +-
 .../auth/authorizer/LocalFileAuthorizerTest.java   |    9 +-
 .../iotdb/db/auth/entity/PathPrivilegeTest.java    |    8 +-
 .../org/apache/iotdb/db/auth/entity/RoleTest.java  |    8 +-
 .../org/apache/iotdb/db/auth/entity/UserTest.java  |    8 +-
 .../db/auth/role/LocalFileRoleAccessorTest.java    |    6 +-
 .../db/auth/role/LocalFileRoleManagerTest.java     |    8 +-
 .../db/auth/user/LocalFileUserAccessorTest.java    |    6 +-
 .../db/auth/user/LocalFileUserManagerTest.java     |    8 +-
 .../engine/compaction/AbstractCompactionTest.java  |    3 +
 .../compaction/FastAlignedCrossCompactionTest.java |  751 +++--
 .../FastNonAlignedCrossCompactionTest.java         |  767 ++++--
 .../compaction/ReadChunkInnerCompactionTest.java   |  377 +++
 ...va => ReadPointAlignedCrossCompactionTest.java} |  804 ++++--
 ...=> ReadPointNonAlignedCrossCompactionTest.java} |  820 ++++--
 .../ReadChunkCompactionPerformerNoAlignedTest.java |  274 ++
 .../utils/CompactionFileGeneratorUtils.java        |   60 +
 .../compaction/utils/TsFileGeneratorUtils.java     |  116 +-
 .../cache/DataNodeDevicePathCacheTest.java         |   62 +
 .../db/metadata/cache/DataNodeSchemaCacheTest.java |   50 +
 .../metadata/mtree/schemafile/SchemaFileTest.java  |  137 +-
 .../db/mpp/execution/QueryStateMachineTest.java    |    2 +
 .../db/mpp/plan/analyze/FakeSchemaFetcherImpl.java |    3 -
 .../mpp/plan/analyze/QueryTimePartitionTest.java   |   14 +-
 .../iotdb/db/mpp/plan/plan/distribution/Util.java  |    3 -
 .../node/process/AggregationNodeSerdeTest.java     |    7 +-
 .../node/process/GroupByLevelNodeSerdeTest.java    |    8 +-
 .../plan/node/process/GroupByTagNodeSerdeTest.java |    5 +-
 .../source/SeriesAggregationScanNodeSerdeTest.java |    7 +-
 .../executor/PipeAssignerSubtaskExecutorTest.java  |    2 +-
 .../executor/PipeConnectorSubtaskExecutorTest.java |    6 +-
 .../executor/PipeProcessorSubtaskExecutorTest.java |   12 +-
 .../executor/PipeSubtaskExecutorTest.java          |    2 +-
 .../AlignedSeriesScanLimitOffsetPushDownTest.java  |   36 +-
 .../series/SeriesScanLimitOffsetPushDownTest.java  |   23 +-
 .../security/encrypt/MessageDigestEncryptTest.java |    6 +-
 site/src/main/.vuepress/styles/index.scss          |    6 +-
 site/src/main/package-lock.json                    | 2881 +++++++-------------
 .../src/main/thrift/confignode.thrift              |   47 +-
 thrift/src/main/thrift/client.thrift               |    3 +
 .../iotdb/tsfile/read/TsFileSequenceReader.java    |    2 +-
 .../iotdb/tsfile/read/filter/GroupByFilter.java    |   13 +-
 .../read/filter/PredicateRemoveNotRewriter.java    |   50 +
 .../iotdb/tsfile/read/filter/TimeFilter.java       |  158 +-
 .../iotdb/tsfile/read/filter/ValueFilter.java      |  179 +-
 .../tsfile/read/filter/basic/BinaryFilter.java     |    5 -
 .../iotdb/tsfile/read/filter/basic/Filter.java     |   11 +-
 .../tsfile/read/filter/factory/FilterFactory.java  |   10 +-
 .../tsfile/read/filter/operator/AndFilter.java     |   11 +
 .../iotdb/tsfile/read/filter/operator/Between.java |  127 +-
 .../iotdb/tsfile/read/filter/operator/Eq.java      |   25 +-
 .../iotdb/tsfile/read/filter/operator/Gt.java      |   23 +-
 .../iotdb/tsfile/read/filter/operator/GtEq.java    |   23 +-
 .../iotdb/tsfile/read/filter/operator/In.java      |   34 +-
 .../iotdb/tsfile/read/filter/operator/Like.java    |   55 +-
 .../iotdb/tsfile/read/filter/operator/Lt.java      |   23 +-
 .../iotdb/tsfile/read/filter/operator/LtEq.java    |   23 +-
 .../iotdb/tsfile/read/filter/operator/NotEq.java   |   25 +-
 .../tsfile/read/filter/operator/NotFilter.java     |   26 +-
 .../tsfile/read/filter/operator/OrFilter.java      |   11 +
 .../iotdb/tsfile/read/filter/operator/Regexp.java  |   57 +-
 .../read/reader/chunk/AlignedChunkReader.java      |   40 +-
 .../tsfile/read/reader/chunk/ChunkReader.java      |    4 +
 .../iotdb/tsfile/read/reader/page/PageReader.java  |   12 +-
 .../tsfile/write/chunk/AlignedChunkWriterImpl.java |   42 +-
 .../tsfile/read/filter/FilterSerializeTest.java    |   21 +-
 .../read/filter/MinTimeMaxTimeFilterTest.java      |   42 +-
 .../iotdb/tsfile/read/filter/OperatorTest.java     |    4 +-
 .../filter/PredicateRemoveNotRewriterTest.java     |  121 +
 .../tsfile/read/filter/StatisticsFilterTest.java   |  113 +-
 301 files changed, 12143 insertions(+), 5389 deletions(-)

diff --cc 
server/src/main/java/org/apache/iotdb/db/mpp/metric/QueryMetricsManager.java
index a653d71dd0,adb6541e8c..16012c6707
--- 
a/server/src/main/java/org/apache/iotdb/db/mpp/metric/QueryMetricsManager.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/mpp/metric/QueryMetricsManager.java
@@@ -26,13 -35,16 +35,17 @@@ public class QueryMetricsManager 
    private final MetricService metricService = MetricService.getInstance();
  
    public void recordPlanCost(String stage, long costTimeInNanos) {
-     //    metricService.timer(
-     //        costTimeInNanos,
-     //        TimeUnit.NANOSECONDS,
-     //        Metric.QUERY_PLAN_COST.toString(),
-     //        MetricLevel.IMPORTANT,
-     //        Tag.STAGE.toString(),
-     //        stage);
++
+     if (!DO_NOTHING.equals(
+         
MetricConfigDescriptor.getInstance().getMetricConfig().getMetricLevel())) {
+       metricService.timer(
+           costTimeInNanos,
+           TimeUnit.NANOSECONDS,
+           Metric.QUERY_PLAN_COST.toString(),
+           MetricLevel.IMPORTANT,
+           Tag.STAGE.toString(),
+           stage);
+     }
    }
  
    public void recordOperatorExecutionCost(String operatorType, long 
costTimeInNanos) {
diff --cc 
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/StatementGenerator.java
index aa0b9de287,a450673702..583222a61f
--- 
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/StatementGenerator.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/StatementGenerator.java
@@@ -120,9 -120,9 +120,8 @@@ import static org.apache.iotdb.tsfile.c
  public class StatementGenerator {
    private static final PerformanceOverviewMetrics 
PERFORMANCE_OVERVIEW_METRICS =
        PerformanceOverviewMetrics.getInstance();
--
-   private static final ConcurrentHashMap<String, PartialPath> 
partialPathCache =
-       new ConcurrentHashMap<>();
+   private static final DataNodeDevicePathCache DEVICE_PATH_CACHE =
+       DataNodeDevicePathCache.getInstance();
  
    public static Statement createStatement(String sql, ZoneId zoneId) {
      return invokeParser(sql, zoneId);
@@@ -821,12 -836,12 +833,12 @@@
        throws IllegalPathException {
      String path =
          ML_METRICS_PATH_PREFIX
 -            + TsFileConstant.PATH_SEPARATOR
 +            + PATH_SEPARATOR
              + recordModelMetricsReq.getModelId()
 -            + TsFileConstant.PATH_SEPARATOR
 +            + PATH_SEPARATOR
              + recordModelMetricsReq.getTrialId();
      InsertRowStatement insertRowStatement = new InsertRowStatement();
-     insertRowStatement.setDevicePath(new PartialPath(path));
+     insertRowStatement.setDevicePath(DEVICE_PATH_CACHE.getPartialPath(path));
      insertRowStatement.setTime(recordModelMetricsReq.getTimestamp());
      
insertRowStatement.setMeasurements(recordModelMetricsReq.getMetrics().toArray(new
 String[0]));
      insertRowStatement.setAligned(true);
diff --cc 
server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
index 1a696abe03,2a44762fdd..0cc051c99a
--- a/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
@@@ -92,29 -93,28 +92,29 @@@ public class QueryContext 
     * them from 'modFile' and put then into the cache.
     */
    public List<Modification> getPathModifications(ModificationFile modFile, 
PartialPath path) {
+     // TODO change a way to do the existing check to avoid this IO call each 
time.
 -
 +    return Collections.emptyList();
- 
      // if the mods file does not exist, do not add it to the cache
 -    if (!modFile.exists()) {
 -      return Collections.emptyList();
 -    }
 -    Map<String, List<Modification>> fileModifications =
 -        filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new 
ConcurrentHashMap<>());
 -    return fileModifications.computeIfAbsent(
 -        path.getFullPath(),
 -        k -> {
 -          PatternTreeMap<Modification, ModsSerializer> allModifications =
 -              fileModCache.get(modFile.getFilePath());
 -          if (allModifications == null) {
 -            allModifications = PatternTreeMapFactory.getModsPatternTreeMap();
 -            for (Modification modification : modFile.getModifications()) {
 -              allModifications.append(modification.getPath(), modification);
 -            }
 -            fileModCache.put(modFile.getFilePath(), allModifications);
 -          }
 -          return sortAndMerge(allModifications.getOverlapped(path));
 -        });
 +    //    if (!modFile.exists()) {
 +    //      return Collections.emptyList();
 +    //    }
 +    //    Map<String, List<Modification>> fileModifications =
 +    //        filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new
 +    // ConcurrentHashMap<>());
 +    //    return fileModifications.computeIfAbsent(
 +    //        path.getFullPath(),
 +    //        k -> {
 +    //          PatternTreeMap<Modification, ModsSerializer> allModifications 
=
 +    //              fileModCache.get(modFile.getFilePath());
 +    //          if (allModifications == null) {
 +    //            allModifications = 
PatternTreeMapFactory.getModsPatternTreeMap();
 +    //            for (Modification modification : 
modFile.getModifications()) {
 +    //              allModifications.append(modification.getPath(), 
modification);
 +    //            }
 +    //            fileModCache.put(modFile.getFilePath(), allModifications);
 +    //          }
 +    //          return sortAndMerge(allModifications.getOverlapped(path));
 +    //        });
    }
  
    private List<Modification> sortAndMerge(List<Modification> modifications) {

Reply via email to