You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/06/26 05:12:01 UTC

[iotdb] branch master updated: remove old cluster module from master branch (#6446)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 11c6c331e6 remove old cluster module from master branch (#6446)
11c6c331e6 is described below

commit 11c6c331e61a127a3c66906d5dfde75069ec04c6
Author: Haonan <hh...@outlook.com>
AuthorDate: Sun Jun 26 13:11:56 2022 +0800

    remove old cluster module from master branch (#6446)
---
 cluster/pom.xml                                    |  228 --
 cluster/src/assembly/cluster.xml                   |   35 -
 .../resources/conf/iotdb-cluster.properties        |  200 --
 cluster/src/assembly/resources/sbin/add-node.bat   |  133 --
 cluster/src/assembly/resources/sbin/add-node.sh    |   95 -
 cluster/src/assembly/resources/sbin/nodetool.bat   |   58 -
 cluster/src/assembly/resources/sbin/nodetool.sh    |   48 -
 .../src/assembly/resources/sbin/remove-node.bat    |  110 -
 cluster/src/assembly/resources/sbin/remove-node.sh |   72 -
 cluster/src/assembly/resources/sbin/start-node.bat |  136 --
 cluster/src/assembly/resources/sbin/start-node.sh  |   97 -
 cluster/src/assembly/resources/sbin/stop-node.bat  |   27 -
 cluster/src/assembly/resources/sbin/stop-node.sh   |   39 -
 .../java/org/apache/iotdb/cluster/ClientMain.java  |  469 -----
 .../iotdb/cluster/ClusterFileFlushPolicy.java      |   75 -
 .../org/apache/iotdb/cluster/ClusterIoTDB.java     |  675 ------
 .../apache/iotdb/cluster/ClusterIoTDBMBean.java    |   36 -
 .../cluster/ClusterIoTDBServerCommandLine.java     |   94 -
 .../apache/iotdb/cluster/RemoteTsFileResource.java |  150 --
 .../apache/iotdb/cluster/client/BaseFactory.java   |   54 -
 .../iotdb/cluster/client/ClientCategory.java       |   38 -
 .../apache/iotdb/cluster/client/ClientManager.java |  223 --
 .../iotdb/cluster/client/ClientPoolFactory.java    |  101 -
 .../iotdb/cluster/client/IClientManager.java       |   35 -
 .../cluster/client/async/AsyncBaseFactory.java     |   68 -
 .../cluster/client/async/AsyncDataClient.java      |  218 --
 .../cluster/client/async/AsyncMetaClient.java      |  178 --
 .../cluster/client/sync/SyncClientAdaptor.java     |  527 -----
 .../iotdb/cluster/client/sync/SyncDataClient.java  |  154 --
 .../iotdb/cluster/client/sync/SyncMetaClient.java  |  144 --
 .../apache/iotdb/cluster/config/ClusterConfig.java |  584 ------
 .../iotdb/cluster/config/ClusterConstant.java      |  144 --
 .../iotdb/cluster/config/ClusterDescriptor.java    |  418 ----
 .../iotdb/cluster/config/ConsistencyLevel.java     |   67 -
 .../iotdb/cluster/coordinator/Coordinator.java     |  807 -------
 .../iotdb/cluster/exception/AddSelfException.java  |   28 -
 .../exception/BadSeedUrlFormatException.java       |   30 -
 .../exception/ChangeMembershipException.java       |   28 -
 .../exception/CheckConsistencyException.java       |   37 -
 .../exception/ConfigInconsistentException.java     |   29 -
 .../cluster/exception/EmptyIntervalException.java  |   28 -
 .../cluster/exception/EntryCompactedException.java |   30 -
 .../exception/EntryUnavailableException.java       |   28 -
 .../GetEntriesWrongParametersException.java        |   27 -
 .../cluster/exception/LeaderUnknownException.java  |   31 -
 .../cluster/exception/LogExecutionException.java   |   27 -
 .../cluster/exception/MemberReadOnlyException.java |   33 -
 .../cluster/exception/NoHeaderNodeException.java   |   31 -
 .../cluster/exception/NotInSameGroupException.java |   32 -
 .../cluster/exception/NotManagedSlotException.java |   33 -
 .../PartitionTableUnavailableException.java        |   30 -
 .../iotdb/cluster/exception/PullFileException.java |   34 -
 .../cluster/exception/QueryTimeOutException.java   |   27 -
 .../cluster/exception/ReaderNotFoundException.java |   27 -
 .../cluster/exception/RequestTimeOutException.java |   34 -
 .../exception/SnapshotInstallationException.java   |   37 -
 .../exception/StartUpCheckFailureException.java    |   31 -
 .../exception/TruncateCommittedEntryException.java |   30 -
 .../cluster/exception/UnknownLogTypeException.java |   28 -
 .../exception/UnsupportedPlanException.java        |   29 -
 .../iotdb/cluster/log/CommitLogCallback.java       |   48 -
 .../apache/iotdb/cluster/log/CommitLogTask.java    |   65 -
 .../org/apache/iotdb/cluster/log/HardState.java    |  114 -
 .../java/org/apache/iotdb/cluster/log/Log.java     |  145 --
 .../org/apache/iotdb/cluster/log/LogApplier.java   |   35 -
 .../apache/iotdb/cluster/log/LogDispatcher.java    |  461 ----
 .../org/apache/iotdb/cluster/log/LogParser.java    |  110 -
 .../org/apache/iotdb/cluster/log/Snapshot.java     |   75 -
 .../iotdb/cluster/log/StableEntryManager.java      |   61 -
 .../cluster/log/applier/AsyncDataLogApplier.java   |  302 ---
 .../iotdb/cluster/log/applier/BaseApplier.java     |  263 ---
 .../iotdb/cluster/log/applier/DataLogApplier.java  |  185 --
 .../iotdb/cluster/log/applier/MetaLogApplier.java  |   90 -
 .../iotdb/cluster/log/catchup/CatchUpTask.java     |  403 ----
 .../iotdb/cluster/log/catchup/LogCatchUpTask.java  |  350 ---
 .../cluster/log/catchup/SnapshotCatchUpTask.java   |  159 --
 .../iotdb/cluster/log/logtypes/AddNodeLog.java     |  136 --
 .../iotdb/cluster/log/logtypes/CloseFileLog.java   |  124 --
 .../cluster/log/logtypes/EmptyContentLog.java      |   63 -
 .../iotdb/cluster/log/logtypes/LargeTestLog.java   |   78 -
 .../cluster/log/logtypes/PhysicalPlanLog.java      |  115 -
 .../iotdb/cluster/log/logtypes/RemoveNodeLog.java  |  131 --
 .../cluster/log/manage/CommittedEntryManager.java  |  301 ---
 .../manage/FilePartitionedSnapshotLogManager.java  |  259 ---
 .../log/manage/MetaSingleSnapshotLogManager.java   |   93 -
 .../log/manage/PartitionedSnapshotLogManager.java  |  137 --
 .../iotdb/cluster/log/manage/RaftLogManager.java   | 1038 ---------
 .../log/manage/UnCommittedEntryManager.java        |  276 ---
 .../log/manage/serializable/LogManagerMeta.java    |  143 --
 .../serializable/SyncLogDequeSerializer.java       | 1409 -------------
 .../iotdb/cluster/log/snapshot/FileSnapshot.java   |  641 ------
 .../cluster/log/snapshot/MetaSimpleSnapshot.java   |  342 ---
 .../cluster/log/snapshot/PartitionedSnapshot.java  |  223 --
 .../cluster/log/snapshot/PullSnapshotTask.java     |  269 ---
 .../log/snapshot/PullSnapshotTaskDescriptor.java   |  135 --
 .../cluster/log/snapshot/SnapshotFactory.java      |   28 -
 .../cluster/log/snapshot/SnapshotInstaller.java    |   33 -
 .../log/snapshot/TimeseriesSchemaSnapshot.java     |   31 -
 .../iotdb/cluster/metadata/CSchemaProcessor.java   | 1741 ---------------
 .../apache/iotdb/cluster/metadata/MetaPuller.java  |  452 ----
 .../cluster/partition/NodeAdditionResult.java      |   37 -
 .../iotdb/cluster/partition/NodeRemovalResult.java |   61 -
 .../iotdb/cluster/partition/PartitionGroup.java    |  109 -
 .../iotdb/cluster/partition/PartitionTable.java    |  154 --
 .../partition/balancer/DefaultSlotBalancer.java    |  121 --
 .../cluster/partition/balancer/SlotBalancer.java   |   43 -
 .../iotdb/cluster/partition/slot/SlotManager.java  |  402 ----
 .../partition/slot/SlotNodeAdditionResult.java     |   40 -
 .../partition/slot/SlotNodeRemovalResult.java      |   79 -
 .../cluster/partition/slot/SlotPartitionTable.java |  611 ------
 .../iotdb/cluster/partition/slot/SlotStrategy.java |   48 -
 .../partition/slot/SlotTimePartitionFilter.java    |   56 -
 .../cluster/query/ClusterDataQueryExecutor.java    |  325 ---
 .../cluster/query/ClusterPhysicalGenerator.java    |  106 -
 .../iotdb/cluster/query/ClusterPlanExecutor.java   |  923 --------
 .../iotdb/cluster/query/ClusterPlanRouter.java     |  507 -----
 .../apache/iotdb/cluster/query/ClusterPlanner.java |   35 -
 .../iotdb/cluster/query/ClusterQueryRouter.java    |  109 -
 .../cluster/query/ClusterUDTFQueryExecutor.java    |  103 -
 .../iotdb/cluster/query/LocalQueryExecutor.java    | 1066 ----------
 .../iotdb/cluster/query/RemoteQueryContext.java    |   73 -
 .../query/aggregate/ClusterAggregateExecutor.java  |  107 -
 .../cluster/query/aggregate/ClusterAggregator.java |  292 ---
 .../cluster/query/fill/ClusterFillExecutor.java    |  104 -
 .../cluster/query/fill/ClusterLinearFill.java      |   80 -
 .../cluster/query/fill/ClusterPreviousFill.java    |  269 ---
 .../cluster/query/fill/PreviousFillArguments.java  |   70 -
 .../iotdb/cluster/query/filter/SlotSgFilter.java   |   47 -
 .../cluster/query/filter/SlotTsFileFilter.java     |   69 -
 .../groupby/ClusterGroupByNoVFilterDataSet.java    |   61 -
 .../groupby/ClusterGroupByVFilterDataSet.java      |   75 -
 .../query/groupby/MergeGroupByExecutor.java        |  143 --
 .../query/groupby/RemoteGroupByExecutor.java       |  176 --
 .../query/last/ClusterLastQueryExecutor.java       |  296 ---
 .../cluster/query/manage/ClusterQueryManager.java  |  129 --
 .../query/manage/ClusterSessionManager.java        |  138 --
 .../cluster/query/manage/QueryCoordinator.java     |   66 -
 .../cluster/query/reader/ClusterReaderFactory.java | 1229 -----------
 .../cluster/query/reader/ClusterTimeGenerator.java |  217 --
 .../iotdb/cluster/query/reader/DataSourceInfo.java |  272 ---
 .../iotdb/cluster/query/reader/EmptyReader.java    |  172 --
 .../reader/ManagedDescPriorityMergeReader.java     |   96 -
 .../query/reader/ManagedPriorityMergeReader.java   |   94 -
 .../cluster/query/reader/MergedReaderByTime.java   |   47 -
 .../reader/RemoteSeriesReaderByTimestamp.java      |  122 --
 .../query/reader/RemoteSimpleSeriesReader.java     |  167 --
 .../query/reader/mult/AbstractMultPointReader.java |   70 -
 .../mult/AssignPathAscPriorityMergeReader.java     |   49 -
 .../mult/AssignPathDescPriorityMergeReader.java    |   49 -
 .../reader/mult/AssignPathManagedMergeReader.java  |  121 --
 .../mult/IAssignPathPriorityMergeReader.java       |   47 -
 .../query/reader/mult/IMultBatchReader.java        |   31 -
 .../cluster/query/reader/mult/MultBatchReader.java |   74 -
 .../query/reader/mult/MultDataSourceInfo.java      |  270 ---
 .../cluster/query/reader/mult/MultElement.java     |   49 -
 .../cluster/query/reader/mult/MultEmptyReader.java |   52 -
 .../reader/mult/MultSeriesRawDataPointReader.java  |   55 -
 .../query/reader/mult/RemoteMultSeriesReader.java  |  227 --
 .../iotdb/cluster/server/ClusterRPCService.java    |  110 -
 .../cluster/server/ClusterRPCServiceMBean.java     |   35 -
 .../iotdb/cluster/server/ClusterTSServiceImpl.java |   47 -
 .../iotdb/cluster/server/HardLinkCleaner.java      |  110 -
 .../apache/iotdb/cluster/server/NodeCharacter.java |   28 -
 .../cluster/server/PullSnapshotHintService.java    |  181 --
 .../org/apache/iotdb/cluster/server/Response.java  |   63 -
 .../iotdb/cluster/server/StoppedMemberManager.java |  160 --
 .../server/basic/ClusterServiceProvider.java       |   95 -
 .../server/clusterinfo/ClusterInfoServer.java      |   90 -
 .../server/clusterinfo/ClusterInfoServerMBean.java |   22 -
 .../server/clusterinfo/ClusterInfoServiceImpl.java |   71 -
 .../ClusterInfoServiceThriftHandler.java           |   55 -
 .../handlers/caller/AppendGroupEntryHandler.java   |  157 --
 .../handlers/caller/AppendNodeEntryHandler.java    |  187 --
 .../server/handlers/caller/ElectionHandler.java    |  167 --
 .../server/handlers/caller/GenericHandler.java     |   94 -
 .../caller/GetChildNodeNextLevelHandler.java       |   59 -
 .../caller/GetChildNodeNextLevelPathHandler.java   |   60 -
 .../server/handlers/caller/GetDevicesHandler.java  |   60 -
 .../handlers/caller/GetNodesListHandler.java       |   59 -
 .../caller/GetTimeseriesSchemaHandler.java         |   59 -
 .../server/handlers/caller/HeartbeatHandler.java   |  156 --
 .../server/handlers/caller/JoinClusterHandler.java |   65 -
 .../server/handlers/caller/LogCatchUpHandler.java  |  115 -
 .../handlers/caller/LogCatchUpInBatchHandler.java  |  111 -
 .../server/handlers/caller/NodeStatusHandler.java  |   59 -
 .../handlers/caller/PreviousFillHandler.java       |  101 -
 .../caller/PullMeasurementSchemaHandler.java       |   78 -
 .../handlers/caller/PullSnapshotHandler.java       |   81 -
 .../caller/PullTimeseriesSchemaHandler.java        |   73 -
 .../handlers/caller/ShowTimeSeriesHandler.java     |  121 --
 .../handlers/caller/SnapshotCatchUpHandler.java    |   61 -
 .../server/handlers/caller/package-info.java       |   21 -
 .../handlers/forwarder/ForwardPlanHandler.java     |   68 -
 .../server/heartbeat/DataHeartbeatThread.java      |   68 -
 .../cluster/server/heartbeat/HeartbeatThread.java  |  443 ----
 .../server/heartbeat/MetaHeartbeatThread.java      |   96 -
 .../cluster/server/member/DataGroupMember.java     | 1164 ----------
 .../server/member/DataGroupMemberMBean.java        |   25 -
 .../cluster/server/member/MetaGroupMember.java     | 1954 -----------------
 .../server/member/MetaGroupMemberMBean.java        |   35 -
 .../iotdb/cluster/server/member/RaftMember.java    | 2219 --------------------
 .../cluster/server/member/RaftMemberMBean.java     |   53 -
 .../iotdb/cluster/server/member/package-info.java  |   24 -
 .../iotdb/cluster/server/monitor/NodeReport.java   |  268 ---
 .../iotdb/cluster/server/monitor/NodeStatus.java   |  118 --
 .../cluster/server/monitor/NodeStatusManager.java  |  183 --
 .../apache/iotdb/cluster/server/monitor/Peer.java  |   70 -
 .../apache/iotdb/cluster/server/monitor/Timer.java |  337 ---
 .../server/raft/AbstractDataRaftService.java       |   54 -
 .../server/raft/AbstractMetaRaftService.java       |   52 -
 .../cluster/server/raft/AbstractRaftService.java   |   76 -
 .../server/raft/DataRaftHeartBeatService.java      |   62 -
 .../server/raft/DataRaftHeartBeatServiceMBean.java |   22 -
 .../iotdb/cluster/server/raft/DataRaftService.java |   59 -
 .../cluster/server/raft/DataRaftServiceMBean.java  |   22 -
 .../server/raft/MetaRaftHeartBeatService.java      |   62 -
 .../server/raft/MetaRaftHeartBeatServiceMBean.java |   22 -
 .../iotdb/cluster/server/raft/MetaRaftService.java |   59 -
 .../cluster/server/raft/MetaRaftServiceMBean.java  |   22 -
 .../cluster/server/raft/RaftServiceHandler.java    |   43 -
 .../cluster/server/service/BaseAsyncService.java   |  176 --
 .../cluster/server/service/BaseSyncService.java    |  181 --
 .../cluster/server/service/DataAsyncService.java   |  503 -----
 .../cluster/server/service/DataGroupEngine.java    |  510 -----
 .../server/service/DataGroupEngineMBean.java       |   31 -
 .../server/service/DataGroupServiceImpls.java      |  749 -------
 .../cluster/server/service/DataSyncService.java    |  458 ----
 .../cluster/server/service/MetaAsyncService.java   |  255 ---
 .../cluster/server/service/MetaSyncService.java    |  253 ---
 .../iotdb/cluster/server/service/package-info.java |   24 -
 .../apache/iotdb/cluster/utils/ClientUtils.java    |   66 -
 .../iotdb/cluster/utils/ClusterConsistent.java     |   30 -
 .../apache/iotdb/cluster/utils/ClusterNode.java    |   86 -
 .../iotdb/cluster/utils/ClusterQueryUtils.java     |   84 -
 .../apache/iotdb/cluster/utils/ClusterUtils.java   |  376 ----
 .../org/apache/iotdb/cluster/utils/IOUtils.java    |   88 -
 .../iotdb/cluster/utils/NodeSerializeUtils.java    |   92 -
 .../apache/iotdb/cluster/utils/PartitionUtils.java |  184 --
 .../apache/iotdb/cluster/utils/PlanSerializer.java |   59 -
 .../apache/iotdb/cluster/utils/StatusUtils.java    |  228 --
 .../cluster/utils/nodetool/ClusterMonitor.java     |  325 ---
 .../utils/nodetool/ClusterMonitorMBean.java        |   85 -
 .../iotdb/cluster/utils/nodetool/NodeTool.java     |   52 -
 .../iotdb/cluster/utils/nodetool/Printer.java      |   38 -
 .../cluster/utils/nodetool/function/Header.java    |   60 -
 .../cluster/utils/nodetool/function/LogView.java   |   88 -
 .../cluster/utils/nodetool/function/Migration.java |   59 -
 .../utils/nodetool/function/NodeToolCmd.java       |  145 --
 .../cluster/utils/nodetool/function/Partition.java |  102 -
 .../cluster/utils/nodetool/function/Ring.java      |   50 -
 .../cluster/utils/nodetool/function/Slot.java      |   63 -
 .../cluster/utils/nodetool/function/Status.java    |   63 -
 .../iotdb/cluster/client/BaseClientTest.java       |  156 --
 .../iotdb/cluster/client/ClientManagerTest.java    |  212 --
 .../cluster/client/ClientPoolFactoryTest.java      |  293 ---
 .../iotdb/cluster/client/MockClientManager.java    |   47 -
 .../cluster/client/async/AsyncDataClientTest.java  |   79 -
 .../cluster/client/async/AsyncMetaClientTest.java  |   78 -
 .../cluster/client/sync/SyncClientAdaptorTest.java |  464 ----
 .../cluster/client/sync/SyncDataClientTest.java    |  110 -
 .../cluster/client/sync/SyncMetaClientTest.java    |  110 -
 .../org/apache/iotdb/cluster/common/IoTDBTest.java |  176 --
 .../iotdb/cluster/common/TestAsyncClient.java      |   53 -
 .../iotdb/cluster/common/TestAsyncDataClient.java  |  304 ---
 .../iotdb/cluster/common/TestAsyncMetaClient.java  |   50 -
 .../iotdb/cluster/common/TestDataGroupMember.java  |   45 -
 .../apache/iotdb/cluster/common/TestException.java |   27 -
 .../org/apache/iotdb/cluster/common/TestLog.java   |   67 -
 .../iotdb/cluster/common/TestLogApplier.java       |   66 -
 .../iotdb/cluster/common/TestLogManager.java       |   39 -
 .../cluster/common/TestManagedSeriesReader.java    |   96 -
 .../iotdb/cluster/common/TestMetaGroupMember.java  |   39 -
 .../cluster/common/TestPartitionedLogManager.java  |   54 -
 .../apache/iotdb/cluster/common/TestSnapshot.java  |  110 -
 .../iotdb/cluster/common/TestSyncClient.java       |   47 -
 .../org/apache/iotdb/cluster/common/TestUtils.java |  439 ----
 .../cluster/integration/BaseSingleNodeTest.java    |   90 -
 .../iotdb/cluster/integration/SingleNodeTest.java  |  131 --
 .../iotdb/cluster/log/CommitLogCallbackTest.java   |   53 -
 .../iotdb/cluster/log/CommitLogTaskTest.java       |   78 -
 .../apache/iotdb/cluster/log/HardStateTest.java    |   49 -
 .../iotdb/cluster/log/LogDispatcherTest.java       |  269 ---
 .../apache/iotdb/cluster/log/LogParserTest.java    |  122 --
 .../log/applier/AsyncDataLogApplierTest.java       |  174 --
 .../cluster/log/applier/DataLogApplierTest.java    |  499 -----
 .../cluster/log/applier/MetaLogApplierTest.java    |  135 --
 .../iotdb/cluster/log/catchup/CatchUpTaskTest.java |  398 ----
 .../cluster/log/catchup/LogCatchUpTaskTest.java    |  301 ---
 .../log/catchup/SnapshotCatchUpTaskTest.java       |  282 ---
 .../cluster/log/logtypes/SerializeLogTest.java     |  146 --
 .../log/manage/CommittedEntryManagerTest.java      |  625 ------
 .../FilePartitionedSnapshotLogManagerTest.java     |  117 --
 .../manage/MetaSingleSnapshotLogManagerTest.java   |   93 -
 .../cluster/log/manage/RaftLogManagerTest.java     | 1889 -----------------
 .../log/manage/UnCommittedEntryManagerTest.java    |  695 ------
 .../serializable/SyncLogDequeSerializerTest.java   |  612 ------
 .../cluster/log/snapshot/DataSnapshotTest.java     |  196 --
 .../cluster/log/snapshot/FileSnapshotTest.java     |  310 ---
 .../log/snapshot/MetaSimpleSnapshotTest.java       |  346 ---
 .../log/snapshot/PartitionedSnapshotTest.java      |  204 --
 .../snapshot/PullSnapshotTaskDescriptorTest.java   |   64 -
 .../cluster/log/snapshot/PullSnapshotTaskTest.java |  337 ---
 .../iotdb/cluster/log/snapshot/SimpleSnapshot.java |  132 --
 .../cluster/partition/SchemaProcessorWhiteBox.java |   54 -
 .../iotdb/cluster/partition/SlotManagerTest.java   |  155 --
 .../cluster/partition/SlotPartitionTableTest.java  |  546 -----
 .../apache/iotdb/cluster/query/BaseQueryTest.java  |  125 --
 .../query/ClusterAggregateExecutorTest.java        |  145 --
 .../query/ClusterDataQueryExecutorTest.java        |  240 ---
 .../query/ClusterPhysicalGeneratorTest.java        |   72 -
 .../cluster/query/ClusterPlanExecutorTest.java     |  112 -
 .../iotdb/cluster/query/ClusterPlannerTest.java    |   55 -
 .../cluster/query/ClusterQueryRouterTest.java      |  324 ---
 .../query/ClusterUDTFQueryExecutorTest.java        |  121 --
 .../iotdb/cluster/query/LoadConfigurationTest.java |  124 --
 .../query/fill/ClusterFillExecutorTest.java        |  170 --
 .../ClusterGroupByNoVFilterDataSetTest.java        |   90 -
 .../groupby/ClusterGroupByVFilterDataSetTest.java  |  102 -
 .../query/groupby/MergeGroupByExecutorTest.java    |  117 --
 .../query/groupby/RemoteGroupByExecutorTest.java   |  171 --
 .../query/last/ClusterLastQueryExecutorTest.java   |   95 -
 .../query/manage/ClusterQueryManagerTest.java      |  182 --
 .../cluster/query/manage/QueryCoordinatorTest.java |  121 --
 .../query/reader/ClusterReaderFactoryTest.java     |   85 -
 .../query/reader/ClusterTimeGeneratorTest.java     |  134 --
 .../cluster/query/reader/DatasourceInfoTest.java   |  112 -
 .../reader/RemoteSeriesReaderByTimestampTest.java  |  269 ---
 .../query/reader/RemoteSimpleSeriesReaderTest.java |  243 ---
 .../mult/AssignPathManagedMergeReaderTest.java     |  208 --
 .../mult/MultSeriesRawDataPointReaderTest.java     |   67 -
 .../reader/mult/RemoteMultSeriesReaderTest.java    |  346 ---
 .../server/clusterinfo/ClusterInfoServerTest.java  |   99 -
 .../clusterinfo/ClusterInfoServiceImplTest.java    |  100 -
 .../caller/AppendGroupEntryHandlerTest.java        |  188 --
 .../caller/AppendNodeEntryHandlerTest.java         |  175 --
 .../handlers/caller/ElectionHandlerTest.java       |  178 --
 .../server/handlers/caller/GenericHandlerTest.java |   58 -
 .../handlers/caller/HeartbeatHandlerTest.java      |  121 --
 .../handlers/caller/JoinClusterHandlerTest.java    |   67 -
 .../handlers/caller/LogCatchUpHandlerTest.java     |  128 --
 .../caller/PullMeasurementSchemaHandlerTest.java   |   92 -
 .../handlers/caller/PullSnapshotHandlerTest.java   |   84 -
 .../caller/SnapshotCatchUpHandlerTest.java         |   58 -
 .../handlers/forwarder/ForwardPlanHandlerTest.java |   59 -
 .../server/heartbeat/DataHeartbeatThreadTest.java  |  160 --
 .../server/heartbeat/HeartbeatThreadTest.java      |  244 ---
 .../server/heartbeat/MetaHeartbeatThreadTest.java  |  244 ---
 .../iotdb/cluster/server/member/BaseMember.java    |  328 ---
 .../cluster/server/member/DataGroupMemberTest.java | 1255 -----------
 .../cluster/server/member/MetaGroupMemberTest.java | 1488 -------------
 .../cluster/server/member/RaftMemberTest.java      |  246 ---
 .../org/apache/iotdb/cluster/utils/Constants.java  |   24 -
 .../cluster/utils/CreateTemplatePlanUtil.java      |   74 -
 .../iotdb/cluster/utils/SerializeUtilTest.java     |  210 --
 cluster/src/test/resources/logback-test.xml        |   41 -
 .../resources/node1conf/iotdb-cluster.properties   |   37 -
 .../resources/node1conf/iotdb-engine.properties    |   30 -
 .../src/test/resources/node1conf/iotdb-metric.yml  |   21 -
 cluster/src/test/resources/node1conf/logback.xml   |  282 ---
 .../resources/node2conf/iotdb-cluster.properties   |   37 -
 .../resources/node2conf/iotdb-engine.properties    |   30 -
 .../src/test/resources/node2conf/iotdb-metric.yml  |   21 -
 cluster/src/test/resources/node2conf/logback.xml   |  282 ---
 .../resources/node3conf/iotdb-cluster.properties   |   37 -
 .../resources/node3conf/iotdb-engine.properties    |   30 -
 .../src/test/resources/node3conf/iotdb-metric.yml  |   21 -
 cluster/src/test/resources/node3conf/logback.xml   |  282 ---
 docker/src/main/Dockerfile-cluster                 |   44 -
 pom.xml                                            |    4 -
 testcontainer/pom.xml                              |   14 -
 thrift-cluster/README.md                           |   22 -
 thrift-cluster/pom.xml                             |   72 -
 thrift-cluster/rpc-changelist.md                   |  181 --
 thrift-cluster/src/main/thrift/cluster.thrift      |  584 ------
 374 files changed, 69099 deletions(-)

diff --git a/cluster/pom.xml b/cluster/pom.xml
deleted file mode 100644
index 61f5b652fb..0000000000
--- a/cluster/pom.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.iotdb</groupId>
-        <artifactId>iotdb-parent</artifactId>
-        <version>0.14.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <artifactId>iotdb-cluster</artifactId>
-    <name>cluster</name>
-    <properties>
-        <cluster.test.skip>false</cluster.test.skip>
-        <cluster.it.skip>${cluster.test.skip}</cluster.it.skip>
-        <cluster.ut.skip>${cluster.test.skip}</cluster.ut.skip>
-    </properties>
-    <dependencies>
-        <!-- The version of thrift is overridden because using 0.13.0 in the cluster module
-        will cause unclear bugs -->
-        <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
-            <version>${thrift.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>service-rpc</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.thrift</groupId>
-                    <artifactId>libthrift</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-server</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.thrift</groupId>
-                    <artifactId>libthrift</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-thrift-cluster</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.thrift</groupId>
-                    <artifactId>libthrift</artifactId>
-                </exclusion>
-            </exclusions>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-server</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-session</artifactId>
-            <version>${project.version}</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-jdbc</artifactId>
-            <version>${project.version}</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <version>${awaitility.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <!-- for mocked test-->
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-module-junit4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.powermock</groupId>
-            <artifactId>powermock-api-mockito2</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
-        </dependency>
-    </dependencies>
-    <profiles>
-        <profile>
-            <id>skipClusterTests</id>
-            <activation>
-                <property>
-                    <name>skipTests</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <cluster.test.skip>true</cluster.test.skip>
-                <cluster.ut.skip>true</cluster.ut.skip>
-                <cluster.it.skip>true</cluster.it.skip>
-            </properties>
-        </profile>
-        <profile>
-            <id>skipUT_Cluster_Tests</id>
-            <activation>
-                <property>
-                    <name>skipUTs</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <cluster.ut.skip>true</cluster.ut.skip>
-            </properties>
-        </profile>
-        <profile>
-            <id>only_test_Cluster</id>
-            <activation>
-                <property>
-                    <name>cluster.test.only</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <cluster.test.skip>false</cluster.test.skip>
-                <cluster.ut.skip>false</cluster.ut.skip>
-                <cluster.it.skip>false</cluster.it.skip>
-            </properties>
-        </profile>
-    </profiles>
-    <build>
-        <plugins>
-            <!--using `mvn test` to run UT, `mvn verify` to run ITs
-                        Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <skipTests>${cluster.ut.skip}</skipTests>
-                    <forkMode>pertest</forkMode>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>run-integration-tests</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <skipTests>${cluster.test.skip}</skipTests>
-                    <skipITs>${cluster.it.skip}</skipITs>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>${maven.assembly.version}</version>
-                <executions>
-                    <!-- Package binaries-->
-                    <execution>
-                        <id>cluster-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <descriptors>
-                                <descriptor>src/assembly/cluster.xml</descriptor>
-                            </descriptors>
-                            <appendAssemblyId>false</appendAssemblyId>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/cluster/src/assembly/cluster.xml b/cluster/src/assembly/cluster.xml
deleted file mode 100644
index 7025a3ed88..0000000000
--- a/cluster/src/assembly/cluster.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or a [...]
-  -->
-<assembly>
-    <id>cluster</id>
-    <formats>
-        <format>dir</format>
-        <format>zip</format>
-    </formats>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>lib</outputDirectory>
-        </dependencySet>
-    </dependencySets>
-    <fileSets>
-        <fileSet>
-            <directory>src/assembly/resources</directory>
-            <outputDirectory>${file.separator}</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/server/src/assembly/resources/conf</directory>
-            <outputDirectory>${file.separator}conf</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/server/src/assembly/resources/tools</directory>
-            <outputDirectory>${file.separator}tools</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/metrics/interface/src/main/assembly/resources/conf</directory>
-            <outputDirectory>conf</outputDirectory>
-        </fileSet>
-    </fileSets>
-</assembly>
diff --git a/cluster/src/assembly/resources/conf/iotdb-cluster.properties b/cluster/src/assembly/resources/conf/iotdb-cluster.properties
deleted file mode 100644
index 45de5102be..0000000000
--- a/cluster/src/assembly/resources/conf/iotdb-cluster.properties
+++ /dev/null
@@ -1,200 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#-------------------------------------------IMPORTANT---------------------------------------------#
-# 1. Note that the system will automatically create a heartbeat port for each metadata service    #
-# and data service. The default metadata heartbeat port is internal_meta_port + 1,                #
-# The default data heartbeat port is internal_data_port + 1.                                      #
-# So when you configure these two items and seed_nodes, pay attention to reserve a port for       #
-# heartbeat service.                                                                              #
-# 2. If open_server_rpc_port is set to true, the server module's RPC port will be turned on,      #
-# and the server module's RPC port will be set to rpc_port (in iotdb-engines.properties) + 1,     #
-# so this port should also be reserved.                                                           #
-#-------------------------------------------IMPORTANT---------------------------------------------#
-
-# used for communication between cluster nodes, eg heartbeat、raft logs and snapshots etc.
-# if this parameter is commented, then the IP that binded by the hostname will be used.
-internal_ip=127.0.0.1
-
-# port for metadata service
-internal_meta_port=9003
-
-# port for data service
-internal_data_port=40010
-
-# port for cluster info API, 6567 by default
-#cluster_info_public_port=6567
-
-# whether open port for server module (for debug purpose)
-# if true, the rpc_port of the single server will be changed to rpc_port (in iotdb-engines.properties) + 1
-# open_server_rpc_port=false
-
-# comma-separated {IP/DOMAIN}:internal_meta_port pairs, when used by start-datanode.sh(.bat),
-# this configuration means the nodes that will form the initial cluster,
-# every node that use start-datanode.sh(.bat) should have the same SEED_NODES, or the
-# building of the initial cluster will fail. WARNING: if the initial cluster is built, this
-# should not be changed before the environment is cleaned.
-# when used by add-node.sh(.bat), this means the nodes to which that the application of joining
-# the cluster will be sent, as all nodes can respond to a request, this configuration can be any
-# nodes that already in the cluster, unnecessary to be the nodes that were used to build the
-# initial cluster by start-datanode.sh(.bat). Several nodes will be picked randomly to send the
-# request, the number of nodes picked depends on the number of retries.
-#seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
-seed_nodes=127.0.0.1:9003
-
-# whether to use thrift compressed protocol for internal communications. If you want to change
-# compression settings for external clients, please modify 'rpc_thrift_compression_enable' in
-# 'iotdb-engine.properties'.
-# WARNING: this must be consistent across all nodes in the cluster
-# rpc_thrift_compression_enable=false
-
-# number of replications for one partition
-default_replica_num=1
-
-# sub raft num for multi-raft
-multi_raft_factor=1
-
-# cluster name to identify different clusters
-# all node's cluster_name in one cluster are the same
-# cluster_name=default
-
-# Thrift socket and connection timeout between raft nodes, in milliseconds.
-# NOTE: the timeout of connection used for sending heartbeats and requesting votes
-# will be adjusted to min(heartbeat_interval_ms, connection_timeout_ms).
-# connection_timeout_ms=20000
-
-# write operation timeout threshold (ms), this is only for internal communications,
-# not for the whole operation.
-# write_operation_timeout_ms=30000
-
-# read operation timeout threshold (ms), this is only for internal communications,
-# not for the whole operation.
-# read_operation_timeout_ms=30000
-
-# the time interval (ms) between two rounds of heartbeat broadcast of one raft group leader.
-# Recommend to set it as 1/10 of election_timeout_ms, but larger than 1 RTT between each two nodes.
-# heartbeat_interval_ms=1000
-
-# The election timeout in follower, or the time waiting for requesting votes in elector, in milliseconds.
-# election_timeout_ms=20000
-
-# catch up timeout threshold (ms), this is used for a follower behind the leader too much,
-# so the leader will send logs(snapshot) to the follower,
-# NOTICE, it may cost minutes of time to send a snapshot,
-# so this parameter should be larger than the snapshot cost time.
-# catch_up_timeout_ms=300000
-
-# whether to use batch append entries in log catch up
-# use_batch_in_catch_up=true
-
-# the minimum number of committed logs in memory, after each log deletion, at most such number of logs
-# will remain in memory. Increasing the number will reduce the chance to use snapshot in catch-ups,
-# but will also increase the memory footprint
-# min_num_of_logs_in_mem=1000
-
-# maximum number of committed logs in memory, when reached, a log deletion will be triggered.
-# Increasing the number will reduce the chance to use snapshot in catch-ups, but will also increase
-# memory footprint
-# max_num_of_logs_in_mem=2000
-
-# Ratio of write memory allocated for raft log, 0.2 by default
-# Increasing the number will reduce the memory allocated for write process in iotdb, but will also
-# increase the memory footprint for raft log, which reduces the chance to use snapshot in catch-ups
-# raft_log_memory_proportion=0.2
-
-# deletion check period of the submitted log
-# log_deletion_check_interval_second=-1
-
-# Whether creating schema automatically is enabled, this will replace the one in iotdb-engine.properties
-# enable_auto_create_schema=true
-
-# consistency level, now three consistency levels are supported: strong, mid, and weak.
-# Strong consistency means the server will first try to synchronize with the leader to get the
-# newest data, if failed(timeout), directly report an error to the user;
-# While mid consistency means the server will first try to synchronize with the leader,
-# but if failed(timeout), it will give up and just use current data it has cached before;
-# Weak consistency does not synchronize with the leader and simply use the local data
-# consistency_level=mid
-
-# Whether to use asynchronous server
-# is_use_async_server=false
-
-# Whether to use asynchronous applier
-# is_use_async_applier=true
-
-# is raft log persistence enabled
-# is_enable_raft_log_persistence=true
-
-# When a certain amount of raft log is reached, it will be flushed to disk
-# It is possible to lose at most flush_raft_log_threshold operations
-# flush_raft_log_threshold=10000
-
-# Size of log buffer in each RaftMember's LogManager(in byte).
-# raft_log_buffer_size=16777216
-
-# The maximum value of the raft log index stored in the memory per raft group,
-# These indexes are used to index the location of the log on the disk
-# max_raft_log_index_size_in_memory=10000
-
-# If leader finds too many uncommitted raft logs, raft group leader will wait for a short period of
-# time, and then append the raft log
-# uncommitted_raft_log_num_for_reject_threshold=500
-
-# If followers find too many committed raft logs have not been applied, followers will reject the raft
-# log sent by leader
-# unapplied_raft_log_num_for_reject_threshold=500
-
-# The maximum size of the raft log saved on disk for each file (in bytes) of each raft group.
-# The default size is 1GB
-# max_raft_log_persist_data_size_per_file=1073741824
-
-# The maximum number of persistent raft log files on disk per raft group,
-# So each raft group's log takes up disk space approximately equals
-# max_raft_log_persist_data_size_per_file*max_number_of_persist_raft_log_files
-# max_number_of_persist_raft_log_files=5
-
-# The maximum number of logs saved on the disk
-# max_persist_raft_log_number_on_disk=1000000
-
-# whether enable use persist log on disk to catch up when no logs found in memory, if set false,
-# will use snapshot to catch up when no logs found in memory.
-# enable_use_persist_log_on_disk_to_catch_up=false
-
-# The number of logs read on the disk at one time, which is mainly used to control the memory usage.
-# This value multiplied by the log size is about the amount of memory used to read logs from the disk at one time.
-# max_number_of_logs_per_fetch_on_disk=1000
-
-# When consistency level is set to mid, query will fail if the log lag exceeds max_read_log_lag
-# This default value is 1000
-# max_read_log_lag=1000
-
-# When a follower tries to sync log with the leader, sync will fail if the log Lag exceeds max_sync_log_lag.
-# This default value is 100000
-# max_sync_log_lag=100000
-
-# Max number of clients in a ClientPool of a member for one node. When the num of clients in the ClientPool exceeds this parameter, the ClientPool blocks the thread that obtains the client for waitClientTimeoutMS.
-# max_client_pernode_permember_number=1000
-
-# Max number of idle clients in a ClientPool of a member for one node. When the num of clients in the ClientPool exceeds this parameter, the ClientPool destroys the client when it returns.
-# max_idle_client_pernode_permember_number=500
-
-# If the number of connections created for a node exceeds  `max_client_pernode_permember_number`,
-# we need to wait so much time for other connections to be released until timeout,
-# or a new connection will be created.
-# wait_client_timeout_ms=5000
diff --git a/cluster/src/assembly/resources/sbin/add-node.bat b/cluster/src/assembly/resources/sbin/add-node.bat
deleted file mode 100755
index d272cf90b9..0000000000
--- a/cluster/src/assembly/resources/sbin/add-node.bat
+++ /dev/null
@@ -1,133 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-echo ````````````````````````
-echo Starting IoTDB (Cluster Mode)
-echo ````````````````````````
-
-PATH %PATH%;%JAVA_HOME%\bin\
-set "FULL_VERSION="
-set "MAJOR_VERSION="
-set "MINOR_VERSION="
-
-
-for /f tokens^=2-5^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do (
-	set "FULL_VERSION=%%j-%%k-%%l-%%m"
-	IF "%%j" == "1" (
-	    set "MAJOR_VERSION=%%k"
-	    set "MINOR_VERSION=%%l"
-	) else (
-	    set "MAJOR_VERSION=%%j"
-	    set "MINOR_VERSION=%%k"
-	)
-)
-
-set JAVA_VERSION=%MAJOR_VERSION%
-
-IF NOT %JAVA_VERSION% == 8 (
-	IF NOT %JAVA_VERSION% == 11 (
-		echo IoTDB only supports jdk8 or jdk11, please check your java version.
-		goto finally
-	)
-)
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
-popd
-
-SET enable_printgc=false
-IF "%1" == "printgc" (
-  SET enable_printgc=true
-  SHIFT
-)
-
-SET IOTDB_CONF=%1
-IF "%IOTDB_CONF%" == "" (
-  SET IOTDB_CONF=%IOTDB_HOME%\conf
-) ELSE (
-  SET IOTDB_CONF="%IOTDB_CONF%"
-)
-
-SET IOTDB_LOGS=%IOTDB_HOME%\logs
-
-IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
-  IF  "%enable_printgc%" == "true" (
-    CALL "%IOTDB_CONF%\iotdb-env.bat" printgc
-  ) ELSE (
-    CALL "%IOTDB_CONF%\iotdb-env.bat"
-  )
-) ELSE IF EXIST "%IOTDB_HOME%/conf/iotdb-env.bat" (
-  IF  "%enable_printgc%" == "true" (
-    CALL "%IOTDB_HOME%/conf/iotdb-env.bat" printgc
-  ) ELSE (
-    CALL "%IOTDB_HOME%/conf/iotdb-env.bat"
-   )
-) ELSE (
-  echo "can't find iotdb-env.bat"
-)
-
-@setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
-set CONF_PARAMS=-a
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.cluster.ClusterIoTDB
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM -----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -Dlogback.configurationFile="%IOTDB_CONF%\logback.xml"^
- -DIOTDB_HOME="%IOTDB_HOME%"^
- -DTSFILE_HOME="%IOTDB_HOME%"^
- -DTSFILE_CONF="%IOTDB_CONF%"^
- -DIOTDB_CONF="%IOTDB_CONF%"
-
-@REM ***** CLASSPATH library setting *****
-@REM Ensure that any user defined CLASSPATH variables are not used on startup
-set CLASSPATH="%IOTDB_HOME%\lib"
-
-@REM For each jar in the IOTDB_HOME lib directory call append to build the CLASSPATH variable.
-set CLASSPATH=%CLASSPATH%;"%IOTDB_HOME%\lib\*"
-set CLASSPATH=%CLASSPATH%;iotdb.IoTDB
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-goto :eof
-
-@REM -----------------------------------------------------------------------------
-:okClasspath
-
-rem echo CLASSPATH: %CLASSPATH%
-
-"%JAVA_HOME%\bin\java" %ILLEGAL_ACCESS_PARAMS% %JAVA_OPTS% %IOTDB_HEAP_OPTS% -cp %CLASSPATH% %IOTDB_JMX_OPTS% %MAIN_CLASS% %CONF_PARAMS%
-goto finally
-
-:err
-echo JAVA_HOME environment variable must be set!
-pause
-
-
-@REM -----------------------------------------------------------------------------
-:finally
-
-pause
-
-ENDLOCAL
\ No newline at end of file
diff --git a/cluster/src/assembly/resources/sbin/add-node.sh b/cluster/src/assembly/resources/sbin/add-node.sh
deleted file mode 100755
index 321299902b..0000000000
--- a/cluster/src/assembly/resources/sbin/add-node.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-echo ---------------------
-echo "Starting IoTDB (Cluster Mode)"
-echo ---------------------
-
-if [ -z "${IOTDB_HOME}" ]; then
-  export IOTDB_HOME="`dirname "$0"`/.."
-fi
-
-enable_printgc=false
-if [ "$#" -ge "1" -a "$1" == "printgc" ]; then
-  enable_printgc=true;
-  shift
-fi
-
-IOTDB_CONF=$1
-if [ -z "${IOTDB_CONF}" ]; then
-  export IOTDB_CONF=${IOTDB_HOME}/conf
-fi
-
-if [ -f "$IOTDB_CONF/iotdb-env.sh" ]; then
-    if [ $enable_printgc == "true" ]; then
-      . "$IOTDB_CONF/iotdb-env.sh" "printgc"
-    else
-       . "$IOTDB_CONF/iotdb-env.sh"
-    fi
-elif [ -f "${IOTDB_HOME}/conf/iotdb-env.sh" ]; then
-    if [ $enable_printgc == "true" ]; then
-      . "${IOTDB_HOME}/conf/iotdb-env.sh" "printgc"
-    else
-      . "${IOTDB_HOME}/conf/iotdb-env.sh"
-    fi
-else
-    echo "can't find $IOTDB_CONF/iotdb-env.sh"
-fi
-
-
-if [ -n "$JAVA_HOME" ]; then
-    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
-        if [ -x "$java" ]; then
-            JAVA="$java"
-            break
-        fi
-    done
-else
-    JAVA=java
-fi
-
-if [ -z $JAVA ] ; then
-    echo Unable to find java executable. Check JAVA_HOME and PATH environment variables.  > /dev/stderr
-    exit 1;
-fi
-
-CLASSPATH=""
-for f in ${IOTDB_HOME}/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}":"$f
-done
-classname=org.apache.iotdb.cluster.ClusterIoTDB
-
-launch_service()
-{
-	class="$1"
-	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
-	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
-	exec "$JAVA" $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" "$class" -a
-	return $?
-}
-
-# Start up the service
-launch_service "$classname"
-
-exit $?
diff --git a/cluster/src/assembly/resources/sbin/nodetool.bat b/cluster/src/assembly/resources/sbin/nodetool.bat
deleted file mode 100755
index 7dd9111dbc..0000000000
--- a/cluster/src/assembly/resources/sbin/nodetool.bat
+++ /dev/null
@@ -1,58 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%CD%
-popd
-
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.cluster.utils.nodetool.NodeTool
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM -----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -DIOTDB_HOME=%IOTDB_HOME%
-
-REM For each jar in the IOTDB_HOME lib directory call append to build the CLASSPATH variable.
-for %%i in ("%IOTDB_HOME%\lib\*.jar") do call :append "%%i"
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-goto :eof
-
-REM -----------------------------------------------------------------------------
-:okClasspath
-
-"%JAVA_HOME%\bin\java" %JAVA_OPTS% -cp "%CLASSPATH%" %MAIN_CLASS% %*
-
-goto finally
-
-
-:err
-echo JAVA_HOME environment variable must be set!
-pause
-
-
-@REM -----------------------------------------------------------------------------
-:finally
-
-ENDLOCAL
\ No newline at end of file
diff --git a/cluster/src/assembly/resources/sbin/nodetool.sh b/cluster/src/assembly/resources/sbin/nodetool.sh
deleted file mode 100755
index ab005a722a..0000000000
--- a/cluster/src/assembly/resources/sbin/nodetool.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-if [ -z "${IOTDB_HOME}" ]; then
-  export IOTDB_HOME="$(cd "`dirname "$0"`"/..; pwd)"
-fi
-
-
-MAIN_CLASS=org.apache.iotdb.cluster.utils.nodetool.NodeTool
-
-
-CLASSPATH=""
-for f in ${IOTDB_HOME}/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}":"$f
-done
-
-
-if [ -n "$JAVA_HOME" ]; then
-    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
-        if [ -x "$java" ]; then
-            JAVA="$java"
-            break
-        fi
-    done
-else
-    JAVA=java
-fi
-
-exec "$JAVA" -cp "$CLASSPATH" "$MAIN_CLASS" "$@"
-
-exit $?
diff --git a/cluster/src/assembly/resources/sbin/remove-node.bat b/cluster/src/assembly/resources/sbin/remove-node.bat
deleted file mode 100755
index fc3202b711..0000000000
--- a/cluster/src/assembly/resources/sbin/remove-node.bat
+++ /dev/null
@@ -1,110 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-echo ````````````````````````
-echo Starting to remove a node (Cluster Mode)
-echo ````````````````````````
-
-PATH %PATH%;%JAVA_HOME%\bin\
-set "FULL_VERSION="
-set "MAJOR_VERSION="
-set "MINOR_VERSION="
-
-
-for /f tokens^=2-5^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do (
-	set "FULL_VERSION=%%j-%%k-%%l-%%m"
-	IF "%%j" == "1" (
-	    set "MAJOR_VERSION=%%k"
-	    set "MINOR_VERSION=%%l"
-	) else (
-	    set "MAJOR_VERSION=%%j"
-	    set "MINOR_VERSION=%%k"
-	)
-)
-
-set JAVA_VERSION=%MAJOR_VERSION%
-
-IF NOT %JAVA_VERSION% == 8 (
-	IF NOT %JAVA_VERSION% == 11 (
-		echo IoTDB only supports jdk8 or jdk11, please check your java version.
-		goto finally
-	)
-)
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
-popd
-
-set IOTDB_CONF=%IOTDB_HOME%\conf
-set IOTDB_LOGS=%IOTDB_HOME%\logs
-
-@setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
-set CONF_PARAMS=-r
-set is_conf_path=false
-for %%i in (%*) do (
-	set CONF_PARAMS=!CONF_PARAMS! %%i
-)
-
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.cluster.ClusterIoTDB
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM -----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -Dlogback.configurationFile="%IOTDB_CONF%\logback.xml"^
- -DIOTDB_HOME="%IOTDB_HOME%"^
- -DTSFILE_HOME="%IOTDB_HOME%"^
- -DCLUSTER_CONF="%IOTDB_CONF%"^
- -DIOTDB_CONF="%IOTDB_CONF%"
-
-@REM ***** CLASSPATH library setting *****
-@REM Ensure that any user defined CLASSPATH variables are not used on startup
-set CLASSPATH="%IOTDB_HOME%\lib"
-
-@REM For each jar in the IOTDB_HOME lib directory call append to build the CLASSPATH variable.
-set CLASSPATH=%CLASSPATH%;"%IOTDB_HOME%\lib\*"
-set CLASSPATH=%CLASSPATH%;iotdb.ClusterIoTDB
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-goto :eof
-
-@REM -----------------------------------------------------------------------------
-:okClasspath
-
-rem echo CLASSPATH: %CLASSPATH%
-
-"%JAVA_HOME%\bin\java" %JAVA_OPTS% %IOTDB_HEAP_OPTS% -cp %CLASSPATH% %IOTDB_JMX_OPTS% %MAIN_CLASS% %CONF_PARAMS%
-goto finally
-
-:err
-echo JAVA_HOME environment variable must be set!
-pause
-
-
-@REM -----------------------------------------------------------------------------
-:finally
-
-pause
-
-ENDLOCAL
\ No newline at end of file
diff --git a/cluster/src/assembly/resources/sbin/remove-node.sh b/cluster/src/assembly/resources/sbin/remove-node.sh
deleted file mode 100755
index 0cafad1535..0000000000
--- a/cluster/src/assembly/resources/sbin/remove-node.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-echo ---------------------
-echo "Starting to remove a node(Cluster Mode)"
-echo ---------------------
-
-if [ -z "${IOTDB_HOME}" ]; then
-  export IOTDB_HOME="`dirname "$0"`/.."
-fi
-
-IOTDB_CONF=${IOTDB_HOME}/conf
-
-CONF_PARAMS="-r "$*
-
-if [ -n "$JAVA_HOME" ]; then
-    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
-        if [ -x "$java" ]; then
-            JAVA="$java"
-            break
-        fi
-    done
-else
-    JAVA=java
-fi
-
-if [ -z $JAVA ] ; then
-    echo Unable to find java executable. Check JAVA_HOME and PATH environment variables.  > /dev/stderr
-    exit 1;
-fi
-
-CLASSPATH=""
-for f in ${IOTDB_HOME}/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}":"$f
-done
-classname=org.apache.iotdb.cluster.ClusterIoTDB
-
-launch_service()
-{
-	class="$1"
-	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
-	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -DCLUSTER_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
-	exec "$JAVA" $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" "$class" $CONF_PARAMS
-	return $?
-}
-
-# Start up the service
-launch_service "$classname"
-
-exit $?
diff --git a/cluster/src/assembly/resources/sbin/start-node.bat b/cluster/src/assembly/resources/sbin/start-node.bat
deleted file mode 100755
index a16e79b016..0000000000
--- a/cluster/src/assembly/resources/sbin/start-node.bat
+++ /dev/null
@@ -1,136 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-echo ````````````````````````
-echo Starting IoTDB (Cluster Mode)
-echo ````````````````````````
-
-PATH %PATH%;%JAVA_HOME%\bin\
-set "FULL_VERSION="
-set "MAJOR_VERSION="
-set "MINOR_VERSION="
-
-
-for /f tokens^=2-5^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do (
-	set "FULL_VERSION=%%j-%%k-%%l-%%m"
-	IF "%%j" == "1" (
-	    set "MAJOR_VERSION=%%k"
-	    set "MINOR_VERSION=%%l"
-	) else (
-	    set "MAJOR_VERSION=%%j"
-	    set "MINOR_VERSION=%%k"
-	)
-)
-
-set JAVA_VERSION=%MAJOR_VERSION%
-
-@REM we do not check jdk that version less than 1.8 because they are too stale...
-IF "%JAVA_VERSION%" == "6" (
-	echo IoTDB only supports jdk >= 8, please check your java version.
-	goto finally
-)
-IF "%JAVA_VERSION%" == "7" (
-	echo IoTDB only supports jdk >= 8, please check your java version.
-	goto finally
-)
-
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
-popd
-
-SET enable_printgc=false
-IF "%1" == "printgc" (
-  SET enable_printgc=true
-  SHIFT
-)
-
-SET IOTDB_CONF=%1
-IF "%IOTDB_CONF%" == "" (
-  SET IOTDB_CONF=%IOTDB_HOME%\conf
-) ELSE (
-  SET IOTDB_CONF="%IOTDB_CONF%"
-)
-
-SET IOTDB_LOGS=%IOTDB_HOME%\logs
-
-IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
-  IF  "%enable_printgc%" == "true" (
-    CALL "%IOTDB_CONF%\iotdb-env.bat" printgc
-  ) ELSE (
-    CALL "%IOTDB_CONF%\iotdb-env.bat"
-  )
-) ELSE IF EXIST "%IOTDB_HOME%/conf/iotdb-env.bat" (
-  IF  "%enable_printgc%" == "true" (
-    CALL "%IOTDB_HOME%/conf/iotdb-env.bat" printgc
-  ) ELSE (
-    CALL "%IOTDB_HOME%/conf/iotdb-env.bat"
-   )
-) ELSE (
-  echo "can't find iotdb-env.bat"
-)
-
-@setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
-set CONF_PARAMS=-s
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.cluster.ClusterIoTDB
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM -----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -Dlogback.configurationFile="%IOTDB_CONF%\logback.xml"^
- -DIOTDB_HOME="%IOTDB_HOME%"^
- -DTSFILE_HOME="%IOTDB_HOME%"^
- -DTSFILE_CONF="%IOTDB_CONF%"^
- -DIOTDB_CONF="%IOTDB_CONF%"
-
-@REM ***** CLASSPATH library setting *****
-@REM Ensure that any user defined CLASSPATH variables are not used on startup
-set CLASSPATH="%IOTDB_HOME%\lib\*"
-
-@REM this special suffix 'iotdb.ClusterIoTDB' is mandatory as stop-node.bat uses it to filter the process id.
-set CLASSPATH=%CLASSPATH%;iotdb.ClusterIoTDB
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-goto :eof
-
-@REM -----------------------------------------------------------------------------
-:okClasspath
-
-rem echo CLASSPATH: %CLASSPATH%
-
-"%JAVA_HOME%\bin\java" %ILLEGAL_ACCESS_PARAMS% %JAVA_OPTS% %IOTDB_HEAP_OPTS% -cp %CLASSPATH% %IOTDB_JMX_OPTS% %MAIN_CLASS% %CONF_PARAMS%
-goto finally
-
-:err
-echo JAVA_HOME environment variable must be set!
-pause
-
-
-@REM -----------------------------------------------------------------------------
-:finally
-
-pause
-
-ENDLOCAL
diff --git a/cluster/src/assembly/resources/sbin/start-node.sh b/cluster/src/assembly/resources/sbin/start-node.sh
deleted file mode 100755
index 31a84f58a1..0000000000
--- a/cluster/src/assembly/resources/sbin/start-node.sh
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-echo ---------------------
-echo "Starting IoTDB (Cluster Mode)"
-echo ---------------------
-
-if [ -z "${IOTDB_HOME}" ]; then
-  export IOTDB_HOME="`dirname "$0"`/.."
-fi
-
-enable_printgc=false
-if [ "$#" -ge "1" -a "$1" == "printgc" ]; then
-  enable_printgc=true;
-  shift
-fi
-
-IOTDB_CONF=$1
-if [ -z "${IOTDB_CONF}" ]; then
-  export IOTDB_CONF=${IOTDB_HOME}/conf
-fi
-
-if [ -f "$IOTDB_CONF/iotdb-env.sh" ]; then
-    if [ $enable_printgc == "true" ]; then
-      . "$IOTDB_CONF/iotdb-env.sh" "printgc"
-    else
-        . "$IOTDB_CONF/iotdb-env.sh"
-    fi
-elif [ -f "${IOTDB_HOME}/conf/iotdb-env.sh" ]; then
-    if [ $enable_printgc == "true" ]; then
-      . "${IOTDB_HOME}/conf/iotdb-env.sh" "printgc"
-    else
-      . "${IOTDB_HOME}/conf/iotdb-env.sh"
-    fi
-else
-    echo "can't find $IOTDB_CONF/iotdb-env.sh"
-fi
-
-CONF_PARAMS="-s "$*
-
-if [ -n "$JAVA_HOME" ]; then
-    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
-        if [ -x "$java" ]; then
-            JAVA="$java"
-            break
-        fi
-    done
-else
-    JAVA=java
-fi
-
-if [ -z $JAVA ] ; then
-    echo Unable to find java executable. Check JAVA_HOME and PATH environment variables.  > /dev/stderr
-    exit 1;
-fi
-
-CLASSPATH=""
-for f in ${IOTDB_HOME}/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}":"$f
-done
-classname=org.apache.iotdb.cluster.ClusterIoTDB
-
-launch_service()
-{
-	class="$1"
-	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
-	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -DTSFILE_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
-	exec "$JAVA" $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" "$class" $CONF_PARAMS
-	return $?
-}
-
-# Start up the service
-launch_service "$classname"
-
-exit $?
diff --git a/cluster/src/assembly/resources/sbin/stop-node.bat b/cluster/src/assembly/resources/sbin/stop-node.bat
deleted file mode 100644
index 29c54c9e94..0000000000
--- a/cluster/src/assembly/resources/sbin/stop-node.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-
-pushd..
-set exec_dir=%cd%
-popd
-set exec_dir=%exec_dir:\=\\%
-wmic process where (commandline like "%%iotdb.ClusterIoTDB%%" and not name="wmic.exe" and  commandline  like "%%%exec_dir%%%") delete
-
diff --git a/cluster/src/assembly/resources/sbin/stop-node.sh b/cluster/src/assembly/resources/sbin/stop-node.sh
deleted file mode 100644
index 4d670c4954..0000000000
--- a/cluster/src/assembly/resources/sbin/stop-node.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-PIDS=$(ps ax | grep -i 'ClusterIoTDB' | grep java | grep -v grep | awk '{print $1}')
-sig=0
-for every_pid in ${PIDS}
-do
-  cwd_path=$(ls -l /proc/$every_pid | grep "cwd ->" | grep -v grep | awk '{print $NF}')
-  pwd_path=$(/bin/pwd)
-  if [[ $pwd_path =~ $cwd_path ]]; then
-    kill -s TERM $every_pid
-    echo "close IoTDB"
-    sig=1
-  fi
-done
-
-if [ $sig -eq 0 ]; then
-  echo "No IoTDB server to stop"
-  exit 1
-fi
-
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
deleted file mode 100644
index 30b0a3bf93..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster;
-
-import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.jdbc.Config;
-import org.apache.iotdb.rpc.IoTDBConnectionException;
-import org.apache.iotdb.rpc.RpcTransportFactory;
-import org.apache.iotdb.rpc.StatementExecutionException;
-import org.apache.iotdb.rpc.TSStatusCode;
-import org.apache.iotdb.service.rpc.thrift.TSCloseOperationReq;
-import org.apache.iotdb.service.rpc.thrift.TSCloseSessionReq;
-import org.apache.iotdb.service.rpc.thrift.TSCreateTimeseriesReq;
-import org.apache.iotdb.service.rpc.thrift.TSExecuteStatementReq;
-import org.apache.iotdb.service.rpc.thrift.TSExecuteStatementResp;
-import org.apache.iotdb.service.rpc.thrift.TSIService;
-import org.apache.iotdb.service.rpc.thrift.TSIService.Client;
-import org.apache.iotdb.service.rpc.thrift.TSIService.Client.Factory;
-import org.apache.iotdb.service.rpc.thrift.TSInsertStringRecordReq;
-import org.apache.iotdb.service.rpc.thrift.TSOpenSessionReq;
-import org.apache.iotdb.service.rpc.thrift.TSOpenSessionResp;
-import org.apache.iotdb.service.rpc.thrift.TSProtocolVersion;
-import org.apache.iotdb.session.SessionDataSet;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.write.schema.IMeasurementSchema;
-import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.DefaultParser;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TCompactProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@SuppressWarnings("java:S106")
-public class ClientMain {
-
-  private static final Logger logger = LoggerFactory.getLogger(ClientMain.class);
-
-  private static final String PARAM_INSERTION = "i";
-  private static final String PARAM_QUERY = "q";
-  private static final String PARAM_DELETE_STORAGE_GROUP = "dsg";
-  private static final String PARAM_DELETE_SERIES = "ds";
-  private static final String PARAM_QUERY_PORTS = "qp";
-  private static final String PARAM_INSERT_PORT = "ip";
-  private static final String PARAM_BATCH = "b";
-  private static Options options = new Options();
-
-  private static String ip = "127.0.0.1";
-  private static int port = 6667;
-
-  static {
-    options.addOption(new Option(PARAM_INSERTION, "Perform insertion"));
-    options.addOption(new Option(PARAM_QUERY, "Perform query"));
-    options.addOption(new Option(PARAM_DELETE_SERIES, "Perform deleting timeseries"));
-    options.addOption(new Option(PARAM_DELETE_STORAGE_GROUP, "Perform deleting storage group"));
-    options.addOption(
-        new Option(PARAM_QUERY_PORTS, true, "Ports to query (ip is currently " + "localhost)"));
-    options.addOption(new Option(PARAM_INSERT_PORT, true, "Port to perform insertion"));
-    options.addOption(new Option(PARAM_BATCH, "Test batch statement"));
-  }
-
-  private static Map<String, TSStatus> failedQueries;
-
-  private static final String[] STORAGE_GROUPS =
-      new String[] {
-        "root.beijing", "root.shanghai", "root.guangzhou", "root.shenzhen",
-      };
-
-  private static final String[] DEVICES =
-      new String[] {
-        "root.beijing.d1", "root.shanghai.d1", "root.guangzhou.d1", "root.shenzhen.d1",
-      };
-
-  private static final String[] MEASUREMENTS = new String[] {"s1"};
-
-  private static final TSDataType[] DATA_TYPES = new TSDataType[] {TSDataType.DOUBLE};
-
-  private static List<IMeasurementSchema> schemas;
-
-  private static final String[] DATA_QUERIES =
-      new String[] {
-        // raw data multi series
-        "SELECT * FROM root",
-        "SELECT * FROM root WHERE time <= 691200000",
-        "SELECT * FROM root WHERE time >= 391200000 and time <= 691200000",
-        "SELECT * FROM root.*.* WHERE s1 <= 0.7",
-        // raw data single series
-        "SELECT s1 FROM root.beijing.d1",
-        "SELECT s1 FROM root.shanghai.d1",
-        "SELECT s1 FROM root.guangzhou.d1",
-        "SELECT s1 FROM root.shenzhen.d1",
-        // aggregation
-        "SELECT count(s1) FROM root.*.*",
-        "SELECT avg(s1) FROM root.*.*",
-        "SELECT sum(s1) FROM root.*.*",
-        "SELECT max_value(s1) FROM root.*.*",
-        "SELECT count(s1) FROM root.*.* where time <= 691200000",
-        "SELECT count(s1) FROM root.*.* where s1 <= 0.7",
-        // group by device
-        "SELECT * FROM root GROUP BY DEVICE",
-        // fill
-        "SELECT s1 FROM root.beijing.d1 WHERE time = 86400000 FILL (DOUBLE[PREVIOUS,1d])",
-        "SELECT s1 FROM root.shanghai.d1 WHERE time = 86400000 FILL (DOUBLE[LINEAR,1d,1d])",
-        "SELECT s1 FROM root.guangzhou.d1 WHERE time = 126400000 FILL (DOUBLE[PREVIOUS,1d])",
-        "SELECT s1 FROM root.shenzhen.d1 WHERE time = 126400000 FILL (DOUBLE[LINEAR,1d,1d])",
-        // group by
-        "SELECT COUNT(*) FROM root.*.* GROUP BY ([0, 864000000), 3d, 3d)",
-        "SELECT AVG(*) FROM root.*.* WHERE s1 <= 0.7 GROUP BY ([0, 864000000), 3d, 3d)",
-        // last
-        "SELECT LAST s1 FROM root.*.*",
-      };
-
-  private static final String[] META_QUERY =
-      new String[] {
-        "SHOW STORAGE GROUP",
-        "SHOW TIMESERIES root",
-        "COUNT TIMESERIES root",
-        "COUNT TIMESERIES root GROUP BY LEVEL=2",
-        "SHOW DEVICES",
-        "SHOW TIMESERIES root limit 1 offset 1",
-      };
-
-  public static void main(String[] args)
-      throws TException, StatementExecutionException, IoTDBConnectionException, ParseException,
-          SQLException, ClassNotFoundException {
-    CommandLineParser parser = new DefaultParser();
-    CommandLine commandLine = parser.parse(options, args);
-    boolean noOption = args.length == 0;
-
-    failedQueries = new HashMap<>();
-    prepareSchema();
-
-    if (commandLine.hasOption(PARAM_INSERT_PORT)) {
-      port = Integer.parseInt(commandLine.getOptionValue(PARAM_INSERT_PORT));
-    }
-
-    doInsertion(noOption, commandLine);
-
-    doQuery(noOption, commandLine);
-
-    doDeleteSeries(noOption, commandLine);
-
-    doDeleteSG(noOption, commandLine);
-
-    doBatchStmt(noOption, commandLine);
-  }
-
-  private static void doInsertion(boolean noOption, CommandLine commandLine) throws TException {
-    if (noOption || commandLine.hasOption(PARAM_INSERTION)) {
-      System.out.println("Test insertion");
-      Client client = getClient(ip, port);
-      long sessionId = connectClient(client);
-      testInsertion(client, sessionId);
-      client.closeSession(new TSCloseSessionReq(sessionId));
-    }
-  }
-
-  private static void doQuery(boolean noOption, CommandLine commandLine)
-      throws StatementExecutionException, TException, IoTDBConnectionException {
-    if (noOption || commandLine.hasOption(PARAM_QUERY)) {
-      int[] queryPorts = null;
-      if (commandLine.hasOption(PARAM_QUERY_PORTS)) {
-        queryPorts = parseIntArray(commandLine.getOptionValue(PARAM_QUERY_PORTS));
-      }
-      if (queryPorts == null) {
-        queryPorts = new int[] {port, port + 1, port + 2};
-      }
-      for (int queryPort : queryPorts) {
-        System.out.println("Test port: " + queryPort);
-
-        Client client = getClient(ip, queryPort);
-        long sessionId = connectClient(client);
-        System.out.println("Test data queries");
-        testQuery(client, sessionId, DATA_QUERIES);
-
-        System.out.println("Test metadata queries");
-        testQuery(client, sessionId, META_QUERY);
-
-        logger.info("Failed queries: {}", failedQueries);
-        client.closeSession(new TSCloseSessionReq(sessionId));
-      }
-    }
-  }
-
-  private static void doDeleteSeries(boolean noOption, CommandLine commandLine) throws TException {
-    if (noOption || commandLine.hasOption(PARAM_DELETE_SERIES)) {
-      System.out.println("Test delete timeseries");
-      Client client = getClient(ip, port);
-      long sessionId = connectClient(client);
-      testDeleteTimeseries(client, sessionId);
-      client.closeSession(new TSCloseSessionReq(sessionId));
-    }
-  }
-
-  private static void doDeleteSG(boolean noOption, CommandLine commandLine)
-      throws StatementExecutionException, TException, IoTDBConnectionException {
-    if (noOption || commandLine.hasOption(PARAM_DELETE_STORAGE_GROUP)) {
-      System.out.println("Test delete storage group");
-      Client client = getClient(ip, port);
-      long sessionId = connectClient(client);
-      testDeleteStorageGroup(client, sessionId);
-      client.closeSession(new TSCloseSessionReq(sessionId));
-    }
-  }
-
-  private static void doBatchStmt(boolean noOption, CommandLine commandLine)
-      throws SQLException, ClassNotFoundException {
-    if (noOption || commandLine.hasOption(PARAM_BATCH)) {
-      System.out.println("Test batch create sgs");
-      testBatch(ip, port);
-    }
-  }
-
-  private static int[] parseIntArray(String str) {
-    if (str == null) {
-      return new int[0];
-    }
-    String[] split = str.split(",");
-    int[] ret = new int[split.length];
-    for (int i = 0; i < split.length; i++) {
-      ret[i] = Integer.parseInt(split[i]);
-    }
-    return ret;
-  }
-
-  private static long connectClient(Client client) throws TException {
-    TSOpenSessionReq openReq =
-        new TSOpenSessionReq(
-            TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3, ZoneId.systemDefault().getId());
-    openReq.setUsername("root");
-    openReq.setPassword("root");
-    TSOpenSessionResp openResp = client.openSession(openReq);
-    return openResp.getSessionId();
-  }
-
-  @SuppressWarnings({"java:S2095"}) // the transport is used later
-  private static Client getClient(String ip, int port) throws TTransportException {
-    TSIService.Client.Factory factory = new Factory();
-    TTransport transport = RpcTransportFactory.INSTANCE.getTransportWithNoTimeout(ip, port);
-    transport.open();
-    TProtocol protocol =
-        IoTDBDescriptor.getInstance().getConfig().isRpcThriftCompressionEnable()
-            ? new TCompactProtocol(transport)
-            : new TBinaryProtocol(transport);
-    return factory.getClient(protocol);
-  }
-
-  private static void prepareSchema() {
-    schemas = new ArrayList<>();
-    for (String device : DEVICES) {
-      for (int i = 0; i < MEASUREMENTS.length; i++) {
-        String measurement = MEASUREMENTS[i];
-        schemas.add(
-            new MeasurementSchema(
-                device + IoTDBConstant.PATH_SEPARATOR + measurement, DATA_TYPES[i]));
-      }
-    }
-  }
-
-  private static void testQuery(Client client, long sessionId, String[] queries)
-      throws TException, StatementExecutionException, IoTDBConnectionException {
-    long statementId = client.requestStatementId(sessionId);
-    for (String dataQuery : queries) {
-      executeQuery(client, sessionId, dataQuery, statementId);
-    }
-
-    TSCloseOperationReq tsCloseOperationReq = new TSCloseOperationReq(sessionId);
-    tsCloseOperationReq.setStatementId(statementId);
-    client.closeOperation(tsCloseOperationReq);
-  }
-
-  private static void executeQuery(Client client, long sessionId, String query, long statementId)
-      throws TException, StatementExecutionException, IoTDBConnectionException {
-    if (logger.isInfoEnabled()) {
-      logger.info("{ {} }", query);
-    }
-    TSExecuteStatementResp resp =
-        client.executeQueryStatement(
-            new TSExecuteStatementReq(sessionId, query, statementId).setFetchSize(1000));
-    if (resp.status.code != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-      failedQueries.put(query, resp.status);
-      return;
-    }
-
-    long queryId = resp.getQueryId();
-    if (logger.isInfoEnabled()) {
-      logger.info(resp.columns.toString());
-    }
-
-    try (SessionDataSet dataSet =
-        new SessionDataSet(
-            query,
-            resp.getColumns(),
-            resp.getDataTypeList(),
-            resp.columnNameIndexMap,
-            queryId,
-            statementId,
-            client,
-            sessionId,
-            resp.queryDataSet,
-            false)) {
-      while (dataSet.hasNext()) {
-        if (logger.isInfoEnabled()) {
-          logger.info(dataSet.next().toString());
-        }
-      }
-    }
-    System.out.println();
-
-    TSCloseOperationReq tsCloseOperationReq = new TSCloseOperationReq(sessionId);
-    tsCloseOperationReq.setQueryId(queryId);
-    client.closeOperation(tsCloseOperationReq);
-  }
-
-  private static void testDeleteStorageGroup(Client client, long sessionId)
-      throws TException, StatementExecutionException, IoTDBConnectionException {
-    if (logger.isInfoEnabled()) {
-      logger.info(client.deleteStorageGroups(sessionId, Arrays.asList(STORAGE_GROUPS)).toString());
-    }
-
-    testQuery(client, sessionId, new String[] {"SELECT * FROM root"});
-  }
-
-  private static void registerTimeseries(long sessionId, Client client) throws TException {
-    TSCreateTimeseriesReq req = new TSCreateTimeseriesReq();
-    req.setSessionId(sessionId);
-    for (IMeasurementSchema schema : schemas) {
-      req.setDataType(schema.getType().ordinal());
-      req.setEncoding(schema.getEncodingType().ordinal());
-      req.setCompressor(schema.getCompressor().ordinal());
-      req.setPath(schema.getMeasurementId());
-      if (logger.isInfoEnabled()) {
-        logger.info(client.createTimeseries(req).toString());
-      }
-    }
-  }
-
-  @SuppressWarnings("ConstantConditions")
-  private static void testInsertion(Client client, long sessionId) throws TException {
-    for (String storageGroup : STORAGE_GROUPS) {
-      if (logger.isInfoEnabled()) {
-        logger.info(client.setStorageGroup(sessionId, storageGroup).toString());
-      }
-    }
-
-    registerTimeseries(sessionId, client);
-
-    TSInsertStringRecordReq insertReq = new TSInsertStringRecordReq();
-    insertReq.setMeasurements(Arrays.asList(MEASUREMENTS));
-    insertReq.setSessionId(sessionId);
-
-    for (int i = 0; i < 10; i++) {
-      List<String> values = new ArrayList<>(MEASUREMENTS.length);
-      insertReq.setTimestamp(i * 24 * 3600 * 1000L);
-      for (int i1 = 0; i1 < MEASUREMENTS.length; i1++) {
-        switch (DATA_TYPES[i1]) {
-          case DOUBLE:
-            values.add(Double.toString(i * 0.1));
-            break;
-          case BOOLEAN:
-            values.add(Boolean.toString(i % 2 == 0));
-            break;
-          case INT64:
-            values.add(Long.toString(i));
-            break;
-          case INT32:
-            values.add(Integer.toString(i));
-            break;
-          case FLOAT:
-            values.add(Float.toString(i * 0.1f));
-            break;
-          case TEXT:
-            values.add("S" + i);
-            break;
-        }
-      }
-
-      insertReq.setValues(values);
-
-      for (String device : DEVICES) {
-        insertReq.setPrefixPath(device);
-        if (logger.isInfoEnabled()) {
-          logger.info(insertReq.toString());
-          logger.info(client.insertStringRecord(insertReq).toString());
-        }
-      }
-    }
-  }
-
-  private static void testDeleteTimeseries(Client client, long sessionId) throws TException {
-    List<String> paths = new ArrayList<>();
-    for (String measurement : MEASUREMENTS) {
-      for (String device : DEVICES) {
-        paths.add(device + "." + measurement);
-      }
-    }
-    if (logger.isInfoEnabled()) {
-      logger.info(client.deleteTimeseries(sessionId, paths).toString());
-    }
-  }
-
-  private static void testBatch(String ip, int port) throws ClassNotFoundException, SQLException {
-    Class.forName(Config.JDBC_DRIVER_NAME);
-    try (Connection connection =
-            DriverManager.getConnection(
-                Config.IOTDB_URL_PREFIX + String.format("%s:%d/", ip, port), "root", "root");
-        Statement statement = connection.createStatement()) {
-
-      statement.addBatch("SET STORAGE GROUP TO root.batch1");
-      statement.addBatch("SET STORAGE GROUP TO root.batch2");
-      statement.addBatch("SET STORAGE GROUP TO root.batch3");
-      statement.addBatch("SET STORAGE GROUP TO root.batch4");
-
-      statement.executeBatch();
-      statement.clearBatch();
-
-      try (ResultSet set = statement.executeQuery("SHOW STORAGE GROUP")) {
-        int colNum = set.getMetaData().getColumnCount();
-        while (set.next()) {
-          StringBuilder stringBuilder = new StringBuilder();
-          for (int i = 0; i < colNum; i++) {
-            stringBuilder.append(set.getString(i + 1)).append(",");
-          }
-          System.out.println(stringBuilder);
-        }
-      }
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterFileFlushPolicy.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterFileFlushPolicy.java
deleted file mode 100644
index c642632206..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterFileFlushPolicy.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster;
-
-import org.apache.iotdb.cluster.server.member.MetaGroupMember;
-import org.apache.iotdb.db.engine.flush.TsFileFlushPolicy;
-import org.apache.iotdb.db.engine.storagegroup.DataRegion;
-import org.apache.iotdb.db.engine.storagegroup.TsFileProcessor;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-public class ClusterFileFlushPolicy implements TsFileFlushPolicy {
-
-  private static final Logger logger = LoggerFactory.getLogger(ClusterFileFlushPolicy.class);
-
-  private ExecutorService closePartitionExecutor;
-  private MetaGroupMember metaGroupMember;
-
-  public ClusterFileFlushPolicy(MetaGroupMember metaGroupMember) {
-    this.metaGroupMember = metaGroupMember;
-    this.closePartitionExecutor =
-        new ThreadPoolExecutor(
-            16,
-            1024,
-            0,
-            TimeUnit.SECONDS,
-            new LinkedBlockingDeque<>(),
-            r -> {
-              Thread thread = new Thread(r);
-              thread.setName("ClusterFileFlushPolicy-" + thread.getId());
-              return thread;
-            });
-  }
-
-  @Override
-  public void apply(DataRegion dataRegion, TsFileProcessor processor, boolean isSeq) {
-    logger.info(
-        "The memtable size reaches the threshold, async flush it to tsfile: {}",
-        processor.getTsFileResource().getTsFile().getAbsolutePath());
-
-    if (processor.shouldClose()) {
-      // find the related DataGroupMember and close the processor through it
-      // we execute it in another thread to avoid deadlocks
-      closePartitionExecutor.submit(
-          () ->
-              metaGroupMember.closePartition(
-                  dataRegion.getDataRegionId(), processor.getTimeRangeId(), isSeq));
-    }
-    // flush the memtable anyway to avoid the insertion trigger the policy again
-    processor.asyncFlush();
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
deleted file mode 100644
index e4ddfd87b2..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster;
-
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.ClientManager;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.client.async.AsyncDataClient;
-import org.apache.iotdb.cluster.client.async.AsyncMetaClient;
-import org.apache.iotdb.cluster.client.sync.SyncClientAdaptor;
-import org.apache.iotdb.cluster.client.sync.SyncDataClient;
-import org.apache.iotdb.cluster.config.ClusterConfig;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.coordinator.Coordinator;
-import org.apache.iotdb.cluster.exception.ConfigInconsistentException;
-import org.apache.iotdb.cluster.exception.StartUpCheckFailureException;
-import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
-import org.apache.iotdb.cluster.metadata.MetaPuller;
-import org.apache.iotdb.cluster.partition.slot.SlotPartitionTable;
-import org.apache.iotdb.cluster.partition.slot.SlotStrategy;
-import org.apache.iotdb.cluster.query.manage.ClusterSessionManager;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.server.ClusterRPCService;
-import org.apache.iotdb.cluster.server.ClusterTSServiceImpl;
-import org.apache.iotdb.cluster.server.HardLinkCleaner;
-import org.apache.iotdb.cluster.server.Response;
-import org.apache.iotdb.cluster.server.basic.ClusterServiceProvider;
-import org.apache.iotdb.cluster.server.clusterinfo.ClusterInfoServer;
-import org.apache.iotdb.cluster.server.member.MetaGroupMember;
-import org.apache.iotdb.cluster.server.monitor.NodeReport;
-import org.apache.iotdb.cluster.server.raft.DataRaftHeartBeatService;
-import org.apache.iotdb.cluster.server.raft.DataRaftService;
-import org.apache.iotdb.cluster.server.raft.MetaRaftHeartBeatService;
-import org.apache.iotdb.cluster.server.raft.MetaRaftService;
-import org.apache.iotdb.cluster.server.service.DataGroupEngine;
-import org.apache.iotdb.cluster.server.service.DataGroupServiceImpls;
-import org.apache.iotdb.cluster.server.service.MetaAsyncService;
-import org.apache.iotdb.cluster.server.service.MetaSyncService;
-import org.apache.iotdb.cluster.utils.ClusterUtils;
-import org.apache.iotdb.cluster.utils.nodetool.ClusterMonitor;
-import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.commons.exception.ConfigurationException;
-import org.apache.iotdb.commons.exception.StartupException;
-import org.apache.iotdb.commons.service.JMXService;
-import org.apache.iotdb.commons.service.RegisterManager;
-import org.apache.iotdb.commons.service.ThriftServiceThread;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.db.conf.IoTDBConfig;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.conf.IoTDBStartCheck;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.service.IoTDB;
-import org.apache.iotdb.db.service.basic.ServiceProvider;
-
-import org.apache.thrift.TException;
-import org.apache.thrift.async.TAsyncClientManager;
-import org.apache.thrift.protocol.TBinaryProtocol.Factory;
-import org.apache.thrift.protocol.TCompactProtocol;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import static org.apache.iotdb.cluster.config.ClusterConstant.THREAD_POLL_WAIT_TERMINATION_TIME_S;
-import static org.apache.iotdb.cluster.utils.ClusterUtils.UNKNOWN_CLIENT_IP;
-
-/** we do not inherent IoTDB instance, as it may break the singleton mode of IoTDB. */
-public class ClusterIoTDB implements ClusterIoTDBMBean {
-
-  private static final Logger logger = LoggerFactory.getLogger(ClusterIoTDB.class);
-  private final String mbeanName =
-      String.format(
-          "%s:%s=%s", "org.apache.iotdb.cluster.service", IoTDBConstant.JMX_TYPE, "ClusterIoTDB");
-
-  // TODO: better to throw exception if the client can not be get. Then we can remove this field.
-  private boolean printClientConnectionErrorStack = false;
-
-  private MetaGroupMember metaGroupMember;
-
-  private DataGroupEngine dataGroupEngine;
-
-  private Node thisNode;
-  private Coordinator coordinator;
-
-  private final IoTDB iotdb = IoTDB.getInstance();
-
-  // Cluster IoTDB uses a individual registerManager with its parent.
-  private final RegisterManager registerManager = new RegisterManager();
-
-  /**
-   * a single thread pool, every "REPORT_INTERVAL_SEC" seconds, "reportThread" will print the status
-   * of all raft members in this node.
-   */
-  private ScheduledExecutorService reportThread;
-
-  private boolean allowReport = true;
-
-  /** hardLinkCleaner will periodically clean expired hardlinks created during snapshots. */
-  private ScheduledExecutorService hardLinkCleanerThread;
-
-  /**
-   * The clientManager is only used by those instances who do not belong to any DataGroup or
-   * MetaGroup.
-   */
-  private IClientManager clientManager;
-
-  private ClusterIoTDB() {
-    // we do not init anything here, so that we can re-initialize the instance in IT.
-  }
-
-  /** initialize the current node and its services */
-  public boolean initLocalEngines() {
-    ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
-    thisNode = new Node();
-    // set internal rpc ip and ports
-    thisNode.setInternalIp(config.getInternalIp());
-    thisNode.setMetaPort(config.getInternalMetaPort());
-    thisNode.setDataPort(config.getInternalDataPort());
-    // set client rpc ip and ports
-    thisNode.setClientPort(config.getClusterRpcPort());
-    thisNode.setClientIp(IoTDBDescriptor.getInstance().getConfig().getRpcAddress());
-    coordinator = new Coordinator();
-    // local engine
-    TProtocolFactory protocolFactory =
-        ThriftServiceThread.getProtocolFactory(
-            IoTDBDescriptor.getInstance().getConfig().isRpcThriftCompressionEnable());
-    metaGroupMember = new MetaGroupMember(protocolFactory, thisNode, coordinator);
-    IoTDB.setClusterMode();
-    IoTDB.setSchemaProcessor(CSchemaProcessor.getInstance());
-    ((CSchemaProcessor) IoTDB.schemaProcessor).setMetaGroupMember(metaGroupMember);
-    ((CSchemaProcessor) IoTDB.schemaProcessor).setCoordinator(coordinator);
-    MetaPuller.getInstance().init(metaGroupMember);
-    // set coordinator for serviceProvider construction
-    try {
-      IoTDB.setServiceProvider(new ClusterServiceProvider(coordinator, metaGroupMember));
-    } catch (QueryProcessException e) {
-      logger.error("Failed to set clusterServiceProvider.", e);
-      stop();
-      return false;
-    }
-
-    // from the scope of the DataGroupEngine,it should be singleton pattern
-    // the way of setting MetaGroupMember in DataGroupEngine may need a better modification in
-    // future commit.
-    DataGroupEngine.setProtocolFactory(protocolFactory);
-    DataGroupEngine.setMetaGroupMember(metaGroupMember);
-    dataGroupEngine = DataGroupEngine.getInstance();
-    clientManager =
-        new ClientManager(
-            ClusterDescriptor.getInstance().getConfig().isUseAsyncServer(),
-            ClientManager.Type.RequestForwardClient);
-    initTasks();
-    try {
-      // we need to check config after initLocalEngines.
-      startServerCheck();
-      JMXService.registerMBean(metaGroupMember, metaGroupMember.getMBeanName());
-    } catch (StartupException e) {
-      logger.error("Failed to check cluster config.", e);
-      stop();
-      return false;
-    }
-    return true;
-  }
-
-  private void initTasks() {
-    reportThread = IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor("NodeReportThread");
-    ScheduledExecutorUtil.safelyScheduleAtFixedRate(
-        reportThread,
-        this::generateNodeReport,
-        ClusterConstant.REPORT_INTERVAL_SEC,
-        ClusterConstant.REPORT_INTERVAL_SEC,
-        TimeUnit.SECONDS);
-    hardLinkCleanerThread =
-        IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor("HardLinkCleaner");
-    ScheduledExecutorUtil.safelyScheduleAtFixedRate(
-        hardLinkCleanerThread,
-        new HardLinkCleaner(),
-        ClusterConstant.CLEAN_HARDLINK_INTERVAL_SEC,
-        ClusterConstant.CLEAN_HARDLINK_INTERVAL_SEC,
-        TimeUnit.SECONDS);
-  }
-
-  /**
-   * Generate a report containing the status of both MetaGroupMember and DataGroupMembers of this
-   * node. This will help to see if the node is in a consistent and right state during debugging.
-   */
-  private void generateNodeReport() {
-    if (logger.isDebugEnabled() && allowReport) {
-      try {
-        NodeReport report = new NodeReport(thisNode);
-        report.setMetaMemberReport(metaGroupMember.genMemberReport());
-        report.setDataMemberReportList(dataGroupEngine.genMemberReports());
-        logger.debug(report.toString());
-      } catch (Exception e) {
-        logger.error("exception occurred when generating node report", e);
-      }
-    }
-  }
-
-  public static void main(String[] args) {
-    new ClusterIoTDBServerCommandLine().doMain(args);
-  }
-
-  protected boolean serverCheckAndInit() throws ConfigurationException, IOException {
-    IoTDBStartCheck.getInstance().checkConfig();
-    IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
-    // init server's configuration first, because the cluster configuration may read settings from
-    // the server's configuration.
-    // auto create schema is took over by cluster module, so we disable it in the server module.
-    config.setAutoCreateSchemaEnabled(false);
-    // check cluster config
-    String checkResult = clusterConfigCheck();
-    if (checkResult != null) {
-      logger.error(checkResult);
-      return false;
-    }
-    ClusterConfig clusterConfig = ClusterDescriptor.getInstance().getConfig();
-    // if client ip is the default address, set it same with internal ip
-    if (config.getRpcAddress().equals("0.0.0.0")) {
-      config.setRpcAddress(clusterConfig.getInternalIp());
-    }
-    // set the memory allocated for raft log of each raft log manager
-    if (clusterConfig.getReplicationNum() > 1) {
-      clusterConfig.setMaxMemorySizeForRaftLog(
-          (long)
-              (config.getAllocateMemoryForWrite()
-                  * clusterConfig.getRaftLogMemoryProportion()
-                  / clusterConfig.getReplicationNum()));
-      // calculate remaining memory allocated for write process
-      config.setAllocateMemoryForWrite(
-          (long)
-              (config.getAllocateMemoryForWrite()
-                  * (1 - clusterConfig.getRaftLogMemoryProportion())));
-    }
-    return true;
-  }
-
-  private String clusterConfigCheck() {
-    try {
-      ClusterDescriptor.getInstance().replaceHostnameWithIp();
-    } catch (Exception e) {
-      return String.format("replace hostname with ip failed, %s", e.getMessage());
-    }
-    ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
-    // check the initial replicateNum and refuse to start when the replicateNum <= 0
-    if (config.getReplicationNum() <= 0) {
-      return String.format(
-          "ReplicateNum should be greater than 0 instead of %d.", config.getReplicationNum());
-    }
-    // check the initial cluster size and refuse to start when the size < quorum
-    int quorum = config.getReplicationNum() / 2 + 1;
-    if (config.getSeedNodeUrls().size() < quorum) {
-      return String.format(
-          "Seed number less than quorum, seed number: %s, quorum: " + "%s.",
-          config.getSeedNodeUrls().size(), quorum);
-    }
-    // TODO: duplicate code
-    Set<Node> seedNodes = new HashSet<>();
-    for (String url : config.getSeedNodeUrls()) {
-      Node node = ClusterUtils.parseNode(url);
-      if (seedNodes.contains(node)) {
-        return String.format(
-            "SeedNodes must not repeat each other. SeedNodes: %s", config.getSeedNodeUrls());
-      }
-      seedNodes.add(node);
-    }
-    return null;
-  }
-
-  /** Start as a seed node */
-  public void activeStartNodeMode() {
-    try {
-      // start iotdb server first
-      IoTDB.getInstance().active();
-      // some work about cluster
-      preInitCluster();
-      // try to build cluster
-      metaGroupMember.buildCluster();
-      // register service after cluster build
-      postInitCluster();
-      // init ServiceImpl to handle request of client
-      startClientRPC();
-    } catch (StartupException
-        | StartUpCheckFailureException
-        | ConfigInconsistentException
-        | QueryProcessException e) {
-      logger.error("Fail to start  server", e);
-      stop();
-    }
-  }
-
-  private void preInitCluster() throws StartupException {
-    stopRaftInfoReport();
-    JMXService.registerMBean(this, mbeanName);
-    // register MetaGroupMember. MetaGroupMember has the same position with "StorageEngine" in the
-    // cluster module.
-    // TODO: it is better to remove coordinator out of metaGroupEngine
-
-    registerManager.register(metaGroupMember);
-    registerManager.register(dataGroupEngine);
-
-    // rpc service initialize
-    DataGroupServiceImpls dataGroupServiceImpls = new DataGroupServiceImpls();
-    if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {
-      MetaAsyncService metaAsyncService = new MetaAsyncService(metaGroupMember);
-      MetaRaftHeartBeatService.getInstance().initAsyncedServiceImpl(metaAsyncService);
-      MetaRaftService.getInstance().initAsyncedServiceImpl(metaAsyncService);
-      DataRaftService.getInstance().initAsyncedServiceImpl(dataGroupServiceImpls);
-      DataRaftHeartBeatService.getInstance().initAsyncedServiceImpl(dataGroupServiceImpls);
-    } else {
-      MetaSyncService syncService = new MetaSyncService(metaGroupMember);
-      MetaRaftHeartBeatService.getInstance().initSyncedServiceImpl(syncService);
-      MetaRaftService.getInstance().initSyncedServiceImpl(syncService);
-      DataRaftService.getInstance().initSyncedServiceImpl(dataGroupServiceImpls);
-      DataRaftHeartBeatService.getInstance().initSyncedServiceImpl(dataGroupServiceImpls);
-    }
-    // start RPC service
-    logger.info("start Meta Heartbeat RPC service... ");
-    registerManager.register(MetaRaftHeartBeatService.getInstance());
-    /* TODO: better to start the Meta RPC service until the heartbeatService has elected the leader
-    and quorum of followers have caught up. */
-    logger.info("start Meta RPC service... ");
-    registerManager.register(MetaRaftService.getInstance());
-  }
-
-  private void postInitCluster() throws StartupException {
-    logger.info("start Data Heartbeat RPC service... ");
-    registerManager.register(DataRaftHeartBeatService.getInstance());
-    logger.info("start Data RPC service... ");
-    registerManager.register(DataRaftService.getInstance());
-    // RPC based DBA API
-    registerManager.register(ClusterInfoServer.getInstance());
-    // JMX based DBA API
-    registerManager.register(ClusterMonitor.INSTANCE);
-  }
-
-  private void startClientRPC() throws QueryProcessException, StartupException {
-    // we must wait until the metaGroup established.
-    // So that the ClusterRPCService can work.
-    ClusterTSServiceImpl clusterServiceImpl = new ClusterTSServiceImpl();
-    ServiceProvider.SESSION_MANAGER = ClusterSessionManager.getInstance();
-    ClusterSessionManager.getInstance().setCoordinator(coordinator);
-    ClusterRPCService.getInstance().initSyncedServiceImpl(clusterServiceImpl);
-    registerManager.register(ClusterRPCService.getInstance());
-    // init influxDB MManager
-    if (IoTDBDescriptor.getInstance().getConfig().isEnableInfluxDBRpcService()) {
-      IoTDB.initInfluxDBMManager();
-    }
-  }
-
-  /** Be added to the cluster by seed nodes */
-  public void activeAddNodeMode() {
-    try {
-      final long startTime = System.currentTimeMillis();
-      preInitCluster();
-      metaGroupMember.joinCluster();
-      postInitCluster();
-      dataGroupEngine.pullSnapshots();
-      startClientRPC();
-      logger.info(
-          "Adding this node {} to cluster costs {} ms",
-          thisNode,
-          (System.currentTimeMillis() - startTime));
-    } catch (StartupException
-        | QueryProcessException
-        | StartUpCheckFailureException
-        | ConfigInconsistentException e) {
-      stop();
-      logger.error("Fail to join cluster", e);
-    }
-  }
-
-  private void startServerCheck() throws StartupException {
-    ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
-    // assert not duplicated nodes
-    Set<Node> seedNodes = new HashSet<>();
-    for (String url : config.getSeedNodeUrls()) {
-      Node node = ClusterUtils.parseNode(url);
-      if (seedNodes.contains(node)) {
-        String message =
-            String.format(
-                "SeedNodes must not repeat each other. SeedNodes: %s", config.getSeedNodeUrls());
-        throw new StartupException(metaGroupMember.getName(), message);
-      }
-      seedNodes.add(node);
-    }
-
-    // assert this node is in all nodes when restart
-    if (!metaGroupMember.getAllNodes().isEmpty()) {
-      if (!metaGroupMember.getAllNodes().contains(metaGroupMember.getThisNode())) {
-        String message =
-            String.format(
-                "All nodes in partitionTables must contains local node in start-server mode. "
-                    + "LocalNode: %s, AllNodes: %s",
-                metaGroupMember.getThisNode(), metaGroupMember.getAllNodes());
-        throw new StartupException(metaGroupMember.getName(), message);
-      } else {
-        return;
-      }
-    }
-
-    // assert this node is in seed nodes list
-    if (!seedNodes.contains(thisNode)) {
-      String message =
-          String.format(
-              "SeedNodes must contains local node in start-server mode. LocalNode: %s ,SeedNodes: "
-                  + "%s",
-              thisNode.toString(), config.getSeedNodeUrls());
-      throw new StartupException(metaGroupMember.getName(), message);
-    }
-  }
-
-  protected void doRemoveNode(String[] args) throws IOException {
-    if (args.length != 3) {
-      logger.error("Usage: <ip> <metaPort>");
-      return;
-    }
-    String ip = args[1];
-    int metaPort = Integer.parseInt(args[2]);
-    ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
-    TProtocolFactory factory =
-        config.isRpcThriftCompressionEnabled() ? new TCompactProtocol.Factory() : new Factory();
-    Node nodeToRemove = new Node();
-    nodeToRemove.setInternalIp(ip).setMetaPort(metaPort).setClientIp(UNKNOWN_CLIENT_IP);
-    // try sending the request to each seed node
-    for (String url : config.getSeedNodeUrls()) {
-      Node node = ClusterUtils.parseNode(url);
-      if (node == null) {
-        continue;
-      }
-      AsyncMetaClient client =
-          new AsyncMetaClient(factory, new TAsyncClientManager(), node, ClientCategory.META);
-      Long response = null;
-      long startTime = System.currentTimeMillis();
-      try {
-        logger.info("Start removing node {} with the help of node {}", nodeToRemove, node);
-        response = SyncClientAdaptor.removeNode(client, nodeToRemove);
-      } catch (TException e) {
-        logger.warn("Cannot send remove node request through {}, try next node", node);
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-        logger.warn("Cannot send remove node request through {}, try next node", node);
-      }
-      if (response != null) {
-        handleNodeRemovalResp(response, nodeToRemove, startTime);
-        return;
-      }
-    }
-  }
-
-  private void handleNodeRemovalResp(Long response, Node nodeToRemove, long startTime) {
-    if (response == Response.RESPONSE_AGREE) {
-      logger.info(
-          "Node {} is successfully removed, cost {}ms",
-          nodeToRemove,
-          (System.currentTimeMillis() - startTime));
-    } else if (response == Response.RESPONSE_CLUSTER_TOO_SMALL) {
-      logger.error("Cluster size is too small, cannot remove any node");
-    } else if (response == Response.RESPONSE_REJECT) {
-      logger.error("Node {} is not found in the cluster, please check", nodeToRemove);
-    } else if (response == Response.RESPONSE_DATA_MIGRATION_NOT_FINISH) {
-      logger.warn(
-          "The data migration of the previous membership change operation is not finished. Please "
-              + "try again later");
-    } else {
-      logger.error("Unexpected response {}", response);
-    }
-  }
-
-  /** Developers may perform pre-start customizations here for debugging or experiments. */
-  @SuppressWarnings("java:S125") // leaving examples
-  private void preStartCustomize() {
-    // customize data distribution
-    // The given example tries to divide storage groups like "root.sg_1", "root.sg_2"... into k
-    // nodes evenly, and use default strategy for other groups
-    SlotPartitionTable.setSlotStrategy(
-        new SlotStrategy() {
-          final SlotStrategy defaultStrategy = new SlotStrategy.DefaultStrategy();
-          final int clusterSize =
-              ClusterDescriptor.getInstance().getConfig().getSeedNodeUrls().size();
-
-          @Override
-          public int calculateSlotByTime(String storageGroupName, long timestamp, int maxSlotNum) {
-            int sgSerialNum = extractSerialNumInSGName(storageGroupName) % clusterSize;
-            if (sgSerialNum >= 0) {
-              return maxSlotNum / clusterSize * sgSerialNum;
-            } else {
-              return defaultStrategy.calculateSlotByTime(storageGroupName, timestamp, maxSlotNum);
-            }
-          }
-
-          @Override
-          public int calculateSlotByPartitionNum(
-              String storageGroupName, long partitionId, int maxSlotNum) {
-            int sgSerialNum = extractSerialNumInSGName(storageGroupName) % clusterSize;
-            if (sgSerialNum >= 0) {
-              return maxSlotNum / clusterSize * sgSerialNum;
-            } else {
-              return defaultStrategy.calculateSlotByPartitionNum(
-                  storageGroupName, partitionId, maxSlotNum);
-            }
-          }
-
-          private int extractSerialNumInSGName(String storageGroupName) {
-            String[] s = storageGroupName.split("_");
-            if (s.length != 2) {
-              return -1;
-            }
-            try {
-              return Integer.parseInt(s[1]);
-            } catch (NumberFormatException e) {
-              return -1;
-            }
-          }
-        });
-  }
-
-  public void stop() {
-    deactivate();
-  }
-
-  private void deactivate() {
-    logger.info("Deactivating Cluster IoTDB...");
-    stopThreadPools();
-    registerManager.deregisterAll();
-    JMXService.deregisterMBean(mbeanName);
-    logger.info("ClusterIoTDB is deactivated.");
-    // stop the iotdb kernel
-    iotdb.stop();
-  }
-
-  private void stopThreadPools() {
-    stopThreadPool(reportThread, "reportThread");
-    stopThreadPool(hardLinkCleanerThread, "hardLinkCleanerThread");
-  }
-
-  private void stopThreadPool(ExecutorService pool, String name) {
-    if (pool != null) {
-      pool.shutdownNow();
-      try {
-        pool.awaitTermination(THREAD_POLL_WAIT_TERMINATION_TIME_S, TimeUnit.SECONDS);
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-        logger.error("Unexpected interruption when waiting for {} to end", name, e);
-      }
-    }
-  }
-
-  @TestOnly
-  public void setClientManager(IClientManager clientManager) {
-    this.clientManager = clientManager;
-  }
-
-  @TestOnly
-  public IClientManager getClientManager() {
-    return this.clientManager;
-  }
-
-  @TestOnly
-  public void setDataGroupEngine(DataGroupEngine dataGroupEngine) {
-    this.dataGroupEngine = dataGroupEngine;
-  }
-
-  public MetaGroupMember getMetaGroupMember() {
-    return metaGroupMember;
-  }
-
-  public Node getThisNode() {
-    return thisNode;
-  }
-
-  public Coordinator getCoordinator() {
-    return coordinator;
-  }
-
-  public IoTDB getIotdb() {
-    return iotdb;
-  }
-
-  public RegisterManager getRegisterManager() {
-    return registerManager;
-  }
-
-  public DataGroupEngine getDataGroupEngine() {
-    return dataGroupEngine;
-  }
-
-  public void setMetaGroupMember(MetaGroupMember metaGroupMember) {
-    this.metaGroupMember = metaGroupMember;
-  }
-
-  public static ClusterIoTDB getInstance() {
-    return ClusterIoTDBHolder.INSTANCE;
-  }
-
-  @Override
-  public boolean startRaftInfoReport() {
-    logger.info("Raft status report is enabled.");
-    allowReport = true;
-    return logger.isDebugEnabled();
-  }
-
-  @Override
-  public void stopRaftInfoReport() {
-    logger.info("Raft status report is disabled.");
-    allowReport = false;
-  }
-
-  @Override
-  public void enablePrintClientConnectionErrorStack() {
-    printClientConnectionErrorStack = true;
-  }
-
-  @Override
-  public void disablePrintClientConnectionErrorStack() {
-    printClientConnectionErrorStack = false;
-  }
-
-  public boolean shouldPrintClientConnectionErrorStack() {
-    return printClientConnectionErrorStack;
-  }
-
-  public SyncDataClient getSyncDataClient(Node node, int readOperationTimeoutMS)
-      throws IOException {
-    SyncDataClient dataClient =
-        (SyncDataClient) clientManager.borrowSyncClient(node, ClientCategory.DATA);
-    if (dataClient != null) {
-      dataClient.setTimeout(readOperationTimeoutMS);
-    }
-    return dataClient;
-  }
-
-  public AsyncDataClient getAsyncDataClient(Node node, int readOperationTimeoutMS)
-      throws IOException {
-    AsyncDataClient dataClient =
-        (AsyncDataClient) clientManager.borrowAsyncClient(node, ClientCategory.DATA);
-    if (dataClient != null) {
-      dataClient.setTimeout(readOperationTimeoutMS);
-    }
-    return dataClient;
-  }
-
-  private static class ClusterIoTDBHolder {
-
-    private static final ClusterIoTDB INSTANCE = new ClusterIoTDB();
-
-    private ClusterIoTDBHolder() {}
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBMBean.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBMBean.java
deleted file mode 100644
index 7fedf0f3d9..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBMBean.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster;
-
-// we do not inherent IoTDB instance, as it may break the singleton mode of IoTDB.
-public interface ClusterIoTDBMBean {
-  /**
-   * try to enable the raft info report.
-   *
-   * @return true only if the log level is lower than debug and the report is enabled.
-   */
-  boolean startRaftInfoReport();
-
-  void stopRaftInfoReport();
-
-  void enablePrintClientConnectionErrorStack();
-
-  void disablePrintClientConnectionErrorStack();
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBServerCommandLine.java b/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBServerCommandLine.java
deleted file mode 100644
index 220fbb643d..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBServerCommandLine.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster;
-
-import org.apache.iotdb.commons.ServerCommandLine;
-import org.apache.iotdb.commons.exception.ConfigurationException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class ClusterIoTDBServerCommandLine extends ServerCommandLine {
-  private static final Logger logger = LoggerFactory.getLogger(ClusterIoTDBServerCommandLine.class);
-
-  // establish the cluster as a seed
-  private static final String MODE_START = "-s";
-  // join an established cluster
-  private static final String MODE_ADD = "-a";
-  // send a request to remove a node, more arguments: ip-of-removed-node
-  // metaport-of-removed-node
-  private static final String MODE_REMOVE = "-r";
-
-  private static final String USAGE =
-      "Usage: <-s|-a|-r> "
-          + "[-D{} <configure folder>] \n"
-          + "-s: start the node as a seed\n"
-          + "-a: start the node as a new node\n"
-          + "-r: remove the node out of the cluster\n";
-
-  @Override
-  protected String getUsage() {
-    return USAGE;
-  }
-
-  @Override
-  protected int run(String[] args) {
-    if (args.length < 1) {
-      usage(null);
-      return -1;
-    }
-
-    ClusterIoTDB cluster = ClusterIoTDB.getInstance();
-    // check config of iotdb,and set some configs in cluster mode
-    try {
-      if (!cluster.serverCheckAndInit()) {
-        return -1;
-      }
-    } catch (ConfigurationException | IOException e) {
-      logger.error("meet error when doing start checking", e);
-      return -1;
-    }
-    String mode = args[0];
-    logger.info("Running mode {}", mode);
-
-    // initialize the current node and its services
-    if (!cluster.initLocalEngines()) {
-      logger.error("initLocalEngines error, stop process!");
-      return -1;
-    }
-
-    // we start IoTDB kernel first. then we start the cluster module.
-    if (MODE_START.equals(mode)) {
-      cluster.activeStartNodeMode();
-    } else if (MODE_ADD.equals(mode)) {
-      cluster.activeAddNodeMode();
-    } else if (MODE_REMOVE.equals(mode)) {
-      try {
-        cluster.doRemoveNode(args);
-      } catch (IOException e) {
-        logger.error("Fail to remove node in cluster", e);
-      }
-    } else {
-      logger.error("Unrecognized mode {}", mode);
-    }
-    return 0;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/RemoteTsFileResource.java b/cluster/src/main/java/org/apache/iotdb/cluster/RemoteTsFileResource.java
deleted file mode 100644
index e8878880d0..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/RemoteTsFileResource.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.utils.NodeSerializeUtils;
-import org.apache.iotdb.commons.utils.SerializeUtils;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
-import org.apache.iotdb.db.engine.storagegroup.TsFileResourceStatus;
-
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Objects;
-
-public class RemoteTsFileResource extends TsFileResource {
-
-  private Node source;
-  private boolean isRemote = false;
-  private boolean withModification = false;
-
-  /**
-   * Whether the plan range ([minPlanIndex, maxPlanIndex]) overlaps with another TsFile in the same
-   * time partition. If not (unique = true), we shall have confidence that the file has all data
-   * whose plan indexes are within [minPlanIndex, maxPlanIndex], so we can remove other local files
-   * that overlaps with it.
-   */
-  private boolean isPlanRangeUnique = false;
-
-  public RemoteTsFileResource() {
-    setStatus(TsFileResourceStatus.CLOSED);
-    this.timeIndex = IoTDBDescriptor.getInstance().getConfig().getTimeIndexLevel().getTimeIndex();
-  }
-
-  private RemoteTsFileResource(TsFileResource other) throws IOException {
-    super(other);
-    withModification = new File(getModFile().getFilePath()).exists();
-    setStatus(TsFileResourceStatus.CLOSED);
-  }
-
-  public RemoteTsFileResource(TsFileResource other, Node source) throws IOException {
-    this(other);
-    this.source = source;
-    this.isRemote = true;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    if (!super.equals(o)) {
-      return false;
-    }
-    RemoteTsFileResource that = (RemoteTsFileResource) o;
-    return Objects.equals(source, that.source);
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(super.hashCode(), source);
-  }
-
-  public void serialize(DataOutputStream dataOutputStream) {
-    NodeSerializeUtils.serialize(source, dataOutputStream);
-    try {
-      // the path here is only for the remote node to get a download link, so it does not matter
-      // if it is absolute
-      SerializeUtils.serialize(getTsFile().getPath(), dataOutputStream);
-
-      timeIndex.serialize(dataOutputStream);
-      dataOutputStream.writeBoolean(withModification);
-
-      dataOutputStream.writeLong(maxPlanIndex);
-      dataOutputStream.writeLong(minPlanIndex);
-
-      dataOutputStream.writeByte(isPlanRangeUnique ? 1 : 0);
-    } catch (IOException ignored) {
-      // unreachable
-    }
-  }
-
-  public void deserialize(ByteBuffer buffer) {
-    source = new Node();
-    NodeSerializeUtils.deserialize(source, buffer);
-    setFile(new File(SerializeUtils.deserializeString(buffer)));
-
-    timeIndex =
-        IoTDBDescriptor.getInstance()
-            .getConfig()
-            .getTimeIndexLevel()
-            .getTimeIndex()
-            .deserialize(buffer);
-
-    withModification = buffer.get() == 1;
-
-    maxPlanIndex = buffer.getLong();
-    minPlanIndex = buffer.getLong();
-
-    isPlanRangeUnique = buffer.get() == 1;
-
-    isRemote = true;
-  }
-
-  public Node getSource() {
-    return source;
-  }
-
-  public boolean isRemote() {
-    return isRemote;
-  }
-
-  public void setRemote(boolean remote) {
-    isRemote = remote;
-  }
-
-  public boolean isWithModification() {
-    return withModification;
-  }
-
-  public boolean isPlanRangeUnique() {
-    return isPlanRangeUnique;
-  }
-
-  public void setPlanRangeUnique(boolean planRangeUnique) {
-    isPlanRangeUnique = planRangeUnique;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/BaseFactory.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/BaseFactory.java
deleted file mode 100644
index 1c60df6b87..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/BaseFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client;
-
-import org.apache.commons.pool2.KeyedPooledObjectFactory;
-import org.apache.commons.pool2.PooledObject;
-import org.apache.thrift.async.TAsyncClientManager;
-import org.apache.thrift.protocol.TProtocolFactory;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-public abstract class BaseFactory<K, T> implements KeyedPooledObjectFactory<K, T> {
-
-  protected TAsyncClientManager[] managers;
-  protected TProtocolFactory protocolFactory;
-  protected AtomicInteger clientCnt = new AtomicInteger();
-  protected ClientCategory category;
-  protected IClientManager clientPoolManager;
-
-  protected BaseFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-    this.protocolFactory = protocolFactory;
-    this.category = category;
-  }
-
-  protected BaseFactory(
-      TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-    this.protocolFactory = protocolFactory;
-    this.category = category;
-    this.clientPoolManager = clientManager;
-  }
-
-  @Override
-  public void activateObject(K node, PooledObject<T> pooledObject) throws Exception {}
-
-  @Override
-  public void passivateObject(K node, PooledObject<T> pooledObject) throws Exception {}
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientCategory.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientCategory.java
deleted file mode 100644
index fdd6669845..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientCategory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client;
-
-public enum ClientCategory {
-  META("MetaClient"),
-  META_HEARTBEAT("MetaHeartbeatClient"),
-  DATA("DataClient"),
-  DATA_HEARTBEAT("DataHeartbeatClient"),
-  DATA_ASYNC_APPEND_CLIENT("DataAsyncAppendClient");
-
-  private final String name;
-
-  ClientCategory(String name) {
-    this.name = name;
-  }
-
-  public String getName() {
-    return name;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientManager.java
deleted file mode 100644
index ae24a6dea9..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientManager.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService;
-
-import com.google.common.collect.Maps;
-import org.apache.commons.pool2.KeyedObjectPool;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.Map;
-
-/**
- * One should borrow the reusable client from this manager and return the client after use. The
- * underlying client pool is powered by Apache Commons Pool. The class provided 3 default pool group
- * according to current usage: RequestForwardClient, DataGroupClients, MetaGroupClients.
- *
- * <p>TODO: We can refine the client structure by reorg the interfaces defined in cluster-thrift.
- */
-public class ClientManager implements IClientManager {
-
-  private static final Logger logger = LoggerFactory.getLogger(ClientManager.class);
-
-  private Map<ClientCategory, KeyedObjectPool<Node, RaftService.AsyncClient>> asyncClientPoolMap;
-  private Map<ClientCategory, KeyedObjectPool<Node, RaftService.Client>> syncClientPoolMap;
-  private final ClientPoolFactory clientPoolFactory;
-
-  /**
-   * {@link ClientManager.Type#RequestForwardClient} represents the clients used to forward external
-   * client requests to proper node to handle such as query, insert request.
-   *
-   * <p>{@link ClientManager.Type#DataGroupClient} represents the clients used to appendEntry,
-   * appendEntries, sendHeartbeat, etc for data raft group.
-   *
-   * <p>{@link ClientManager.Type#MetaGroupClient} represents the clients used to appendEntry,
-   * appendEntries, sendHeartbeat, etc for meta raft group. *
-   */
-  public enum Type {
-    RequestForwardClient,
-    DataGroupClient,
-    MetaGroupClient
-  }
-
-  public ClientManager(boolean isAsyncMode, Type type) {
-    clientPoolFactory = new ClientPoolFactory();
-    clientPoolFactory.setClientManager(this);
-    if (isAsyncMode) {
-      asyncClientPoolMap = Maps.newHashMap();
-      constructAsyncClientMap(type);
-    } else {
-      syncClientPoolMap = Maps.newHashMap();
-      constructSyncClientMap(type);
-    }
-  }
-
-  private void constructAsyncClientMap(Type type) {
-    switch (type) {
-      case RequestForwardClient:
-        asyncClientPoolMap.put(
-            ClientCategory.DATA, clientPoolFactory.createAsyncDataPool(ClientCategory.DATA));
-        break;
-      case MetaGroupClient:
-        asyncClientPoolMap.put(
-            ClientCategory.META, clientPoolFactory.createAsyncMetaPool(ClientCategory.META));
-        asyncClientPoolMap.put(
-            ClientCategory.META_HEARTBEAT,
-            clientPoolFactory.createAsyncMetaPool(ClientCategory.META_HEARTBEAT));
-        break;
-      case DataGroupClient:
-        asyncClientPoolMap.put(
-            ClientCategory.DATA, clientPoolFactory.createAsyncDataPool(ClientCategory.DATA));
-        asyncClientPoolMap.put(
-            ClientCategory.DATA_HEARTBEAT,
-            clientPoolFactory.createAsyncDataPool(ClientCategory.DATA_HEARTBEAT));
-        asyncClientPoolMap.put(
-            ClientCategory.DATA_ASYNC_APPEND_CLIENT,
-            clientPoolFactory.createSingleManagerAsyncDataPool());
-        break;
-      default:
-        logger.warn("unsupported ClientManager type: {}", type);
-        break;
-    }
-  }
-
-  private void constructSyncClientMap(Type type) {
-    switch (type) {
-      case RequestForwardClient:
-        syncClientPoolMap.put(
-            ClientCategory.DATA, clientPoolFactory.createSyncDataPool(ClientCategory.DATA));
-        break;
-      case MetaGroupClient:
-        syncClientPoolMap.put(
-            ClientCategory.META, clientPoolFactory.createSyncMetaPool(ClientCategory.META));
-        syncClientPoolMap.put(
-            ClientCategory.META_HEARTBEAT,
-            clientPoolFactory.createSyncMetaPool(ClientCategory.META_HEARTBEAT));
-        break;
-      case DataGroupClient:
-        syncClientPoolMap.put(
-            ClientCategory.DATA, clientPoolFactory.createSyncDataPool(ClientCategory.DATA));
-        syncClientPoolMap.put(
-            ClientCategory.DATA_HEARTBEAT,
-            clientPoolFactory.createSyncDataPool(ClientCategory.DATA_HEARTBEAT));
-        break;
-      default:
-        logger.warn("unsupported ClientManager type: {}", type);
-        break;
-    }
-  }
-
-  /**
-   * It's safe to convert: 1. RaftService.AsyncClient to TSDataService.AsyncClient when category is
-   * DATA or DATA_HEARTBEAT; 2. RaftService.AsyncClient to TSMetaService.AsyncClient when category
-   * is META or META_HEARTBEAT.
-   *
-   * @return RaftService.AsyncClient
-   */
-  @Override
-  public RaftService.AsyncClient borrowAsyncClient(Node node, ClientCategory category)
-      throws IOException {
-    KeyedObjectPool<Node, RaftService.AsyncClient> pool;
-    RaftService.AsyncClient client = null;
-    if (asyncClientPoolMap != null && (pool = asyncClientPoolMap.get(category)) != null) {
-      try {
-        client = pool.borrowObject(node);
-      } catch (IOException e) {
-        // external needs the IOException to check connection
-        throw e;
-      } catch (Exception e) {
-        // external doesn't care of other exceptions
-        logger.error("BorrowAsyncClient fail.", e);
-      }
-    } else {
-      logger.warn(
-          "BorrowSyncClient invoke on unsupported mode or category: Node:{}, ClientCategory:{}, "
-              + "isSyncMode:{}",
-          node,
-          clientPoolFactory,
-          syncClientPoolMap != null);
-    }
-    return client;
-  }
-
-  /**
-   * It's safe to convert: 1. RaftService.Client to TSDataService.Client when category is DATA or
-   * DATA_HEARTBEAT; 2. RaftService.Client to TSMetaService.Client when category is META or
-   * META_HEARTBEAT.
-   *
-   * @return RaftService.Client
-   */
-  @Override
-  public RaftService.Client borrowSyncClient(Node node, ClientCategory category)
-      throws IOException {
-    KeyedObjectPool<Node, RaftService.Client> pool;
-    RaftService.Client client = null;
-    if (syncClientPoolMap != null && (pool = syncClientPoolMap.get(category)) != null) {
-      try {
-        client = pool.borrowObject(node);
-      } catch (TTransportException e) {
-        // external needs to check transport related exception
-        throw new IOException(e);
-      } catch (IOException e) {
-        // external needs the IOException to check connection
-        throw e;
-      } catch (Exception e) {
-        // external doesn't care of other exceptions
-        logger.error("BorrowSyncClient fail.", e);
-      }
-    } else {
-      logger.warn(
-          "BorrowSyncClient invoke on unsupported mode or category: Node:{}, ClientCategory:{}, "
-              + "isSyncMode:{}",
-          node,
-          clientPoolFactory,
-          syncClientPoolMap != null);
-    }
-    return client;
-  }
-
-  @Override
-  public void returnAsyncClient(
-      RaftService.AsyncClient client, Node node, ClientCategory category) {
-    if (client != null && node != null) {
-      try {
-        asyncClientPoolMap.get(category).returnObject(node, client);
-      } catch (Exception e) {
-        logger.error("AsyncClient return error: {}", client, e);
-      }
-    }
-  }
-
-  @Override
-  public void returnSyncClient(RaftService.Client client, Node node, ClientCategory category) {
-    if (client != null && node != null) {
-      try {
-        syncClientPoolMap.get(category).returnObject(node, client);
-      } catch (Exception e) {
-        logger.error("SyncClient return error: {}", client, e);
-      }
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientPoolFactory.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientPoolFactory.java
deleted file mode 100644
index 00db59adcb..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/ClientPoolFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client;
-
-import org.apache.iotdb.cluster.client.async.AsyncDataClient;
-import org.apache.iotdb.cluster.client.async.AsyncMetaClient;
-import org.apache.iotdb.cluster.client.sync.SyncDataClient;
-import org.apache.iotdb.cluster.client.sync.SyncMetaClient;
-import org.apache.iotdb.cluster.config.ClusterConfig;
-import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService;
-
-import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
-import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TCompactProtocol;
-import org.apache.thrift.protocol.TProtocolFactory;
-
-import java.time.Duration;
-
-public class ClientPoolFactory {
-
-  protected long waitClientTimeoutMS;
-  protected int maxConnectionForEachNode;
-  protected int maxIdleConnectionForEachNode;
-  private final TProtocolFactory protocolFactory;
-  private GenericKeyedObjectPoolConfig poolConfig;
-  private IClientManager clientManager;
-
-  public ClientPoolFactory() {
-    ClusterConfig config = ClusterDescriptor.getInstance().getConfig();
-    this.waitClientTimeoutMS = config.getWaitClientTimeoutMS();
-    this.maxConnectionForEachNode = config.getMaxClientPerNodePerMember();
-    this.maxIdleConnectionForEachNode = config.getMaxIdleClientPerNodePerMember();
-    protocolFactory =
-        config.isRpcThriftCompressionEnabled()
-            ? new TCompactProtocol.Factory()
-            : new TBinaryProtocol.Factory();
-    poolConfig = new GenericKeyedObjectPoolConfig();
-    poolConfig.setMaxTotalPerKey(maxConnectionForEachNode);
-    poolConfig.setMaxIdlePerKey(maxIdleConnectionForEachNode);
-    poolConfig.setMaxWait(Duration.ofMillis(waitClientTimeoutMS));
-    poolConfig.setTestOnReturn(true);
-    poolConfig.setTestOnBorrow(true);
-  }
-
-  public void setClientManager(IClientManager clientManager) {
-    this.clientManager = clientManager;
-  }
-
-  public GenericKeyedObjectPool<Node, RaftService.Client> createSyncDataPool(
-      ClientCategory category) {
-    return new GenericKeyedObjectPool<>(
-        new SyncDataClient.SyncDataClientFactory(protocolFactory, category, clientManager),
-        poolConfig);
-  }
-
-  public GenericKeyedObjectPool<Node, RaftService.Client> createSyncMetaPool(
-      ClientCategory category) {
-    return new GenericKeyedObjectPool<>(
-        new SyncMetaClient.SyncMetaClientFactory(protocolFactory, category, clientManager),
-        poolConfig);
-  }
-
-  public GenericKeyedObjectPool<Node, RaftService.AsyncClient> createAsyncDataPool(
-      ClientCategory category) {
-    return new GenericKeyedObjectPool<>(
-        new AsyncDataClient.AsyncDataClientFactory(protocolFactory, category, clientManager),
-        poolConfig);
-  }
-
-  public GenericKeyedObjectPool<Node, RaftService.AsyncClient> createAsyncMetaPool(
-      ClientCategory category) {
-    return new GenericKeyedObjectPool<>(
-        new AsyncMetaClient.AsyncMetaClientFactory(protocolFactory, category, clientManager),
-        poolConfig);
-  }
-
-  public GenericKeyedObjectPool<Node, RaftService.AsyncClient> createSingleManagerAsyncDataPool() {
-    return new GenericKeyedObjectPool<>(
-        new AsyncDataClient.SingleManagerFactory(protocolFactory, clientManager), poolConfig);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/IClientManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/IClientManager.java
deleted file mode 100644
index 6652e0c6e7..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/IClientManager.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService;
-
-import java.io.IOException;
-
-public interface IClientManager {
-  RaftService.AsyncClient borrowAsyncClient(Node node, ClientCategory category) throws IOException;
-
-  RaftService.Client borrowSyncClient(Node node, ClientCategory category) throws IOException;
-
-  void returnAsyncClient(RaftService.AsyncClient client, Node node, ClientCategory category);
-
-  void returnSyncClient(RaftService.Client client, Node node, ClientCategory category);
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncBaseFactory.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncBaseFactory.java
deleted file mode 100644
index b2b84153a6..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncBaseFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.async;
-
-import org.apache.iotdb.cluster.client.BaseFactory;
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService;
-
-import org.apache.thrift.async.TAsyncClientManager;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public abstract class AsyncBaseFactory<K, T extends RaftService.AsyncClient>
-    extends BaseFactory<K, T> {
-
-  private static final Logger logger = LoggerFactory.getLogger(AsyncBaseFactory.class);
-
-  protected AsyncBaseFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-    super(protocolFactory, category);
-    managers =
-        new TAsyncClientManager
-            [ClusterDescriptor.getInstance().getConfig().getSelectorNumOfClientPool()];
-    for (int i = 0; i < managers.length; i++) {
-      try {
-        managers[i] = new TAsyncClientManager();
-      } catch (IOException e) {
-        logger.error("Cannot create data heartbeat client manager for factory", e);
-      }
-    }
-  }
-
-  protected AsyncBaseFactory(
-      TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-    super(protocolFactory, category, clientManager);
-    managers =
-        new TAsyncClientManager
-            [ClusterDescriptor.getInstance().getConfig().getSelectorNumOfClientPool()];
-    for (int i = 0; i < managers.length; i++) {
-      try {
-        managers[i] = new TAsyncClientManager();
-      } catch (IOException e) {
-        logger.error("Cannot create data heartbeat client manager for factory", e);
-      }
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncDataClient.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncDataClient.java
deleted file mode 100644
index ebfb7ded5a..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncDataClient.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.async;
-
-import org.apache.iotdb.cluster.client.BaseFactory;
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.TSDataService;
-import org.apache.iotdb.cluster.utils.ClientUtils;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
-
-import org.apache.commons.pool2.PooledObject;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
-import org.apache.thrift.async.TAsyncClientManager;
-import org.apache.thrift.async.TAsyncMethodCall;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.transport.TNonblockingTransport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-/**
- * Notice: Because a client will be returned to a pool immediately after a successful request, you
- * should not cache it anywhere else.
- */
-public class AsyncDataClient extends TSDataService.AsyncClient {
-
-  private static final Logger logger = LoggerFactory.getLogger(AsyncDataClient.class);
-
-  private Node node;
-  private ClientCategory category;
-  private IClientManager clientManager;
-
-  @TestOnly
-  public AsyncDataClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager clientManager,
-      TNonblockingTransport transport) {
-    super(protocolFactory, clientManager, transport);
-  }
-
-  public AsyncDataClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager tClientManager,
-      Node node,
-      ClientCategory category)
-      throws IOException {
-    // the difference of the two clients lies in the port
-    super(
-        protocolFactory,
-        tClientManager,
-        TNonblockingSocketWrapper.wrap(
-            node.getInternalIp(),
-            ClientUtils.getPort(node, category),
-            ClusterConstant.getConnectionTimeoutInMS()));
-    this.node = node;
-    this.category = category;
-  }
-
-  public AsyncDataClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager tClientManager,
-      Node node,
-      ClientCategory category,
-      IClientManager manager)
-      throws IOException {
-    this(protocolFactory, tClientManager, node, category);
-    this.clientManager = manager;
-  }
-
-  public void close() {
-    ___transport.close();
-    ___currentMethod = null;
-  }
-
-  public boolean isValid() {
-    return ___transport != null;
-  }
-
-  /**
-   * return self if clientPool is not null, the method doesn't need to call by user, it will trigger
-   * once client transport complete.
-   */
-  private void returnSelf() {
-    if (clientManager != null) {
-      clientManager.returnAsyncClient(this, node, category);
-    }
-  }
-
-  @Override
-  public void onComplete() {
-    super.onComplete();
-    returnSelf();
-  }
-
-  @Override
-  public String toString() {
-    return "Async"
-        + category.getName()
-        + "{"
-        + "node="
-        + node
-        + ","
-        + "port="
-        + ClientUtils.getPort(node, category)
-        + '}';
-  }
-
-  public Node getNode() {
-    return node;
-  }
-
-  public boolean isReady() {
-    try {
-      checkReady();
-      return true;
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  @TestOnly
-  TAsyncMethodCall<Object> getCurrMethod() {
-    return ___currentMethod;
-  }
-
-  public static class AsyncDataClientFactory extends AsyncBaseFactory<Node, AsyncDataClient> {
-
-    public AsyncDataClientFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-      super(protocolFactory, category);
-    }
-
-    public AsyncDataClientFactory(
-        TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-      super(protocolFactory, category, clientManager);
-    }
-
-    @Override
-    public void destroyObject(Node node, PooledObject<AsyncDataClient> pooledObject) {
-      pooledObject.getObject().close();
-    }
-
-    @Override
-    public PooledObject<AsyncDataClient> makeObject(Node node) throws Exception {
-      TAsyncClientManager manager = managers[clientCnt.incrementAndGet() % managers.length];
-      manager = manager == null ? new TAsyncClientManager() : manager;
-      return new DefaultPooledObject<>(
-          new AsyncDataClient(protocolFactory, manager, node, category, clientPoolManager));
-    }
-
-    @Override
-    public boolean validateObject(Node node, PooledObject<AsyncDataClient> pooledObject) {
-      return pooledObject.getObject() != null && pooledObject.getObject().isValid();
-    }
-  }
-
-  public static class SingleManagerFactory extends BaseFactory<Node, AsyncDataClient> {
-
-    public SingleManagerFactory(TProtocolFactory protocolFactory) {
-      super(protocolFactory, ClientCategory.DATA);
-      managers = new TAsyncClientManager[1];
-      try {
-        managers[0] = new TAsyncClientManager();
-      } catch (IOException e) {
-        logger.error("Cannot create data heartbeat client manager for factory", e);
-      }
-    }
-
-    public SingleManagerFactory(TProtocolFactory protocolFactory, IClientManager clientManager) {
-      this(protocolFactory);
-      this.clientPoolManager = clientManager;
-    }
-
-    @Override
-    public void activateObject(Node node, PooledObject<AsyncDataClient> pooledObject) {}
-
-    @Override
-    public void destroyObject(Node node, PooledObject<AsyncDataClient> pooledObject) {
-      pooledObject.getObject().close();
-    }
-
-    @Override
-    public PooledObject<AsyncDataClient> makeObject(Node node) throws Exception {
-      return new DefaultPooledObject<>(
-          new AsyncDataClient(
-              protocolFactory, managers[0], node, ClientCategory.DATA, clientPoolManager));
-    }
-
-    @Override
-    public void passivateObject(Node node, PooledObject<AsyncDataClient> pooledObject) {}
-
-    @Override
-    public boolean validateObject(Node node, PooledObject<AsyncDataClient> pooledObject) {
-      return pooledObject.getObject() != null && pooledObject.getObject().isValid();
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncMetaClient.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncMetaClient.java
deleted file mode 100644
index 6d4c03998c..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncMetaClient.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.async;
-
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.TSMetaService;
-import org.apache.iotdb.cluster.utils.ClientUtils;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
-
-import org.apache.commons.pool2.PooledObject;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
-import org.apache.thrift.async.TAsyncClientManager;
-import org.apache.thrift.async.TAsyncMethodCall;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.transport.TNonblockingTransport;
-
-import java.io.IOException;
-
-/**
- * Notice: Because a client will be returned to a pool immediately after a successful request, you
- * should not cache it anywhere else.
- */
-public class AsyncMetaClient extends TSMetaService.AsyncClient {
-
-  private Node node;
-  private ClientCategory category;
-  private IClientManager clientManager;
-
-  public AsyncMetaClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager clientManager,
-      TNonblockingTransport transport) {
-    super(protocolFactory, clientManager, transport);
-  }
-
-  public AsyncMetaClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager clientManager,
-      Node node,
-      ClientCategory category)
-      throws IOException {
-    // the difference of the two clients lies in the port
-    super(
-        protocolFactory,
-        clientManager,
-        TNonblockingSocketWrapper.wrap(
-            node.getInternalIp(),
-            ClientUtils.getPort(node, category),
-            ClusterConstant.getConnectionTimeoutInMS()));
-    this.node = node;
-    this.category = category;
-  }
-
-  public AsyncMetaClient(
-      TProtocolFactory protocolFactory,
-      TAsyncClientManager clientManager,
-      Node node,
-      ClientCategory category,
-      IClientManager manager)
-      throws IOException {
-    this(protocolFactory, clientManager, node, category);
-    this.clientManager = manager;
-  }
-
-  /**
-   * return self if clientManager is not null, the method doesn't need to call by user, it will
-   * trigger once client transport complete.
-   */
-  public void returnSelf() {
-    if (clientManager != null) {
-      clientManager.returnAsyncClient(this, node, category);
-    }
-  }
-
-  @Override
-  public void onComplete() {
-    super.onComplete();
-    returnSelf();
-  }
-
-  @Override
-  public String toString() {
-    return "Async"
-        + category.getName()
-        + "{"
-        + "node="
-        + node
-        + ","
-        + "port="
-        + ClientUtils.getPort(node, category)
-        + '}';
-  }
-
-  public void close() {
-    ___transport.close();
-    ___currentMethod = null;
-  }
-
-  public Node getNode() {
-    return node;
-  }
-
-  @TestOnly
-  public boolean isReady() {
-    try {
-      checkReady();
-      return true;
-    } catch (Exception e) {
-      return false;
-    }
-  }
-
-  public boolean isValid() {
-    return ___transport != null;
-  }
-
-  @TestOnly
-  TAsyncMethodCall<Object> getCurrMethod() {
-    return ___currentMethod;
-  }
-
-  public static class AsyncMetaClientFactory extends AsyncBaseFactory<Node, AsyncMetaClient> {
-
-    public AsyncMetaClientFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-      super(protocolFactory, category);
-    }
-
-    public AsyncMetaClientFactory(
-        TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-      super(protocolFactory, category, clientManager);
-    }
-
-    @Override
-    public void activateObject(Node node, PooledObject<AsyncMetaClient> pooledObject) {}
-
-    @Override
-    public void destroyObject(Node node, PooledObject<AsyncMetaClient> pooledObject) {
-      pooledObject.getObject().close();
-    }
-
-    @Override
-    public PooledObject<AsyncMetaClient> makeObject(Node node) throws Exception {
-      TAsyncClientManager manager = managers[clientCnt.incrementAndGet() % managers.length];
-      manager = manager == null ? new TAsyncClientManager() : manager;
-      return new DefaultPooledObject<>(
-          new AsyncMetaClient(protocolFactory, manager, node, category, clientPoolManager));
-    }
-
-    @Override
-    public void passivateObject(Node node, PooledObject<AsyncMetaClient> pooledObject) {}
-
-    @Override
-    public boolean validateObject(Node node, PooledObject<AsyncMetaClient> pooledObject) {
-      return pooledObject != null && pooledObject.getObject().isValid();
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientAdaptor.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientAdaptor.java
deleted file mode 100644
index b066bc86a0..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientAdaptor.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.sync;
-
-import org.apache.iotdb.cluster.client.async.AsyncDataClient;
-import org.apache.iotdb.cluster.client.async.AsyncMetaClient;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.log.Snapshot;
-import org.apache.iotdb.cluster.log.snapshot.SnapshotFactory;
-import org.apache.iotdb.cluster.rpc.thrift.AddNodeResponse;
-import org.apache.iotdb.cluster.rpc.thrift.CheckStatusResponse;
-import org.apache.iotdb.cluster.rpc.thrift.ExecutNonQueryReq;
-import org.apache.iotdb.cluster.rpc.thrift.GetAggrResultRequest;
-import org.apache.iotdb.cluster.rpc.thrift.GetAllPathsResult;
-import org.apache.iotdb.cluster.rpc.thrift.GroupByRequest;
-import org.apache.iotdb.cluster.rpc.thrift.LastQueryRequest;
-import org.apache.iotdb.cluster.rpc.thrift.MeasurementSchemaRequest;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.PreviousFillRequest;
-import org.apache.iotdb.cluster.rpc.thrift.PullSchemaRequest;
-import org.apache.iotdb.cluster.rpc.thrift.PullSnapshotRequest;
-import org.apache.iotdb.cluster.rpc.thrift.RaftNode;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService.AsyncClient;
-import org.apache.iotdb.cluster.rpc.thrift.SingleSeriesQueryRequest;
-import org.apache.iotdb.cluster.rpc.thrift.StartUpStatus;
-import org.apache.iotdb.cluster.rpc.thrift.TNodeStatus;
-import org.apache.iotdb.cluster.server.handlers.caller.GenericHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetChildNodeNextLevelHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetChildNodeNextLevelPathHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetDevicesHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetNodesListHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.GetTimeseriesSchemaHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.JoinClusterHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullMeasurementSchemaHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullSnapshotHandler;
-import org.apache.iotdb.cluster.server.handlers.caller.PullTimeseriesSchemaHandler;
-import org.apache.iotdb.cluster.server.handlers.forwarder.ForwardPlanHandler;
-import org.apache.iotdb.cluster.utils.PlanSerializer;
-import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.commons.utils.SerializeUtils;
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.sys.ShowDevicesPlan;
-import org.apache.iotdb.db.query.context.QueryContext;
-import org.apache.iotdb.tsfile.read.filter.TimeFilter;
-import org.apache.iotdb.tsfile.read.filter.basic.Filter;
-import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory;
-import org.apache.iotdb.tsfile.read.filter.operator.AndFilter;
-import org.apache.iotdb.tsfile.write.schema.IMeasurementSchema;
-import org.apache.iotdb.tsfile.write.schema.TimeseriesSchema;
-
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * SyncClientAdaptor convert the async of AsyncClient method call to a sync one by synchronizing on
- * an AtomicReference of the return value of an RPC, and wait for at most connectionTimeoutInMS
- * until the reference is set by the handler or the request timeouts.
- */
-@SuppressWarnings("java:S2274") // enable timeout
-public class SyncClientAdaptor {
-
-  private static final Logger logger = LoggerFactory.getLogger(SyncClientAdaptor.class);
-
-  private SyncClientAdaptor() {
-    // static class
-  }
-
-  public static Long removeNode(AsyncMetaClient asyncMetaClient, Node nodeToRemove)
-      throws TException, InterruptedException {
-    AtomicReference<Long> responseRef = new AtomicReference<>();
-    GenericHandler<Long> handler = new GenericHandler<>(asyncMetaClient.getNode(), responseRef);
-    asyncMetaClient.removeNode(nodeToRemove, handler);
-    synchronized (responseRef) {
-      if (responseRef.get() == null) {
-        responseRef.wait(ClusterConstant.getConnectionTimeoutInMS());
-      }
-    }
-    return responseRef.get();
-  }
-
-  public static Boolean matchTerm(
-      AsyncClient client, Node target, long prevLogIndex, long prevLogTerm, RaftNode header)
-      throws TException, InterruptedException {
-    try {
-      AtomicReference<Boolean> resultRef = new AtomicReference<>(null);
-      GenericHandler<Boolean> matchTermHandler = new GenericHandler<>(target, resultRef);
-
-      client.matchTerm(prevLogIndex, prevLogTerm, header, matchTermHandler);
-      synchronized (resultRef) {
-        if (resultRef.get() == null) {
-          resultRef.wait(ClusterConstant.getConnectionTimeoutInMS());
-        }
-      }
-      return resultRef.get();
-    } catch (NullPointerException e) {
-      logger.error("match term null exception", e);
-      return false;
-    }
-  }
-
-  public static Long querySingleSeriesByTimestamp(
-      AsyncDataClient client, SingleSeriesQueryRequest request)
-      throws TException, InterruptedException {
-    AtomicReference<Long> result = new AtomicReference<>();
-    GenericHandler<Long> handler = new GenericHandler<>(client.getNode(), result);
-
-    client.querySingleSeriesByTimestamp(request, handler);
-    synchronized (result) {
-      if (result.get() == null && handler.getException() == null) {
-        result.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return result.get();
-  }
-
-  public static Long querySingleSeries(
-      AsyncDataClient client, SingleSeriesQueryRequest request, long timeOffset)
-      throws TException, InterruptedException {
-    AtomicReference<Long> result = new AtomicReference<>();
-    GenericHandler<Long> handler = new GenericHandler<>(client.getNode(), result);
-    Filter newFilter;
-    // add timestamp to as a timeFilter to skip the data which has been read
-    if (request.isSetTimeFilterBytes()) {
-      Filter timeFilter = FilterFactory.deserialize(request.timeFilterBytes);
-      newFilter = new AndFilter(timeFilter, TimeFilter.gt(timeOffset));
-    } else {
-      newFilter = TimeFilter.gt(timeOffset);
-    }
-    request.setTimeFilterBytes(SerializeUtils.serializeFilter(newFilter));
-
-    client.querySingleSeries(request, handler);
-    synchronized (result) {
-      if (result.get() == null && handler.getException() == null) {
-        result.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return result.get();
-  }
-
-  public static List<String> getNodeList(
-      AsyncDataClient client, RaftNode header, String schemaPattern, int level)
-      throws TException, InterruptedException {
-    GetNodesListHandler handler = new GetNodesListHandler();
-    AtomicReference<List<String>> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-
-    client.getNodeList(header, schemaPattern, level, handler);
-    synchronized (response) {
-      if (response.get() == null) {
-        response.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return response.get();
-  }
-
-  public static Set<String> getChildNodeInNextLevel(
-      AsyncDataClient client, RaftNode header, String path)
-      throws TException, InterruptedException {
-    GetChildNodeNextLevelHandler handler = new GetChildNodeNextLevelHandler();
-    AtomicReference<Set<String>> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-
-    client.getChildNodeInNextLevel(header, path, handler);
-    synchronized (response) {
-      if (response.get() == null) {
-        response.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return response.get();
-  }
-
-  public static Set<String> getNextChildren(AsyncDataClient client, RaftNode header, String path)
-      throws TException, InterruptedException {
-    GetChildNodeNextLevelPathHandler handler = new GetChildNodeNextLevelPathHandler();
-    AtomicReference<Set<String>> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-
-    client.getChildNodePathInNextLevel(header, path, handler);
-    synchronized (response) {
-      if (response.get() == null) {
-        response.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return response.get();
-  }
-
-  public static ByteBuffer getAllMeasurementSchema(
-      AsyncDataClient client, MeasurementSchemaRequest request)
-      throws IOException, InterruptedException, TException {
-    GetTimeseriesSchemaHandler handler = new GetTimeseriesSchemaHandler();
-    AtomicReference<ByteBuffer> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-    client.getAllMeasurementSchema(request, handler);
-    synchronized (response) {
-      if (response.get() == null) {
-        response.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return response.get();
-  }
-
-  public static TNodeStatus queryNodeStatus(AsyncMetaClient client)
-      throws TException, InterruptedException {
-    AtomicReference<TNodeStatus> resultRef = new AtomicReference<>();
-    GenericHandler<TNodeStatus> handler = new GenericHandler<>(client.getNode(), resultRef);
-
-    client.queryNodeStatus(handler);
-    synchronized (resultRef) {
-      if (resultRef.get() == null) {
-        resultRef.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    if (handler.getException() != null) {
-      throw new TException(handler.getException());
-    }
-    return resultRef.get();
-  }
-
-  public static CheckStatusResponse checkStatus(AsyncMetaClient client, StartUpStatus startUpStatus)
-      throws TException, InterruptedException {
-    AtomicReference<CheckStatusResponse> resultRef = new AtomicReference<>();
-    GenericHandler<CheckStatusResponse> handler = new GenericHandler<>(client.getNode(), resultRef);
-
-    client.checkStatus(startUpStatus, handler);
-    synchronized (resultRef) {
-      if (resultRef.get() == null) {
-        resultRef.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    if (handler.getException() != null) {
-      throw new TException(handler.getException());
-    }
-    return resultRef.get();
-  }
-
-  public static AddNodeResponse addNode(
-      AsyncMetaClient client, Node thisNode, StartUpStatus startUpStatus)
-      throws TException, InterruptedException {
-    JoinClusterHandler handler = new JoinClusterHandler();
-    AtomicReference<AddNodeResponse> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-
-    client.addNode(thisNode, startUpStatus, handler);
-    synchronized (response) {
-      if (response.get() == null) {
-        response.wait(60 * 1000L);
-      }
-    }
-    return response.get();
-  }
-
-  public static List<IMeasurementSchema> pullMeasurementSchema(
-      AsyncDataClient client, PullSchemaRequest pullSchemaRequest)
-      throws TException, InterruptedException {
-    AtomicReference<List<IMeasurementSchema>> measurementSchemas = new AtomicReference<>();
-
-    client.pullMeasurementSchema(
-        pullSchemaRequest,
-        new PullMeasurementSchemaHandler(
-            client.getNode(), pullSchemaRequest.getPrefixPaths(), measurementSchemas));
-    synchronized (measurementSchemas) {
-      if (measurementSchemas.get() == null) {
-        measurementSchemas.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return measurementSchemas.get();
-  }
-
-  public static List<TimeseriesSchema> pullTimeseriesSchema(
-      AsyncDataClient client, PullSchemaRequest pullSchemaRequest)
-      throws TException, InterruptedException {
-    AtomicReference<List<TimeseriesSchema>> timeseriesSchemas = new AtomicReference<>();
-    client.pullTimeSeriesSchema(
-        pullSchemaRequest,
-        new PullTimeseriesSchemaHandler(
-            client.getNode(), pullSchemaRequest.getPrefixPaths(), timeseriesSchemas));
-
-    synchronized (timeseriesSchemas) {
-      if (timeseriesSchemas.get() == null) {
-        timeseriesSchemas.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return timeseriesSchemas.get();
-  }
-
-  public static List<ByteBuffer> getAggrResult(AsyncDataClient client, GetAggrResultRequest request)
-      throws TException, InterruptedException {
-    AtomicReference<List<ByteBuffer>> resultReference = new AtomicReference<>();
-    GenericHandler<List<ByteBuffer>> handler =
-        new GenericHandler<>(client.getNode(), resultReference);
-
-    client.getAggrResult(request, handler);
-    synchronized (resultReference) {
-      if (resultReference.get() == null) {
-        resultReference.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    if (handler.getException() != null) {
-      throw new TException(handler.getException());
-    }
-    return resultReference.get();
-  }
-
-  public static List<String> getUnregisteredMeasurements(
-      AsyncDataClient client, RaftNode header, List<String> seriesPaths)
-      throws TException, InterruptedException {
-    AtomicReference<List<String>> remoteResult = new AtomicReference<>();
-    GenericHandler<List<String>> handler = new GenericHandler<>(client.getNode(), remoteResult);
-
-    client.getUnregisteredTimeseries(header, seriesPaths, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static GetAllPathsResult getAllPaths(
-      AsyncDataClient client, RaftNode header, List<String> pathsToQuery, boolean withAlias)
-      throws InterruptedException, TException {
-    AtomicReference<GetAllPathsResult> remoteResult = new AtomicReference<>();
-    GenericHandler<GetAllPathsResult> handler =
-        new GenericHandler<>(client.getNode(), remoteResult);
-
-    client.getAllPaths(header, pathsToQuery, withAlias, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static Integer getPathCount(
-      AsyncDataClient client, RaftNode header, List<String> pathsToQuery, int level)
-      throws InterruptedException, TException {
-    AtomicReference<Integer> remoteResult = new AtomicReference<>(null);
-    GenericHandler<Integer> handler = new GenericHandler<>(client.getNode(), remoteResult);
-
-    client.getPathCount(header, pathsToQuery, level, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static Integer getDeviceCount(
-      AsyncDataClient client, RaftNode header, List<String> pathsToQuery)
-      throws InterruptedException, TException {
-    AtomicReference<Integer> remoteResult = new AtomicReference<>(null);
-    GenericHandler<Integer> handler = new GenericHandler<>(client.getNode(), remoteResult);
-
-    client.getDeviceCount(header, pathsToQuery, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static Set<String> getAllDevices(
-      AsyncDataClient client, RaftNode header, List<String> pathsToQuery, boolean isPrefixMatch)
-      throws InterruptedException, TException {
-    AtomicReference<Set<String>> remoteResult = new AtomicReference<>();
-    GenericHandler<Set<String>> handler = new GenericHandler<>(client.getNode(), remoteResult);
-
-    client.getAllDevices(header, pathsToQuery, isPrefixMatch, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static ByteBuffer getDevices(AsyncDataClient client, RaftNode header, ShowDevicesPlan plan)
-      throws InterruptedException, TException, IOException {
-    GetDevicesHandler handler = new GetDevicesHandler();
-    AtomicReference<ByteBuffer> response = new AtomicReference<>(null);
-    handler.setResponse(response);
-    handler.setContact(client.getNode());
-    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-    DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
-    plan.serialize(dataOutputStream);
-
-    client.getDevices(header, ByteBuffer.wrap(byteArrayOutputStream.toByteArray()), handler);
-    synchronized (handler) {
-      if (response.get() == null) {
-        response.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return response.get();
-  }
-
-  public static Long getGroupByExecutor(AsyncDataClient client, GroupByRequest request)
-      throws TException, InterruptedException {
-    AtomicReference<Long> result = new AtomicReference<>();
-    GenericHandler<Long> handler = new GenericHandler<>(client.getNode(), result);
-
-    client.getGroupByExecutor(request, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static ByteBuffer previousFill(AsyncDataClient client, PreviousFillRequest request)
-      throws TException, InterruptedException {
-    AtomicReference<ByteBuffer> resultRef = new AtomicReference<>();
-    GenericHandler<ByteBuffer> nodeHandler = new GenericHandler<>(client.getNode(), resultRef);
-
-    client.previousFill(request, nodeHandler);
-    return nodeHandler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static TSStatus executeNonQuery(
-      AsyncClient client, PhysicalPlan plan, RaftNode header, Node receiver)
-      throws IOException, TException, InterruptedException {
-    AtomicReference<TSStatus> status = new AtomicReference<>();
-    ExecutNonQueryReq req = new ExecutNonQueryReq();
-    req.planBytes = ByteBuffer.wrap(PlanSerializer.getInstance().serialize(plan));
-    if (header != null) {
-      req.setHeader(header);
-    }
-
-    client.executeNonQueryPlan(req, new ForwardPlanHandler(status, plan, receiver));
-    synchronized (status) {
-      if (status.get() == null) {
-        status.wait(ClusterConstant.getWriteOperationTimeoutMS());
-      }
-    }
-    return status.get();
-  }
-
-  public static ByteBuffer readFile(
-      AsyncDataClient client, String remotePath, long offset, int fetchSize)
-      throws InterruptedException, TException {
-    AtomicReference<ByteBuffer> result = new AtomicReference<>();
-    GenericHandler<ByteBuffer> handler = new GenericHandler<>(client.getNode(), result);
-
-    client.readFile(remotePath, offset, fetchSize, handler);
-    return handler.getResult(ClusterConstant.getWriteOperationTimeoutMS());
-  }
-
-  public static List<ByteBuffer> getGroupByResult(
-      AsyncDataClient client, RaftNode header, long executorId, long curStartTime, long curEndTime)
-      throws InterruptedException, TException {
-    AtomicReference<List<ByteBuffer>> fetchResult = new AtomicReference<>();
-    GenericHandler<List<ByteBuffer>> handler = new GenericHandler<>(client.getNode(), fetchResult);
-
-    client.getGroupByResult(header, executorId, curStartTime, curEndTime, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static ByteBuffer peekNextNotNullValue(
-      AsyncDataClient client, RaftNode header, long executorId, long curStartTime, long curEndTime)
-      throws InterruptedException, TException {
-    AtomicReference<ByteBuffer> fetchResult = new AtomicReference<>();
-    GenericHandler<ByteBuffer> handler = new GenericHandler<>(client.getNode(), fetchResult);
-
-    client.peekNextNotNullValue(header, executorId, curStartTime, curEndTime, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static <T extends Snapshot> Map<Integer, T> pullSnapshot(
-      AsyncDataClient client,
-      PullSnapshotRequest request,
-      List<Integer> slots,
-      SnapshotFactory<T> factory)
-      throws TException, InterruptedException {
-    AtomicReference<Map<Integer, T>> snapshotRef = new AtomicReference<>();
-
-    client.pullSnapshot(
-        request, new PullSnapshotHandler<>(snapshotRef, client.getNode(), slots, factory));
-    synchronized (snapshotRef) {
-      if (snapshotRef.get() == null) {
-        snapshotRef.wait(ClusterConstant.getReadOperationTimeoutMS());
-      }
-    }
-    return snapshotRef.get();
-  }
-
-  public static ByteBuffer last(
-      AsyncDataClient client,
-      List<PartialPath> seriesPaths,
-      List<Integer> dataTypeOrdinals,
-      Filter timeFilter,
-      QueryContext context,
-      Map<String, Set<String>> deviceMeasurements,
-      RaftNode header)
-      throws TException, InterruptedException {
-    AtomicReference<ByteBuffer> result = new AtomicReference<>();
-    GenericHandler<ByteBuffer> handler = new GenericHandler<>(client.getNode(), result);
-    LastQueryRequest request =
-        new LastQueryRequest(
-            PartialPath.toStringList(seriesPaths),
-            dataTypeOrdinals,
-            context.getQueryId(),
-            deviceMeasurements,
-            header,
-            client.getNode());
-    if (timeFilter != null) {
-      request.setFilterBytes(SerializeUtils.serializeFilter(timeFilter));
-    }
-    client.last(request, handler);
-    return handler.getResult(ClusterConstant.getReadOperationTimeoutMS());
-  }
-
-  public static boolean onSnapshotApplied(
-      AsyncDataClient client, RaftNode header, List<Integer> slots)
-      throws TException, InterruptedException {
-    AtomicReference<Boolean> result = new AtomicReference<>();
-    GenericHandler<Boolean> handler = new GenericHandler<>(client.getNode(), result);
-
-    client.onSnapshotApplied(header, slots, handler);
-    return handler.getResult(ClusterConstant.getWriteOperationTimeoutMS());
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataClient.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataClient.java
deleted file mode 100644
index 75aa6a096b..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataClient.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.sync;
-
-import org.apache.iotdb.cluster.client.BaseFactory;
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.TSDataService;
-import org.apache.iotdb.cluster.utils.ClientUtils;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.rpc.RpcTransportFactory;
-import org.apache.iotdb.rpc.TConfigurationConst;
-import org.apache.iotdb.rpc.TimeoutChangeableTransport;
-
-import org.apache.commons.pool2.PooledObject;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransportException;
-
-import java.net.SocketException;
-
-/**
- * Notice: Because a client will be returned to a pool immediately after a successful request, you
- * should not cache it anywhere else.
- */
-// TODO: Refine the interfaces of TSDataService. TSDataService interfaces doesn't need extends
-// RaftService interfaces.
-public class SyncDataClient extends TSDataService.Client {
-
-  private Node node;
-  private ClientCategory category;
-  private IClientManager clientManager;
-
-  @TestOnly
-  public SyncDataClient(TProtocol prot) {
-    super(prot);
-  }
-
-  public SyncDataClient(TProtocolFactory protocolFactory, Node node, ClientCategory category)
-      throws TTransportException {
-
-    // the difference of the two clients lies in the port
-    super(
-        protocolFactory.getProtocol(
-            RpcTransportFactory.INSTANCE.getTransport(
-                new TSocket(
-                    TConfigurationConst.defaultTConfiguration,
-                    node.getInternalIp(),
-                    ClientUtils.getPort(node, category),
-                    ClusterConstant.getConnectionTimeoutInMS()))));
-    this.node = node;
-    this.category = category;
-    getInputProtocol().getTransport().open();
-  }
-
-  public SyncDataClient(
-      TProtocolFactory protocolFactory, Node node, ClientCategory category, IClientManager manager)
-      throws TTransportException {
-    this(protocolFactory, node, category);
-    this.clientManager = manager;
-  }
-
-  public void returnSelf() {
-    if (clientManager != null) {
-      clientManager.returnSyncClient(this, node, category);
-    }
-  }
-
-  public void setTimeout(int timeout) {
-    // the same transport is used in both input and output
-    ((TimeoutChangeableTransport) (getInputProtocol().getTransport())).setTimeout(timeout);
-  }
-
-  public void close() {
-    getInputProtocol().getTransport().close();
-  }
-
-  @TestOnly
-  public int getTimeout() throws SocketException {
-    return ((TimeoutChangeableTransport) getInputProtocol().getTransport()).getTimeOut();
-  }
-
-  @Override
-  public String toString() {
-    return "Sync"
-        + category.getName()
-        + "{"
-        + "node="
-        + node
-        + ","
-        + "port="
-        + ClientUtils.getPort(node, category)
-        + '}';
-  }
-
-  public Node getNode() {
-    return node;
-  }
-
-  public static class SyncDataClientFactory extends BaseFactory<Node, SyncDataClient> {
-
-    public SyncDataClientFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-      super(protocolFactory, category);
-    }
-
-    public SyncDataClientFactory(
-        TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-      super(protocolFactory, category, clientManager);
-    }
-
-    @Override
-    public void activateObject(Node node, PooledObject<SyncDataClient> pooledObject) {
-      pooledObject.getObject().setTimeout(ClusterConstant.getConnectionTimeoutInMS());
-    }
-
-    @Override
-    public void destroyObject(Node node, PooledObject<SyncDataClient> pooledObject) {
-      pooledObject.getObject().close();
-    }
-
-    @Override
-    public PooledObject<SyncDataClient> makeObject(Node node) throws Exception {
-      return new DefaultPooledObject<>(
-          new SyncDataClient(protocolFactory, node, category, clientPoolManager));
-    }
-
-    @Override
-    public boolean validateObject(Node node, PooledObject<SyncDataClient> pooledObject) {
-      return pooledObject.getObject() != null
-          && pooledObject.getObject().getInputProtocol().getTransport().isOpen();
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncMetaClient.java b/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncMetaClient.java
deleted file mode 100644
index 2d2481cb2b..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncMetaClient.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.client.sync;
-
-import org.apache.iotdb.cluster.client.BaseFactory;
-import org.apache.iotdb.cluster.client.ClientCategory;
-import org.apache.iotdb.cluster.client.IClientManager;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.TSMetaService;
-import org.apache.iotdb.cluster.utils.ClientUtils;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.rpc.RpcTransportFactory;
-import org.apache.iotdb.rpc.TConfigurationConst;
-import org.apache.iotdb.rpc.TimeoutChangeableTransport;
-
-import org.apache.commons.pool2.PooledObject;
-import org.apache.commons.pool2.impl.DefaultPooledObject;
-import org.apache.thrift.protocol.TProtocolFactory;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransportException;
-
-import java.net.SocketException;
-
-/**
- * Notice: Because a client will be returned to a pool immediately after a successful request, you
- * should not cache it anywhere else.
- */
-public class SyncMetaClient extends TSMetaService.Client {
-
-  private Node node;
-  private ClientCategory category;
-  private IClientManager clientManager;
-
-  public SyncMetaClient(TProtocolFactory protocolFactory, Node node, ClientCategory category)
-      throws TTransportException {
-    super(
-        protocolFactory.getProtocol(
-            RpcTransportFactory.INSTANCE.getTransport(
-                new TSocket(
-                    TConfigurationConst.defaultTConfiguration,
-                    node.getInternalIp(),
-                    ClientUtils.getPort(node, category),
-                    ClusterConstant.getConnectionTimeoutInMS()))));
-    this.node = node;
-    this.category = category;
-    getInputProtocol().getTransport().open();
-  }
-
-  public SyncMetaClient(
-      TProtocolFactory protocolFactory, Node node, ClientCategory category, IClientManager manager)
-      throws TTransportException {
-    this(protocolFactory, node, category);
-    this.clientManager = manager;
-  }
-
-  public void returnSelf() {
-    if (clientManager != null) {
-      clientManager.returnSyncClient(this, node, category);
-    }
-  }
-
-  public void setTimeout(int timeout) {
-    // the same transport is used in both input and output
-    ((TimeoutChangeableTransport) (getInputProtocol().getTransport())).setTimeout(timeout);
-  }
-
-  @TestOnly
-  public int getTimeout() throws SocketException {
-    return ((TimeoutChangeableTransport) getInputProtocol().getTransport()).getTimeOut();
-  }
-
-  public void close() {
-    getInputProtocol().getTransport().close();
-  }
-
-  public Node getNode() {
-    return node;
-  }
-
-  @Override
-  public String toString() {
-    return "Sync"
-        + category.getName()
-        + "{"
-        + "node="
-        + node
-        + ","
-        + "port="
-        + ClientUtils.getPort(node, category)
-        + '}';
-  }
-
-  public static class SyncMetaClientFactory extends BaseFactory<Node, SyncMetaClient> {
-
-    public SyncMetaClientFactory(TProtocolFactory protocolFactory, ClientCategory category) {
-      super(protocolFactory, category);
-    }
-
-    public SyncMetaClientFactory(
-        TProtocolFactory protocolFactory, ClientCategory category, IClientManager clientManager) {
-      super(protocolFactory, category, clientManager);
-    }
-
-    @Override
-    public void activateObject(Node node, PooledObject<SyncMetaClient> pooledObject) {
-      pooledObject.getObject().setTimeout(ClusterConstant.getConnectionTimeoutInMS());
-    }
-
-    @Override
-    public void destroyObject(Node node, PooledObject<SyncMetaClient> pooledObject) {
-      pooledObject.getObject().close();
-    }
-
-    @Override
-    public PooledObject<SyncMetaClient> makeObject(Node node) throws Exception {
-      return new DefaultPooledObject<>(
-          new SyncMetaClient(protocolFactory, node, category, clientPoolManager));
-    }
-
-    @Override
-    public boolean validateObject(Node node, PooledObject<SyncMetaClient> pooledObject) {
-      return pooledObject.getObject() != null
-          && pooledObject.getObject().getInputProtocol().getTransport().isOpen();
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConfig.java b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConfig.java
deleted file mode 100644
index 3e08e067ba..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConfig.java
+++ /dev/null
@@ -1,584 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.config;
-
-import org.apache.iotdb.cluster.utils.ClusterConsistent;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-public class ClusterConfig {
-  private static Logger logger = LoggerFactory.getLogger(ClusterConfig.class);
-  static final String CONFIG_NAME = "iotdb-cluster.properties";
-
-  private String internalIp;
-  private int internalMetaPort = 9003;
-  private int internalDataPort = 40010;
-  private int clusterRpcPort = IoTDBDescriptor.getInstance().getConfig().getRpcPort();
-  private int clusterInfoRpcPort = 6567;
-
-  /** each one is a {internalIp | domain name}:{meta port} string tuple. */
-  private List<String> seedNodeUrls;
-
-  @ClusterConsistent private boolean isRpcThriftCompressionEnabled = false;
-
-  @ClusterConsistent private int replicationNum = 1;
-
-  @ClusterConsistent private int multiRaftFactor = 1;
-
-  @ClusterConsistent private String clusterName = "default";
-
-  @ClusterConsistent private boolean useAsyncServer = false;
-
-  private boolean useAsyncApplier = true;
-
-  private int connectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
-
-  private long heartbeatIntervalMs = TimeUnit.SECONDS.toMillis(1);
-
-  private long electionTimeoutMs = TimeUnit.SECONDS.toMillis(20);
-
-  private int readOperationTimeoutMS = (int) TimeUnit.SECONDS.toMillis(30);
-
-  private int writeOperationTimeoutMS = (int) TimeUnit.SECONDS.toMillis(30);
-
-  private int catchUpTimeoutMS = (int) TimeUnit.SECONDS.toMillis(300);
-
-  private boolean useBatchInLogCatchUp = true;
-
-  /** max number of committed logs to be saved */
-  private int minNumOfLogsInMem = 1000;
-
-  /** max number of committed logs in memory */
-  private int maxNumOfLogsInMem = 2000;
-
-  /** max memory size of committed logs in memory, default 512M */
-  private long maxMemorySizeForRaftLog = 536870912;
-
-  /** Ratio of write memory allocated for raft log */
-  private double RaftLogMemoryProportion = 0.2;
-
-  /** deletion check period of the submitted log */
-  private int logDeleteCheckIntervalSecond = -1;
-
-  /** max number of clients in a ClientPool of a member for one node. */
-  private int maxClientPerNodePerMember = 1000;
-
-  /** max number of idle clients in a ClientPool of a member for one node. */
-  private int maxIdleClientPerNodePerMember = 500;
-
-  /**
-   * If the number of connections created for a node exceeds `max_client_pernode_permember_number`,
-   * we need to wait so much time for other connections to be released until timeout, or a new
-   * connection will be created.
-   */
-  private long waitClientTimeoutMS = 5 * 1000L;
-
-  /**
-   * ClientPool will have so many selector threads (TAsyncClientManager) to distribute to its
-   * clients.
-   */
-  private int selectorNumOfClientPool =
-      Runtime.getRuntime().availableProcessors() / 3 > 0
-          ? Runtime.getRuntime().availableProcessors() / 3
-          : 1;
-
-  /**
-   * Whether creating schema automatically is enabled, this will replace the one in
-   * iotdb-engine.properties
-   */
-  private boolean enableAutoCreateSchema = true;
-
-  private boolean enableRaftLogPersistence = true;
-
-  private int flushRaftLogThreshold = 10000;
-
-  /**
-   * Size of log buffer. If raft log persistence is enabled and the size of a insert plan is smaller
-   * than this parameter, then the insert plan will be rejected by WAL.
-   */
-  private int raftLogBufferSize = 16 * 1024 * 1024;
-
-  /**
-   * consistency level, now three consistency levels are supported: strong, mid and weak. Strong
-   * consistency means the server will first try to synchronize with the leader to get the newest
-   * meta data, if failed(timeout), directly report an error to the user; While mid consistency
-   * means the server will first try to synchronize with the leader, but if failed(timeout), it will
-   * give up and just use current data it has cached before; Weak consistency do not synchronize
-   * with the leader and simply use the local data
-   */
-  private ConsistencyLevel consistencyLevel = ConsistencyLevel.MID_CONSISTENCY;
-
-  private long joinClusterTimeOutMs = TimeUnit.SECONDS.toMillis(5);
-
-  private int pullSnapshotRetryIntervalMs = (int) TimeUnit.SECONDS.toMillis(5);
-
-  /**
-   * The maximum value of the raft log index stored in the memory per raft group, These indexes are
-   * used to index the location of the log on the disk
-   */
-  private int maxRaftLogIndexSizeInMemory = 10000;
-
-  /**
-   * If leader finds too many uncommitted raft logs, raft group leader will wait for a short period
-   * of time, and then append the raft log
-   */
-  private int UnCommittedRaftLogNumForRejectThreshold = 500;
-
-  /**
-   * If followers find too many committed raft logs have not been applied, followers will reject the
-   * raft log sent by leader
-   */
-  private int UnAppliedRaftLogNumForRejectThreshold = 500;
-
-  /**
-   * The maximum size of the raft log saved on disk for each file (in bytes) of each raft group. The
-   * default size is 1GB
-   */
-  private int maxRaftLogPersistDataSizePerFile = 1073741824;
-
-  /**
-   * The maximum number of persistent raft log files on disk per raft group, So each raft group's
-   * log takes up disk space approximately equals max_raft_log_persist_data_size_per_file *
-   * max_number_of_persist_raft_log_files
-   */
-  private int maxNumberOfPersistRaftLogFiles = 5;
-
-  /** The maximum number of logs saved on the disk */
-  private int maxPersistRaftLogNumberOnDisk = 1_000_000;
-
-  private boolean enableUsePersistLogOnDiskToCatchUp = true;
-
-  /**
-   * The number of logs read on the disk at one time, which is mainly used to control the memory
-   * usage.This value multiplied by the log size is about the amount of memory used to read logs
-   * from the disk at one time.
-   */
-  private int maxNumberOfLogsPerFetchOnDisk = 1000;
-
-  /**
-   * When set to true, if the log queue of a follower fills up, LogDispatcher will wait for a while
-   * until the queue becomes available, otherwise LogDispatcher will just ignore that slow node.
-   */
-  private boolean waitForSlowNode = true;
-
-  /**
-   * When consistency level is set to mid, query will fail if the log lag exceeds max_read_log_lag.
-   */
-  private long maxReadLogLag = 1000L;
-
-  /**
-   * When a follower tries to sync log with the leader, sync will fail if the log Lag exceeds
-   * maxSyncLogLag.
-   */
-  private long maxSyncLogLag = 100000L;
-
-  private boolean openServerRpcPort = false;
-
-  /**
-   * create a clusterConfig class. The internalIP will be set according to the server's hostname. If
-   * there is something error for getting the ip of the hostname, then set the internalIp as
-   * localhost.
-   */
-  public ClusterConfig() {
-    try {
-      internalIp = InetAddress.getLocalHost().getHostAddress();
-    } catch (UnknownHostException e) {
-      logger.error(e.getMessage());
-      internalIp = "127.0.0.1";
-    }
-    seedNodeUrls = Arrays.asList(String.format("%s:%d", internalIp, internalMetaPort));
-  }
-
-  public int getSelectorNumOfClientPool() {
-    return selectorNumOfClientPool;
-  }
-
-  public int getMaxClientPerNodePerMember() {
-    return maxClientPerNodePerMember;
-  }
-
-  public void setMaxClientPerNodePerMember(int maxClientPerNodePerMember) {
-    this.maxClientPerNodePerMember = maxClientPerNodePerMember;
-  }
-
-  public int getMaxIdleClientPerNodePerMember() {
-    return maxIdleClientPerNodePerMember;
-  }
-
-  public void setMaxIdleClientPerNodePerMember(int maxIdleClientPerNodePerMember) {
-    this.maxIdleClientPerNodePerMember = maxIdleClientPerNodePerMember;
-  }
-
-  public boolean isUseBatchInLogCatchUp() {
-    return useBatchInLogCatchUp;
-  }
-
-  public void setUseBatchInLogCatchUp(boolean useBatchInLogCatchUp) {
-    this.useBatchInLogCatchUp = useBatchInLogCatchUp;
-  }
-
-  public int getInternalMetaPort() {
-    return internalMetaPort;
-  }
-
-  public void setInternalMetaPort(int internalMetaPort) {
-    this.internalMetaPort = internalMetaPort;
-  }
-
-  public boolean isRpcThriftCompressionEnabled() {
-    return isRpcThriftCompressionEnabled;
-  }
-
-  void setRpcThriftCompressionEnabled(boolean rpcThriftCompressionEnabled) {
-    isRpcThriftCompressionEnabled = rpcThriftCompressionEnabled;
-  }
-
-  public List<String> getSeedNodeUrls() {
-    return seedNodeUrls;
-  }
-
-  public void setSeedNodeUrls(List<String> seedNodeUrls) {
-    this.seedNodeUrls = seedNodeUrls;
-  }
-
-  public int getReplicationNum() {
-    return replicationNum;
-  }
-
-  public void setReplicationNum(int replicationNum) {
-    this.replicationNum = replicationNum;
-  }
-
-  public int getMultiRaftFactor() {
-    return multiRaftFactor;
-  }
-
-  public void setMultiRaftFactor(int multiRaftFactor) {
-    this.multiRaftFactor = multiRaftFactor;
-  }
-
-  void setClusterName(String clusterName) {
-    this.clusterName = clusterName;
-  }
-
-  public String getClusterName() {
-    return clusterName;
-  }
-
-  public int getInternalDataPort() {
-    return internalDataPort;
-  }
-
-  public void setInternalDataPort(int internalDataPort) {
-    this.internalDataPort = internalDataPort;
-  }
-
-  public int getClusterRpcPort() {
-    return clusterRpcPort;
-  }
-
-  public void setClusterRpcPort(int clusterRpcPort) {
-    this.clusterRpcPort = clusterRpcPort;
-  }
-
-  public int getConnectionTimeoutInMS() {
-    return connectionTimeoutInMS;
-  }
-
-  void setConnectionTimeoutInMS(int connectionTimeoutInMS) {
-    this.connectionTimeoutInMS = connectionTimeoutInMS;
-  }
-
-  public int getCatchUpTimeoutMS() {
-    return catchUpTimeoutMS;
-  }
-
-  public void setCatchUpTimeoutMS(int catchUpTimeoutMS) {
-    this.catchUpTimeoutMS = catchUpTimeoutMS;
-  }
-
-  public int getReadOperationTimeoutMS() {
-    return readOperationTimeoutMS;
-  }
-
-  void setReadOperationTimeoutMS(int readOperationTimeoutMS) {
-    this.readOperationTimeoutMS = readOperationTimeoutMS;
-  }
-
-  public int getWriteOperationTimeoutMS() {
-    return writeOperationTimeoutMS;
-  }
-
-  public void setWriteOperationTimeoutMS(int writeOperationTimeoutMS) {
-    this.writeOperationTimeoutMS = writeOperationTimeoutMS;
-  }
-
-  public int getMinNumOfLogsInMem() {
-    return minNumOfLogsInMem;
-  }
-
-  public void setMinNumOfLogsInMem(int minNumOfLogsInMem) {
-    this.minNumOfLogsInMem = minNumOfLogsInMem;
-  }
-
-  public int getLogDeleteCheckIntervalSecond() {
-    return logDeleteCheckIntervalSecond;
-  }
-
-  void setLogDeleteCheckIntervalSecond(int logDeleteCheckIntervalSecond) {
-    this.logDeleteCheckIntervalSecond = logDeleteCheckIntervalSecond;
-  }
-
-  public ConsistencyLevel getConsistencyLevel() {
-    return consistencyLevel;
-  }
-
-  public void setConsistencyLevel(ConsistencyLevel consistencyLevel) {
-    this.consistencyLevel = consistencyLevel;
-  }
-
-  public boolean isEnableAutoCreateSchema() {
-    return enableAutoCreateSchema;
-  }
-
-  public void setEnableAutoCreateSchema(boolean enableAutoCreateSchema) {
-    this.enableAutoCreateSchema = enableAutoCreateSchema;
-  }
-
-  public boolean isUseAsyncServer() {
-    return useAsyncServer;
-  }
-
-  public void setUseAsyncServer(boolean useAsyncServer) {
-    this.useAsyncServer = useAsyncServer;
-  }
-
-  public boolean isEnableRaftLogPersistence() {
-    return enableRaftLogPersistence;
-  }
-
-  public void setEnableRaftLogPersistence(boolean enableRaftLogPersistence) {
-    this.enableRaftLogPersistence = enableRaftLogPersistence;
-  }
-
-  public boolean isUseAsyncApplier() {
-    return useAsyncApplier;
-  }
-
-  public void setUseAsyncApplier(boolean useAsyncApplier) {
-    this.useAsyncApplier = useAsyncApplier;
-  }
-
-  public int getMaxNumOfLogsInMem() {
-    return maxNumOfLogsInMem;
-  }
-
-  public void setMaxNumOfLogsInMem(int maxNumOfLogsInMem) {
-    this.maxNumOfLogsInMem = maxNumOfLogsInMem;
-  }
-
-  public int getUnCommittedRaftLogNumForRejectThreshold() {
-    return UnCommittedRaftLogNumForRejectThreshold;
-  }
-
-  public void setUnCommittedRaftLogNumForRejectThreshold(
-      int unCommittedRaftLogNumForRejectThreshold) {
-    UnCommittedRaftLogNumForRejectThreshold = unCommittedRaftLogNumForRejectThreshold;
-  }
-
-  public int getUnAppliedRaftLogNumForRejectThreshold() {
-    return UnAppliedRaftLogNumForRejectThreshold;
-  }
-
-  public void setUnAppliedRaftLogNumForRejectThreshold(int unAppliedRaftLogNumForRejectThreshold) {
-    UnAppliedRaftLogNumForRejectThreshold = unAppliedRaftLogNumForRejectThreshold;
-  }
-
-  public int getRaftLogBufferSize() {
-    return raftLogBufferSize;
-  }
-
-  public void setRaftLogBufferSize(int raftLogBufferSize) {
-    this.raftLogBufferSize = raftLogBufferSize;
-  }
-
-  public int getFlushRaftLogThreshold() {
-    return flushRaftLogThreshold;
-  }
-
-  void setFlushRaftLogThreshold(int flushRaftLogThreshold) {
-    this.flushRaftLogThreshold = flushRaftLogThreshold;
-  }
-
-  public long getJoinClusterTimeOutMs() {
-    return joinClusterTimeOutMs;
-  }
-
-  public void setJoinClusterTimeOutMs(long joinClusterTimeOutMs) {
-    this.joinClusterTimeOutMs = joinClusterTimeOutMs;
-  }
-
-  public int getPullSnapshotRetryIntervalMs() {
-    return pullSnapshotRetryIntervalMs;
-  }
-
-  public void setPullSnapshotRetryIntervalMs(int pullSnapshotRetryIntervalMs) {
-    this.pullSnapshotRetryIntervalMs = pullSnapshotRetryIntervalMs;
-  }
-
-  public int getMaxRaftLogIndexSizeInMemory() {
-    return maxRaftLogIndexSizeInMemory;
-  }
-
-  public void setMaxRaftLogIndexSizeInMemory(int maxRaftLogIndexSizeInMemory) {
-    this.maxRaftLogIndexSizeInMemory = maxRaftLogIndexSizeInMemory;
-  }
-
-  public long getMaxMemorySizeForRaftLog() {
-    return maxMemorySizeForRaftLog;
-  }
-
-  public void setMaxMemorySizeForRaftLog(long maxMemorySizeForRaftLog) {
-    this.maxMemorySizeForRaftLog = maxMemorySizeForRaftLog;
-  }
-
-  public double getRaftLogMemoryProportion() {
-    return RaftLogMemoryProportion;
-  }
-
-  public void setRaftLogMemoryProportion(double raftLogMemoryProportion) {
-    RaftLogMemoryProportion = raftLogMemoryProportion;
-  }
-
-  public int getMaxRaftLogPersistDataSizePerFile() {
-    return maxRaftLogPersistDataSizePerFile;
-  }
-
-  public void setMaxRaftLogPersistDataSizePerFile(int maxRaftLogPersistDataSizePerFile) {
-    this.maxRaftLogPersistDataSizePerFile = maxRaftLogPersistDataSizePerFile;
-  }
-
-  public int getMaxNumberOfPersistRaftLogFiles() {
-    return maxNumberOfPersistRaftLogFiles;
-  }
-
-  public void setMaxNumberOfPersistRaftLogFiles(int maxNumberOfPersistRaftLogFiles) {
-    this.maxNumberOfPersistRaftLogFiles = maxNumberOfPersistRaftLogFiles;
-  }
-
-  public int getMaxPersistRaftLogNumberOnDisk() {
-    return maxPersistRaftLogNumberOnDisk;
-  }
-
-  public void setMaxPersistRaftLogNumberOnDisk(int maxPersistRaftLogNumberOnDisk) {
-    this.maxPersistRaftLogNumberOnDisk = maxPersistRaftLogNumberOnDisk;
-  }
-
-  public boolean isEnableUsePersistLogOnDiskToCatchUp() {
-    return enableUsePersistLogOnDiskToCatchUp;
-  }
-
-  public void setEnableUsePersistLogOnDiskToCatchUp(boolean enableUsePersistLogOnDiskToCatchUp) {
-    this.enableUsePersistLogOnDiskToCatchUp = enableUsePersistLogOnDiskToCatchUp;
-  }
-
-  public int getMaxNumberOfLogsPerFetchOnDisk() {
-    return maxNumberOfLogsPerFetchOnDisk;
-  }
-
-  public void setMaxNumberOfLogsPerFetchOnDisk(int maxNumberOfLogsPerFetchOnDisk) {
-    this.maxNumberOfLogsPerFetchOnDisk = maxNumberOfLogsPerFetchOnDisk;
-  }
-
-  public boolean isWaitForSlowNode() {
-    return waitForSlowNode;
-  }
-
-  public long getMaxReadLogLag() {
-    return maxReadLogLag;
-  }
-
-  public void setMaxReadLogLag(long maxReadLogLag) {
-    this.maxReadLogLag = maxReadLogLag;
-  }
-
-  public long getMaxSyncLogLag() {
-    return maxSyncLogLag;
-  }
-
-  public void setMaxSyncLogLag(long maxSyncLogLag) {
-    this.maxSyncLogLag = maxSyncLogLag;
-  }
-
-  public String getInternalIp() {
-    return internalIp;
-  }
-
-  public void setInternalIp(String internalIp) {
-    this.internalIp = internalIp;
-  }
-
-  public boolean isOpenServerRpcPort() {
-    return openServerRpcPort;
-  }
-
-  public void setOpenServerRpcPort(boolean openServerRpcPort) {
-    this.openServerRpcPort = openServerRpcPort;
-  }
-
-  public long getWaitClientTimeoutMS() {
-    return waitClientTimeoutMS;
-  }
-
-  public void setWaitClientTimeoutMS(long waitClientTimeoutMS) {
-    this.waitClientTimeoutMS = waitClientTimeoutMS;
-  }
-
-  public long getHeartbeatIntervalMs() {
-    return heartbeatIntervalMs;
-  }
-
-  public void setHeartbeatIntervalMs(long heartbeatIntervalMs) {
-    this.heartbeatIntervalMs = heartbeatIntervalMs;
-  }
-
-  public long getElectionTimeoutMs() {
-    return electionTimeoutMs;
-  }
-
-  public void setElectionTimeoutMs(long electionTimeoutMs) {
-    this.electionTimeoutMs = electionTimeoutMs;
-  }
-
-  public int getClusterInfoRpcPort() {
-    return clusterInfoRpcPort;
-  }
-
-  public void setClusterInfoRpcPort(int clusterInfoRpcPort) {
-    this.clusterInfoRpcPort = clusterInfoRpcPort;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
deleted file mode 100644
index 529f44fe5f..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.config;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.commons.utils.TestOnly;
-
-public class ClusterConstant {
-
-  /**
-   * We only change the value in tests to reduce test time, so they are essentially constant. A
-   * failed election will restart in [0, max(heartbeatInterval, 50ms)). If this range is too small,
-   * a stale node may frequently issue elections and thus makes the leader step down.
-   */
-  private static long electionMaxWaitMs =
-      Math.max(ClusterDescriptor.getInstance().getConfig().getHeartbeatIntervalMs(), 50L);
-
-  // Heartbeat client connection timeout should not be larger than heartbeat interval, otherwise
-  // the thread pool of sending heartbeats or requesting votes may be used up by waiting for
-  // establishing connection with some slow or dead nodes.
-  private static final int heartbeatClientConnTimeoutMs =
-      Math.min(
-          (int) ClusterConstant.getHeartbeatIntervalMs(),
-          ClusterConstant.getConnectionTimeoutInMS());
-
-  public static final int SLOT_NUM = 10000;
-  public static final int HASH_SALT = 2333;
-  public static final int CHECK_ALIVE_TIME_OUT_MS = 1000;
-
-  public static final int LOG_NUM_IN_BATCH = 100;
-
-  public static final int RETRY_WAIT_TIME_MS = 10;
-
-  public static final int THREAD_POLL_WAIT_TERMINATION_TIME_S = 10;
-
-  /**
-   * every "REPORT_INTERVAL_SEC" seconds, a reporter thread will print the status of all raft
-   * members in this node.
-   */
-  public static final int REPORT_INTERVAL_SEC = 10;
-
-  /**
-   * during snapshot, hardlinks of data files are created to for downloading. hardlinks will be
-   * checked every hour by default to see if they have expired, and will be cleaned if so.
-   */
-  public static final long CLEAN_HARDLINK_INTERVAL_SEC = 3600L;
-
-  public static final Node EMPTY_NODE = new Node();
-
-  private ClusterConstant() {
-    // constant class
-  }
-
-  public static long getElectionMaxWaitMs() {
-    return electionMaxWaitMs;
-  }
-
-  @TestOnly
-  public static void setElectionMaxWaitMs(long electionMaxWaitMs) {
-    ClusterConstant.electionMaxWaitMs = electionMaxWaitMs;
-  }
-
-  private static int connectionTimeoutInMS =
-      ClusterDescriptor.getInstance().getConfig().getConnectionTimeoutInMS();
-  private static int readOperationTimeoutMS =
-      ClusterDescriptor.getInstance().getConfig().getReadOperationTimeoutMS();
-  private static int writeOperationTimeoutMS =
-      ClusterDescriptor.getInstance().getConfig().getWriteOperationTimeoutMS();
-  private static int syncLeaderMaxWaitMs = 20 * 1000;
-  private static long heartbeatIntervalMs =
-      ClusterDescriptor.getInstance().getConfig().getHeartbeatIntervalMs();
-  private static long electionTimeoutMs =
-      ClusterDescriptor.getInstance().getConfig().getElectionTimeoutMs();
-
-  public static int getConnectionTimeoutInMS() {
-    return connectionTimeoutInMS;
-  }
-
-  public static void setConnectionTimeoutInMS(int connectionTimeoutInMS) {
-    ClusterConstant.connectionTimeoutInMS = connectionTimeoutInMS;
-  }
-
-  public static int getReadOperationTimeoutMS() {
-    return readOperationTimeoutMS;
-  }
-
-  public static int getWriteOperationTimeoutMS() {
-    return writeOperationTimeoutMS;
-  }
-
-  public static int getSyncLeaderMaxWaitMs() {
-    return syncLeaderMaxWaitMs;
-  }
-
-  public static void setSyncLeaderMaxWaitMs(int syncLeaderMaxWaitMs) {
-    ClusterConstant.syncLeaderMaxWaitMs = syncLeaderMaxWaitMs;
-  }
-
-  public static long getHeartbeatIntervalMs() {
-    return heartbeatIntervalMs;
-  }
-
-  public static void setHeartbeatIntervalMs(long heartBeatIntervalMs) {
-    ClusterConstant.heartbeatIntervalMs = heartBeatIntervalMs;
-  }
-
-  public static long getElectionTimeoutMs() {
-    return electionTimeoutMs;
-  }
-
-  public static void setElectionTimeoutMs(long electionTimeoutMs) {
-    ClusterConstant.electionTimeoutMs = electionTimeoutMs;
-  }
-
-  public static int getHeartbeatClientConnTimeoutMs() {
-    return heartbeatClientConnTimeoutMs;
-  }
-
-  @TestOnly
-  public static void setReadOperationTimeoutMS(int readOperationTimeoutMS) {
-    ClusterConstant.readOperationTimeoutMS = readOperationTimeoutMS;
-  }
-
-  @TestOnly
-  public static void setWriteOperationTimeoutMS(int writeOperationTimeoutMS) {
-    ClusterConstant.writeOperationTimeoutMS = writeOperationTimeoutMS;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java b/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
deleted file mode 100644
index f556998bc2..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.config;
-
-import org.apache.iotdb.cluster.exception.BadSeedUrlFormatException;
-import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-
-import com.google.common.net.InetAddresses;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-
-public class ClusterDescriptor {
-
-  private static final Logger logger = LoggerFactory.getLogger(ClusterDescriptor.class);
-  private static final ClusterDescriptor INSTANCE = new ClusterDescriptor();
-  private final ClusterConfig config = new ClusterConfig();
-
-  private ClusterDescriptor() {
-    // load settings from cluster's file.
-    // so, iotdb-cluster.properties can overwrite iotdb-engine.properties.
-    loadProps();
-
-    // if open the server rpc port, we will enable the rpc service and change the server's rpc port
-    // to rpc_port + 1
-    if (config.isOpenServerRpcPort()) {
-      IoTDBDescriptor.getInstance().getConfig().setEnableRpcService(true);
-      IoTDBDescriptor.getInstance()
-          .getConfig()
-          .setRpcPort(IoTDBDescriptor.getInstance().getConfig().getRpcPort() + 1);
-    } else {
-      IoTDBDescriptor.getInstance().getConfig().setEnableRpcService(false);
-    }
-  }
-
-  public ClusterConfig getConfig() {
-    return config;
-  }
-
-  public static ClusterDescriptor getInstance() {
-    return INSTANCE;
-  }
-
-  public String getPropsUrl() {
-    String url = System.getProperty(IoTDBConstant.IOTDB_CONF, null);
-    if (url == null) {
-      url = System.getProperty(IoTDBConstant.IOTDB_HOME, null);
-      if (url != null) {
-        url = url + File.separatorChar + "conf" + File.separatorChar + ClusterConfig.CONFIG_NAME;
-      } else {
-        logger.warn(
-            "Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading "
-                + "config file {}, use default configuration",
-            ClusterConfig.CONFIG_NAME);
-        // update all data seriesPath
-        return null;
-      }
-    } else {
-      url += (File.separatorChar + ClusterConfig.CONFIG_NAME);
-    }
-    return url;
-  }
-
-  public void replaceHostnameWithIp() throws UnknownHostException, BadSeedUrlFormatException {
-    boolean isInvalidClusterInternalIp = InetAddresses.isInetAddress(config.getInternalIp());
-    if (!isInvalidClusterInternalIp) {
-      config.setInternalIp(hostnameToIP(config.getInternalIp()));
-    }
-    List<String> newSeedUrls = new ArrayList<>();
-    for (String seedUrl : config.getSeedNodeUrls()) {
-      String[] splits = seedUrl.split(":");
-      if (splits.length != 2) {
-        throw new BadSeedUrlFormatException(seedUrl);
-      }
-      String seedIP = splits[0];
-      boolean isInvalidSeedIp = InetAddresses.isInetAddress(seedIP);
-      if (!isInvalidSeedIp) {
-        String newSeedIP = hostnameToIP(seedIP);
-        newSeedUrls.add(newSeedIP + ":" + splits[1]);
-      } else {
-        newSeedUrls.add(seedUrl);
-      }
-    }
-    config.setSeedNodeUrls(newSeedUrls);
-    logger.debug(
-        "after replace, the rpcIP={}, internalIP={}, seedUrls={}",
-        IoTDBDescriptor.getInstance().getConfig().getRpcAddress(),
-        config.getInternalIp(),
-        config.getSeedNodeUrls());
-  }
-
-  /** load an property file and set TsfileDBConfig variables. */
-  private void loadProps() {
-    String url = getPropsUrl();
-    Properties properties = System.getProperties();
-    if (url != null) {
-      try (InputStream inputStream = new FileInputStream(new File(url))) {
-        logger.info("Start to read config file {}", url);
-        properties.load(inputStream);
-      } catch (IOException e) {
-        logger.warn("Fail to find config file {}", url, e);
-      }
-    }
-    config.setInternalIp(properties.getProperty("internal_ip", config.getInternalIp()));
-
-    config.setInternalMetaPort(
-        Integer.parseInt(
-            properties.getProperty(
-                "internal_meta_port", String.valueOf(config.getInternalMetaPort()))));
-
-    config.setInternalDataPort(
-        Integer.parseInt(
-            properties.getProperty(
-                "internal_data_port", Integer.toString(config.getInternalDataPort()))));
-
-    // rpc port and rpc address are defined in iotdb-engine.properties.
-    // To avoid inconsistency, we do not read "rpc_port" in iotdb-cluster.properties
-    // even users claim the property.
-
-    config.setClusterInfoRpcPort(
-        Integer.parseInt(
-            properties.getProperty(
-                "cluster_info_public_port", Integer.toString(config.getClusterInfoRpcPort()))));
-
-    config.setMultiRaftFactor(
-        Integer.parseInt(
-            properties.getProperty(
-                "multi_raft_factor", String.valueOf(config.getMultiRaftFactor()))));
-
-    config.setReplicationNum(
-        Integer.parseInt(
-            properties.getProperty(
-                "default_replica_num", String.valueOf(config.getReplicationNum()))));
-
-    config.setClusterName(properties.getProperty("cluster_name", config.getClusterName()));
-
-    config.setRpcThriftCompressionEnabled(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "rpc_thrift_compression_enable",
-                String.valueOf(config.isRpcThriftCompressionEnabled()))));
-
-    config.setConnectionTimeoutInMS(
-        Integer.parseInt(
-            properties.getProperty(
-                "connection_timeout_ms", String.valueOf(config.getConnectionTimeoutInMS()))));
-
-    config.setHeartbeatIntervalMs(
-        Long.parseLong(
-            properties.getProperty(
-                "heartbeat_interval_ms", String.valueOf(config.getHeartbeatIntervalMs()))));
-
-    config.setElectionTimeoutMs(
-        Long.parseLong(
-            properties.getProperty(
-                "election_timeout_ms", String.valueOf(config.getElectionTimeoutMs()))));
-
-    config.setReadOperationTimeoutMS(
-        Integer.parseInt(
-            properties.getProperty(
-                "read_operation_timeout_ms", String.valueOf(config.getReadOperationTimeoutMS()))));
-
-    config.setCatchUpTimeoutMS(
-        Integer.parseInt(
-            properties.getProperty(
-                "catch_up_timeout_ms", String.valueOf(config.getCatchUpTimeoutMS()))));
-
-    config.setWriteOperationTimeoutMS(
-        Integer.parseInt(
-            properties.getProperty(
-                "write_operation_timeout_ms",
-                String.valueOf(config.getWriteOperationTimeoutMS()))));
-
-    config.setUseBatchInLogCatchUp(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "use_batch_in_catch_up", String.valueOf(config.isUseBatchInLogCatchUp()))));
-
-    config.setMinNumOfLogsInMem(
-        Integer.parseInt(
-            properties.getProperty(
-                "min_num_of_logs_in_mem", String.valueOf(config.getMinNumOfLogsInMem()))));
-
-    config.setMaxNumOfLogsInMem(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_num_of_logs_in_mem", String.valueOf(config.getMaxNumOfLogsInMem()))));
-
-    config.setRaftLogMemoryProportion(
-        Double.parseDouble(
-            properties.getProperty(
-                "raft_log_memory_proportion",
-                String.valueOf(config.getRaftLogMemoryProportion()))));
-
-    config.setLogDeleteCheckIntervalSecond(
-        Integer.parseInt(
-            properties.getProperty(
-                "log_deletion_check_interval_second",
-                String.valueOf(config.getLogDeleteCheckIntervalSecond()))));
-
-    config.setEnableAutoCreateSchema(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "enable_auto_create_schema", String.valueOf(config.isEnableAutoCreateSchema()))));
-
-    config.setUseAsyncServer(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "is_use_async_server", String.valueOf(config.isUseAsyncServer()))));
-
-    config.setOpenServerRpcPort(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "open_server_rpc_port", String.valueOf(config.isOpenServerRpcPort()))));
-
-    config.setUseAsyncApplier(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "is_use_async_applier", String.valueOf(config.isUseAsyncApplier()))));
-
-    config.setEnableRaftLogPersistence(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "is_enable_raft_log_persistence",
-                String.valueOf(config.isEnableRaftLogPersistence()))));
-
-    config.setFlushRaftLogThreshold(
-        Integer.parseInt(
-            properties.getProperty(
-                "flush_raft_log_threshold", String.valueOf(config.getFlushRaftLogThreshold()))));
-
-    config.setRaftLogBufferSize(
-        Integer.parseInt(
-            properties.getProperty(
-                "raft_log_buffer_size", String.valueOf(config.getRaftLogBufferSize()))));
-
-    config.setMaxRaftLogIndexSizeInMemory(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_raft_log_index_size_in_memory",
-                String.valueOf(config.getMaxRaftLogIndexSizeInMemory()))));
-
-    config.setUnCommittedRaftLogNumForRejectThreshold(
-        Integer.parseInt(
-            properties.getProperty(
-                "uncommitted_raft_log_num_for_reject_threshold",
-                String.valueOf(config.getUnCommittedRaftLogNumForRejectThreshold()))));
-
-    config.setUnAppliedRaftLogNumForRejectThreshold(
-        Integer.parseInt(
-            properties.getProperty(
-                "unapplied_raft_log_num_for_reject_threshold",
-                String.valueOf(config.getUnAppliedRaftLogNumForRejectThreshold()))));
-
-    config.setMaxRaftLogPersistDataSizePerFile(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_raft_log_persist_data_size_per_file",
-                String.valueOf(config.getMaxRaftLogPersistDataSizePerFile()))));
-
-    config.setMaxNumberOfPersistRaftLogFiles(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_number_of_persist_raft_log_files",
-                String.valueOf(config.getMaxNumberOfPersistRaftLogFiles()))));
-
-    config.setMaxPersistRaftLogNumberOnDisk(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_persist_raft_log_number_on_disk",
-                String.valueOf(config.getMaxPersistRaftLogNumberOnDisk()))));
-
-    config.setMaxNumberOfLogsPerFetchOnDisk(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_number_of_logs_per_fetch_on_disk",
-                String.valueOf(config.getMaxNumberOfLogsPerFetchOnDisk()))));
-
-    config.setEnableUsePersistLogOnDiskToCatchUp(
-        Boolean.parseBoolean(
-            properties.getProperty(
-                "enable_use_persist_log_on_disk_to_catch_up",
-                String.valueOf(config.isEnableUsePersistLogOnDiskToCatchUp()))));
-
-    config.setMaxReadLogLag(
-        Long.parseLong(
-            properties.getProperty("max_read_log_lag", String.valueOf(config.getMaxReadLogLag()))));
-
-    config.setMaxSyncLogLag(
-        Long.parseLong(
-            properties.getProperty("max_sync_log_lag", String.valueOf(config.getMaxSyncLogLag()))));
-
-    config.setMaxClientPerNodePerMember(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_client_pernode_permember_number",
-                String.valueOf(config.getMaxClientPerNodePerMember()))));
-
-    config.setMaxIdleClientPerNodePerMember(
-        Integer.parseInt(
-            properties.getProperty(
-                "max_idle_client_pernode_permember_number",
-                String.valueOf(config.getMaxIdleClientPerNodePerMember()))));
-
-    config.setWaitClientTimeoutMS(
-        Long.parseLong(
-            properties.getProperty(
-                "wait_client_timeout_ms", String.valueOf(config.getWaitClientTimeoutMS()))));
-
-    String consistencyLevel = properties.getProperty("consistency_level");
-    if (consistencyLevel != null) {
-      config.setConsistencyLevel(ConsistencyLevel.getConsistencyLevel(consistencyLevel));
-    }
-
-    String seedUrls = properties.getProperty("seed_nodes");
-    if (seedUrls != null) {
-      List<String> urlList = getSeedUrlList(seedUrls);
-      config.setSeedNodeUrls(urlList);
-    }
-  }
-
-  /**
-   * Split the seed urls as one list.
-   *
-   * @param seedUrls the seed urls.
-   * @return the seed urls as a list.
-   */
-  public static List<String> getSeedUrlList(String seedUrls) {
-    if (seedUrls == null) {
-      return Collections.emptyList();
-    }
-    List<String> urlList = new ArrayList<>();
-    String[] split = seedUrls.split(",");
-    for (String nodeUrl : split) {
-      nodeUrl = nodeUrl.trim();
-      if ("".equals(nodeUrl)) {
-        continue;
-      }
-      urlList.add(nodeUrl);
-    }
-    return urlList;
-  }
-
-  public void loadHotModifiedProps() throws QueryProcessException {
-    Properties properties = getProperties();
-    if (properties != null) {
-      loadHotModifiedProps(properties);
-    }
-  }
-
-  private Properties getProperties() throws QueryProcessException {
-    String url = getPropsUrl();
-    if (url == null) {
-      return null;
-    }
-    Properties properties;
-    try (InputStream inputStream = new FileInputStream(new File(url))) {
-      logger.info("Start to reload config file {}", url);
-      properties = new Properties();
-      properties.load(inputStream);
-    } catch (Exception e) {
-      throw new QueryProcessException(
-          String.format("Fail to reload config file %s because %s", url, e.getMessage()));
-    }
-    return properties;
-  }
-
-  /**
-   * This method is for setting hot modified properties of the cluster. Currently, we support
-   * connection_timeout_ms, max_resolved_log_size
-   *
-   * @param properties
-   * @throws QueryProcessException
-   */
-  public void loadHotModifiedProps(Properties properties) {
-
-    config.setConnectionTimeoutInMS(
-        Integer.parseInt(
-            properties.getProperty(
-                "connection_timeout_ms", String.valueOf(config.getConnectionTimeoutInMS()))));
-
-    logger.info("Set cluster configuration {}", properties);
-  }
-
-  private String hostnameToIP(String hostname) throws UnknownHostException {
-    InetAddress address = InetAddress.getByName(hostname);
-    return address.getHostAddress();
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/config/ConsistencyLevel.java b/cluster/src/main/java/org/apache/iotdb/cluster/config/ConsistencyLevel.java
deleted file mode 100644
index cd95bde18a..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/config/ConsistencyLevel.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.config;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public enum ConsistencyLevel {
-  /**
-   * Strong consistency means the server will first try to synchronize with the leader to get the
-   * newest meta data, if failed(timeout), directly report an error to the user;
-   */
-  STRONG_CONSISTENCY("strong"),
-
-  /**
-   * mid consistency means the server will first try to synchronize with the leader, but if
-   * failed(timeout), it will give up and just use current data it has cached before;
-   */
-  MID_CONSISTENCY("mid"),
-
-  /** weak consistency do not synchronize with the leader and simply use the local data */
-  WEAK_CONSISTENCY("weak"),
-  ;
-
-  private String consistencyLevelName;
-  private static final Logger logger = LoggerFactory.getLogger(ConsistencyLevel.class);
-
-  ConsistencyLevel(String consistencyLevelName) {
-    this.consistencyLevelName = consistencyLevelName;
-  }
-
-  public static ConsistencyLevel getConsistencyLevel(String consistencyLevel) {
-    if (consistencyLevel == null) {
-      return ConsistencyLevel.MID_CONSISTENCY;
-    }
-    switch (consistencyLevel.toLowerCase()) {
-      case "strong":
-        return ConsistencyLevel.STRONG_CONSISTENCY;
-      case "mid":
-        return ConsistencyLevel.MID_CONSISTENCY;
-      case "weak":
-        return ConsistencyLevel.WEAK_CONSISTENCY;
-      default:
-        logger.warn(
-            "Unsupported consistency level={}, use default consistency level={}",
-            consistencyLevel,
-            ConsistencyLevel.MID_CONSISTENCY.consistencyLevelName);
-        return ConsistencyLevel.MID_CONSISTENCY;
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java b/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
deleted file mode 100644
index 8cc848622d..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.coordinator;
-
-import org.apache.iotdb.cluster.ClusterIoTDB;
-import org.apache.iotdb.cluster.client.async.AsyncDataClient;
-import org.apache.iotdb.cluster.client.sync.SyncDataClient;
-import org.apache.iotdb.cluster.config.ClusterConstant;
-import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.exception.ChangeMembershipException;
-import org.apache.iotdb.cluster.exception.CheckConsistencyException;
-import org.apache.iotdb.cluster.exception.UnknownLogTypeException;
-import org.apache.iotdb.cluster.exception.UnsupportedPlanException;
-import org.apache.iotdb.cluster.log.Log;
-import org.apache.iotdb.cluster.metadata.CSchemaProcessor;
-import org.apache.iotdb.cluster.partition.PartitionGroup;
-import org.apache.iotdb.cluster.query.ClusterPlanRouter;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.RaftNode;
-import org.apache.iotdb.cluster.server.member.MetaGroupMember;
-import org.apache.iotdb.cluster.server.monitor.Timer;
-import org.apache.iotdb.cluster.utils.PartitionUtils;
-import org.apache.iotdb.cluster.utils.StatusUtils;
-import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.commons.exception.IllegalPathException;
-import org.apache.iotdb.commons.exception.MetadataException;
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.db.exception.metadata.PathNotExistException;
-import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.qp.physical.BatchPlan;
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertMultiTabletsPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowsPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateAlignedTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateMultiTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.qp.physical.sys.SetTemplatePlan;
-import org.apache.iotdb.db.service.IoTDB;
-import org.apache.iotdb.rpc.RpcUtils;
-import org.apache.iotdb.rpc.TSStatusCode;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CountDownLatch;
-
-/** Coordinator of client non-query request */
-public class Coordinator {
-
-  private static final Logger logger = LoggerFactory.getLogger(Coordinator.class);
-
-  private MetaGroupMember metaGroupMember;
-
-  private String name;
-  private Node thisNode;
-  /** router calculates the partition groups that a partitioned plan should be sent to */
-  private ClusterPlanRouter router;
-
-  private static final String MSG_MULTIPLE_ERROR =
-      "The following errors occurred when executing "
-          + "the query, please retry or contact the DBA: ";
-
-  @TestOnly
-  public Coordinator(MetaGroupMember metaGroupMember) {
-    linkMetaGroupMember(metaGroupMember);
-  }
-
-  public Coordinator() {}
-
-  public void linkMetaGroupMember(MetaGroupMember metaGroupMember) {
-    this.metaGroupMember = metaGroupMember;
-    if (metaGroupMember.getCoordinator() != null && metaGroupMember.getCoordinator() != this) {
-      logger.warn("MetadataGroupMember linked inconsistent Coordinator, will correct it.");
-      metaGroupMember.setCoordinator(this);
-    }
-    this.name = metaGroupMember.getName();
-    this.thisNode = metaGroupMember.getThisNode();
-  }
-
-  public void setRouter(ClusterPlanRouter router) {
-    this.router = router;
-  }
-
-  /**
-   * Execute a non-query plan. According to the type of the plan, the plan will be executed on all
-   * nodes (like timeseries deletion) or the nodes that belong to certain groups (like data
-   * ingestion).
-   *
-   * @param plan a non-query plan.
-   */
-  public TSStatus executeNonQueryPlan(PhysicalPlan plan) {
-    TSStatus result;
-    long startTime = Timer.Statistic.COORDINATOR_EXECUTE_NON_QUERY.getOperationStartTime();
-    if (PartitionUtils.isLocalNonQueryPlan(plan)) {
-      // run locally
-      result = executeNonQueryLocally(plan);
-    } else if (PartitionUtils.isGlobalMetaPlan(plan)) {
-      // forward the plan to all meta group nodes
-      result = metaGroupMember.processNonPartitionedMetaPlan(plan);
-    } else if (PartitionUtils.isGlobalDataPlan(plan)) {
-      // forward the plan to all data group nodes
-      result = processNonPartitionedDataPlan(plan);
-    } else {
-      // split the plan and forward them to some PartitionGroups
-      try {
-        result = processPartitionedPlan(plan);
-      } catch (UnsupportedPlanException e) {
-        return StatusUtils.getStatus(StatusUtils.UNSUPPORTED_OPERATION, e.getMessage());
-      }
-    }
-    Timer.Statistic.COORDINATOR_EXECUTE_NON_QUERY.calOperationCostTimeFromStart(startTime);
-    return result;
-  }
-
-  /** execute a non-query plan that is not necessary to be executed on other nodes. */
-  private TSStatus executeNonQueryLocally(PhysicalPlan plan) {
-    boolean execRet;
-    try {
-      execRet = metaGroupMember.getLocalExecutor().processNonQuery(plan);
-    } catch (QueryProcessException e) {
-      if (e.getErrorCode() != TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode()) {
-        logger.debug("meet error while processing non-query. ", e);
-      } else {
-        logger.warn("meet error while processing non-query. ", e);
-      }
-      return RpcUtils.getStatus(e.getErrorCode(), e.getMessage());
-    } catch (Exception e) {
-      logger.error("{}: server Internal Error: ", IoTDBConstant.GLOBAL_DB_NAME, e);
-      return RpcUtils.getStatus(TSStatusCode.INTERNAL_SERVER_ERROR, e.getMessage());
-    }
-
-    return execRet
-        ? RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS, "Execute successfully")
-        : RpcUtils.getStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR);
-  }
-
-  /**
-   * A non-partitioned plan (like DeleteData) should be executed on all data group nodes, so the
-   * DataGroupLeader should take the responsible to make sure that every node receives the plan.
-   * Thus the plan will be processed locally only by the DataGroupLeader and forwarded by non-leader
-   * nodes.
-   */
-  private TSStatus processNonPartitionedDataPlan(PhysicalPlan plan) {
-    try {
-      if (plan instanceof DeleteTimeSeriesPlan) {
-        // as delete related plans may have abstract paths (paths with wildcards), we convert
-        // them to full paths so the executor nodes will not need to query the metadata holders,
-        // eliminating the risk that when they are querying the metadata holders, the timeseries
-        // has already been deleted
-        ((CSchemaProcessor) IoTDB.schemaProcessor).convertToFullPaths(plan);
-      } else {
-        // function convertToFullPaths has already sync leader
-        metaGroupMember.syncLeaderWithConsistencyCheck(true);
-      }
-    } catch (PathNotExistException e) {
-      if (plan.getPaths().isEmpty()) {
-        // only reports an error when there is no matching path
-        return StatusUtils.getStatus(StatusUtils.TIMESERIES_NOT_EXIST_ERROR, e.getMessage());
-      }
-    } catch (CheckConsistencyException e) {
-      logger.debug(
-          "Forwarding global data plan {} to meta leader {}", plan, metaGroupMember.getLeader());
-      metaGroupMember.waitLeader();
-      return metaGroupMember.forwardPlan(plan, metaGroupMember.getLeader(), null);
-    }
-    try {
-      createSchemaIfNecessary(plan);
-    } catch (MetadataException | CheckConsistencyException e) {
-      logger.error("{}: Cannot find storage groups for {}", name, plan);
-      return StatusUtils.NO_STORAGE_GROUP;
-    }
-    List<PartitionGroup> globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
-    logger.debug("Forwarding global data plan {} to {} groups", plan, globalGroups.size());
-    return forwardPlan(globalGroups, plan);
-  }
-
-  public void createSchemaIfNecessary(PhysicalPlan plan)
-      throws MetadataException, CheckConsistencyException {
-    if (plan instanceof SetTemplatePlan) {
-      try {
-        IoTDB.schemaProcessor.getBelongedStorageGroup(
-            new PartialPath(((SetTemplatePlan) plan).getPrefixPath()));
-      } catch (IllegalPathException e) {
-        // the plan has been checked
-      } catch (StorageGroupNotSetException e) {
-        ((CSchemaProcessor) IoTDB.schemaProcessor).createSchema(plan);
-      }
-    }
-  }
-
-  /**
-   * A partitioned plan (like batch insertion) will be split into several sub-plans, each belongs to
-   * a data group. And these sub-plans will be sent to and executed on the corresponding groups
-   * separately.
-   */
-  public TSStatus processPartitionedPlan(PhysicalPlan plan) throws UnsupportedPlanException {
-    logger.debug("{}: Received a partitioned plan {}", name, plan);
-    if (metaGroupMember.getPartitionTable() == null) {
-      logger.debug("{}: Partition table is not ready", name);
-      return StatusUtils.PARTITION_TABLE_NOT_READY;
-    }
-
-    if (!checkPrivilegeForBatchExecution(plan)) {
-      return concludeFinalStatus(
-          plan, plan.getPaths().size(), true, false, false, null, Collections.emptyList());
-    }
-
-    // split the plan into sub-plans that each only involve one data group
-    Map<PhysicalPlan, PartitionGroup> planGroupMap;
-    try {
-      planGroupMap = splitPlan(plan);
-    } catch (CheckConsistencyException checkConsistencyException) {
-      return StatusUtils.getStatus(
-          StatusUtils.CONSISTENCY_FAILURE, checkConsistencyException.getMessage());
-    }
-
-    // the storage group is not found locally
-    if (planGroupMap == null || planGroupMap.isEmpty()) {
-      if ((plan instanceof InsertPlan
-              || plan instanceof CreateTimeSeriesPlan
-              || plan instanceof CreateAlignedTimeSeriesPlan
-              || plan instanceof CreateMultiTimeSeriesPlan)
-          && ClusterDescriptor.getInstance().getConfig().isEnableAutoCreateSchema()) {
-
-        logger.debug("{}: No associated storage group found for {}, auto-creating", name, plan);
-        try {
-          ((CSchemaProcessor) IoTDB.schemaProcessor).createSchema(plan);
-          return processPartitionedPlan(plan);
-        } catch (MetadataException | CheckConsistencyException e) {
-          logger.error(
-              String.format("Failed to set storage group or create timeseries, because %s", e));
-        }
-      }
-      logger.error("{}: Cannot find storage groups for {}", name, plan);
-      return StatusUtils.NO_STORAGE_GROUP;
-    }
-    logger.debug("{}: The data groups of {} are {}", name, plan, planGroupMap);
-    return forwardPlan(planGroupMap, plan);
-  }
-
-  /**
-   * check if batch execution plan has privilege on any sg
-   *
-   * @param plan
-   * @return
-   */
-  private boolean checkPrivilegeForBatchExecution(PhysicalPlan plan) {
-    if (plan instanceof BatchPlan) {
-      return ((BatchPlan) plan).getResults().size() != plan.getPaths().size();
-    } else {
-      return true;
-    }
-  }
-
-  /**
-   * Forward a plan to all DataGroupMember groups. Only when all nodes time out, will a TIME_OUT be
-   * returned. The error messages from each group (if any) will be compacted into one string.
-   *
-   * @param partitionGroups
-   * @param plan
-   */
-  private TSStatus forwardPlan(List<PartitionGroup> partitionGroups, PhysicalPlan plan) {
-    // the error codes from the groups that cannot execute the plan
-    TSStatus status;
-    List<String> errorCodePartitionGroups = new ArrayList<>();
-    for (PartitionGroup partitionGroup : partitionGroups) {
-      if (partitionGroup.contains(thisNode)) {
-        // the query should be handled by a group the local node is in, handle it with in the group
-        status =
-            metaGroupMember
-                .getLocalDataMember(partitionGroup.getHeader())
-                .executeNonQueryPlan(plan);
-        logger.debug(
-            "Execute {} in a local group of {} with status {}",
-            plan,
-            partitionGroup.getHeader(),
-            status);
-      } else {
-        // forward the query to the group that should handle it
-        status = forwardPlan(plan, partitionGroup);
-        logger.debug(
-            "Forward {} to a remote group of {} with status {}",
-            plan,
-            partitionGroup.getHeader(),
-            status);
-      }
-      if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()
-          && !(plan instanceof SetTemplatePlan
-              && status.getCode() == TSStatusCode.DUPLICATED_TEMPLATE.getStatusCode())
-          && !(plan instanceof DeleteTimeSeriesPlan
-              && status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode())) {
-        // execution failed, record the error message
-        errorCodePartitionGroups.add(
-            String.format(
-                "[%s@%s:%s]", status.getCode(), partitionGroup.getHeader(), status.getMessage()));
-      }
-    }
-    if (errorCodePartitionGroups.isEmpty()) {
-      status = StatusUtils.OK;
-    } else {
-      status =
-          StatusUtils.getStatus(
-              StatusUtils.EXECUTE_STATEMENT_ERROR, MSG_MULTIPLE_ERROR + errorCodePartitionGroups);
-    }
-    logger.debug("{}: executed {} with answer {}", name, plan, status);
-    return status;
-  }
-
-  public void sendLogToAllDataGroups(Log log) throws ChangeMembershipException {
-    if (logger.isDebugEnabled()) {
-      logger.debug("Send log {} to all data groups: start", log);
-    }
-
-    Map<PhysicalPlan, PartitionGroup> planGroupMap = router.splitAndRouteChangeMembershipLog(log);
-    List<String> errorCodePartitionGroups = new CopyOnWriteArrayList<>();
-    CountDownLatch counter = new CountDownLatch(planGroupMap.size());
-    for (Map.Entry<PhysicalPlan, PartitionGroup> entry : planGroupMap.entrySet()) {
-      metaGroupMember
-          .getAppendLogThreadPool()
-          .submit(() -> forwardChangeMembershipPlan(log, entry, errorCodePartitionGroups, counter));
-    }
-    try {
-      counter.await();
-    } catch (InterruptedException e) {
-      Thread.currentThread().interrupt();
-      throw new ChangeMembershipException(
-          String.format("Can not wait all data groups to apply %s", log));
-    }
-    if (!errorCodePartitionGroups.isEmpty()) {
-      throw new ChangeMembershipException(
-          String.format("Apply %s failed with status {%s}", log, errorCodePartitionGroups));
-    }
-    if (logger.isDebugEnabled()) {
-      logger.debug("Send log {} to all data groups: end", log);
-    }
-  }
-
-  private void forwardChangeMembershipPlan(
-      Log log,
-      Map.Entry<PhysicalPlan, PartitionGroup> entry,
-      List<String> errorCodePartitionGroups,
-      CountDownLatch counter) {
-    int retryTime = 0;
-    long startTime = System.currentTimeMillis();
-    try {
-      while (true) {
-        if (logger.isDebugEnabled()) {
-          logger.debug(
-              "Send change membership log {} to data group {}, retry time: {}",
-              log,
-              entry.getValue(),
-              retryTime);
-        }
-        try {
-          TSStatus status = forwardToSingleGroup(entry);
-          if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-            if (logger.isDebugEnabled()) {
-              logger.debug(
-                  "Success to send change membership log {} to data group {}",
-                  log,
-                  entry.getValue());
-            }
-            return;
-          }
-          long cost = System.currentTimeMillis() - startTime;
-          if (cost > ClusterDescriptor.getInstance().getConfig().getWriteOperationTimeoutMS()) {
-            errorCodePartitionGroups.add(
-                String.format(
-                    "Forward change membership log %s to data group %s", log, entry.getValue()));
-            return;
-          }
-          Thread.sleep(ClusterConstant.RETRY_WAIT_TIME_MS);
-        } catch (InterruptedException e) {
-          Thread.currentThread().interrupt();
-          errorCodePartitionGroups.add(e.getMessage());
-          return;
-        }
-        retryTime++;
-      }
-    } finally {
-      counter.countDown();
-    }
-  }
-
-  /** split a plan into several sub-plans, each belongs to only one data group. */
-  private Map<PhysicalPlan, PartitionGroup> splitPlan(PhysicalPlan plan)
-      throws UnsupportedPlanException, CheckConsistencyException {
-    Map<PhysicalPlan, PartitionGroup> planGroupMap = null;
-    try {
-      planGroupMap = router.splitAndRoutePlan(plan);
-    } catch (StorageGroupNotSetException e) {
-      // synchronize with the leader to see if this node has unpulled storage groups
-      metaGroupMember.syncLeaderWithConsistencyCheck(true);
-      try {
-        planGroupMap = router.splitAndRoutePlan(plan);
-      } catch (MetadataException | UnknownLogTypeException ex) {
-        // ignore
-      }
-    } catch (MetadataException | UnknownLogTypeException e) {
-      logger.error("Cannot route plan {}", plan, e);
-    }
-    logger.debug("route plan {} with partitionGroup {}", plan, planGroupMap);
-    return planGroupMap;
-  }
-
-  /**
-   * Forward plans to the DataGroupMember of one node in the corresponding group. Only when all
-   * nodes time out, will a TIME_OUT be returned.
-   *
-   * @param planGroupMap sub-plan -> belong data group pairs
-   */
-  private TSStatus forwardPlan(Map<PhysicalPlan, PartitionGroup> planGroupMap, PhysicalPlan plan) {
-    // the error codes from the groups that cannot execute the plan
-    TSStatus status;
-    // need to create substatus for multiPlan
-
-    // InsertTabletPlan, InsertMultiTabletsPlan, InsertRowsPlan and CreateMultiTimeSeriesPlan
-    // contains many rows,
-    // each will correspond to a TSStatus as its execution result,
-    // as the plan is split and the sub-plans may have interleaving ranges,
-    // we must assure that each TSStatus is placed to the right position
-    // e.g., an InsertTabletPlan contains 3 rows, row1 and row3 belong to NodeA and row2
-    // belongs to NodeB, when NodeA returns a success while NodeB returns a failure, the
-    // failure and success should be placed into proper positions in TSStatus.subStatus
-    if (plan instanceof InsertMultiTabletsPlan
-        || plan instanceof CreateMultiTimeSeriesPlan
-        || plan instanceof InsertRowsPlan) {
-      status = forwardMultiSubPlan(planGroupMap, plan);
-    } else if (planGroupMap.size() == 1) {
-      status = forwardToSingleGroup(planGroupMap.entrySet().iterator().next());
-    } else {
-      status = forwardToMultipleGroup(planGroupMap);
-    }
-    if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
-        && status.isSetRedirectNode()) {
-      status.setCode(TSStatusCode.NEED_REDIRECTION.getStatusCode());
-    }
-    logger.debug("{}: executed {} with answer {}", name, plan, status);
-    return status;
-  }
-
-  private TSStatus forwardToSingleGroup(Map.Entry<PhysicalPlan, PartitionGroup> entry) {
-    TSStatus result;
-    if (entry.getValue().contains(thisNode)) {
-      // the query should be handled by a group the local node is in, handle it with in the group
-      long startTime =
-          Timer.Statistic.META_GROUP_MEMBER_EXECUTE_NON_QUERY_IN_LOCAL_GROUP
-              .getOperationStartTime();
-      result =
-          metaGroupMember
-              .getLocalDataMember(entry.getValue().getHeader())
-              .executeNonQueryPlan(entry.getKey());
-      logger.debug(
-          "Execute {} in a local group of {}, {}",
-          entry.getKey(),
-          entry.getValue().getHeader(),
-          result);
-      Timer.Statistic.META_GROUP_MEMBER_EXECUTE_NON_QUERY_IN_LOCAL_GROUP
-          .calOperationCostTimeFromStart(startTime);
-    } else {
-      // forward the query to the group that should handle it
-      long startTime =
-          Timer.Statistic.META_GROUP_MEMBER_EXECUTE_NON_QUERY_IN_REMOTE_GROUP
-              .getOperationStartTime();
-      logger.debug(
-          "Forward {} to a remote group of {}", entry.getKey(), entry.getValue().getHeader());
-      result = forwardPlan(entry.getKey(), entry.getValue());
-      Timer.Statistic.META_GROUP_MEMBER_EXECUTE_NON_QUERY_IN_REMOTE_GROUP
-          .calOperationCostTimeFromStart(startTime);
-    }
-    return result;
-  }
-
-  /**
-   * forward each sub-plan to its corresponding data group, if some groups goes wrong, the error
-   * messages from each group will be compacted into one string.
-   *
-   * @param planGroupMap sub-plan -> data group pairs
-   */
-  private TSStatus forwardToMultipleGroup(Map<PhysicalPlan, PartitionGroup> planGroupMap) {
-    List<String> errorCodePartitionGroups = new ArrayList<>();
-    TSStatus tmpStatus;
-    boolean allRedirect = true;
-    TEndPoint endPoint = null;
-    for (Map.Entry<PhysicalPlan, PartitionGroup> entry : planGroupMap.entrySet()) {
-      tmpStatus = forwardToSingleGroup(entry);
-      if (tmpStatus.isSetRedirectNode()) {
-        endPoint = tmpStatus.getRedirectNode();
-      } else {
-        allRedirect = false;
-      }
-      if (tmpStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-        // execution failed, record the error message
-        errorCodePartitionGroups.add(
-            String.format(
-                "[%s@%s:%s]",
-                tmpStatus.getCode(), entry.getValue().getHeader(), tmpStatus.getMessage()));
-      }
-    }
-    TSStatus status;
-    if (errorCodePartitionGroups.isEmpty()) {
-      if (allRedirect) {
-        status = StatusUtils.getStatus(TSStatusCode.NEED_REDIRECTION, endPoint);
-      } else {
-        status = StatusUtils.OK;
-      }
-    } else {
-      status =
-          StatusUtils.getStatus(
-              StatusUtils.EXECUTE_STATEMENT_ERROR, MSG_MULTIPLE_ERROR + errorCodePartitionGroups);
-    }
-    return status;
-  }
-
-  /**
-   * Forward each sub-plan to its belonging data group, and combine responses from the groups.
-   *
-   * @param planGroupMap sub-plan -> data group pairs
-   */
-  @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
-  private TSStatus forwardMultiSubPlan(
-      Map<PhysicalPlan, PartitionGroup> planGroupMap, PhysicalPlan parentPlan) {
-    List<String> errorCodePartitionGroups = new ArrayList<>();
-    TSStatus tmpStatus;
-    TSStatus[] subStatus = null;
-    boolean noFailure = true;
-    boolean isBatchFailure = false;
-    boolean isBatchRedirect = false;
-    int totalRowNum = parentPlan.getPaths().size();
-    // send sub-plans to each belonging data group and collect results
-    for (Map.Entry<PhysicalPlan, PartitionGroup> entry : planGroupMap.entrySet()) {
-      tmpStatus = forwardToSingleGroup(entry);
-      logger.debug("{}: from {},{},{}", name, entry.getKey(), entry.getValue(), tmpStatus);
-      noFailure = (tmpStatus.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) && noFailure;
-      isBatchFailure =
-          (tmpStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) || isBatchFailure;
-      if (tmpStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()
-          || tmpStatus.isSetRedirectNode() && !(parentPlan instanceof CreateMultiTimeSeriesPlan)) {
-        if (parentPlan instanceof InsertMultiTabletsPlan) {
-          // the subStatus is the two-dimensional array,
-          // The first dimension is the number of InsertTabletPlans,
-          // and the second dimension is the number of rows per InsertTabletPlan
-          totalRowNum = ((InsertMultiTabletsPlan) parentPlan).getTabletsSize();
-        } else if (parentPlan instanceof CreateMultiTimeSeriesPlan) {
-          totalRowNum = parentPlan.getPaths().size();
-        } else if (parentPlan instanceof InsertRowsPlan) {
-          totalRowNum = ((InsertRowsPlan) parentPlan).getRowCount();
-        }
-
-        if (subStatus == null) {
-          subStatus = new TSStatus[totalRowNum];
-          Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);
-        }
-        // set the status from one group to the proper positions of the overall status
-        if (parentPlan instanceof InsertMultiTabletsPlan) {
-          InsertMultiTabletsPlan tmpMultiTabletPlan = ((InsertMultiTabletsPlan) entry.getKey());
-          for (int i = 0; i < tmpMultiTabletPlan.getInsertTabletPlanList().size(); i++) {
-            InsertTabletPlan tmpInsertTabletPlan = tmpMultiTabletPlan.getInsertTabletPlan(i);
-            int parentIndex = tmpMultiTabletPlan.getParentIndex(i);
-            int parentPlanRowCount = ((InsertMultiTabletsPlan) parentPlan).getRowCount(parentIndex);
-            if (tmpStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-              subStatus[parentIndex] = tmpStatus.subStatus.get(i);
-              if (tmpStatus.subStatus.get(i).getCode()
-                  == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-                if (subStatus[parentIndex].subStatus == null) {
-                  TSStatus[] tmpSubTsStatus = new TSStatus[parentPlanRowCount];
-                  Arrays.fill(tmpSubTsStatus, RpcUtils.SUCCESS_STATUS);
-                  subStatus[parentIndex].subStatus = Arrays.asList(tmpSubTsStatus);
-                }
-                TSStatus[] reorderTsStatus =
-                    subStatus[parentIndex].subStatus.toArray(new TSStatus[] {});
-
-                PartitionUtils.reordering(
-                    tmpInsertTabletPlan,
-                    reorderTsStatus,
-                    tmpStatus.subStatus.get(i).subStatus.toArray(new TSStatus[] {}));
-                subStatus[parentIndex].subStatus = Arrays.asList(reorderTsStatus);
-              }
-              if (tmpStatus.isSetRedirectNode()) {
-                if (tmpStatus.isSetRedirectNode()
-                    && tmpInsertTabletPlan.getMaxTime()
-                        == ((InsertMultiTabletsPlan) parentPlan)
-                            .getInsertTabletPlan(parentIndex)
-                            .getMaxTime()) {
-                  subStatus[parentIndex].setRedirectNode(tmpStatus.redirectNode);
-                  isBatchRedirect = true;
-                }
-              }
-            } else if (tmpStatus.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-              if (tmpStatus.isSetRedirectNode()
-                  && tmpInsertTabletPlan.getMaxTime()
-                      == ((InsertMultiTabletsPlan) parentPlan)
-                          .getInsertTabletPlan(parentIndex)
-                          .getMaxTime()) {
-                subStatus[parentIndex] =
-                    StatusUtils.getStatus(RpcUtils.SUCCESS_STATUS, tmpStatus.redirectNode);
-                isBatchRedirect = true;
-              }
-            }
-          }
-        } else if (parentPlan instanceof CreateMultiTimeSeriesPlan) {
-          CreateMultiTimeSeriesPlan subPlan = (CreateMultiTimeSeriesPlan) entry.getKey();
-          for (int i = 0; i < subPlan.getIndexes().size(); i++) {
-            subStatus[subPlan.getIndexes().get(i)] = tmpStatus.subStatus.get(i);
-          }
-        } else if (parentPlan instanceof InsertRowsPlan) {
-          InsertRowsPlan subPlan = (InsertRowsPlan) entry.getKey();
-          if (tmpStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-            for (int i = 0; i < subPlan.getInsertRowPlanIndexList().size(); i++) {
-              subStatus[subPlan.getInsertRowPlanIndexList().get(i)] = tmpStatus.subStatus.get(i);
-              if (tmpStatus.isSetRedirectNode()) {
-                subStatus[subPlan.getInsertRowPlanIndexList().get(i)].setRedirectNode(
-                    tmpStatus.getRedirectNode());
-                isBatchRedirect = true;
-              }
-            }
-          } else if (tmpStatus.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-            if (tmpStatus.isSetRedirectNode()) {
-              isBatchRedirect = true;
-              TSStatus redirectStatus =
-                  StatusUtils.getStatus(RpcUtils.SUCCESS_STATUS, tmpStatus.getRedirectNode());
-              for (int i = 0; i < subPlan.getInsertRowPlanIndexList().size(); i++) {
-                subStatus[subPlan.getInsertRowPlanIndexList().get(i)] = redirectStatus;
-              }
-            }
-          }
-        }
-      }
-
-      if (tmpStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-        // execution failed, record the error message
-        errorCodePartitionGroups.add(
-            String.format(
-                "[%s@%s:%s:%s]",
-                tmpStatus.getCode(),
-                entry.getValue().getHeader(),
-                tmpStatus.getMessage(),
-                tmpStatus.subStatus));
-      }
-    }
-    return concludeFinalStatus(
-        parentPlan,
-        totalRowNum,
-        noFailure,
-        isBatchRedirect,
-        isBatchFailure,
-        subStatus,
-        errorCodePartitionGroups);
-  }
-
-  private TSStatus concludeFinalStatus(
-      PhysicalPlan parentPlan,
-      int totalRowNum,
-      boolean noFailure,
-      boolean isBatchRedirect,
-      boolean isBatchFailure,
-      TSStatus[] subStatus,
-      List<String> errorCodePartitionGroups) {
-    if (parentPlan instanceof InsertMultiTabletsPlan
-        && !((InsertMultiTabletsPlan) parentPlan).getResults().isEmpty()) {
-      if (subStatus == null) {
-        subStatus = new TSStatus[totalRowNum];
-        Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);
-      }
-      noFailure = false;
-      isBatchFailure = true;
-      for (Map.Entry<Integer, TSStatus> integerTSStatusEntry :
-          ((InsertMultiTabletsPlan) parentPlan).getResults().entrySet()) {
-        subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();
-      }
-    }
-
-    if (parentPlan instanceof CreateMultiTimeSeriesPlan
-        && !((CreateMultiTimeSeriesPlan) parentPlan).getResults().isEmpty()) {
-      if (subStatus == null) {
-        subStatus = new TSStatus[totalRowNum];
-        Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);
-      }
-      noFailure = false;
-      isBatchFailure = true;
-      for (Map.Entry<Integer, TSStatus> integerTSStatusEntry :
-          ((CreateMultiTimeSeriesPlan) parentPlan).getResults().entrySet()) {
-        subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();
-      }
-    }
-
-    if (parentPlan instanceof InsertRowsPlan
-        && !((InsertRowsPlan) parentPlan).getResults().isEmpty()) {
-      if (subStatus == null) {
-        subStatus = new TSStatus[totalRowNum];
-        Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);
-      }
-      noFailure = false;
-      isBatchFailure = true;
-      for (Map.Entry<Integer, TSStatus> integerTSStatusEntry :
-          ((InsertRowsPlan) parentPlan).getResults().entrySet()) {
-        subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();
-      }
-    }
-
-    TSStatus status;
-    if (noFailure) {
-      if (isBatchRedirect) {
-        status = RpcUtils.getStatus(Arrays.asList(subStatus));
-        status.setCode(TSStatusCode.NEED_REDIRECTION.getStatusCode());
-      } else {
-        status = StatusUtils.OK;
-      }
-    } else if (isBatchFailure) {
-      status = RpcUtils.getStatus(Arrays.asList(subStatus));
-    } else {
-      status =
-          StatusUtils.getStatus(
-              StatusUtils.EXECUTE_STATEMENT_ERROR, MSG_MULTIPLE_ERROR + errorCodePartitionGroups);
-    }
-    return status;
-  }
-
-  /**
-   * Forward a plan to the DataGroupMember of one node in the group. Only when all nodes time out,
-   * will a TIME_OUT be returned.
-   */
-  private TSStatus forwardPlan(PhysicalPlan plan, PartitionGroup group) {
-    for (Node node : group) {
-      TSStatus status;
-      try {
-        // only data plans are partitioned, so it must be processed by its data server instead of
-        // meta server
-        if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {
-          status = forwardDataPlanAsync(plan, node, group.getHeader());
-        } else {
-          status = forwardDataPlanSync(plan, node, group.getHeader());
-        }
-      } catch (IOException e) {
-        status = StatusUtils.getStatus(StatusUtils.EXECUTE_STATEMENT_ERROR, e.getMessage());
-      }
-      if (!StatusUtils.TIME_OUT.equals(status)) {
-        if (!status.isSetRedirectNode()) {
-          status.setRedirectNode(new TEndPoint(node.getClientIp(), node.getClientPort()));
-        }
-        return status;
-      } else {
-        logger.warn("Forward {} to {} timed out", plan, node);
-      }
-    }
-    logger.warn("Forward {} to {} timed out", plan, group);
-    return StatusUtils.TIME_OUT;
-  }
-
-  /**
-   * Forward a non-query plan to the data port of "receiver"
-   *
-   * @param plan a non-query plan
-   * @param header to determine which DataGroupMember of "receiver" will process the request.
-   * @return a TSStatus indicating if the forwarding is successful.
-   */
-  private TSStatus forwardDataPlanAsync(PhysicalPlan plan, Node receiver, RaftNode header)
-      throws IOException {
-    AsyncDataClient client =
-        ClusterIoTDB.getInstance()
-            .getAsyncDataClient(receiver, ClusterConstant.getWriteOperationTimeoutMS());
-    return this.metaGroupMember.forwardPlanAsync(plan, receiver, header, client);
-  }
-
-  private TSStatus forwardDataPlanSync(PhysicalPlan plan, Node receiver, RaftNode header)
-      throws IOException {
-    SyncDataClient client =
-        ClusterIoTDB.getInstance()
-            .getSyncDataClient(receiver, ClusterConstant.getWriteOperationTimeoutMS());
-    return this.metaGroupMember.forwardPlanSync(plan, receiver, header, client);
-  }
-
-  public Node getThisNode() {
-    return thisNode;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/AddSelfException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/AddSelfException.java
deleted file mode 100644
index 3e7ff15431..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/AddSelfException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-/** Raised when a node received an AddNodeRequest of adding itself. */
-public class AddSelfException extends Exception {
-
-  public AddSelfException() {
-    super("Cannot add one itself");
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/BadSeedUrlFormatException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/BadSeedUrlFormatException.java
deleted file mode 100644
index 24ea7583c1..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/BadSeedUrlFormatException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class BadSeedUrlFormatException extends Exception {
-
-  public BadSeedUrlFormatException(String seedUrl) {
-    super(
-        String.format(
-            "Seed url %s has bad format, which should be " + "{IP/DomainName}:{metaPort}",
-            seedUrl));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ChangeMembershipException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/ChangeMembershipException.java
deleted file mode 100644
index 6ad64eabb8..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ChangeMembershipException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-/** Raised when add/remove membership log can not be sent to all data groups */
-public class ChangeMembershipException extends Exception {
-
-  public ChangeMembershipException(String errMsg) {
-    super(String.format("Change membership fails, error message=%s ", errMsg));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/CheckConsistencyException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/CheckConsistencyException.java
deleted file mode 100644
index c872ceea17..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/CheckConsistencyException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.exception;
-
-/**
- * Raised when check consistency failed, now only happens if there is a strong-consistency and
- * syncLeader failed
- */
-public class CheckConsistencyException extends Exception {
-
-  public CheckConsistencyException(String errMsg) {
-    super(String.format("check consistency failed, error message=%s ", errMsg));
-  }
-
-  public static final CheckConsistencyException CHECK_STRONG_CONSISTENCY_EXCEPTION =
-      new CheckConsistencyException("strong consistency, sync with leader failed");
-
-  public static final CheckConsistencyException CHECK_MID_CONSISTENCY_EXCEPTION =
-      new CheckConsistencyException(
-          "mid consistency, localAppliedId is smaller than the leaderCommitId");
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ConfigInconsistentException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/ConfigInconsistentException.java
deleted file mode 100644
index 71e2eeb557..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ConfigInconsistentException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class ConfigInconsistentException extends Exception {
-
-  public ConfigInconsistentException() {
-    super(
-        "The configuration of this node is inconsistent with the cluster. See previous logs for "
-            + "explanation");
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EmptyIntervalException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/EmptyIntervalException.java
deleted file mode 100644
index 829ba15b86..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EmptyIntervalException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.tsfile.read.filter.basic.Filter;
-
-public class EmptyIntervalException extends Exception {
-
-  public EmptyIntervalException(Filter filter) {
-    super(String.format("The interval of the filter %s is empty.", filter));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryCompactedException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryCompactedException.java
deleted file mode 100644
index 629252f995..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryCompactedException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class EntryCompactedException extends Exception {
-
-  public EntryCompactedException(long index, long boundary) {
-    super(
-        String.format(
-            "Entry index %d is unavailable due to compaction, and the lower bound is %d",
-            index, boundary));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryUnavailableException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryUnavailableException.java
deleted file mode 100644
index d5d030389a..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/EntryUnavailableException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class EntryUnavailableException extends Exception {
-
-  public EntryUnavailableException(long index, long boundary) {
-    super(
-        String.format("Entry index %d is unavailable, and the upper bound is %d", index, boundary));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/GetEntriesWrongParametersException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/GetEntriesWrongParametersException.java
deleted file mode 100644
index d6903b9b19..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/GetEntriesWrongParametersException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class GetEntriesWrongParametersException extends Exception {
-
-  public GetEntriesWrongParametersException(long low, long high) {
-    super(String.format("invalid getEntries: parameter: %d >= %d", low, high));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/LeaderUnknownException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/LeaderUnknownException.java
deleted file mode 100644
index f91285415a..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/LeaderUnknownException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-
-import java.util.Collection;
-
-/** Raised when a request should be forwarded to the leader but the leader cannot be found. */
-public class LeaderUnknownException extends Exception {
-
-  public LeaderUnknownException(Collection<Node> nodes) {
-    super(String.format("The leader is unknown in this group %s", nodes));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/LogExecutionException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/LogExecutionException.java
deleted file mode 100644
index 609c5f9e60..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/LogExecutionException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class LogExecutionException extends Exception {
-
-  public LogExecutionException(Throwable cause) {
-    super(cause);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/MemberReadOnlyException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/MemberReadOnlyException.java
deleted file mode 100644
index 0139e42e57..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/MemberReadOnlyException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-
-public class MemberReadOnlyException extends Exception {
-
-  public MemberReadOnlyException(Node node) {
-    super(
-        String.format(
-            "The node %s has been set readonly for the partitions, please retry to find "
-                + "a new node",
-            node));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NoHeaderNodeException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/NoHeaderNodeException.java
deleted file mode 100644
index b610a61626..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NoHeaderNodeException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-/**
- * Raised when a DataClusterServer receives a request without a header node indicating which group
- * it belongs to.
- */
-public class NoHeaderNodeException extends Exception {
-
-  public NoHeaderNodeException() {
-    super("Header Node is required in data group communication!");
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotInSameGroupException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotInSameGroupException.java
deleted file mode 100644
index e11b438a3c..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotInSameGroupException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-
-import java.util.List;
-
-/** Raised when a DataClusterServer receives a request but the node is not in the target group. */
-public class NotInSameGroupException extends Exception {
-
-  public NotInSameGroupException(List<Node> group, Node thisNode) {
-    super(String.format("This node %s is not in the data group %s", thisNode, group));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotManagedSlotException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotManagedSlotException.java
deleted file mode 100644
index 638f2aae73..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/NotManagedSlotException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import java.util.List;
-
-/**
- * Raised when a data group leader receives a PullSnapshotRequest but finds it does not manage the
- * requested slot.
- */
-public class NotManagedSlotException extends Exception {
-
-  public NotManagedSlotException(int requiredSlots, List<Integer> slots) {
-    super(String.format("%d is not in the managed slots %s", requiredSlots, slots));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/PartitionTableUnavailableException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/PartitionTableUnavailableException.java
deleted file mode 100644
index 5a9679e2e8..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/PartitionTableUnavailableException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-
-/** Raised when a node receives requests before the its partition table is set up. */
-public class PartitionTableUnavailableException extends Exception {
-
-  public PartitionTableUnavailableException(Node node) {
-    super(String.format("Partition table of %s is not ready, cannot serve", node));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/PullFileException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/PullFileException.java
deleted file mode 100644
index 2b7151e038..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/PullFileException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-
-public class PullFileException extends Exception {
-
-  public PullFileException(String fileName, Node node) {
-    super(String.format("Cannot pull file %s from %s due to network condition", fileName, node));
-  }
-
-  public PullFileException(String fileName, Node node, Exception e) {
-    super(
-        String.format("Cannot pull file %s from %s because %s", fileName, node, e.getMessage()), e);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/QueryTimeOutException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/QueryTimeOutException.java
deleted file mode 100644
index ea42fdf598..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/QueryTimeOutException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class QueryTimeOutException extends Exception {
-
-  public QueryTimeOutException(String query) {
-    super("Query: " + query + " timed out");
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ReaderNotFoundException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/ReaderNotFoundException.java
deleted file mode 100644
index 48a65d4f82..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/ReaderNotFoundException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class ReaderNotFoundException extends Exception {
-
-  public ReaderNotFoundException(long readerId) {
-    super(String.format("The requested reader %d is not found", readerId));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/RequestTimeOutException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/RequestTimeOutException.java
deleted file mode 100644
index 6fbede1d6b..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/RequestTimeOutException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.cluster.log.Log;
-
-/** Raised when a request times out before reaching an agreement in a group. */
-public class RequestTimeOutException extends Exception {
-
-  public RequestTimeOutException(Log log) {
-    super("Request \"" + log + "\" timeout");
-  }
-
-  public RequestTimeOutException(String request) {
-    super("Request \"" + request + "\" timeout");
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/SnapshotInstallationException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/SnapshotInstallationException.java
deleted file mode 100644
index 750c6bf7db..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/SnapshotInstallationException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class SnapshotInstallationException extends Exception {
-
-  public SnapshotInstallationException(String message) {
-    super(message);
-  }
-
-  public SnapshotInstallationException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public SnapshotInstallationException() {}
-
-  public SnapshotInstallationException(Throwable cause) {
-    super(cause);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/StartUpCheckFailureException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/StartUpCheckFailureException.java
deleted file mode 100644
index d84e7413dd..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/StartUpCheckFailureException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class StartUpCheckFailureException extends Exception {
-
-  public StartUpCheckFailureException() {
-    super("The start up check cannot finish timely, please check the network");
-  }
-
-  public StartUpCheckFailureException(Throwable e) {
-    super(e);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/TruncateCommittedEntryException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/TruncateCommittedEntryException.java
deleted file mode 100644
index ac1099938c..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/TruncateCommittedEntryException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-public class TruncateCommittedEntryException extends Exception {
-
-  public TruncateCommittedEntryException(long index, long committed) {
-    super(
-        String.format(
-            "The committed entries cannot be truncated: parameter: %d, commitIndex : %d",
-            index, committed));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnknownLogTypeException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnknownLogTypeException.java
deleted file mode 100644
index d2eaa6d2c1..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnknownLogTypeException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-/** Raised when the type of a raft log is unknown. */
-public class UnknownLogTypeException extends Exception {
-
-  public UnknownLogTypeException(int logType) {
-    super("Unknown log type: " + logType);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnsupportedPlanException.java b/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnsupportedPlanException.java
deleted file mode 100644
index 479db4c9c2..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/exception/UnsupportedPlanException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.exception;
-
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-
-public class UnsupportedPlanException extends Exception {
-
-  public UnsupportedPlanException(PhysicalPlan plan) {
-    super(String.format("Plan %s is not supported", plan));
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogCallback.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogCallback.java
deleted file mode 100644
index 7205d2a5e3..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogCallback.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.server.member.RaftMember;
-
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CommitLogCallback implements AsyncMethodCallback<Void> {
-
-  private static final Logger logger = LoggerFactory.getLogger(CommitLogCallback.class);
-  private final RaftMember raftMember;
-
-  public CommitLogCallback(RaftMember raftMember) {
-    this.raftMember = raftMember;
-  }
-
-  @Override
-  public void onComplete(Void v) {
-    synchronized (raftMember.getSyncLock()) {
-      raftMember.getSyncLock().notifyAll();
-    }
-  }
-
-  @Override
-  public void onError(Exception e) {
-    logger.error("async commit log failed", e);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogTask.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogTask.java
deleted file mode 100644
index 8c40dc8cc8..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/CommitLogTask.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.log.manage.RaftLogManager;
-
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CommitLogTask implements Runnable {
-
-  private static final Logger logger = LoggerFactory.getLogger(CommitLogTask.class);
-  private RaftLogManager logManager;
-  private long leaderCommit;
-  private long term;
-
-  public CommitLogTask(RaftLogManager logManager, long leaderCommit, long term) {
-    this.logManager = logManager;
-    this.leaderCommit = leaderCommit;
-    this.term = term;
-  }
-
-  /** listener field */
-  private AsyncMethodCallback<Void> callback;
-
-  /** @param callback the event listener */
-  public void registerCallback(AsyncMethodCallback<Void> callback) {
-    this.callback = callback;
-  }
-
-  private void doCommitLog() {
-    if (callback == null) {
-      logger.error("callback is not registered");
-      return;
-    }
-
-    boolean success = logManager.maybeCommit(leaderCommit, term);
-    if (success) {
-      callback.onComplete(null);
-    }
-  }
-
-  @Override
-  public void run() {
-    doCommitLog();
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/HardState.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/HardState.java
deleted file mode 100644
index 2e9e172341..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/HardState.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.utils.NodeSerializeUtils;
-import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
-
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-public class HardState {
-
-  private long currentTerm;
-  private Node voteFor;
-
-  public HardState() {
-    this.voteFor = null;
-  }
-
-  public static HardState deserialize(ByteBuffer buffer) {
-    HardState res = new HardState();
-    res.setCurrentTerm(ReadWriteIOUtils.readLong(buffer));
-    int isNull = buffer.get();
-    if (isNull == 1) {
-      Node node = new Node();
-      NodeSerializeUtils.deserialize(node, buffer);
-      res.setVoteFor(node);
-    } else {
-      res.setVoteFor(null);
-    }
-    return res;
-  }
-
-  public ByteBuffer serialize() {
-    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-    DataOutputStream dataOutputStream = new DataOutputStream(outputStream);
-    try {
-      dataOutputStream.writeLong(currentTerm);
-      if (voteFor == null) {
-        dataOutputStream.writeByte(0);
-      } else {
-        dataOutputStream.writeByte(1);
-        NodeSerializeUtils.serialize(voteFor, dataOutputStream);
-      }
-    } catch (IOException e) {
-      // unreachable
-    }
-    return ByteBuffer.wrap(outputStream.toByteArray());
-  }
-
-  public long getCurrentTerm() {
-    return currentTerm;
-  }
-
-  public void setCurrentTerm(long currentTerm) {
-    this.currentTerm = currentTerm;
-  }
-
-  public Node getVoteFor() {
-    return voteFor;
-  }
-
-  public void setVoteFor(Node voteFor) {
-    this.voteFor = voteFor;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (!(o instanceof HardState)) {
-      return false;
-    }
-    HardState that = (HardState) o;
-    return new EqualsBuilder()
-        .append(currentTerm, that.currentTerm)
-        .append(voteFor, that.voteFor)
-        .isEquals();
-  }
-
-  @Override
-  public int hashCode() {
-    return new HashCodeBuilder(17, 37).append(currentTerm).append(voteFor).toHashCode();
-  }
-
-  @Override
-  public String toString() {
-    return "HardState{" + "currentTerm=" + currentTerm + ", voteFor=" + voteFor + '}';
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/Log.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/Log.java
deleted file mode 100644
index e70c326e33..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/Log.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.cluster.log;
-
-import java.nio.ByteBuffer;
-import java.util.Comparator;
-import java.util.Objects;
-
-/**
- * Log records operations that are made on this cluster. Each log records 2 longs: currLogIndex,
- * currLogTerm, so that the logs in a cluster will form a log chain and abnormal operations can thus
- * be distinguished and removed.
- */
-public abstract class Log implements Comparable<Log> {
-
-  private static final Comparator<Log> COMPARATOR =
-      Comparator.comparingLong(Log::getCurrLogIndex).thenComparing(Log::getCurrLogTerm);
-
-  protected static final int DEFAULT_BUFFER_SIZE = 4096;
-  private long currLogIndex;
-  private long currLogTerm;
-
-  // for async application
-  private volatile boolean applied;
-
-  @SuppressWarnings("java:S3077")
-  private volatile Exception exception;
-
-  private long createTime;
-  private long enqueueTime;
-
-  private int byteSize = 0;
-
-  public abstract ByteBuffer serialize();
-
-  public abstract void deserialize(ByteBuffer buffer);
-
-  public enum Types {
-    // DO CHECK LogParser when you add a new type of log
-    ADD_NODE,
-    PHYSICAL_PLAN,
-    CLOSE_FILE,
-    REMOVE_NODE,
-    EMPTY_CONTENT,
-    TEST_LARGE_CONTENT
-  }
-
-  public long getCurrLogIndex() {
-    return currLogIndex;
-  }
-
-  public void setCurrLogIndex(long currLogIndex) {
-    this.currLogIndex = currLogIndex;
-  }
-
-  public long getCurrLogTerm() {
-    return currLogTerm;
-  }
-
-  public void setCurrLogTerm(long currLogTerm) {
-    this.currLogTerm = currLogTerm;
-  }
-
-  @SuppressWarnings("java:S2886") // synchronized outside
-  public boolean isApplied() {
-    return applied;
-  }
-
-  public void setApplied(boolean applied) {
-    synchronized (this) {
-      this.applied = applied;
-      this.notifyAll();
-    }
-  }
-
-  public Exception getException() {
-    return exception;
-  }
-
-  public void setException(Exception exception) {
-    this.exception = exception;
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) {
-      return true;
-    }
-    if (o == null || getClass() != o.getClass()) {
-      return false;
-    }
-    Log log = (Log) o;
-    return currLogIndex == log.currLogIndex && currLogTerm == log.currLogTerm;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(currLogIndex, currLogTerm);
-  }
-
-  @Override
-  public int compareTo(Log o) {
-    return COMPARATOR.compare(this, o);
-  }
-
-  public long getCreateTime() {
-    return createTime;
-  }
-
-  public void setCreateTime(long createTime) {
-    this.createTime = createTime;
-  }
-
-  public long getEnqueueTime() {
-    return enqueueTime;
-  }
-
-  public void setEnqueueTime(long enqueueTime) {
-    this.enqueueTime = enqueueTime;
-  }
-
-  public long getByteSize() {
-    return byteSize;
-  }
-
-  public void setByteSize(int byteSize) {
-    this.byteSize = byteSize;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/LogApplier.java
deleted file mode 100644
index e4fbec77ca..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogApplier.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-/** LogApplier applies the log to the local node to make it take effect. */
-public interface LogApplier {
-
-  /**
-   * Apply the given log, if any exception is thrown during the execution, the exception will be
-   * recorded in the log. Either an exception is thrown or the log is executed successfully, log
-   * .setApplied(true) must be called.
-   *
-   * @param log
-   */
-  void apply(Log log);
-
-  default void close() {}
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java
deleted file mode 100644
index c9ebf31d17..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.rpc.thrift.AppendEntriesRequest;
-import org.apache.iotdb.cluster.rpc.thrift.AppendEntryRequest;
-import org.apache.iotdb.cluster.rpc.thrift.Node;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService.AsyncClient;
-import org.apache.iotdb.cluster.rpc.thrift.RaftService.Client;
-import org.apache.iotdb.cluster.server.handlers.caller.AppendNodeEntryHandler;
-import org.apache.iotdb.cluster.server.member.RaftMember;
-import org.apache.iotdb.cluster.server.monitor.Peer;
-import org.apache.iotdb.cluster.server.monitor.Timer;
-import org.apache.iotdb.cluster.utils.ClientUtils;
-import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * A LogDispatcher serves a raft leader by queuing logs that the leader wants to send to its
- * followers and send the logs in an ordered manner so that the followers will not wait for previous
- * logs for too long. For example: if the leader send 3 logs, log1, log2, log3, concurrently to
- * follower A, the actual reach order may be log3, log2, and log1. According to the protocol, log3
- * and log2 must halt until log1 reaches, as a result, the total delay may increase significantly.
- */
-public class LogDispatcher {
-
-  private static final Logger logger = LoggerFactory.getLogger(LogDispatcher.class);
-  private RaftMember member;
-  private boolean useBatchInLogCatchUp =
-      ClusterDescriptor.getInstance().getConfig().isUseBatchInLogCatchUp();
-  // each follower has a queue and a dispatch thread is attached in executorService.
-  private List<BlockingQueue<SendLogRequest>> nodeLogQueues = new ArrayList<>();
-  private ExecutorService executorService;
-
-  // TODO we have no way to close this pool.
-  private static final ExecutorService serializationService =
-      IoTDBThreadPoolFactory.newFixedThreadPoolWithDaemonThread(
-          Runtime.getRuntime().availableProcessors(), "DispatcherEncoder");
-
-  public LogDispatcher(RaftMember member) {
-    this.member = member;
-    executorService =
-        IoTDBThreadPoolFactory.newCachedThreadPool("LogDispatcher-" + member.getName());
-    for (Node node : member.getAllNodes()) {
-      if (!node.equals(member.getThisNode())) {
-        nodeLogQueues.add(createQueueAndBindingThread(node));
-      }
-    }
-  }
-
-  @TestOnly
-  public void close() throws InterruptedException {
-    executorService.shutdownNow();
-    executorService.awaitTermination(10, TimeUnit.SECONDS);
-  }
-
-  public void offer(SendLogRequest log) {
-    // if nodeLogQueues.isEmpty(), then nothing to do.
-
-    // do serialization here to avoid taking LogManager for too long
-    if (!nodeLogQueues.isEmpty()) {
-      log.serializedLogFuture =
-          serializationService.submit(
-              () -> {
-                ByteBuffer byteBuffer = log.getLog().serialize();
-                log.getLog().setByteSize(byteBuffer.array().length);
-                return byteBuffer;
-              });
-    }
-    for (int i = 0; i < nodeLogQueues.size(); i++) {
-      BlockingQueue<SendLogRequest> nodeLogQueue = nodeLogQueues.get(i);
-      try {
-        boolean addSucceeded;
-        if (ClusterDescriptor.getInstance().getConfig().isWaitForSlowNode()) {
-          addSucceeded =
-              nodeLogQueue.offer(
-                  log,
-                  ClusterDescriptor.getInstance().getConfig().getWriteOperationTimeoutMS(),
-                  TimeUnit.MILLISECONDS);
-        } else {
-          addSucceeded = nodeLogQueue.add(log);
-        }
-
-        if (!addSucceeded) {
-          logger.debug(
-              "Log queue[{}] of {} is full, ignore the log to this node", i, member.getName());
-        } else {
-          log.setEnqueueTime(System.nanoTime());
-        }
-      } catch (IllegalStateException e) {
-        logger.debug(
-            "Log queue[{}] of {} is full, ignore the log to this node", i, member.getName());
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-      }
-    }
-  }
-
-  private BlockingQueue<SendLogRequest> createQueueAndBindingThread(Node node) {
-    BlockingQueue<SendLogRequest> logBlockingQueue =
-        new ArrayBlockingQueue<>(
-            ClusterDescriptor.getInstance().getConfig().getMaxNumOfLogsInMem());
-    int bindingThreadNum = 1;
-    for (int i = 0; i < bindingThreadNum; i++) {
-      executorService.submit(new DispatcherThread(node, logBlockingQueue));
-    }
-    return logBlockingQueue;
-  }
-
-  public static class SendLogRequest {
-
-    private Log log;
-    private AtomicInteger voteCounter;
-    private AtomicBoolean leaderShipStale;
-    private AtomicLong newLeaderTerm;
-    private AppendEntryRequest appendEntryRequest;
-    private long enqueueTime;
-    private Future<ByteBuffer> serializedLogFuture;
-
-    public SendLogRequest(
-        Log log,
-        AtomicInteger voteCounter,
-        AtomicBoolean leaderShipStale,
-        AtomicLong newLeaderTerm,
-        AppendEntryRequest appendEntryRequest) {
-      this.setLog(log);
-      this.setVoteCounter(voteCounter);
-      this.setLeaderShipStale(leaderShipStale);
-      this.setNewLeaderTerm(newLeaderTerm);
-      this.setAppendEntryRequest(appendEntryRequest);
-    }
-
-    public AtomicInteger getVoteCounter() {
-      return voteCounter;
-    }
-
-    public void setVoteCounter(AtomicInteger voteCounter) {
-      this.voteCounter = voteCounter;
-    }
-
-    public Log getLog() {
-      return log;
-    }
-
-    public void setLog(Log log) {
-      this.log = log;
-    }
-
-    public long getEnqueueTime() {
-      return enqueueTime;
-    }
-
-    public void setEnqueueTime(long enqueueTime) {
-      this.enqueueTime = enqueueTime;
-    }
-
-    public AtomicBoolean getLeaderShipStale() {
-      return leaderShipStale;
-    }
-
-    public void setLeaderShipStale(AtomicBoolean leaderShipStale) {
-      this.leaderShipStale = leaderShipStale;
-    }
-
-    public AtomicLong getNewLeaderTerm() {
-      return newLeaderTerm;
-    }
-
-    void setNewLeaderTerm(AtomicLong newLeaderTerm) {
-      this.newLeaderTerm = newLeaderTerm;
-    }
-
-    public AppendEntryRequest getAppendEntryRequest() {
-      return appendEntryRequest;
-    }
-
-    public void setAppendEntryRequest(AppendEntryRequest appendEntryRequest) {
-      this.appendEntryRequest = appendEntryRequest;
-    }
-
-    @Override
-    public String toString() {
-      return "SendLogRequest{" + "log=" + log + '}';
-    }
-  }
-
-  class DispatcherThread implements Runnable {
-
-    private Node receiver;
-    private BlockingQueue<SendLogRequest> logBlockingDeque;
-    private List<SendLogRequest> currBatch = new ArrayList<>();
-    private Peer peer;
-
-    DispatcherThread(Node receiver, BlockingQueue<SendLogRequest> logBlockingDeque) {
-      this.receiver = receiver;
-      this.logBlockingDeque = logBlockingDeque;
-      this.peer =
-          member
-              .getPeerMap()
-              .computeIfAbsent(receiver, r -> new Peer(member.getLogManager().getLastLogIndex()));
-    }
-
-    @Override
-    public void run() {
-      Thread.currentThread().setName("LogDispatcher-" + member.getName() + "-" + receiver);
-      try {
-        while (!Thread.interrupted()) {
-          SendLogRequest poll = logBlockingDeque.take();
-          currBatch.add(poll);
-          logBlockingDeque.drainTo(currBatch);
-          if (logger.isDebugEnabled()) {
-            logger.debug("Sending {} logs to {}", currBatch.size(), receiver);
-          }
-          for (SendLogRequest request : currBatch) {
-            request.getAppendEntryRequest().entry = request.serializedLogFuture.get();
-          }
-          sendBatchLogs(currBatch);
-          currBatch.clear();
-        }
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-      } catch (Exception e) {
-        logger.error("Unexpected error in log dispatcher", e);
-      }
-      logger.info("Dispatcher exits");
-    }
-
-    private void appendEntriesAsync(
-        List<ByteBuffer> logList, AppendEntriesRequest request, List<SendLogRequest> currBatch)
-        throws TException {
-      AsyncMethodCallback<Long> handler = new AppendEntriesHandler(currBatch);
-      AsyncClient client = member.getSendLogAsyncClient(receiver);
-      if (logger.isDebugEnabled()) {
-        logger.debug(
-            "{}: append entries {} with {} logs", member.getName(), receiver, logList.size());
-      }
-      if (client != null) {
-        client.appendEntries(request, handler);
-      }
-    }
-
-    private void appendEntriesSync(
-        List<ByteBuffer> logList, AppendEntriesRequest request, List<SendLogRequest> currBatch) {
-
-      long startTime = Timer.Statistic.RAFT_SENDER_WAIT_FOR_PREV_LOG.getOperationStartTime();
-      if (!member.waitForPrevLog(peer, currBatch.get(0).getLog())) {
-        logger.warn(
-            "{}: node {} timed out when appending {}",
-            member.getName(),
-            receiver,
-            currBatch.get(0).getLog());
-        return;
-      }
-      Timer.Statistic.RAFT_SENDER_WAIT_FOR_PREV_LOG.calOperationCostTimeFromStart(startTime);
-
-      Client client = member.getSyncClient(receiver);
-      if (client == null) {
-        logger.error("No available client for {}", receiver);
-        return;
-      }
-      AsyncMethodCallback<Long> handler = new AppendEntriesHandler(currBatch);
-      startTime = Timer.Statistic.RAFT_SENDER_SEND_LOG.getOperationStartTime();
-      try {
-        long result = client.appendEntries(request);
-        Timer.Statistic.RAFT_SENDER_SEND_LOG.calOperationCostTimeFromStart(startTime);
-        if (result != -1 && logger.isInfoEnabled()) {
-          logger.info(
-              "{}: Append {} logs to {}, resp: {}",
-              member.getName(),
-              logList.size(),
-              receiver,
-              result);
-        }
-        handler.onComplete(result);
-      } catch (TException e) {
-        client.getInputProtocol().getTransport().close();
-        handler.onError(e);
-        logger.warn("Failed logs: {}, first index: {}", logList, request.prevLogIndex + 1);
-      } finally {
-        ClientUtils.putBackSyncClient(client);
-      }
-    }
-
-    private AppendEntriesRequest prepareRequest(
-        List<ByteBuffer> logList, List<SendLogRequest> currBatch, int firstIndex) {
-      AppendEntriesRequest request = new AppendEntriesRequest();
-
-      if (member.getHeader() != null) {
-        request.setHeader(member.getHeader());
-      }
-      request.setLeader(member.getThisNode());
-      request.setLeaderCommit(member.getLogManager().getCommitLogIndex());
-
-      synchronized (member.getTerm()) {
-        request.setTerm(member.getTerm().get());
-      }
-
-      request.setEntries(logList);
-      // set index for raft
-      request.setPrevLogIndex(currBatch.get(firstIndex).getLog().getCurrLogIndex() - 1);
-      try {
-        request.setPrevLogTerm(currBatch.get(firstIndex).getAppendEntryRequest().prevLogTerm);
-      } catch (Exception e) {
-        logger.error("getTerm failed for newly append entries", e);
-      }
-      return request;
-    }
-
-    private void sendLogs(List<SendLogRequest> currBatch) throws TException {
-      int logIndex = 0;
-      logger.debug(
-          "send logs from index {} to {}",
-          currBatch.get(0).getLog().getCurrLogIndex(),
-          currBatch.get(currBatch.size() - 1).getLog().getCurrLogIndex());
-      while (logIndex < currBatch.size()) {
-        long logSize = IoTDBDescriptor.getInstance().getConfig().getThriftMaxFrameSize();
-        List<ByteBuffer> logList = new ArrayList<>();
-        int prevIndex = logIndex;
-
-        for (; logIndex < currBatch.size(); logIndex++) {
-          long curSize = currBatch.get(logIndex).getAppendEntryRequest().entry.array().length;
-          if (logSize - curSize <= IoTDBConstant.LEFT_SIZE_IN_REQUEST) {
-            break;
-          }
-          logSize -= curSize;
-          Timer.Statistic.LOG_DISPATCHER_LOG_IN_QUEUE.calOperationCostTimeFromStart(
-              currBatch.get(logIndex).getLog().getCreateTime());
-          logList.add(currBatch.get(logIndex).getAppendEntryRequest().entry);
-        }
-
-        AppendEntriesRequest appendEntriesRequest = prepareRequest(logList, currBatch, prevIndex);
-        if (ClusterDescriptor.getInstance().getConfig().isUseAsyncServer()) {
-          appendEntriesAsync(logList, appendEntriesRequest, currBatch.subList(prevIndex, logIndex));
-        } else {
-          appendEntriesSync(logList, appendEntriesRequest, currBatch.subList(prevIndex, logIndex));
-        }
-        for (; prevIndex < logIndex; prevIndex++) {
-          Timer.Statistic.LOG_DISPATCHER_FROM_CREATE_TO_END.calOperationCostTimeFromStart(
-              currBatch.get(prevIndex).getLog().getCreateTime());
-        }
-      }
-    }
-
-    private void sendBatchLogs(List<SendLogRequest> currBatch) throws TException {
-      if (currBatch.size() > 1) {
-        if (useBatchInLogCatchUp) {
-          sendLogs(currBatch);
-        } else {
-          for (SendLogRequest batch : currBatch) {
-            sendLog(batch);
-          }
-        }
-      } else {
-        sendLog(currBatch.get(0));
-      }
-    }
-
-    private void sendLog(SendLogRequest logRequest) {
-      Timer.Statistic.LOG_DISPATCHER_LOG_IN_QUEUE.calOperationCostTimeFromStart(
-          logRequest.getLog().getCreateTime());
-      member.sendLogToFollower(
-          logRequest.getLog(),
-          logRequest.getVoteCounter(),
-          receiver,
-          logRequest.getLeaderShipStale(),
-          logRequest.getNewLeaderTerm(),
-          logRequest.getAppendEntryRequest());
-      Timer.Statistic.LOG_DISPATCHER_FROM_CREATE_TO_END.calOperationCostTimeFromStart(
-          logRequest.getLog().getCreateTime());
-    }
-
-    class AppendEntriesHandler implements AsyncMethodCallback<Long> {
-
-      private final List<AsyncMethodCallback<Long>> singleEntryHandlers;
-
-      private AppendEntriesHandler(List<SendLogRequest> batch) {
-        singleEntryHandlers = new ArrayList<>(batch.size());
-        for (SendLogRequest sendLogRequest : batch) {
-          AppendNodeEntryHandler handler =
-              getAppendNodeEntryHandler(
-                  sendLogRequest.getLog(),
-                  sendLogRequest.getVoteCounter(),
-                  receiver,
-                  sendLogRequest.getLeaderShipStale(),
-                  sendLogRequest.getNewLeaderTerm(),
-                  peer);
-          singleEntryHandlers.add(handler);
-        }
-      }
-
-      @Override
-      public void onComplete(Long aLong) {
-        for (AsyncMethodCallback<Long> singleEntryHandler : singleEntryHandlers) {
-          singleEntryHandler.onComplete(aLong);
-        }
-      }
-
-      @Override
-      public void onError(Exception e) {
-        for (AsyncMethodCallback<Long> singleEntryHandler : singleEntryHandlers) {
-          singleEntryHandler.onError(e);
-        }
-      }
-
-      private AppendNodeEntryHandler getAppendNodeEntryHandler(
-          Log log,
-          AtomicInteger voteCounter,
-          Node node,
-          AtomicBoolean leaderShipStale,
-          AtomicLong newLeaderTerm,
-          Peer peer) {
-        AppendNodeEntryHandler handler = new AppendNodeEntryHandler();
-        handler.setReceiver(node);
-        handler.setVoteCounter(voteCounter);
-        handler.setLeaderShipStale(leaderShipStale);
-        handler.setLog(log);
-        handler.setMember(member);
-        handler.setPeer(peer);
-        handler.setReceiverTerm(newLeaderTerm);
-        return handler;
-      }
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogParser.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/LogParser.java
deleted file mode 100644
index e35943b3fa..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/LogParser.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.exception.UnknownLogTypeException;
-import org.apache.iotdb.cluster.log.Log.Types;
-import org.apache.iotdb.cluster.log.logtypes.AddNodeLog;
-import org.apache.iotdb.cluster.log.logtypes.CloseFileLog;
-import org.apache.iotdb.cluster.log.logtypes.EmptyContentLog;
-import org.apache.iotdb.cluster.log.logtypes.LargeTestLog;
-import org.apache.iotdb.cluster.log.logtypes.PhysicalPlanLog;
-import org.apache.iotdb.cluster.log.logtypes.RemoveNodeLog;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.nio.ByteBuffer;
-
-/** LogParser transform a ByteBuffer into a Log. */
-public class LogParser {
-
-  private static final Logger logger = LoggerFactory.getLogger(LogParser.class);
-  private static final LogParser INSTANCE = new LogParser();
-
-  private LogParser() {
-    // singleton class
-  }
-
-  public static LogParser getINSTANCE() {
-    return INSTANCE;
-  }
-
-  public Log parse(ByteBuffer buffer) throws UnknownLogTypeException {
-    if (logger.isDebugEnabled()) {
-      logger.debug("Received a log buffer, pos:{}, limit:{}", buffer.position(), buffer.limit());
-    }
-    int typeInt = buffer.get();
-    Types type;
-    try {
-      type = Types.values()[typeInt];
-    } catch (ArrayIndexOutOfBoundsException e) {
-      throw new UnknownLogTypeException(typeInt);
-    }
-    logger.debug("The log type is {}", type);
-    Log log;
-    switch (type) {
-      case ADD_NODE:
-        AddNodeLog addNodeLog = new AddNodeLog();
-        addNodeLog.deserialize(buffer);
-        if (logger.isDebugEnabled()) {
-          logger.debug(
-              "The last meta log index of log {} is {}", addNodeLog, addNodeLog.getMetaLogIndex());
-        }
-        log = addNodeLog;
-        break;
-      case PHYSICAL_PLAN:
-        PhysicalPlanLog physicalPlanLog = new PhysicalPlanLog();
-        physicalPlanLog.deserialize(buffer);
-        log = physicalPlanLog;
-        break;
-      case CLOSE_FILE:
-        CloseFileLog closeFileLog = new CloseFileLog();
-        closeFileLog.deserialize(buffer);
-        log = closeFileLog;
-        break;
-      case REMOVE_NODE:
-        RemoveNodeLog removeNodeLog = new RemoveNodeLog();
-        removeNodeLog.deserialize(buffer);
-        if (logger.isDebugEnabled()) {
-          logger.debug(
-              "The last meta log index of log {} is {}",
-              removeNodeLog,
-              removeNodeLog.getMetaLogIndex());
-        }
-        log = removeNodeLog;
-        break;
-      case EMPTY_CONTENT:
-        EmptyContentLog emptyLog = new EmptyContentLog();
-        emptyLog.deserialize(buffer);
-        log = emptyLog;
-        break;
-      case TEST_LARGE_CONTENT:
-        LargeTestLog largeLog = new LargeTestLog();
-        largeLog.deserialize(buffer);
-        log = largeLog;
-        break;
-      default:
-        throw new IllegalArgumentException(type.toString());
-    }
-    logger.debug("Parsed a log {}", log);
-    return log;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/Snapshot.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/Snapshot.java
deleted file mode 100644
index b0c0761b16..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/Snapshot.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.log.snapshot.SnapshotInstaller;
-import org.apache.iotdb.cluster.server.member.RaftMember;
-
-import java.nio.ByteBuffer;
-
-/**
- * As we can only hold a certain amount of logs in memory, when the logs' size exceed the memory
- * capacity, they will be deleted or compressed, and a snapshot of current system will be generated.
- * If a node need to catch up but its next log is deleted, it will catch up based on the latest
- * snapshot and the logs still in memory. The snapshot could be a file recording the list of current
- * system files, or the compressed all historical logs, depending on the implementation.
- */
-public abstract class Snapshot {
-
-  protected long lastLogIndex;
-  protected long lastLogTerm;
-
-  public abstract ByteBuffer serialize();
-
-  public abstract void deserialize(ByteBuffer buffer);
-
-  public void setLastLogIndex(long lastLogIndex) {
-    this.lastLogIndex = lastLogIndex;
-  }
-
-  public void setLastLogTerm(long lastLogTerm) {
-    this.lastLogTerm = lastLogTerm;
-  }
-
-  public long getLastLogIndex() {
-    return lastLogIndex;
-  }
-
-  public long getLastLogTerm() {
-    return lastLogTerm;
-  }
-
-  @SuppressWarnings("java:S1452") // is it possible not to use wildcard?
-  public abstract SnapshotInstaller<? extends Snapshot> getDefaultInstaller(RaftMember member);
-
-  /**
-   * Discard contents which is generated by logs whose index <= 'minIndex' if possible. This method
-   * is a best-effort one without guarantee that the result will absolutely not contain contents
-   * before 'minIndex'.
-   *
-   * @param minIndex
-   */
-  public void truncateBefore(long minIndex) {}
-
-  @Override
-  public String toString() {
-    return String.format("%d-%d", lastLogIndex, lastLogTerm);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/StableEntryManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/StableEntryManager.java
deleted file mode 100644
index c82597e336..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/StableEntryManager.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log;
-
-import org.apache.iotdb.cluster.log.manage.serializable.LogManagerMeta;
-
-import java.io.IOException;
-import java.util.List;
-
-public interface StableEntryManager {
-
-  List<Log> getAllEntriesAfterAppliedIndex();
-
-  List<Log> getAllEntriesAfterCommittedIndex();
-
-  void append(List<Log> entries, long maxHaveAppliedCommitIndex) throws IOException;
-
-  void flushLogBuffer();
-
-  void forceFlushLogBuffer();
-
-  void removeCompactedEntries(long index);
-
-  void setHardStateAndFlush(HardState state);
-
-  HardState getHardState();
-
-  LogManagerMeta getMeta();
-
-  /**
-   * @param startIndex (inclusive) the log start index
-   * @param endIndex (inclusive) the log end index
-   * @return the raft log which index between [startIndex, endIndex] or empty if not found
-   */
-  List<Log> getLogs(long startIndex, long endIndex);
-
-  void close();
-
-  /**
-   * clear all logs, this method mainly used for after a follower accept a snapshot, all the logs
-   * should be cleaned
-   */
-  void clearAllLogs(long commitIndex);
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java
deleted file mode 100644
index ebcc885564..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/AsyncDataLogApplier.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log.applier;
-
-import org.apache.iotdb.cluster.log.Log;
-import org.apache.iotdb.cluster.log.LogApplier;
-import org.apache.iotdb.cluster.log.logtypes.CloseFileLog;
-import org.apache.iotdb.cluster.log.logtypes.PhysicalPlanLog;
-import org.apache.iotdb.cluster.server.monitor.Timer;
-import org.apache.iotdb.cluster.server.monitor.Timer.Statistic;
-import org.apache.iotdb.commons.exception.IllegalPathException;
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertMultiTabletsPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowsPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateTimeSeriesPlan;
-import org.apache.iotdb.db.service.IoTDB;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-
-public class AsyncDataLogApplier implements LogApplier {
-
-  private static final Logger logger = LoggerFactory.getLogger(AsyncDataLogApplier.class);
-  private static final int CONCURRENT_CONSUMER_NUM = Runtime.getRuntime().availableProcessors();
-  private LogApplier embeddedApplier;
-  private Map<PartialPath, DataLogConsumer> consumerMap;
-  private ExecutorService consumerPool;
-  private String name;
-
-  // a plan that affects multiple sgs should wait until all consumers become empty to assure all
-  // previous logs are applied, such a plan will wait on this condition if it finds any
-  // consumers nonempty, and each time a consumer becomes empty, this will be notified so the
-  // waiting log can start another round of check
-  private final Object consumerEmptyCondition = new Object();
-
-  public AsyncDataLogApplier(LogApplier embeddedApplier, String name) {
-    this.embeddedApplier = embeddedApplier;
-    consumerMap = new HashMap<>();
-    consumerPool =
-        new ThreadPoolExecutor(
-            CONCURRENT_CONSUMER_NUM,
-            Integer.MAX_VALUE,
-            0,
-            TimeUnit.SECONDS,
-            new SynchronousQueue<>());
-    this.name = name;
-  }
-
-  @Override
-  public void close() {
-    consumerPool.shutdownNow();
-  }
-
-  @Override
-  // synchronized: when a log is draining consumers, avoid other threads adding more logs so that
-  // the consumers will never be drained
-  public synchronized void apply(Log log) {
-
-    PartialPath logKey;
-    try {
-      logKey = getLogKey(log);
-    } catch (StorageGroupNotSetException e) {
-      logger.debug("Exception occurred when applying {}", log, e);
-      log.setException(e);
-      log.setApplied(true);
-      return;
-    }
-
-    if (logKey != null) {
-      // this plan only affects one sg, so we can run it with other plans in parallel
-      long startTime = Statistic.RAFT_SENDER_COMMIT_TO_CONSUMER_LOGS.getOperationStartTime();
-      provideLogToConsumers(logKey, log);
-      Statistic.RAFT_SENDER_COMMIT_TO_CONSUMER_LOGS.calOperationCostTimeFromStart(startTime);
-      return;
-    }
-
-    logger.debug("{}: {} is waiting for consumers to drain", name, log);
-    long startTime = Statistic.RAFT_SENDER_COMMIT_EXCLUSIVE_LOGS.getOperationStartTime();
-    drainConsumers();
-    applyInternal(log);
-    Statistic.RAFT_SENDER_COMMIT_EXCLUSIVE_LOGS.calOperationCostTimeFromStart(startTime);
-  }
-
-  private PartialPath getLogKey(Log log) throws StorageGroupNotSetException {
-    // we can only apply some kinds of plans in parallel, for other logs, we must wait until all
-    // previous logs are applied, or the order of deletions and insertions may get wrong
-    if (log instanceof PhysicalPlanLog) {
-      PhysicalPlanLog physicalPlanLog = (PhysicalPlanLog) log;
-      PhysicalPlan plan = physicalPlanLog.getPlan();
-      // this plan only affects one sg, so we can run it with other plans in parallel
-      return getPlanKey(plan);
-    } else if (log instanceof CloseFileLog) {
-      CloseFileLog closeFileLog = (CloseFileLog) log;
-      PartialPath partialPath = null;
-      try {
-        partialPath = new PartialPath(closeFileLog.getStorageGroupName());
-      } catch (IllegalPathException e) {
-        // unreachable
-      }
-      return partialPath;
-    }
-    return null;
-  }
-
-  private PartialPath getPlanKey(PhysicalPlan plan) throws StorageGroupNotSetException {
-    return getPlanSG(plan);
-  }
-
-  /**
-   * We can sure that the storage group of all InsertTabletPlans in InsertMultiTabletsPlan are the
-   * same. this is done in {@link
-   * org.apache.iotdb.cluster.query.ClusterPlanRouter#splitAndRoutePlan(InsertMultiTabletsPlan)}
-   *
-   * <p>We can also sure that the storage group of all InsertRowPlans in InsertRowsPlan are the
-   * same. this is done in {@link
-   * org.apache.iotdb.cluster.query.ClusterPlanRouter#splitAndRoutePlan(InsertRowsPlan)}
-   *
-   * @return the sg that the plan belongs to
-   * @throws StorageGroupNotSetException if no sg found
-   */
-  private PartialPath getPlanSG(PhysicalPlan plan) throws StorageGroupNotSetException {
-    PartialPath sgPath = null;
-    if (plan instanceof InsertMultiTabletsPlan) {
-      PartialPath deviceId = ((InsertMultiTabletsPlan) plan).getFirstDeviceId();
-      sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(deviceId);
-    } else if (plan instanceof InsertRowsPlan) {
-      PartialPath path = ((InsertRowsPlan) plan).getFirstDeviceId();
-      sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
-    } else if (plan instanceof InsertPlan) {
-      PartialPath deviceId = ((InsertPlan) plan).getDevicePath();
-      sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(deviceId);
-    } else if (plan instanceof CreateTimeSeriesPlan) {
-      PartialPath path = ((CreateTimeSeriesPlan) plan).getPath();
-      sgPath = IoTDB.schemaProcessor.getBelongedStorageGroup(path);
-    }
-    return sgPath;
-  }
-
-  private void provideLogToConsumers(PartialPath planKey, Log log) {
-    if (Timer.ENABLE_INSTRUMENTING) {
-      log.setEnqueueTime(System.nanoTime());
-    }
-    consumerMap.computeIfAbsent(planKey, d -> new DataLogConsumer(name + "-" + d)).accept(log);
-  }
-
-  private void drainConsumers() {
-    synchronized (consumerEmptyCondition) {
-      while (!allConsumersEmpty()) {
-        // wait until all consumers empty
-        try {
-          consumerEmptyCondition.wait(5);
-        } catch (InterruptedException e) {
-          Thread.currentThread().interrupt();
-          return;
-        }
-      }
-    }
-  }
-
-  private boolean allConsumersEmpty() {
-    for (DataLogConsumer consumer : consumerMap.values()) {
-      if (!consumer.isEmpty()) {
-        if (logger.isDebugEnabled()) {
-          logger.debug("Consumer not empty: {}", consumer);
-        }
-        return false;
-      }
-    }
-    return true;
-  }
-
-  private void applyInternal(Log log) {
-    long startTime = Statistic.RAFT_SENDER_DATA_LOG_APPLY.getOperationStartTime();
-    embeddedApplier.apply(log);
-    if (Timer.ENABLE_INSTRUMENTING) {
-      Statistic.RAFT_SENDER_DATA_LOG_APPLY.calOperationCostTimeFromStart(startTime);
-    }
-  }
-
-  private class DataLogConsumer implements Runnable, Consumer<Log> {
-
-    private BlockingQueue<Log> logQueue = new ArrayBlockingQueue<>(4096);
-    private volatile long lastLogIndex;
-    private volatile long lastAppliedLogIndex;
-    private String name;
-    private Future<?> future;
-
-    public DataLogConsumer(String name) {
-      this.name = name;
-    }
-
-    public boolean isEmpty() {
-      return lastLogIndex == lastAppliedLogIndex;
-    }
-
-    @Override
-    public void run() {
-      // appliers have a higher priority than normal threads (like client threads and low
-      // priority background threads), to assure fast ingestion, but a lower priority than
-      // heartbeat threads
-      Thread.currentThread().setPriority(8);
-      Thread.currentThread().setName(name);
-      while (!Thread.currentThread().isInterrupted()) {
-        try {
-          Log log = logQueue.take();
-          Statistic.RAFT_SENDER_IN_APPLY_QUEUE.calOperationCostTimeFromStart(log.getEnqueueTime());
-          try {
-            applyInternal(log);
-          } finally {
-            lastAppliedLogIndex = log.getCurrLogIndex();
-            if (isEmpty()) {
-              synchronized (consumerEmptyCondition) {
-                consumerEmptyCondition.notifyAll();
-              }
-            }
-          }
-        } catch (InterruptedException e) {
-          Thread.currentThread().interrupt();
-          break;
-        } catch (Exception e) {
-          logger.error("DataLogConsumer exits", e);
-          return;
-        }
-      }
-      logger.info("DataLogConsumer exits");
-    }
-
-    @Override
-    public void accept(Log log) {
-      if (future == null || future.isCancelled() || future.isDone()) {
-        if (future != null) {
-          try {
-            future.get();
-          } catch (InterruptedException e) {
-            logger.error("Last applier thread exits unexpectedly", e);
-            Thread.currentThread().interrupt();
-          } catch (ExecutionException e) {
-            logger.error("Last applier thread exits unexpectedly", e);
-          }
-        }
-        future = consumerPool.submit(this);
-      }
-
-      try {
-        lastLogIndex = log.getCurrLogIndex();
-        logQueue.put(log);
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-        log.setException(e);
-        log.setApplied(true);
-        lastAppliedLogIndex = log.getCurrLogIndex();
-      }
-    }
-
-    @Override
-    public String toString() {
-      return "DataLogConsumer{"
-          + "logQueue="
-          + logQueue.size()
-          + ", lastLogIndex="
-          + lastLogIndex
-          + ", lastAppliedLogIndex="
-          + lastAppliedLogIndex
-          + ", name='"
-          + name
-          + '\''
-          + '}';
-    }
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java
deleted file mode 100644
index 996d083d77..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log.applier;
-
-import org.apache.iotdb.cluster.exception.CheckConsistencyException;
-import org.apache.iotdb.cluster.log.LogApplier;
-import org.apache.iotdb.cluster.metadata.MetaPuller;
-import org.apache.iotdb.cluster.query.ClusterPlanExecutor;
-import org.apache.iotdb.cluster.rpc.thrift.RaftNode;
-import org.apache.iotdb.cluster.server.member.DataGroupMember;
-import org.apache.iotdb.cluster.server.member.MetaGroupMember;
-import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.exception.MetadataException;
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.exception.BatchProcessException;
-import org.apache.iotdb.db.exception.StorageEngineException;
-import org.apache.iotdb.db.exception.metadata.PathNotExistException;
-import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.exception.metadata.template.UndefinedTemplateException;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.qp.executor.PlanExecutor;
-import org.apache.iotdb.db.qp.physical.BatchPlan;
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.utils.SchemaUtils;
-import org.apache.iotdb.rpc.TSStatusCode;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-
-/** BaseApplier use PlanExecutor to execute PhysicalPlans. */
-abstract class BaseApplier implements LogApplier {
-
-  private static final Logger logger = LoggerFactory.getLogger(BaseApplier.class);
-
-  MetaGroupMember metaGroupMember;
-  private PlanExecutor queryExecutor;
-
-  BaseApplier(MetaGroupMember metaGroupMember) {
-    this.metaGroupMember = metaGroupMember;
-  }
-
-  /**
-   * @param plan
-   * @param dataGroupMember the data group member that is applying the log, null if the log is
-   *     applied by a meta group member
-   * @throws QueryProcessException
-   * @throws StorageGroupNotSetException
-   * @throws StorageEngineException
-   */
-  void applyPhysicalPlan(PhysicalPlan plan, DataGroupMember dataGroupMember)
-      throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
-    if (plan instanceof InsertPlan) {
-      processPlanWithTolerance((InsertPlan) plan, dataGroupMember);
-    } else if (plan != null && !plan.isQuery()) {
-      try {
-        getQueryExecutor().processNonQuery(plan);
-      } catch (BatchProcessException e) {
-        handleBatchProcessException(e, plan);
-      } catch (QueryProcessException e) {
-        if (e.getCause() instanceof StorageGroupNotSetException
-            || e.getCause() instanceof UndefinedTemplateException) {
-          executeAfterSync(plan);
-        } else {
-          throw e;
-        }
-      } catch (StorageGroupNotSetException e) {
-        executeAfterSync(plan);
-      }
-    } else if (plan != null) {
-      logger.error("Unsupported physical plan: {}", plan);
-    }
-  }
-
-  private void handleBatchProcessException(
-      BatchProcessException e, InsertPlan plan, DataGroupMember dataGroupMember)
-      throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
-    if (IoTDBDescriptor.getInstance().getConfig().isEnablePartition()) {
-      TSStatus[] failingStatus = e.getFailingStatus();
-      for (int i = 0; i < failingStatus.length; i++) {
-        TSStatus status = failingStatus[i];
-        // skip succeeded plans in later execution
-        if (status != null
-            && status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
-            && plan instanceof BatchPlan) {
-          ((BatchPlan) plan).setIsExecuted(i);
-        }
-      }
-
-      boolean needRetry = false, hasError = false;
-      for (int i = 0, failingStatusLength = failingStatus.length; i < failingStatusLength; i++) {
-        TSStatus status = failingStatus[i];
-        if (status != null) {
-          if (status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()
-              && plan instanceof BatchPlan) {
-            ((BatchPlan) plan).unsetIsExecuted(i);
-            needRetry = true;
-          } else if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-            hasError = true;
-          }
-        }
-      }
-      if (hasError) {
-        throw e;
-      }
-      if (needRetry) {
-        pullTimeseriesSchema(plan, dataGroupMember.getHeader());
-        plan.recoverFromFailure();
-        getQueryExecutor().processNonQuery(plan);
-      }
-    } else {
-      throw e;
-    }
-  }
-
-  private void handleBatchProcessException(BatchProcessException e, PhysicalPlan plan)
-      throws QueryProcessException, StorageEngineException, StorageGroupNotSetException {
-    TSStatus[] failingStatus = e.getFailingStatus();
-    boolean needThrow = false;
-    for (int i = 0; i < failingStatus.length; i++) {
-      TSStatus status = failingStatus[i];
-      // skip succeeded plans in later execution
-      if (status != null
-          && status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
-          && plan instanceof BatchPlan) {
-        ((BatchPlan) plan).setIsExecuted(i);
-      }
-
-      if (plan instanceof DeleteTimeSeriesPlan) {
-        if (status != null && status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-          if (status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()) {
-            logger.info("{} doesn't exist, it may has been deleted.", plan.getPaths().get(i));
-          } else {
-            needThrow = true;
-          }
-        }
-      }
-    }
-    boolean needRetry = false;
-    for (int i = 0, failingStatusLength = failingStatus.length; i < failingStatusLength; i++) {
-      TSStatus status = failingStatus[i];
-      if (status != null
-          && (status.getCode() == TSStatusCode.STORAGE_GROUP_NOT_EXIST.getStatusCode()
-              || status.getCode() == TSStatusCode.UNDEFINED_TEMPLATE.getStatusCode())
-          && plan instanceof BatchPlan) {
-        ((BatchPlan) plan).unsetIsExecuted(i);
-        needRetry = true;
-      }
-    }
-    if (needRetry) {
-      executeAfterSync(plan);
-      return;
-    }
-
-    if (!(plan instanceof DeleteTimeSeriesPlan) || needThrow) {
-      throw e;
-    }
-  }
-
-  private void executeAfterSync(PhysicalPlan plan)
-      throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
-    try {
-      metaGroupMember.syncLeaderWithConsistencyCheck(true);
-    } catch (CheckConsistencyException ce) {
-      throw new QueryProcessException(ce.getMessage());
-    }
-    getQueryExecutor().processNonQuery(plan);
-  }
-
-  /**
-   * @param plan
-   * @param dataGroupMember the data group member that is applying the log, null if the log is
-   *     applied by a meta group member
-   * @throws QueryProcessException
-   * @throws StorageGroupNotSetException
-   * @throws StorageEngineException
-   */
-  private void processPlanWithTolerance(InsertPlan plan, DataGroupMember dataGroupMember)
-      throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
-    try {
-      getQueryExecutor().processNonQuery(plan);
-    } catch (BatchProcessException e) {
-      handleBatchProcessException(e, plan, dataGroupMember);
-    } catch (QueryProcessException | StorageGroupNotSetException | StorageEngineException e) {
-      if (IoTDBDescriptor.getInstance().getConfig().isEnablePartition()) {
-        // check if this is caused by metadata missing, if so, pull metadata and retry
-        Throwable metaMissingException = SchemaUtils.findMetaMissingException(e);
-        boolean causedByPathNotExist = metaMissingException instanceof PathNotExistException;
-
-        if (causedByPathNotExist) {
-          if (logger.isDebugEnabled()) {
-            logger.debug(
-                "Timeseries is not found locally[{}], try pulling it from another group: {}",
-                metaGroupMember.getName(),
-                e.getCause().getMessage());
-          }
-          pullTimeseriesSchema(plan, dataGroupMember.getHeader());
-          plan.recoverFromFailure();
-          getQueryExecutor().processNonQuery(plan);
-        } else {
-          throw e;
-        }
-      } else {
-        throw e;
-      }
-    }
-  }
-
-  /**
-   * @param plan
-   * @param ignoredGroup do not pull schema from the group to avoid backward dependency
-   * @throws QueryProcessException
-   */
-  private void pullTimeseriesSchema(InsertPlan plan, RaftNode ignoredGroup)
-      throws QueryProcessException {
-    try {
-      if (plan instanceof BatchPlan) {
-        MetaPuller.getInstance()
-            .pullTimeSeriesSchemas(((BatchPlan) plan).getPrefixPaths(), ignoredGroup);
-      } else {
-        PartialPath path = plan.getDevicePath();
-        MetaPuller.getInstance()
-            .pullTimeSeriesSchemas(Collections.singletonList(path), ignoredGroup);
-      }
-    } catch (MetadataException e1) {
-      throw new QueryProcessException(e1);
-    }
-  }
-
-  private PlanExecutor getQueryExecutor() throws QueryProcessException {
-    if (queryExecutor == null) {
-      queryExecutor = new ClusterPlanExecutor(metaGroupMember);
-    }
-    return queryExecutor;
-  }
-
-  @TestOnly
-  public void setQueryExecutor(PlanExecutor queryExecutor) {
-    this.queryExecutor = queryExecutor;
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
deleted file mode 100644
index b2f138f71e..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.cluster.log.applier;
-
-import org.apache.iotdb.cluster.ClusterIoTDB;
-import org.apache.iotdb.cluster.exception.CheckConsistencyException;
-import org.apache.iotdb.cluster.log.Log;
-import org.apache.iotdb.cluster.log.logtypes.AddNodeLog;
-import org.apache.iotdb.cluster.log.logtypes.CloseFileLog;
-import org.apache.iotdb.cluster.log.logtypes.PhysicalPlanLog;
-import org.apache.iotdb.cluster.log.logtypes.RemoveNodeLog;
-import org.apache.iotdb.cluster.server.member.DataGroupMember;
-import org.apache.iotdb.cluster.server.member.MetaGroupMember;
-import org.apache.iotdb.cluster.utils.IOUtils;
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.db.engine.StorageEngine;
-import org.apache.iotdb.db.exception.StorageEngineException;
-import org.apache.iotdb.db.exception.metadata.PathNotExistException;
-import org.apache.iotdb.db.exception.metadata.StorageGroupNotSetException;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.qp.physical.PhysicalPlan;
-import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertMultiTabletsPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowsPlan;
-import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
-import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
-import org.apache.iotdb.db.service.IoTDB;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * DataLogApplier applies logs like data insertion/deletion/update and timeseries creation to IoTDB.
- */
-public class DataLogApplier extends BaseApplier {
-
-  private static final Logger logger = LoggerFactory.getLogger(DataLogApplier.class);
-
-  protected DataGroupMember dataGroupMember;
-
-  public DataLogApplier(MetaGroupMember metaGroupMember, DataGroupMember dataGroupMember) {
-    super(metaGroupMember);
-    this.dataGroupMember = dataGroupMember;
-  }
-
-  @Override
-  public void apply(Log log) {
-    logger.debug("DataMember [{}] start applying Log {}", dataGroupMember.getName(), log);
-
-    try {
-      if (log instanceof AddNodeLog) {
-        ClusterIoTDB.getInstance()
-            .getDataGroupEngine()
-            .preAddNodeForDataGroup((AddNodeLog) log, dataGroupMember);
-        dataGroupMember.setAndSaveLastAppliedPartitionTableVersion(
-            ((AddNodeLog) log).getMetaLogIndex());
-      } else if (log instanceof RemoveNodeLog) {
-        ClusterIoTDB.getInstance()
-            .getDataGroupEngine()
-            .preRemoveNodeForDataGroup((RemoveNodeLog) log, dataGroupMember);
-        dataGroupMember.setAndSaveLastAppliedPartitionTableVersion(
-            ((RemoveNodeLog) log).getMetaLogIndex());
-      } else if (log instanceof PhysicalPlanLog) {
-        PhysicalPlanLog physicalPlanLog = (PhysicalPlanLog) log;
-        PhysicalPlan plan = physicalPlanLog.getPlan();
-        applyPhysicalPlan(plan);
-      } else if (log instanceof CloseFileLog) {
-        CloseFileLog closeFileLog = ((CloseFileLog) log);
-        StorageEngine.getInstance()
-            .closeStorageGroupProcessor(
-                new PartialPath(closeFileLog.getStorageGroupName()),
-                closeFileLog.getPartitionId(),
-                closeFileLog.isSeq(),
-                false);
-      } else {
-        logger.error("Unsupported log: {}", log);
-      }
-    } catch (Exception e) {
-      Throwable rootCause = IOUtils.getRootCause(e);
-      if (!(rootCause instanceof PathNotExistException)) {
-        logger.debug("Exception occurred when applying {}", log, e);
-      }
-      log.setException(e);
-    } finally {
-      log.setApplied(true);
-    }
-  }
-
-  public void applyPhysicalPlan(PhysicalPlan plan)
-      throws QueryProcessException, StorageGroupNotSetException, StorageEngineException {
-    if (plan instanceof DeletePlan) {
-      ((DeletePlan) plan).setPartitionFilter(dataGroupMember.getTimePartitionFilter());
-    } else if (plan instanceof DeleteTimeSeriesPlan) {
-      ((DeleteTimeSeriesPlan) plan).setPartitionFilter(dataGroupMember.getTimePartitionFilter());
-    }
-    if (plan instanceof InsertMultiTabletsPlan) {
-      applyInsert((InsertMultiTabletsPlan) plan);
-    } else if (plan instanceof InsertRowsPlan) {
-      applyInsert((InsertRowsPlan) plan);
-    } else if (plan instanceof InsertPlan) {
-      applyInsert((InsertPlan) plan);
-    } else {
-      applyPhysicalPlan(plan, dataGroupMember);
-    }
-  }
-
-  private void applyInsert(InsertMultiTabletsPlan plan)
-      throws StorageGroupNotSetException, QueryProcessException, StorageEngineException {
-    boolean hasSync = false;
-    for (InsertTabletPlan insertTabletPlan : plan.getInsertTabletPlanList()) {
-      try {
-        IoTDB.schemaProcessor.getBelongedStorageGroup(insertTabletPlan.getDevicePath());
-      } catch (StorageGroupNotSetException e) {
-        try {
-          if (!hasSync) {
-            metaGroupMember.syncLeaderWithConsistencyCheck(true);
-            hasSync = true;
-          } else {
-            throw new StorageEngineException(e.getMessage());
-          }
-        } catch (CheckConsistencyException ce) {
-          throw new QueryProcessException(ce.getMessage());
-        }
-      }
-    }
-    applyPhysicalPlan(plan, dataGroupMember);
-  }
-
-  private void applyInsert(InsertRowsPlan plan)
-      throws StorageGroupNotSetException, QueryProcessException, StorageEngineException {
-    boolean hasSync = false;
-    for (InsertRowPlan insertRowPlan : plan.getInsertRowPlanList()) {
-      try {
-        IoTDB.schemaProcessor.getBelongedStorageGroup(insertRowPlan.getDevicePath());
-      } catch (StorageGroupNotSetException e) {
-        try {
-          if (!hasSync) {
-            metaGroupMember.syncLeaderWithConsistencyCheck(true);
-            hasSync = true;
-          } else {
-            throw new StorageEngineException(e.getMessage());
-          }
-        } catch (CheckConsistencyException ce) {
-          throw new QueryProcessException(ce.getMessage());
-        }
-      }
-    }
-    applyPhysicalPlan(plan, dataGroupMember);
-  }
-
-  private void applyInsert(InsertPlan plan)
-      throws StorageGroupNotSetException, QueryProcessException, StorageEngineException {
-    try {
-      IoTDB.schemaProcessor.getBelongedStorageGroup(plan.getDevicePath());
-    } catch (StorageGroupNotSetException e) {
-      // the sg may not exist because the node does not catch up with the leader, retry after
-      // synchronization
-      try {
-        metaGroupMember.syncLeaderWithConsistencyCheck(true);
-      } catch (CheckConsistencyException ce) {
-        throw new QueryProcessException(ce.getMessage());
-      }
-    }
-    applyPhysicalPlan(plan, dataGroupMember);
-  }
-}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/MetaLogApplier.java b/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/MetaLogApplier.java
deleted file mode 100644
index 1c501f8f0f..0000000000
--- a/cluster/src/main/java/org/apache/iotdb/cluster/log/applier/MetaLogApplier.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
... 61771 lines suppressed ...