[IOTDB-1639] Refactoring the cluster class structure to make it consistent with the...
authorPotato <TXYPotato@gmail.com>
Mon, 8 Nov 2021 12:50:20 +0000 (20:50 +0800)
committerGitHub <noreply@github.com>
Mon, 8 Nov 2021 12:50:20 +0000 (20:50 +0800)
commit278fcf3f5fd4cee8dca4d24dc11c6e2fda0270a6
treec0f57094dd88830c951ea2ac3d9decfad68c13d8
parenta1e84d09374153668c2eca02ca2867776e6f7cd2
[IOTDB-1639] Refactoring the cluster class structure to make it consistent with the server module (#4079)

1. Split Thrift RPC service and RPC implementation to make the logic here clear. For detail, refer the discuss: [Cluster-refactor] About refine classes name ยท Issue #3881

2. Weaken the role of MetaGroupMember. metaGroupMember is just an engine for serving meta raft group, which should not control the whole server too deep. Many fields (like coordinator, etc.) are extracted to ClusterIoTDB (renamed from ClusterMain), and ClusterIoTDB is responsible for creating them.

3. Similar with the relationship between StorageEngine and StorageProcessor in the server module, DataGroupMember can be considered as StorageProcessor, we created a DataGroupEngine to control them.

4. Refactored thrift client class hierarchy to reduce the duplication and imported Apache commons-pool the help manager thrift client object.

5. Write related unit tests for new adding code. For existing code, fixed all failed unit test cases

6. Performance verify. The read and write performance of the two branches(cluster-/master) is basically the same.
209 files changed:
.gitignore
cli/pom.xml
cluster/pom.xml
cluster/src/assembly/resources/conf/iotdb-cluster.properties
cluster/src/assembly/resources/sbin/add-node.bat
cluster/src/assembly/resources/sbin/add-node.sh
cluster/src/assembly/resources/sbin/remove-node.bat
cluster/src/assembly/resources/sbin/remove-node.sh
cluster/src/assembly/resources/sbin/start-node.bat
cluster/src/assembly/resources/sbin/start-node.sh
cluster/src/assembly/resources/sbin/stop-node.bat
cluster/src/assembly/resources/sbin/stop-node.sh
cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDB.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/ClusterIoTDBMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/BaseFactory.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/client/ClientCategory.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/client/ClientManager.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/client/ClientPoolFactory.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/client/DataClientProvider.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/IClientManager.java [moved from cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientFactory.java with 65% similarity]
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncBaseFactory.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncClientFactory.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncClientPool.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncDataClient.java
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncDataHeartbeatClient.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncMetaClient.java
cluster/src/main/java/org/apache/iotdb/cluster/client/async/AsyncMetaHeartbeatClient.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientAdaptor.java
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncClientPool.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataClient.java
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncDataHeartbeatClient.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncMetaClient.java
cluster/src/main/java/org/apache/iotdb/cluster/client/sync/SyncMetaHeartbeatClient.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConfig.java
cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConstant.java
cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterDescriptor.java
cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java
cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java
cluster/src/main/java/org/apache/iotdb/cluster/log/applier/DataLogApplier.java
cluster/src/main/java/org/apache/iotdb/cluster/log/catchup/LogCatchUpTask.java
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/FilePartitionedSnapshotLogManager.java
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/PartitionedSnapshotLogManager.java
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/RaftLogManager.java
cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshot.java
cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshot.java
cluster/src/main/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTask.java
cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
cluster/src/main/java/org/apache/iotdb/cluster/partition/PartitionGroup.java
cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregator.java
cluster/src/main/java/org/apache/iotdb/cluster/query/fill/ClusterPreviousFill.java
cluster/src/main/java/org/apache/iotdb/cluster/query/groupby/RemoteGroupByExecutor.java
cluster/src/main/java/org/apache/iotdb/cluster/query/last/ClusterLastQueryExecutor.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/DataSourceInfo.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/RemoteSeriesReaderByTimestamp.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/RemoteSimpleSeriesReader.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/mult/MultDataSourceInfo.java
cluster/src/main/java/org/apache/iotdb/cluster/query/reader/mult/RemoteMultSeriesReader.java
cluster/src/main/java/org/apache/iotdb/cluster/server/ClientServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/ClusterRPCService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/ClusterRPCServiceMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/ClusterTSServiceImpl.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/DataClusterServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/MetaClusterServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/PullSnapshotHintService.java
cluster/src/main/java/org/apache/iotdb/cluster/server/RaftServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/Response.java
cluster/src/main/java/org/apache/iotdb/cluster/server/StoppedMemberManager.java
cluster/src/main/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServer.java
cluster/src/main/java/org/apache/iotdb/cluster/server/handlers/caller/AppendNodeEntryHandler.java
cluster/src/main/java/org/apache/iotdb/cluster/server/handlers/caller/HeartbeatHandler.java
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/DataHeartbeatServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/HeartbeatServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/HeartbeatThread.java
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/MetaHeartbeatServer.java [deleted file]
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/MetaHeartbeatThread.java
cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMember.java
cluster/src/main/java/org/apache/iotdb/cluster/server/member/DataGroupMemberMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMemberMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/AbstractDataRaftService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/AbstractMetaRaftService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/AbstractRaftService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/DataRaftHeartBeatService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/DataRaftHeartBeatServiceMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/DataRaftService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/DataRaftServiceMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/MetaRaftHeartBeatService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/MetaRaftHeartBeatServiceMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/MetaRaftService.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/MetaRaftServiceMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/raft/RaftServiceHandler.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataGroupEngine.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataGroupEngineMBean.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataGroupServiceImpls.java [new file with mode: 0644]
cluster/src/main/java/org/apache/iotdb/cluster/server/service/MetaAsyncService.java
cluster/src/main/java/org/apache/iotdb/cluster/server/service/MetaSyncService.java
cluster/src/main/java/org/apache/iotdb/cluster/utils/ClientUtils.java
cluster/src/main/java/org/apache/iotdb/cluster/utils/ClusterUtils.java
cluster/src/main/java/org/apache/iotdb/cluster/utils/nodetool/ClusterMonitor.java
cluster/src/test/java/org/apache/iotdb/cluster/client/BaseClientTest.java [new file with mode: 0644]
cluster/src/test/java/org/apache/iotdb/cluster/client/ClientManagerTest.java [new file with mode: 0644]
cluster/src/test/java/org/apache/iotdb/cluster/client/ClientPoolFactoryTest.java [new file with mode: 0644]
cluster/src/test/java/org/apache/iotdb/cluster/client/DataClientProviderTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/MockClientManager.java [new file with mode: 0644]
cluster/src/test/java/org/apache/iotdb/cluster/client/async/AsyncClientPoolTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/async/AsyncDataClientTest.java
cluster/src/test/java/org/apache/iotdb/cluster/client/async/AsyncDataHeartbeatClientTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/async/AsyncMetaClientTest.java
cluster/src/test/java/org/apache/iotdb/cluster/client/async/AsyncMetaHeartbeatClientTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/sync/SyncClientPoolTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/sync/SyncDataClientTest.java
cluster/src/test/java/org/apache/iotdb/cluster/client/sync/SyncDataHeartbeatClientTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/client/sync/SyncMetaClientTest.java
cluster/src/test/java/org/apache/iotdb/cluster/client/sync/SyncMetaHeartbeatClientTest.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncClientFactory.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncDataClient.java
cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncMetaClient.java
cluster/src/test/java/org/apache/iotdb/cluster/common/TestSnapshot.java
cluster/src/test/java/org/apache/iotdb/cluster/common/TestSyncClientFactory.java [deleted file]
cluster/src/test/java/org/apache/iotdb/cluster/common/TestUtils.java
cluster/src/test/java/org/apache/iotdb/cluster/integration/BaseSingleNodeTest.java
cluster/src/test/java/org/apache/iotdb/cluster/integration/SingleNodeTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/LogParserTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/applier/DataLogApplierTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/applier/MetaLogApplierTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/catchup/CatchUpTaskTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/catchup/LogCatchUpTaskTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/catchup/SnapshotCatchUpTaskTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/logtypes/SerializeLogTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/DataSnapshotTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/MetaSimpleSnapshotTest.java
cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
cluster/src/test/java/org/apache/iotdb/cluster/partition/MManagerWhiteBox.java
cluster/src/test/java/org/apache/iotdb/cluster/partition/SlotPartitionTableTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/manage/QueryCoordinatorTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/reader/DatasourceInfoTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/reader/RemoteSeriesReaderByTimestampTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/reader/RemoteSimpleSeriesReaderTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/reader/mult/AssignPathManagedMergeReaderTest.java
cluster/src/test/java/org/apache/iotdb/cluster/query/reader/mult/RemoteMultSeriesReaderTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/clusterinfo/ClusterInfoServiceImplTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/handlers/caller/AppendGroupEntryHandlerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/handlers/caller/AppendNodeEntryHandlerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/handlers/caller/ElectionHandlerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/handlers/caller/HeartbeatHandlerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/handlers/caller/LogCatchUpHandlerTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/heartbeat/DataHeartbeatThreadTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/heartbeat/HeartbeatThreadTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/heartbeat/MetaHeartbeatThreadTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/member/BaseMember.java
cluster/src/test/java/org/apache/iotdb/cluster/server/member/DataGroupMemberTest.java
cluster/src/test/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberTest.java
cluster/src/test/resources/node1conf/iotdb-engine.properties
cluster/src/test/resources/node2conf/iotdb-engine.properties
cluster/src/test/resources/node3conf/iotdb-engine.properties
docs/UserGuide/Appendix/Status-Codes.md
docs/zh/UserGuide/Appendix/Status-Codes.md
flink-iotdb-connector/pom.xml
jdbc/pom.xml
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
pom.xml
server/src/assembly/resources/conf/iotdb-engine.properties
server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBDaemonThreadFactory.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/IoTDBThreadPoolFactory.java
server/src/main/java/org/apache/iotdb/db/concurrent/ThreadName.java
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/IThreadPoolMBean.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedScheduledExecutorService.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedScheduledExecutorServiceMBean.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedSingleThreadExecutorService.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedSingleThreadExecutorServiceMBean.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedSingleThreadScheduledExecutor.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedSingleThreadScheduledExecutorMBean.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedThreadPoolExecutor.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/concurrent/threadpool/WrappedThreadPoolExecutorMBean.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfigCheck.java
server/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
server/src/main/java/org/apache/iotdb/db/cq/ContinuousQueryService.java
server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionTaskManager.java
server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/inplace/manage/MergeManager.java
server/src/main/java/org/apache/iotdb/db/engine/flush/FlushManager.java
server/src/main/java/org/apache/iotdb/db/exception/ConfigurationException.java [new file with mode: 0644]
server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
server/src/main/java/org/apache/iotdb/db/rescon/AbstractPoolManager.java
server/src/main/java/org/apache/iotdb/db/service/IoTDB.java
server/src/main/java/org/apache/iotdb/db/service/MetricsService.java
server/src/main/java/org/apache/iotdb/db/service/RPCService.java
server/src/main/java/org/apache/iotdb/db/service/RPCServiceThriftHandler.java
server/src/main/java/org/apache/iotdb/db/service/ServiceType.java
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
server/src/main/java/org/apache/iotdb/db/service/UpgradeSevice.java
server/src/main/java/org/apache/iotdb/db/service/thrift/ThriftService.java
server/src/main/java/org/apache/iotdb/db/service/thrift/ThriftServiceThread.java
server/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServerManager.java
server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
server/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
server/src/test/java/org/apache/iotdb/db/integration/IoTDBCheckConfigIT.java
service-rpc/src/main/java/org/apache/iotdb/rpc/RpcTransportFactory.java
service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
session/src/main/java/org/apache/iotdb/session/SessionConnection.java