You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yo...@apache.org on 2023/01/17 15:51:22 UTC
[iotdb] branch Fix-configuration-error updated: Revert "[IOTDB-5415] Move parameters into correct ConfigClass (#8867)"
This is an automated email from the ASF dual-hosted git repository.
yongzao pushed a commit to branch Fix-configuration-error
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/Fix-configuration-error by this push:
new 951dc15937 Revert "[IOTDB-5415] Move parameters into correct ConfigClass (#8867)"
951dc15937 is described below
commit 951dc15937b289f715adc1ec8b5fbd3d0bdfb582
Author: YongzaoDan <53...@qq.com>
AuthorDate: Tue Jan 17 23:51:04 2023 +0800
Revert "[IOTDB-5415] Move parameters into correct ConfigClass (#8867)"
This reverts commit 5ad67dedf02a8c755e87561cb8a80bcfe4c32a07.
---
.../resources/conf/iotdb-confignode.properties | 8 +-
.../iotdb/confignode/conf/ConfigNodeConfig.java | 1066 ++++++-
.../confignode/conf/ConfigNodeDescriptor.java | 748 ++++-
.../confignode/conf/ConfigNodeRemoveCheck.java | 2 +-
.../confignode/conf/ConfigNodeStartupCheck.java | 74 +-
.../confignode/conf/SystemPropertiesUtils.java | 71 +-
.../statemachine/ConfigNodeRegionStateMachine.java | 26 +-
.../confignode/manager/ClusterSchemaManager.java | 21 +-
.../iotdb/confignode/manager/ConfigManager.java | 66 +-
.../iotdb/confignode/manager/ConsensusManager.java | 82 +-
.../iotdb/confignode/manager/ProcedureManager.java | 17 +-
.../confignode/manager/RetryFailedTasksThread.java | 7 +-
.../iotdb/confignode/manager/UDFManager.java | 6 +-
.../iotdb/confignode/manager/load/LoadManager.java | 7 +-
.../manager/load/balancer/RouteBalancer.java | 21 +-
.../partition/GreedyPartitionAllocator.java | 10 +-
.../balancer/router/leader/ILeaderBalancer.java | 3 +
.../manager/node/ClusterNodeStartUtils.java | 4 +-
.../iotdb/confignode/manager/node/NodeManager.java | 86 +-
.../manager/partition/PartitionManager.java | 27 +-
.../partition}/RegionGroupExtensionPolicy.java | 2 +-
.../iotdb/confignode/persistence/AuthorInfo.java | 2 +-
.../confignode/persistence/ProcedureInfo.java | 2 +-
.../iotdb/confignode/persistence/TriggerInfo.java | 9 +-
.../iotdb/confignode/persistence/UDFInfo.java | 9 +-
.../confignode/persistence/node/NodeInfo.java | 6 +-
.../procedure/env/ConfigNodeProcedureEnv.java | 7 +-
.../procedure/env/DataNodeRemoveHandler.java | 14 +-
.../procedure/store/ConfigProcedureStore.java | 2 +-
.../confignode/procedure/store/ProcedureStore.java | 3 +-
.../iotdb/confignode/service/ConfigNode.java | 56 +-
.../service/thrift/ConfigNodeRPCService.java | 10 +-
.../thrift/ConfigNodeRPCServiceProcessor.java | 11 +-
.../src/test/resources/iotdb-confignode.properties | 21 -
.../iotdb/consensus/ratis/RatisConsensus.java | 2 +-
.../util/TSFileConfigUtilCompletenessTest.java | 3 +-
.../iotdb/influxdb/session/InfluxDBSession.java | 2 +-
integration-test/import-control.xml | 3 +-
.../apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java | 8 +-
.../org/apache/iotdb/db/it/IoTDBRestartIT.java | 23 +-
.../iotdb/session/it/IoTDBSessionComplexIT.java | 6 +-
.../iotdb/session/it/IoTDBSessionSimpleIT.java | 8 +-
.../iotdb/db/integration/IoTDBCheckConfigIT.java | 2 +-
.../iotdb/db/integration/IoTDBCompactionIT.java | 2 +-
.../integration/IoTDBCompactionWithIDTableIT.java | 6 +-
.../iotdb/db/integration/IoTDBMaxTimeQueryIT.java | 19 +-
.../IoTDBMultiOverlappedChunkInUnseqIT.java | 4 +-
.../db/integration/IoTDBMultiOverlappedPageIT.java | 4 +-
.../iotdb/db/integration/IoTDBMultiSeriesIT.java | 2 +-
.../db/integration/IoTDBNewTsFileCompactionIT.java | 155 +-
.../db/integration/IoTDBQueryWithIDTableIT.java | 7 +-
.../db/integration/IoTDBRewriteTsFileToolIT.java | 2 +-
.../db/integration/IoTDBRpcCompressionIT.java | 4 +-
.../db/integration/IoTDBSessionTimeoutIT.java | 4 +-
.../integration/IoTDBSizeTieredCompactionIT.java | 69 +-
.../iotdb/db/integration/IoTDBTimePartitionIT.java | 2 +-
.../apache/iotdb/db/integration/IoTDBTtlIT.java | 4 +-
.../db/integration/env/StandaloneEnvConfig.java | 46 +-
.../db/integration/sync/IoTDBSyncReceiverIT.java | 21 +-
.../sync/IoTDBSyncReceiverLoaderIT.java | 21 +-
.../db/integration/sync/IoTDBSyncSenderIT.java | 19 +-
.../IoTDBDeletionVersionAdaptionIT.java | 2 +-
.../session/IoTDBSessionAlignedABDeviceIT.java | 2 +-
.../session/IoTDBSessionAlignedAggregationIT.java | 2 +-
.../IoTDBSessionAlignedAggregationWithUnSeqIT.java | 2 +-
.../resources/conf/iotdb-common.properties | 38 +-
.../commons/auth/authorizer/BasicAuthorizer.java | 4 +-
.../auth/authorizer/LocalFileAuthorizer.java | 2 +-
.../commons/auth/authorizer/OpenIdAuthorizer.java | 2 +-
.../iotdb/commons/auth/user/BasicUserManager.java | 8 +-
.../iotdb/commons/client/ClientPoolFactory.java | 60 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 2538 ++---------------
.../iotdb/commons/conf/CommonDescriptor.java | 1901 +------------
.../apache/iotdb/commons/conf/IoTDBConstant.java | 4 -
.../apache/iotdb/commons/conf/PropertiesUtils.java | 114 -
.../commons/consensus/ConsensusProtocolClass.java | 46 -
.../commons/enums/HandleSystemErrorStrategy.java | 2 +-
.../iotdb/commons/file/SystemFileFactory.java | 4 +-
.../loadbalance/LeaderDistributionPolicy.java | 45 -
.../iotdb/commons/sync/utils/SyncPathUtil.java | 6 +-
.../org/apache/iotdb/commons/utils/AuthUtils.java | 12 +-
.../schemaregion/rocksdb/RSchemaConfLoader.java | 6 +-
.../rocksdb/RSchemaReadWriteHandler.java | 5 +-
.../schemaregion/rocksdb/RSchemaRegion.java | 2 +-
.../rocksdb/mnode/RStorageGroupMNode.java | 2 +-
.../metadata/tagSchemaRegion/TagSchemaRegion.java | 2 +-
.../tagSchemaRegion/TagSchemaRegionTest.java | 20 +-
.../idtable/IDTableWithDeviceIDListImplTest.java | 20 +-
.../tagIndex/TagTagInvertedIndexTest.java | 2 +-
.../resources/conf/iotdb-datanode.properties | 5 +-
.../org/apache/iotdb/db/audit/AuditLogger.java | 2 +-
.../org/apache/iotdb/db/auth/AuthorityChecker.java | 3 +-
.../apache/iotdb/db/auth/BasicAuthorityCache.java | 13 +-
.../apache/iotdb/db/client/ConfigNodeClient.java | 5 +-
.../org/apache/iotdb/db/client/ConfigNodeInfo.java | 2 +-
.../iotdb/db/client/DataNodeClientPoolFactory.java | 22 +-
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 2926 +++++++++++++++++---
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 2035 +++++++++++---
.../org/apache/iotdb/db/conf/IoTDBStartCheck.java | 94 +-
.../iotdb/db/conf/adapter/CompressionRatio.java | 4 +-
.../db/conf/directories/DirectoryManager.java | 20 +-
.../iotdb/db/conf/directories/FolderManager.java | 4 +-
.../directories/strategy/DirectoryStrategy.java | 2 +-
.../db/consensus/DataRegionConsensusImpl.java | 93 +-
.../db/consensus/SchemaRegionConsensusImpl.java | 64 +-
.../statemachine/DataRegionStateMachine.java | 6 +-
.../statemachine/SchemaRegionStateMachine.java | 2 +-
.../org/apache/iotdb/db/engine/StorageEngine.java | 37 +-
.../iotdb/db/engine/cache/BloomFilterCache.java | 10 +-
.../apache/iotdb/db/engine/cache/ChunkCache.java | 6 +-
.../db/engine/cache/TimeSeriesMetadataCache.java | 6 +-
.../performer/impl/FastCompactionPerformer.java | 2 +-
.../impl/ReadChunkCompactionPerformer.java | 5 +-
.../impl/ReadPointCompactionPerformer.java | 2 +-
.../execute/recover/CompactionRecoverTask.java | 4 +-
.../execute/task/CrossSpaceCompactionTask.java | 2 +-
.../execute/task/InnerSpaceCompactionTask.java | 2 +-
.../readchunk/AlignedSeriesCompactionExecutor.java | 4 +-
.../readchunk/SingleSeriesCompactionExecutor.java | 9 +-
.../execute/utils/log/TsFileIdentifier.java | 2 +-
.../utils/writer/AbstractCompactionWriter.java | 10 +-
.../writer/AbstractCrossCompactionWriter.java | 7 +-
.../writer/AbstractInnerCompactionWriter.java | 7 +-
.../compaction/schedule/CompactionScheduler.java | 8 +-
.../compaction/schedule/CompactionTaskManager.java | 12 +-
.../DefaultCompactionTaskComparatorImpl.java | 2 +-
.../estimator/InplaceCompactionEstimator.java | 2 +-
.../ReadPointCrossCompactionEstimator.java | 2 +-
.../impl/RewriteCrossSpaceCompactionSelector.java | 14 +-
.../impl/SizeTieredCompactionSelector.java | 2 +-
.../apache/iotdb/db/engine/flush/FlushManager.java | 2 +-
.../iotdb/db/engine/flush/MemTableFlushTask.java | 16 +-
.../db/engine/flush/pool/FlushTaskPoolManager.java | 6 +-
.../iotdb/db/engine/load/LoadTsFileManager.java | 2 +-
.../iotdb/db/engine/memtable/AbstractMemTable.java | 4 +-
.../apache/iotdb/db/engine/settle/SettleLog.java | 4 +-
.../db/engine/settle/SettleRequestHandler.java | 2 +-
.../iotdb/db/engine/snapshot/SnapshotLoader.java | 10 +-
.../iotdb/db/engine/snapshot/SnapshotTaker.java | 2 +-
.../iotdb/db/engine/storagegroup/DataRegion.java | 56 +-
.../db/engine/storagegroup/DataRegionInfo.java | 8 +-
.../engine/storagegroup/TimePartitionManager.java | 4 +-
.../db/engine/storagegroup/TsFileProcessor.java | 15 +-
.../db/engine/storagegroup/TsFileResource.java | 2 +-
.../db/engine/trigger/utils/BatchHandlerQueue.java | 9 +-
.../engine/trigger/utils/HTTPConnectionPool.java | 6 +-
.../engine/trigger/utils/MQTTConnectionPool.java | 4 +-
.../apache/iotdb/db/engine/upgrade/UpgradeLog.java | 5 +-
.../exception/sql/PathNumOverLimitException.java | 4 +-
.../metadata/cache/DataNodeLastCacheManager.java | 4 +-
.../db/metadata/cache/DataNodeSchemaCache.java | 8 +-
.../apache/iotdb/db/metadata/idtable/IDTable.java | 2 +-
.../db/metadata/idtable/IDTableHashmapImpl.java | 2 +-
.../iotdb/db/metadata/idtable/IDTableManager.java | 2 +-
.../db/metadata/idtable/entry/DeviceIDFactory.java | 8 +-
.../db/metadata/idtable/entry/SchemaEntry.java | 2 +-
.../metadata/mnode/container/MNodeContainers.java | 2 +-
.../iotdb/db/metadata/mtree/ConfigMTree.java | 2 +-
.../db/metadata/mtree/store/MemMTreeStore.java | 2 +-
.../store/disk/memcontrol/MemManagerHolder.java | 2 +-
.../memcontrol/MemManagerNodeNumBasedImpl.java | 2 +-
.../store/disk/schemafile/MockSchemaFile.java | 2 +-
.../mtree/store/disk/schemafile/SchemaFile.java | 4 +-
.../store/disk/schemafile/SchemaFileConfig.java | 12 +-
.../iotdb/db/metadata/rescon/MemoryStatistics.java | 4 +-
.../db/metadata/rescon/SchemaResourceManager.java | 4 +-
.../db/metadata/schemaregion/SchemaEngine.java | 14 +-
.../schemaregion/SchemaRegionMemoryImpl.java | 25 +-
.../schemaregion/SchemaRegionSchemaFileImpl.java | 20 +-
.../apache/iotdb/db/metadata/tag/TagLogFile.java | 6 +-
.../apache/iotdb/db/metadata/tag/TagManager.java | 24 +-
.../iotdb/db/mpp/common/DataNodeEndPoints.java | 8 +-
.../db/mpp/common/header/ColumnHeaderConstant.java | 2 +-
.../mpp/common/schematree/ClusterSchemaTree.java | 4 +-
.../iotdb/db/mpp/execution/QueryIdGenerator.java | 2 +-
.../execution/exchange/MPPDataExchangeService.java | 20 +-
.../mpp/execution/exchange/SharedTsBlockQueue.java | 4 +-
.../db/mpp/execution/exchange/SinkHandle.java | 4 +-
.../db/mpp/execution/exchange/SourceHandle.java | 4 +-
.../execution/executor/RegionWriteExecutor.java | 33 +-
.../fragment/FragmentInstanceManager.java | 6 +-
.../mpp/execution/memory/LocalMemoryManager.java | 6 +-
.../operator/process/AbstractIntoOperator.java | 4 +-
.../operator/process/TransformOperator.java | 8 +-
.../operator/process/last/LastQueryUtil.java | 4 +-
.../db/mpp/execution/schedule/DriverScheduler.java | 8 +-
.../mpp/execution/schedule/DriverTaskThread.java | 4 +-
.../org/apache/iotdb/db/mpp/plan/Coordinator.java | 14 +-
.../iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java | 11 +-
.../mpp/plan/analyze/ClusterPartitionFetcher.java | 20 +-
.../plan/analyze/ColumnPaginationController.java | 7 +-
.../db/mpp/plan/analyze/cache/PartitionCache.java | 8 +-
.../plan/analyze/schema/ClusterSchemaFetcher.java | 10 +-
.../db/mpp/plan/execution/QueryExecution.java | 2 +-
.../mpp/plan/execution/config/ConfigExecution.java | 2 +-
.../config/metadata/GetTimeSlotListTask.java | 2 +-
.../iotdb/db/mpp/plan/parser/ASTVisitor.java | 30 +-
.../plan/planner/LocalExecutionPlanContext.java | 4 +-
.../db/mpp/plan/planner/LocalExecutionPlanner.java | 6 +-
.../db/mpp/plan/planner/OperatorTreeGenerator.java | 8 +-
.../SimpleFragmentParallelPlanner.java | 4 +-
.../db/mpp/plan/planner/plan/FragmentInstance.java | 8 +-
.../plan/node/load/LoadSingleTsFileNode.java | 4 +-
.../metedata/write/CreateMultiTimeSeriesNode.java | 4 +-
.../plan/planner/plan/node/write/InsertNode.java | 9 +-
.../planner/plan/node/write/InsertRowNode.java | 6 +-
.../scheduler/AbstractFragInsStateTracker.java | 4 +-
.../scheduler/FragmentInstanceDispatcherImpl.java | 4 +-
.../scheduler/load/LoadTsFileDispatcherImpl.java | 4 +-
.../plan/scheduler/load/LoadTsFileScheduler.java | 11 +-
.../plan/statement/crud/LoadTsFileStatement.java | 6 +-
.../metadata/CreateContinuousQueryStatement.java | 6 +-
.../datastructure/SerializableList.java | 4 +-
.../influxdb/handler/QueryHandlerFactory.java | 4 +-
.../influxdb/meta/InfluxDBMetaManagerFactory.java | 4 +-
.../influxdb/parser/InfluxDBAstVisitor.java | 6 +-
.../iotdb/db/protocol/mqtt/MPPPublishHandler.java | 9 +-
.../db/protocol/mqtt/PayloadFormatManager.java | 2 +-
.../protocol/rest/impl/GrafanaApiServiceImpl.java | 8 +-
.../db/protocol/rest/impl/RestApiServiceImpl.java | 6 +-
.../iotdb/db/query/control/SessionManager.java | 2 +-
.../apache/iotdb/db/rescon/MemTableManager.java | 17 +-
.../iotdb/db/rescon/PrimitiveArrayManager.java | 16 +-
.../org/apache/iotdb/db/rescon/SystemInfo.java | 33 +-
.../iotdb/db/rescon/TsFileResourceManager.java | 8 +-
.../java/org/apache/iotdb/db/service/DataNode.java | 118 +-
.../db/service/DataNodeInternalRPCService.java | 8 +-
.../org/apache/iotdb/db/service/GetVersion.java | 2 +-
.../iotdb/db/service/InfluxDBRPCService.java | 21 +-
.../apache/iotdb/db/service/IoTDBShutdownHook.java | 13 +-
.../org/apache/iotdb/db/service/MQTTService.java | 24 +-
.../org/apache/iotdb/db/service/RPCService.java | 16 +-
.../org/apache/iotdb/db/service/SettleService.java | 2 +-
.../db/service/TemporaryQueryDataFileService.java | 2 +-
.../org/apache/iotdb/db/service/UpgradeSevice.java | 4 +-
.../db/service/basic/QueryFrequencyRecorder.java | 4 +-
.../iotdb/db/service/metrics/SystemMetrics.java | 2 +-
.../service/thrift/impl/ClientRPCServiceImpl.java | 32 +-
.../impl/DataNodeInternalRPCServiceImpl.java | 22 +-
.../java/org/apache/iotdb/db/sync/SyncService.java | 2 +-
.../iotdb/db/sync/externalpipe/ExtPipePlugin.java | 4 +-
.../sync/externalpipe/ExtPipePluginRegister.java | 2 +-
.../db/sync/pipedata/load/DeletionLoader.java | 5 +-
.../iotdb/db/sync/pipedata/load/TsFileLoader.java | 4 +-
.../db/sync/transport/client/IoTDBSyncClient.java | 6 +-
.../db/sync/transport/server/ReceiverManager.java | 17 +-
.../org/apache/iotdb/db/tools/TsFileSplitTool.java | 4 +-
.../watermark/GroupedLSBWatermarkEncoder.java | 12 +-
.../db/trigger/executor/TriggerFireVisitor.java | 4 +-
.../trigger/service/TriggerClassLoaderManager.java | 10 +-
.../trigger/service/TriggerManagementService.java | 2 +-
.../org/apache/iotdb/db/utils/DateTimeUtils.java | 11 +-
.../iotdb/db/utils/EncodingInferenceUtils.java | 6 +-
.../org/apache/iotdb/db/utils/OpenFileNumUtil.java | 8 +-
.../apache/iotdb/db/utils/TimePartitionUtils.java | 2 +-
.../apache/iotdb/db/utils/TypeInferenceUtils.java | 12 +-
.../iotdb/db/utils/datastructure/TVList.java | 2 +-
.../utils/datastructure/TVListSortAlgorithm.java | 2 +-
.../runtime/WindowEvaluationTaskPoolManager.java | 6 +-
.../java/org/apache/iotdb/db/wal/WALManager.java | 54 +-
.../allocation/AbstractNodeAllocationStrategy.java | 8 +-
.../org/apache/iotdb/db/wal/buffer/WALBuffer.java | 14 +-
.../apache/iotdb/db/wal/buffer/WALInfoEntry.java | 8 +-
.../iotdb/db/wal/checkpoint/CheckpointManager.java | 10 +-
.../java/org/apache/iotdb/db/wal/io/WALReader.java | 4 +-
.../java/org/apache/iotdb/db/wal/node/WALNode.java | 15 +-
.../iotdb/db/wal/recover/WALNodeRecoverTask.java | 11 +-
.../iotdb/db/wal/recover/WALRecoverManager.java | 9 +-
.../db/wal/recover/file/TsFilePlanRedoer.java | 4 +-
.../org/apache/iotdb/db/wal/utils}/WALMode.java | 2 +-
.../auth/authorizer/LocalFileAuthorizerTest.java | 2 +-
.../db/auth/authorizer/OpenIdAuthorizerTest.java | 2 +-
.../db/auth/user/LocalFileUserManagerTest.java | 2 +-
.../db/conf/adapter/CompressionRatioTest.java | 5 +-
.../engine/compaction/AbstractCompactionTest.java | 20 +-
.../engine/compaction/CompactionSchedulerTest.java | 404 +--
.../CompactionSchedulerWithFastPerformerTest.java | 404 +--
.../compaction/CompactionTaskComparatorTest.java | 2 +-
.../compaction/FastAlignedCrossCompactionTest.java | 6 +-
.../FastCrossCompactionPerformerTest.java | 4 +-
.../FastInnerCompactionPerformerTest.java | 4 +-
.../FastNonAlignedCrossCompactionTest.java | 6 +-
.../ReadPointCompactionPerformerTest.java | 4 +-
.../db/engine/compaction/TsFileIdentifierUT.java | 8 +-
.../cross/CrossSpaceCompactionExceptionTest.java | 2 +-
...eCompactionWithFastPerformerValidationTest.java | 14 +-
...actionWithReadPointPerformerValidationTest.java | 6 +-
.../cross/RewriteCompactionFileSelectorTest.java | 32 +-
.../RewriteCrossSpaceCompactionRecoverTest.java | 2 +-
...eCrossSpaceCompactionWithFastPerformerTest.java | 2 +-
...sSpaceCompactionWithReadPointPerformerTest.java | 2 +-
.../FastCompactionPerformerNoAlignedTest.java | 204 +-
.../inner/InnerCompactionSchedulerTest.java | 42 +-
.../InnerSeqCompactionWithFastPerformerTest.java | 37 +-
...nerSeqCompactionWithReadChunkPerformerTest.java | 37 +-
.../ReadChunkCompactionPerformerNoAlignedTest.java | 204 +-
.../SizeTieredCompactionSelectorTest.java | 4 +-
.../recover/SizeTieredCompactionRecoverTest.java | 6 +-
.../compaction/utils/CompactionClearUtils.java | 4 +-
.../compaction/utils/CompactionConfigRestorer.java | 8 +-
.../utils/MultiTsFileDeviceIteratorTest.java | 2 +-
.../db/engine/settle/SettleRequestHandlerTest.java | 2 +-
.../db/engine/snapshot/IoTDBSnapshotTest.java | 22 +-
.../db/engine/storagegroup/DataRegionTest.java | 99 +-
.../iotdb/db/engine/storagegroup/TTLTest.java | 8 +-
.../storagegroup/TimePartitionManagerTest.java | 8 +-
.../iotdb/db/metadata/mtree/MTreeBelowSGTest.java | 2 +-
.../mtree/multimode/MTreeDiskModeTest.java | 6 +-
.../mtree/multimode/MTreeFullMemoryTest.java | 2 +-
.../mtree/multimode/MTreeMemoryModeTest.java | 4 +-
.../mtree/multimode/MTreeNonMemoryTest.java | 2 +-
.../mtree/multimode/MTreePartialMemoryTest.java | 2 +-
.../mtree/schemafile/AliasIndexPageTest.java | 6 +-
.../mtree/schemafile/InternalPageTest.java | 6 +-
.../mtree/schemafile/SchemaFileLogTest.java | 6 +-
.../metadata/mtree/schemafile/SchemaFileTest.java | 6 +-
.../mtree/schemafile/WrappedSegmentTest.java | 6 +-
.../schemaRegion/AbstractSchemaRegionTest.java | 4 +-
.../schemaRegion/SchemaRegionManagementTest.java | 31 +-
.../db/mpp/execution/exchange/SinkHandleTest.java | 8 +-
.../mpp/execution/exchange/SourceHandleTest.java | 476 ++--
.../execution/operator/MergeSortOperatorTest.java | 6 +-
.../execution/schedule/DriverSchedulerTest.java | 4 +-
.../iotdb/db/mpp/plan/analyze/AnalyzeTest.java | 15 +-
.../mpp/plan/analyze/FakePartitionFetcherImpl.java | 18 +-
.../mpp/plan/analyze/QueryTimePartitionTest.java | 58 +-
.../mpp/plan/analyze/cache/PartitionCacheTest.java | 8 +-
.../mpp/plan/plan/FragmentInstanceSerdeTest.java | 6 +-
.../iotdb/db/mpp/plan/plan/distribution/Util.java | 14 +-
.../plan/node/write/WritePlanNodeSplitTest.java | 11 +-
.../org/apache/iotdb/db/qp/sql/ASTVisitorTest.java | 12 +-
.../db/query/control/FileReaderManagerTest.java | 2 +-
.../iotdb/db/rescon/ResourceManagerTest.java | 11 +-
.../security/encrypt/MessageDigestEncryptTest.java | 2 +-
.../DataNodeInternalRPCServiceImplTest.java | 15 +-
.../org/apache/iotdb/db/tools/MLogParserTest.java | 2 +-
.../iotdb/db/tools/SchemaFileSketchTest.java | 6 +-
.../iotdb/db/tools/TsFileAndModSettleToolTest.java | 8 +-
.../iotdb/db/utils/EncodingInferenceUtilsTest.java | 6 +-
.../apache/iotdb/db/utils/EnvironmentUtils.java | 62 +-
.../iotdb/db/utils/TypeInferenceUtilsTest.java | 24 +-
.../datastructure/PrimitiveArrayManagerTest.java | 19 +-
.../org/apache/iotdb/db/wal/DisableWALTest.java | 8 +-
.../org/apache/iotdb/db/wal/WALManagerTest.java | 10 +-
.../db/wal/allocation/ElasticStrategyTest.java | 12 +-
.../db/wal/allocation/FirstCreateStrategyTest.java | 12 +-
.../db/wal/allocation/RoundRobinStrategyTest.java | 11 +-
.../iotdb/db/wal/buffer/WALBufferCommonTest.java | 12 +-
.../db/wal/checkpoint/CheckpointManagerTest.java | 2 +-
.../org/apache/iotdb/db/wal/io/WALFileTest.java | 6 +-
.../iotdb/db/wal/node/ConsensusReqReaderTest.java | 18 +-
.../org/apache/iotdb/db/wal/node/WALNodeTest.java | 20 +-
.../db/wal/recover/WALRecoverManagerTest.java | 22 +-
.../db/wal/recover/file/TsFilePlanRedoerTest.java | 15 +-
.../file/UnsealedTsFileRecoverPerformerTest.java | 2 +-
.../src/test/resources/iotdb-datanode.properties | 2 +-
.../apache/iotdb/spark/db/EnvironmentUtils.java | 24 +-
.../iotdb/tsfile/common/conf/TSFileConfig.java | 54 +-
.../iotdb/tsfile/common/conf/TSFileDescriptor.java | 2 +
.../file/metadata/enums/CompressionType.java | 28 -
.../tsfile/file/metadata/enums/TSEncoding.java | 29 -
361 files changed, 8713 insertions(+), 8616 deletions(-)
diff --git a/confignode/src/assembly/resources/conf/iotdb-confignode.properties b/confignode/src/assembly/resources/conf/iotdb-confignode.properties
index d1d4d21721..726c0264b3 100644
--- a/confignode/src/assembly/resources/conf/iotdb-confignode.properties
+++ b/confignode/src/assembly/resources/conf/iotdb-confignode.properties
@@ -18,7 +18,7 @@
#
####################
-### ConfigNode RPC Configuration
+### Config Node RPC Configuration
####################
# Used for RPC communication inside cluster.
@@ -35,7 +35,7 @@ cn_internal_port=10710
cn_consensus_port=10720
####################
-### Target ConfigNodes
+### Target Config Nodes
####################
# For the first ConfigNode to start, cn_target_config_node_list points to its own cn_internal_address:cn_internal_port.
@@ -45,7 +45,7 @@ cn_consensus_port=10720
cn_target_config_node_list=127.0.0.1:10710
####################
-### Directory Configuration
+### Directory configuration
####################
# system dir
@@ -72,7 +72,7 @@ cn_target_config_node_list=127.0.0.1:10710
# cn_consensus_dir=data/confignode/consensus
####################
-### Thrift RPC Configuration
+### thrift rpc configuration
####################
# this feature is under development, set this as false before it is done.
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index 2cb6e8318a..552b052ba4 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -19,233 +19,684 @@
package org.apache.iotdb.confignode.conf;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
+import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProperty;
import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.commons.conf.PropertiesUtils;
import org.apache.iotdb.confignode.manager.load.balancer.RegionBalancer;
+import org.apache.iotdb.confignode.manager.load.balancer.router.leader.ILeaderBalancer;
import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
+import org.apache.iotdb.confignode.manager.partition.RegionGroupExtensionPolicy;
+import org.apache.iotdb.consensus.ConsensusFactory;
import org.apache.iotdb.rpc.RpcUtils;
import java.io.File;
-import java.util.concurrent.TimeUnit;
public class ConfigNodeConfig {
- /** Config Node RPC Configuration */
- // Used for RPC communication inside cluster
- private String cnInternalAddress = "127.0.0.1";
- // Used for RPC communication inside cluster
- private int cnInternalPort = 10710;
- // Used for consensus communication among ConfigNodes inside cluster
- private int cnConsensusPort = 10720;
-
- /** Target ConfigNodes */
- // Used for connecting to the ConfigNodeGroup
- private TEndPoint cnTargetConfigNode = new TEndPoint("127.0.0.1", 10710);
-
- /** Directory Configuration */
- // System directory, including version file for each database and metadata
- private String cnSystemDir =
- ConfigNodeConstant.DATA_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
-
- // Consensus directory, storage consensus protocol logs
- private String cnConsensusDir =
- ConfigNodeConstant.DATA_DIR + File.separator + ConfigNodeConstant.CONSENSUS_FOLDER;
+ /** ClusterId, the default value "defaultCluster" will be changed after join cluster */
+ private volatile String clusterName = "defaultCluster";
- /** Thrift RPC Configuration */
- private boolean cnRpcThriftCompressionEnable = false;
- // Whether to use Snappy compression before sending data through the network
- private boolean cnRpcAdvancedCompressionEnable = false;
- // Max concurrent client number
- private int cnRpcMaxConcurrentClientNum = 65535;
- // Max frame size
- private int cnThriftMaxFrameSize = 536870912;
- // Buffer size
- private int cnThriftInitBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
- // Wait for 20 second by default
- private int cnConnectionTimeoutMs = (int) TimeUnit.SECONDS.toMillis(20);
- // ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its
- // clients
- private int cnSelectorThreadNumsOfClientManager = 1;
- // The maximum number of clients that can be idle for a node in a clientManager
- private int cnCoreClientCountForEachNodeInClientManager = 200;
- // The maximum number of clients that can be allocated for a node in a clientManager
- private int cnMaxClientCountForEachNodeInClientManager = 300;
-
- /** Metric Configuration */
- // TODO: Add if necessary
-
- /** Internal Configurations(Unconfigurable in .properties file) */
- // ConfigNodeId, the default value -1 will be changed after join cluster
+ /** ConfigNodeId, the default value -1 will be changed after join cluster */
private volatile int configNodeId = -1;
- private static final int configNodeRegionId = 0;
+ /** could set ip or hostname */
+ private String internalAddress = "127.0.0.1";
+
+ /** used for communication between data node and config node */
+ private int internalPort = 10710;
+
+ /** used for communication between config node and config node */
+ private int consensusPort = 10720;
+
+ /** Used for connecting to the ConfigNodeGroup */
+ private TEndPoint targetConfigNode = new TEndPoint("127.0.0.1", 10710);
+
+ // TODO: Read from iotdb-confignode.properties
+ private int configNodeRegionId = 0;
+
+ /** ConfigNodeGroup consensus protocol */
+ private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
+
+ /** Schema region consensus protocol */
+ private String schemaRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
+
+ /** Default number of SchemaRegion replicas */
+ private int schemaReplicationFactor = 1;
+
+ /** Data region consensus protocol */
+ private String dataRegionConsensusProtocolClass = ConsensusFactory.IOT_CONSENSUS;
+
+ /** Default number of DataRegion replicas */
+ private int dataReplicationFactor = 1;
- // RegionGroup allocate policy
+ /** Number of SeriesPartitionSlots per StorageGroup */
+ private int seriesSlotNum = 10000;
+
+ /** SeriesPartitionSlot executor class */
+ private String seriesPartitionExecutorClass =
+ "org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor";
+
+ /** The maximum number of SchemaRegions expected to be managed by each DataNode. */
+ private double schemaRegionPerDataNode = schemaReplicationFactor;
+
+ /** The policy of extension SchemaRegionGroup for each Database. */
+ private RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy =
+ RegionGroupExtensionPolicy.AUTO;
+
+ /** The number of SchemaRegionGroups for each Database when using CUSTOM extension policy */
+ private int schemaRegionGroupPerDatabase = 1;
+
+ /** The policy of extension DataRegionGroup for each Database. */
+ private RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy =
+ RegionGroupExtensionPolicy.AUTO;
+
+ /** The number of DataRegionGroups for each Database when using CUSTOM extension policy */
+ private int dataRegionGroupPerDatabase = 1;
+
+ /** The maximum number of DataRegions expected to be managed by each DataNode. */
+ private double dataRegionPerProcessor = 1.0;
+
+ /** The least number of SchemaRegionGroup for each Database. */
+ private volatile int leastSchemaRegionGroupNum = 1;
+
+ /** The least number of DataRegionGroup for each Database. */
+ private volatile int leastDataRegionGroupNum = 5;
+
+ /** RegionGroup allocate policy. */
private RegionBalancer.RegionGroupAllocatePolicy regionGroupAllocatePolicy =
RegionBalancer.RegionGroupAllocatePolicy.GREEDY;
- // The unknown DataNode detect interval in milliseconds
+ /**
+ * DataPartition within the same SeriesPartitionSlot will inherit the allocation result of the
+ * previous TimePartitionSlot if set true
+ */
+ private boolean enableDataPartitionInheritPolicy = false;
+
+ /** Max concurrent client number */
+ private int rpcMaxConcurrentClientNum = 65535;
+
+ /** whether to use Snappy compression before sending data through the network */
+ private boolean rpcAdvancedCompressionEnable = false;
- // The route priority policy of cluster read/write requests
+ /** max frame size */
+ private int thriftMaxFrameSize = 536870912;
+
+ /** buffer size */
+ private int thriftDefaultBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
+
+ /** just for test wait for 60 second by default. */
+ private int thriftServerAwaitTimeForStopService = 60;
+
+ /**
+ * The maximum number of clients that can be idle for a node in a clientManager. When the number
+ * of idle clients on a node exceeds this number, newly returned clients will be released
+ */
+ private int coreClientNumForEachNode = DefaultProperty.CORE_CLIENT_NUM_FOR_EACH_NODE;
+
+ /**
+ * The maximum number of clients that can be allocated for a node in a clientManager. When the
+ * number of the client to a single node exceeds this number, the thread for applying for a client
+ * will be blocked for a while, then ClientManager will throw ClientManagerException if there are
+ * no clients after the block time.
+ */
+ private int maxClientNumForEachNode = DefaultProperty.MAX_CLIENT_NUM_FOR_EACH_NODE;
+
+ /** System directory, including version file for each database and metadata */
+ private String systemDir =
+ ConfigNodeConstant.DATA_DIR + File.separator + IoTDBConstant.SYSTEM_FOLDER_NAME;
+
+ /** Consensus directory, storage consensus protocol logs */
+ private String consensusDir =
+ ConfigNodeConstant.DATA_DIR + File.separator + ConfigNodeConstant.CONSENSUS_FOLDER;
+
+ /** External lib directory, stores user-uploaded JAR files */
+ private String extLibDir = IoTDBConstant.EXT_FOLDER_NAME;
+
+ /** External lib directory for UDF, stores user-uploaded JAR files */
+ private String udfDir =
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.UDF_FOLDER_NAME;
+
+ /** External temporary lib directory for storing downloaded udf JAR files */
+ private String udfTemporaryLibDir = udfDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
+
+ /** External lib directory for trigger, stores user-uploaded JAR files */
+ private String triggerDir =
+ IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.TRIGGER_FOLDER_NAME;
+
+ /** External temporary lib directory for storing downloaded trigger JAR files */
+ private String triggerTemporaryLibDir =
+ triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
+
+ /** Time partition interval in milliseconds */
+ private long timePartitionInterval = 604_800_000;
+
+ /** Procedure Evict ttl */
+ private int procedureCompletedEvictTTL = 800;
+
+ /** Procedure completed clean interval */
+ private int procedureCompletedCleanInterval = 30;
+
+ /** Procedure core worker threads size */
+ private int procedureCoreWorkerThreadsCount =
+ Math.max(Runtime.getRuntime().availableProcessors() / 4, 16);
+
+ /** The heartbeat interval in milliseconds */
+ private long heartbeatIntervalInMs = 1000;
+
+ /** The unknown DataNode detect interval in milliseconds */
+ private long unknownDataNodeDetectInterval = heartbeatIntervalInMs;
+
+ /** The policy of cluster RegionGroups' leader distribution */
+ private String leaderDistributionPolicy = ILeaderBalancer.MIN_COST_FLOW_POLICY;
+
+ /** Whether to enable auto leader balance for Ratis consensus protocol */
+ private boolean enableAutoLeaderBalanceForRatisConsensus = false;
+
+ /** Whether to enable auto leader balance for IoTConsensus protocol */
+ private boolean enableAutoLeaderBalanceForIoTConsensus = true;
+
+ /** The route priority policy of cluster read/write requests */
private String routePriorityPolicy = IPriorityBalancer.LEADER_POLICY;
- // CQ related
+ private String readConsistencyLevel = "strong";
+
+ /** RatisConsensus protocol, Max size for a single log append request from leader */
+ private long dataRegionRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
+
+ private long configNodeRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
+ private long schemaRegionRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
+
+ /**
+ * RatisConsensus protocol, trigger a snapshot when ratis_snapshot_trigger_threshold logs are
+ * written
+ */
+ private long dataRegionRatisSnapshotTriggerThreshold = 400000L;
+
+ private long configNodeRatisSnapshotTriggerThreshold = 400000L;
+ private long schemaRegionRatisSnapshotTriggerThreshold = 400000L;
+
+ /** RatisConsensus protocol, allow flushing Raft Log asynchronously */
+ private boolean dataRegionRatisLogUnsafeFlushEnable = false;
+
+ private boolean configNodeRatisLogUnsafeFlushEnable = false;
+ private boolean schemaRegionRatisLogUnsafeFlushEnable = false;
+
+ /** RatisConsensus protocol, max capacity of a single Raft Log segment */
+ private long dataRegionRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
+
+ private long configNodeRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
+ private long schemaRegionRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
+ private long configNodeSimpleConsensusLogSegmentSizeMax = 24 * 1024 * 1024L;
+
+ /** RatisConsensus protocol, flow control window for ratis grpc log appender */
+ private long dataRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
+
+ private long configNodeRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
+ private long schemaRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
+
+ /** RatisConsensus protocol, min election timeout for leader election */
+ private long dataRegionRatisRpcLeaderElectionTimeoutMinMs = 2000L;
+
+ private long configNodeRatisRpcLeaderElectionTimeoutMinMs = 2000L;
+ private long schemaRegionRatisRpcLeaderElectionTimeoutMinMs = 2000L;
+
+ /** RatisConsensus protocol, max election timeout for leader election */
+ private long dataRegionRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
+
+ private long configNodeRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
+ private long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
+
+ /** CQ related */
private int cqSubmitThread = 2;
+
private long cqMinEveryIntervalInMs = 1_000;
+ /** RatisConsensus protocol, request timeout for ratis client */
+ private long dataRegionRatisRequestTimeoutMs = 10000L;
+
+ private long configNodeRatisRequestTimeoutMs = 10000L;
+ private long schemaRegionRatisRequestTimeoutMs = 10000L;
+
+ /** RatisConsensus protocol, exponential back-off retry policy params */
+ private int configNodeRatisMaxRetryAttempts = 10;
+
+ private long configNodeRatisInitialSleepTimeMs = 100;
+ private long configNodeRatisMaxSleepTimeMs = 10000;
+
+ private int dataRegionRatisMaxRetryAttempts = 10;
+ private long dataRegionRatisInitialSleepTimeMs = 100;
+ private long dataRegionRatisMaxSleepTimeMs = 10000;
+
+ private int schemaRegionRatisMaxRetryAttempts = 10;
+ private long schemaRegionRatisInitialSleepTimeMs = 100;
+ private long schemaRegionRatisMaxSleepTimeMs = 10000;
+
+ private long configNodeRatisPreserveLogsWhenPurge = 1000;
+ private long schemaRegionRatisPreserveLogsWhenPurge = 1000;
+ private long dataRegionRatisPreserveLogsWhenPurge = 1000;
+
+ /* first election timeout shares between 3 regions */
+ private long ratisFirstElectionTimeoutMinMs = 50;
+ private long ratisFirstElectionTimeoutMaxMs = 150;
+
+ private long configNodeRatisLogMax = 2L * 1024 * 1024 * 1024; // 2G
+ private long schemaRegionRatisLogMax = 2L * 1024 * 1024 * 1024; // 2G
+ private long dataRegionRatisLogMax = 20L * 1024 * 1024 * 1024; // 20G
+
public ConfigNodeConfig() {
- // Empty constructor
+ // empty constructor
}
- public void formulateFolders() {
+ public void updatePath() {
+ formulateFolders();
+ }
+
+ private void formulateFolders() {
+ systemDir = addHomeDir(systemDir);
+ consensusDir = addHomeDir(consensusDir);
+ extLibDir = addHomeDir(extLibDir);
+ udfDir = addHomeDir(udfDir);
+ udfTemporaryLibDir = addHomeDir(udfTemporaryLibDir);
+ triggerDir = addHomeDir(triggerDir);
+ triggerTemporaryLibDir = addHomeDir(triggerTemporaryLibDir);
+ }
+
+ private String addHomeDir(String dir) {
String homeDir = System.getProperty(ConfigNodeConstant.CONFIGNODE_HOME, null);
- cnSystemDir = PropertiesUtils.addHomeDir(homeDir, cnSystemDir);
- cnConsensusDir = PropertiesUtils.addHomeDir(homeDir, cnConsensusDir);
+ if (!new File(dir).isAbsolute() && homeDir != null && homeDir.length() > 0) {
+ if (!homeDir.endsWith(File.separator)) {
+ dir = homeDir + File.separatorChar + dir;
+ } else {
+ dir = homeDir + dir;
+ }
+ }
+ return dir;
}
- public String getCnInternalAddress() {
- return cnInternalAddress;
+ public String getClusterName() {
+ return clusterName;
}
- public void setCnInternalAddress(String cnInternalAddress) {
- this.cnInternalAddress = cnInternalAddress;
+ public void setClusterName(String clusterName) {
+ this.clusterName = clusterName;
}
- public int getCnInternalPort() {
- return cnInternalPort;
+ public int getConfigNodeId() {
+ return configNodeId;
}
- public void setCnInternalPort(int cnInternalPort) {
- this.cnInternalPort = cnInternalPort;
+ public void setConfigNodeId(int configNodeId) {
+ this.configNodeId = configNodeId;
}
- public int getCnConsensusPort() {
- return cnConsensusPort;
+ public String getInternalAddress() {
+ return internalAddress;
}
- public void setCnConsensusPort(int cnConsensusPort) {
- this.cnConsensusPort = cnConsensusPort;
+ public void setInternalAddress(String internalAddress) {
+ this.internalAddress = internalAddress;
}
- public TEndPoint getCnTargetConfigNode() {
- return cnTargetConfigNode;
+ public int getInternalPort() {
+ return internalPort;
}
- public void setCnTargetConfigNode(TEndPoint cnTargetConfigNode) {
- this.cnTargetConfigNode = cnTargetConfigNode;
+ public void setInternalPort(int internalPort) {
+ this.internalPort = internalPort;
}
- public String getCnSystemDir() {
- return cnSystemDir;
+ public int getConsensusPort() {
+ return consensusPort;
}
- public void setCnSystemDir(String cnSystemDir) {
- this.cnSystemDir = cnSystemDir;
+ public void setConsensusPort(int consensusPort) {
+ this.consensusPort = consensusPort;
}
- public String getCnConsensusDir() {
- return cnConsensusDir;
+ public TEndPoint getTargetConfigNode() {
+ return targetConfigNode;
}
- public void setCnConsensusDir(String cnConsensusDir) {
- this.cnConsensusDir = cnConsensusDir;
+ public void setTargetConfigNode(TEndPoint targetConfigNode) {
+ this.targetConfigNode = targetConfigNode;
}
- public boolean isCnRpcThriftCompressionEnable() {
- return cnRpcThriftCompressionEnable;
+ public int getConfigNodeRegionId() {
+ return configNodeRegionId;
}
- public void setCnRpcThriftCompressionEnable(boolean cnRpcThriftCompressionEnable) {
- this.cnRpcThriftCompressionEnable = cnRpcThriftCompressionEnable;
+ public void setConfigNodeRegionId(int configNodeRegionId) {
+ this.configNodeRegionId = configNodeRegionId;
}
- public boolean isCnRpcAdvancedCompressionEnable() {
- return cnRpcAdvancedCompressionEnable;
+ public int getSeriesSlotNum() {
+ return seriesSlotNum;
}
- public void setCnRpcAdvancedCompressionEnable(boolean cnRpcAdvancedCompressionEnable) {
- this.cnRpcAdvancedCompressionEnable = cnRpcAdvancedCompressionEnable;
+ public void setSeriesSlotNum(int seriesSlotNum) {
+ this.seriesSlotNum = seriesSlotNum;
+ }
+
+ public String getSeriesPartitionExecutorClass() {
+ return seriesPartitionExecutorClass;
+ }
+
+ public void setSeriesPartitionExecutorClass(String seriesPartitionExecutorClass) {
+ this.seriesPartitionExecutorClass = seriesPartitionExecutorClass;
+ }
+
+ public long getTimePartitionInterval() {
+ return timePartitionInterval;
+ }
+
+ public void setTimePartitionInterval(long timePartitionInterval) {
+ this.timePartitionInterval = timePartitionInterval;
}
public int getCnRpcMaxConcurrentClientNum() {
- return cnRpcMaxConcurrentClientNum;
+ return rpcMaxConcurrentClientNum;
+ }
+
+ public void setCnRpcMaxConcurrentClientNum(int rpcMaxConcurrentClientNum) {
+ this.rpcMaxConcurrentClientNum = rpcMaxConcurrentClientNum;
+ }
+
+ public boolean isCnRpcAdvancedCompressionEnable() {
+ return rpcAdvancedCompressionEnable;
}
- public void setCnRpcMaxConcurrentClientNum(int cnRpcMaxConcurrentClientNum) {
- this.cnRpcMaxConcurrentClientNum = cnRpcMaxConcurrentClientNum;
+ public void setCnRpcAdvancedCompressionEnable(boolean rpcAdvancedCompressionEnable) {
+ this.rpcAdvancedCompressionEnable = rpcAdvancedCompressionEnable;
}
public int getCnThriftMaxFrameSize() {
- return cnThriftMaxFrameSize;
+ return thriftMaxFrameSize;
}
- public void setCnThriftMaxFrameSize(int cnThriftMaxFrameSize) {
- this.cnThriftMaxFrameSize = cnThriftMaxFrameSize;
+ public void setCnThriftMaxFrameSize(int thriftMaxFrameSize) {
+ this.thriftMaxFrameSize = thriftMaxFrameSize;
}
- public int getCnThriftInitBufferSize() {
- return cnThriftInitBufferSize;
+ public int getCnThriftDefaultBufferSize() {
+ return thriftDefaultBufferSize;
}
- public void setCnThriftInitBufferSize(int cnThriftInitBufferSize) {
- this.cnThriftInitBufferSize = cnThriftInitBufferSize;
+ public void setCnThriftDefaultBufferSize(int thriftDefaultBufferSize) {
+ this.thriftDefaultBufferSize = thriftDefaultBufferSize;
}
- public int getCnConnectionTimeoutMs() {
- return cnConnectionTimeoutMs;
+ public int getCoreClientNumForEachNode() {
+ return coreClientNumForEachNode;
}
- public void setCnConnectionTimeoutMs(int cnConnectionTimeoutMs) {
- this.cnConnectionTimeoutMs = cnConnectionTimeoutMs;
+ public ConfigNodeConfig setCoreClientNumForEachNode(int coreClientNumForEachNode) {
+ this.coreClientNumForEachNode = coreClientNumForEachNode;
+ return this;
}
- public int getCnSelectorThreadNumsOfClientManager() {
- return cnSelectorThreadNumsOfClientManager;
+ public int getMaxClientNumForEachNode() {
+ return maxClientNumForEachNode;
}
- public void setCnSelectorThreadNumsOfClientManager(int cnSelectorThreadNumsOfClientManager) {
- this.cnSelectorThreadNumsOfClientManager = cnSelectorThreadNumsOfClientManager;
+ public ConfigNodeConfig setMaxClientNumForEachNode(int maxClientNumForEachNode) {
+ this.maxClientNumForEachNode = maxClientNumForEachNode;
+ return this;
}
- public int getCnCoreClientCountForEachNodeInClientManager() {
- return cnCoreClientCountForEachNodeInClientManager;
+ public String getConsensusDir() {
+ return consensusDir;
}
- public void setCnCoreClientCountForEachNodeInClientManager(
- int cnCoreClientCountForEachNodeInClientManager) {
- this.cnCoreClientCountForEachNodeInClientManager = cnCoreClientCountForEachNodeInClientManager;
+ public void setConsensusDir(String consensusDir) {
+ this.consensusDir = consensusDir;
}
- public int getCnMaxClientCountForEachNodeInClientManager() {
- return cnMaxClientCountForEachNodeInClientManager;
+ public String getConfigNodeConsensusProtocolClass() {
+ return configNodeConsensusProtocolClass;
}
- public void setCnMaxClientCountForEachNodeInClientManager(
- int cnMaxClientCountForEachNodeInClientManager) {
- this.cnMaxClientCountForEachNodeInClientManager = cnMaxClientCountForEachNodeInClientManager;
+ public void setConfigNodeConsensusProtocolClass(String configNodeConsensusProtocolClass) {
+ this.configNodeConsensusProtocolClass = configNodeConsensusProtocolClass;
}
- public int getConfigNodeId() {
- return configNodeId;
+ public String getSchemaRegionConsensusProtocolClass() {
+ return schemaRegionConsensusProtocolClass;
}
- public void setConfigNodeId(int configNodeId) {
- this.configNodeId = configNodeId;
+ public void setSchemaRegionConsensusProtocolClass(String schemaRegionConsensusProtocolClass) {
+ this.schemaRegionConsensusProtocolClass = schemaRegionConsensusProtocolClass;
}
- public int getConfigNodeRegionId() {
- return configNodeRegionId;
+ public RegionGroupExtensionPolicy getSchemaRegionGroupExtensionPolicy() {
+ return schemaRegionGroupExtensionPolicy;
+ }
+
+ public void setSchemaRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy) {
+ this.schemaRegionGroupExtensionPolicy = schemaRegionGroupExtensionPolicy;
+ }
+
+ public int getSchemaRegionGroupPerDatabase() {
+ return schemaRegionGroupPerDatabase;
+ }
+
+ public void setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
+ this.schemaRegionGroupPerDatabase = schemaRegionGroupPerDatabase;
+ }
+
+ public RegionGroupExtensionPolicy getDataRegionGroupExtensionPolicy() {
+ return dataRegionGroupExtensionPolicy;
+ }
+
+ public void setDataRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy) {
+ this.dataRegionGroupExtensionPolicy = dataRegionGroupExtensionPolicy;
+ }
+
+ public int getDataRegionGroupPerDatabase() {
+ return dataRegionGroupPerDatabase;
+ }
+
+ public void setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
+ this.dataRegionGroupPerDatabase = dataRegionGroupPerDatabase;
+ }
+
+ public double getSchemaRegionPerDataNode() {
+ return schemaRegionPerDataNode;
+ }
+
+ public void setSchemaRegionPerDataNode(double schemaRegionPerDataNode) {
+ this.schemaRegionPerDataNode = schemaRegionPerDataNode;
+ }
+
+ public String getDataRegionConsensusProtocolClass() {
+ return dataRegionConsensusProtocolClass;
+ }
+
+ public void setDataRegionConsensusProtocolClass(String dataRegionConsensusProtocolClass) {
+ this.dataRegionConsensusProtocolClass = dataRegionConsensusProtocolClass;
+ }
+
+ public double getDataRegionPerProcessor() {
+ return dataRegionPerProcessor;
+ }
+
+ public void setDataRegionPerProcessor(double dataRegionPerProcessor) {
+ this.dataRegionPerProcessor = dataRegionPerProcessor;
+ }
+
+ public int getLeastSchemaRegionGroupNum() {
+ return leastSchemaRegionGroupNum;
+ }
+
+ public void setLeastSchemaRegionGroupNum(int leastSchemaRegionGroupNum) {
+ this.leastSchemaRegionGroupNum = leastSchemaRegionGroupNum;
+ }
+
+ public int getLeastDataRegionGroupNum() {
+ return leastDataRegionGroupNum;
+ }
+
+ public void setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
+ this.leastDataRegionGroupNum = leastDataRegionGroupNum;
}
public RegionBalancer.RegionGroupAllocatePolicy getRegionGroupAllocatePolicy() {
return regionGroupAllocatePolicy;
}
- public void setRegionGroupAllocatePolicy(
+ public void setRegionAllocateStrategy(
RegionBalancer.RegionGroupAllocatePolicy regionGroupAllocatePolicy) {
this.regionGroupAllocatePolicy = regionGroupAllocatePolicy;
}
+ public boolean isEnableDataPartitionInheritPolicy() {
+ return enableDataPartitionInheritPolicy;
+ }
+
+ public void setEnableDataPartitionInheritPolicy(boolean enableDataPartitionInheritPolicy) {
+ this.enableDataPartitionInheritPolicy = enableDataPartitionInheritPolicy;
+ }
+
+ public int getThriftServerAwaitTimeForStopService() {
+ return thriftServerAwaitTimeForStopService;
+ }
+
+ public void setThriftServerAwaitTimeForStopService(int thriftServerAwaitTimeForStopService) {
+ this.thriftServerAwaitTimeForStopService = thriftServerAwaitTimeForStopService;
+ }
+
+ public String getSystemDir() {
+ return systemDir;
+ }
+
+ public void setSystemDir(String systemDir) {
+ this.systemDir = systemDir;
+ }
+
+ public String getExtLibDir() {
+ return extLibDir;
+ }
+
+ public void setExtLibDir(String extLibDir) {
+ this.extLibDir = extLibDir;
+ }
+
+ public String getUdfDir() {
+ return udfDir;
+ }
+
+ public void setUdfDir(String udfDir) {
+ this.udfDir = udfDir;
+ updateUdfTemporaryLibDir();
+ }
+
+ public String getUdfTemporaryLibDir() {
+ return udfTemporaryLibDir;
+ }
+
+ public void updateUdfTemporaryLibDir() {
+ this.udfTemporaryLibDir = udfDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
+ }
+
+ public String getTriggerDir() {
+ return triggerDir;
+ }
+
+ public void setTriggerDir(String triggerDir) {
+ this.triggerDir = triggerDir;
+ updateTriggerTemporaryLibDir();
+ }
+
+ public String getTriggerTemporaryLibDir() {
+ return triggerTemporaryLibDir;
+ }
+
+ public void updateTriggerTemporaryLibDir() {
+ this.triggerTemporaryLibDir = triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
+ }
+
+ public int getSchemaReplicationFactor() {
+ return schemaReplicationFactor;
+ }
+
+ public void setSchemaReplicationFactor(int schemaReplicationFactor) {
+ this.schemaReplicationFactor = schemaReplicationFactor;
+ }
+
+ public int getDataReplicationFactor() {
+ return dataReplicationFactor;
+ }
+
+ public void setDataReplicationFactor(int dataReplicationFactor) {
+ this.dataReplicationFactor = dataReplicationFactor;
+ }
+
+ public int getProcedureCompletedEvictTTL() {
+ return procedureCompletedEvictTTL;
+ }
+
+ public void setProcedureCompletedEvictTTL(int procedureCompletedEvictTTL) {
+ this.procedureCompletedEvictTTL = procedureCompletedEvictTTL;
+ }
+
+ public int getProcedureCompletedCleanInterval() {
+ return procedureCompletedCleanInterval;
+ }
+
+ public void setProcedureCompletedCleanInterval(int procedureCompletedCleanInterval) {
+ this.procedureCompletedCleanInterval = procedureCompletedCleanInterval;
+ }
+
+ public int getProcedureCoreWorkerThreadsCount() {
+ return procedureCoreWorkerThreadsCount;
+ }
+
+ public void setProcedureCoreWorkerThreadsCount(int procedureCoreWorkerThreadsCount) {
+ this.procedureCoreWorkerThreadsCount = procedureCoreWorkerThreadsCount;
+ }
+
+ public long getHeartbeatIntervalInMs() {
+ return heartbeatIntervalInMs;
+ }
+
+ public void setHeartbeatIntervalInMs(long heartbeatIntervalInMs) {
+ this.heartbeatIntervalInMs = heartbeatIntervalInMs;
+ }
+
+ public long getUnknownDataNodeDetectInterval() {
+ return unknownDataNodeDetectInterval;
+ }
+
+ public void setUnknownDataNodeDetectInterval(long unknownDataNodeDetectInterval) {
+ this.unknownDataNodeDetectInterval = unknownDataNodeDetectInterval;
+ }
+
+ public String getLeaderDistributionPolicy() {
+ return leaderDistributionPolicy;
+ }
+
+ public void setLeaderDistributionPolicy(String leaderDistributionPolicy) {
+ this.leaderDistributionPolicy = leaderDistributionPolicy;
+ }
+
+ public boolean isEnableAutoLeaderBalanceForRatisConsensus() {
+ return enableAutoLeaderBalanceForRatisConsensus;
+ }
+
+ public void setEnableAutoLeaderBalanceForRatisConsensus(
+ boolean enableAutoLeaderBalanceForRatisConsensus) {
+ this.enableAutoLeaderBalanceForRatisConsensus = enableAutoLeaderBalanceForRatisConsensus;
+ }
+
+ public boolean isEnableAutoLeaderBalanceForIoTConsensus() {
+ return enableAutoLeaderBalanceForIoTConsensus;
+ }
+
+ public void setEnableAutoLeaderBalanceForIoTConsensus(
+ boolean enableAutoLeaderBalanceForIoTConsensus) {
+ this.enableAutoLeaderBalanceForIoTConsensus = enableAutoLeaderBalanceForIoTConsensus;
+ }
+
public String getRoutePriorityPolicy() {
return routePriorityPolicy;
}
@@ -254,6 +705,214 @@ public class ConfigNodeConfig {
this.routePriorityPolicy = routePriorityPolicy;
}
+ public String getReadConsistencyLevel() {
+ return readConsistencyLevel;
+ }
+
+ public void setReadConsistencyLevel(String readConsistencyLevel) {
+ this.readConsistencyLevel = readConsistencyLevel;
+ }
+
+ public long getDataRegionRatisConsensusLogAppenderBufferSize() {
+ return dataRegionRatisConsensusLogAppenderBufferSize;
+ }
+
+ public void setDataRegionRatisConsensusLogAppenderBufferSize(
+ long dataRegionRatisConsensusLogAppenderBufferSize) {
+ this.dataRegionRatisConsensusLogAppenderBufferSize =
+ dataRegionRatisConsensusLogAppenderBufferSize;
+ }
+
+ public long getDataRegionRatisSnapshotTriggerThreshold() {
+ return dataRegionRatisSnapshotTriggerThreshold;
+ }
+
+ public void setDataRegionRatisSnapshotTriggerThreshold(
+ long dataRegionRatisSnapshotTriggerThreshold) {
+ this.dataRegionRatisSnapshotTriggerThreshold = dataRegionRatisSnapshotTriggerThreshold;
+ }
+
+ public boolean isDataRegionRatisLogUnsafeFlushEnable() {
+ return dataRegionRatisLogUnsafeFlushEnable;
+ }
+
+ public void setDataRegionRatisLogUnsafeFlushEnable(boolean dataRegionRatisLogUnsafeFlushEnable) {
+ this.dataRegionRatisLogUnsafeFlushEnable = dataRegionRatisLogUnsafeFlushEnable;
+ }
+
+ public long getDataRegionRatisLogSegmentSizeMax() {
+ return dataRegionRatisLogSegmentSizeMax;
+ }
+
+ public void setDataRegionRatisLogSegmentSizeMax(long dataRegionRatisLogSegmentSizeMax) {
+ this.dataRegionRatisLogSegmentSizeMax = dataRegionRatisLogSegmentSizeMax;
+ }
+
+ public long getDataRegionRatisGrpcFlowControlWindow() {
+ return dataRegionRatisGrpcFlowControlWindow;
+ }
+
+ public void setDataRegionRatisGrpcFlowControlWindow(long dataRegionRatisGrpcFlowControlWindow) {
+ this.dataRegionRatisGrpcFlowControlWindow = dataRegionRatisGrpcFlowControlWindow;
+ }
+
+ public long getDataRegionRatisRpcLeaderElectionTimeoutMinMs() {
+ return dataRegionRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public void setDataRegionRatisRpcLeaderElectionTimeoutMinMs(
+ long dataRegionRatisRpcLeaderElectionTimeoutMinMs) {
+ this.dataRegionRatisRpcLeaderElectionTimeoutMinMs =
+ dataRegionRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public long getDataRegionRatisRpcLeaderElectionTimeoutMaxMs() {
+ return dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
+ public void setDataRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ long dataRegionRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.dataRegionRatisRpcLeaderElectionTimeoutMaxMs =
+ dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
+ public long getConfigNodeRatisConsensusLogAppenderBufferSize() {
+ return configNodeRatisConsensusLogAppenderBufferSize;
+ }
+
+ public void setConfigNodeRatisConsensusLogAppenderBufferSize(
+ long configNodeRatisConsensusLogAppenderBufferSize) {
+ this.configNodeRatisConsensusLogAppenderBufferSize =
+ configNodeRatisConsensusLogAppenderBufferSize;
+ }
+
+ public long getConfigNodeRatisSnapshotTriggerThreshold() {
+ return configNodeRatisSnapshotTriggerThreshold;
+ }
+
+ public void setConfigNodeRatisSnapshotTriggerThreshold(
+ long configNodeRatisSnapshotTriggerThreshold) {
+ this.configNodeRatisSnapshotTriggerThreshold = configNodeRatisSnapshotTriggerThreshold;
+ }
+
+ public boolean isConfigNodeRatisLogUnsafeFlushEnable() {
+ return configNodeRatisLogUnsafeFlushEnable;
+ }
+
+ public void setConfigNodeRatisLogUnsafeFlushEnable(boolean configNodeRatisLogUnsafeFlushEnable) {
+ this.configNodeRatisLogUnsafeFlushEnable = configNodeRatisLogUnsafeFlushEnable;
+ }
+
+ public long getConfigNodeRatisLogSegmentSizeMax() {
+ return configNodeRatisLogSegmentSizeMax;
+ }
+
+ public void setConfigNodeRatisLogSegmentSizeMax(long configNodeRatisLogSegmentSizeMax) {
+ this.configNodeRatisLogSegmentSizeMax = configNodeRatisLogSegmentSizeMax;
+ }
+
+ public long getConfigNodeRatisGrpcFlowControlWindow() {
+ return configNodeRatisGrpcFlowControlWindow;
+ }
+
+ public void setConfigNodeRatisGrpcFlowControlWindow(long configNodeRatisGrpcFlowControlWindow) {
+ this.configNodeRatisGrpcFlowControlWindow = configNodeRatisGrpcFlowControlWindow;
+ }
+
+ public long getConfigNodeRatisRpcLeaderElectionTimeoutMinMs() {
+ return configNodeRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public void setConfigNodeRatisRpcLeaderElectionTimeoutMinMs(
+ long configNodeRatisRpcLeaderElectionTimeoutMinMs) {
+ this.configNodeRatisRpcLeaderElectionTimeoutMinMs =
+ configNodeRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public long getConfigNodeRatisRpcLeaderElectionTimeoutMaxMs() {
+ return configNodeRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
+ public void setConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(
+ long configNodeRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.configNodeRatisRpcLeaderElectionTimeoutMaxMs =
+ configNodeRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
+ public long getSchemaRegionRatisConsensusLogAppenderBufferSize() {
+ return schemaRegionRatisConsensusLogAppenderBufferSize;
+ }
+
+ public void setSchemaRegionRatisConsensusLogAppenderBufferSize(
+ long schemaRegionRatisConsensusLogAppenderBufferSize) {
+ this.schemaRegionRatisConsensusLogAppenderBufferSize =
+ schemaRegionRatisConsensusLogAppenderBufferSize;
+ }
+
+ public long getSchemaRegionRatisSnapshotTriggerThreshold() {
+ return schemaRegionRatisSnapshotTriggerThreshold;
+ }
+
+ public void setSchemaRegionRatisSnapshotTriggerThreshold(
+ long schemaRegionRatisSnapshotTriggerThreshold) {
+ this.schemaRegionRatisSnapshotTriggerThreshold = schemaRegionRatisSnapshotTriggerThreshold;
+ }
+
+ public boolean isSchemaRegionRatisLogUnsafeFlushEnable() {
+ return schemaRegionRatisLogUnsafeFlushEnable;
+ }
+
+ public void setSchemaRegionRatisLogUnsafeFlushEnable(
+ boolean schemaRegionRatisLogUnsafeFlushEnable) {
+ this.schemaRegionRatisLogUnsafeFlushEnable = schemaRegionRatisLogUnsafeFlushEnable;
+ }
+
+ public long getSchemaRegionRatisLogSegmentSizeMax() {
+ return schemaRegionRatisLogSegmentSizeMax;
+ }
+
+ public void setSchemaRegionRatisLogSegmentSizeMax(long schemaRegionRatisLogSegmentSizeMax) {
+ this.schemaRegionRatisLogSegmentSizeMax = schemaRegionRatisLogSegmentSizeMax;
+ }
+
+ public long getConfigNodeSimpleConsensusLogSegmentSizeMax() {
+ return configNodeSimpleConsensusLogSegmentSizeMax;
+ }
+
+ public void setConfigNodeSimpleConsensusLogSegmentSizeMax(
+ long configNodeSimpleConsensusLogSegmentSizeMax) {
+ this.configNodeSimpleConsensusLogSegmentSizeMax = configNodeSimpleConsensusLogSegmentSizeMax;
+ }
+
+ public long getSchemaRegionRatisGrpcFlowControlWindow() {
+ return schemaRegionRatisGrpcFlowControlWindow;
+ }
+
+ public void setSchemaRegionRatisGrpcFlowControlWindow(
+ long schemaRegionRatisGrpcFlowControlWindow) {
+ this.schemaRegionRatisGrpcFlowControlWindow = schemaRegionRatisGrpcFlowControlWindow;
+ }
+
+ public long getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs() {
+ return schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public void setSchemaRegionRatisRpcLeaderElectionTimeoutMinMs(
+ long schemaRegionRatisRpcLeaderElectionTimeoutMinMs) {
+ this.schemaRegionRatisRpcLeaderElectionTimeoutMinMs =
+ schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
+ }
+
+ public long getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs() {
+ return schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
+ public void setSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs) {
+ this.schemaRegionRatisRpcLeaderElectionTimeoutMaxMs =
+ schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
+ }
+
public int getCqSubmitThread() {
return cqSubmitThread;
}
@@ -269,4 +928,165 @@ public class ConfigNodeConfig {
public void setCqMinEveryIntervalInMs(long cqMinEveryIntervalInMs) {
this.cqMinEveryIntervalInMs = cqMinEveryIntervalInMs;
}
+
+ public long getDataRegionRatisRequestTimeoutMs() {
+ return dataRegionRatisRequestTimeoutMs;
+ }
+
+ public void setDataRegionRatisRequestTimeoutMs(long dataRegionRatisRequestTimeoutMs) {
+ this.dataRegionRatisRequestTimeoutMs = dataRegionRatisRequestTimeoutMs;
+ }
+
+ public long getConfigNodeRatisRequestTimeoutMs() {
+ return configNodeRatisRequestTimeoutMs;
+ }
+
+ public void setConfigNodeRatisRequestTimeoutMs(long configNodeRatisRequestTimeoutMs) {
+ this.configNodeRatisRequestTimeoutMs = configNodeRatisRequestTimeoutMs;
+ }
+
+ public long getSchemaRegionRatisRequestTimeoutMs() {
+ return schemaRegionRatisRequestTimeoutMs;
+ }
+
+ public void setSchemaRegionRatisRequestTimeoutMs(long schemaRegionRatisRequestTimeoutMs) {
+ this.schemaRegionRatisRequestTimeoutMs = schemaRegionRatisRequestTimeoutMs;
+ }
+
+ public int getConfigNodeRatisMaxRetryAttempts() {
+ return configNodeRatisMaxRetryAttempts;
+ }
+
+ public void setConfigNodeRatisMaxRetryAttempts(int configNodeRatisMaxRetryAttempts) {
+ this.configNodeRatisMaxRetryAttempts = configNodeRatisMaxRetryAttempts;
+ }
+
+ public long getConfigNodeRatisInitialSleepTimeMs() {
+ return configNodeRatisInitialSleepTimeMs;
+ }
+
+ public void setConfigNodeRatisInitialSleepTimeMs(long configNodeRatisInitialSleepTimeMs) {
+ this.configNodeRatisInitialSleepTimeMs = configNodeRatisInitialSleepTimeMs;
+ }
+
+ public long getConfigNodeRatisMaxSleepTimeMs() {
+ return configNodeRatisMaxSleepTimeMs;
+ }
+
+ public void setConfigNodeRatisMaxSleepTimeMs(long configNodeRatisMaxSleepTimeMs) {
+ this.configNodeRatisMaxSleepTimeMs = configNodeRatisMaxSleepTimeMs;
+ }
+
+ public int getDataRegionRatisMaxRetryAttempts() {
+ return dataRegionRatisMaxRetryAttempts;
+ }
+
+ public void setDataRegionRatisMaxRetryAttempts(int dataRegionRatisMaxRetryAttempts) {
+ this.dataRegionRatisMaxRetryAttempts = dataRegionRatisMaxRetryAttempts;
+ }
+
+ public long getDataRegionRatisInitialSleepTimeMs() {
+ return dataRegionRatisInitialSleepTimeMs;
+ }
+
+ public void setDataRegionRatisInitialSleepTimeMs(long dataRegionRatisInitialSleepTimeMs) {
+ this.dataRegionRatisInitialSleepTimeMs = dataRegionRatisInitialSleepTimeMs;
+ }
+
+ public long getDataRegionRatisMaxSleepTimeMs() {
+ return dataRegionRatisMaxSleepTimeMs;
+ }
+
+ public void setDataRegionRatisMaxSleepTimeMs(long dataRegionRatisMaxSleepTimeMs) {
+ this.dataRegionRatisMaxSleepTimeMs = dataRegionRatisMaxSleepTimeMs;
+ }
+
+ public int getSchemaRegionRatisMaxRetryAttempts() {
+ return schemaRegionRatisMaxRetryAttempts;
+ }
+
+ public void setSchemaRegionRatisMaxRetryAttempts(int schemaRegionRatisMaxRetryAttempts) {
+ this.schemaRegionRatisMaxRetryAttempts = schemaRegionRatisMaxRetryAttempts;
+ }
+
+ public long getSchemaRegionRatisInitialSleepTimeMs() {
+ return schemaRegionRatisInitialSleepTimeMs;
+ }
+
+ public void setSchemaRegionRatisInitialSleepTimeMs(long schemaRegionRatisInitialSleepTimeMs) {
+ this.schemaRegionRatisInitialSleepTimeMs = schemaRegionRatisInitialSleepTimeMs;
+ }
+
+ public long getSchemaRegionRatisMaxSleepTimeMs() {
+ return schemaRegionRatisMaxSleepTimeMs;
+ }
+
+ public void setSchemaRegionRatisMaxSleepTimeMs(long schemaRegionRatisMaxSleepTimeMs) {
+ this.schemaRegionRatisMaxSleepTimeMs = schemaRegionRatisMaxSleepTimeMs;
+ }
+
+ public long getConfigNodeRatisPreserveLogsWhenPurge() {
+ return configNodeRatisPreserveLogsWhenPurge;
+ }
+
+ public void setConfigNodeRatisPreserveLogsWhenPurge(long configNodeRatisPreserveLogsWhenPurge) {
+ this.configNodeRatisPreserveLogsWhenPurge = configNodeRatisPreserveLogsWhenPurge;
+ }
+
+ public long getSchemaRegionRatisPreserveLogsWhenPurge() {
+ return schemaRegionRatisPreserveLogsWhenPurge;
+ }
+
+ public void setSchemaRegionRatisPreserveLogsWhenPurge(
+ long schemaRegionRatisPreserveLogsWhenPurge) {
+ this.schemaRegionRatisPreserveLogsWhenPurge = schemaRegionRatisPreserveLogsWhenPurge;
+ }
+
+ public long getDataRegionRatisPreserveLogsWhenPurge() {
+ return dataRegionRatisPreserveLogsWhenPurge;
+ }
+
+ public void setDataRegionRatisPreserveLogsWhenPurge(long dataRegionRatisPreserveLogsWhenPurge) {
+ this.dataRegionRatisPreserveLogsWhenPurge = dataRegionRatisPreserveLogsWhenPurge;
+ }
+
+ public long getRatisFirstElectionTimeoutMinMs() {
+ return ratisFirstElectionTimeoutMinMs;
+ }
+
+ public void setRatisFirstElectionTimeoutMinMs(long ratisFirstElectionTimeoutMinMs) {
+ this.ratisFirstElectionTimeoutMinMs = ratisFirstElectionTimeoutMinMs;
+ }
+
+ public long getRatisFirstElectionTimeoutMaxMs() {
+ return ratisFirstElectionTimeoutMaxMs;
+ }
+
+ public void setRatisFirstElectionTimeoutMaxMs(long ratisFirstElectionTimeoutMaxMs) {
+ this.ratisFirstElectionTimeoutMaxMs = ratisFirstElectionTimeoutMaxMs;
+ }
+
+ public long getConfigNodeRatisLogMax() {
+ return configNodeRatisLogMax;
+ }
+
+ public void setConfigNodeRatisLogMax(long configNodeRatisLogMax) {
+ this.configNodeRatisLogMax = configNodeRatisLogMax;
+ }
+
+ public long getSchemaRegionRatisLogMax() {
+ return schemaRegionRatisLogMax;
+ }
+
+ public void setSchemaRegionRatisLogMax(long schemaRegionRatisLogMax) {
+ this.schemaRegionRatisLogMax = schemaRegionRatisLogMax;
+ }
+
+ public long getDataRegionRatisLogMax() {
+ return dataRegionRatisLogMax;
+ }
+
+ public void setDataRegionRatisLogMax(long dataRegionRatisLogMax) {
+ this.dataRegionRatisLogMax = dataRegionRatisLogMax;
+ }
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
index 772d133442..4c1873258a 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
@@ -24,13 +24,16 @@ import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
import org.apache.iotdb.commons.utils.NodeUrlUtils;
import org.apache.iotdb.confignode.manager.load.balancer.RegionBalancer;
+import org.apache.iotdb.confignode.manager.load.balancer.router.leader.ILeaderBalancer;
import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
+import org.apache.iotdb.confignode.manager.partition.RegionGroupExtensionPolicy;
import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -40,32 +43,20 @@ import java.util.Properties;
public class ConfigNodeDescriptor {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNodeDescriptor.class);
- private final ConfigNodeConfig CONF = new ConfigNodeConfig();
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private final CommonDescriptor commonDescriptor = CommonDescriptor.getInstance();
+
+ private final ConfigNodeConfig conf = new ConfigNodeConfig();
private ConfigNodeDescriptor() {
loadProps();
}
public ConfigNodeConfig getConf() {
- return CONF;
- }
-
- public static ConfigNodeDescriptor getInstance() {
- return ConfigNodeDescriptorHolder.INSTANCE;
- }
-
- private static class ConfigNodeDescriptorHolder {
-
- private static final ConfigNodeDescriptor INSTANCE = new ConfigNodeDescriptor();
-
- private ConfigNodeDescriptorHolder() {
- // empty constructor
- }
+ return conf;
}
/**
- * Get props url location
+ * get props url location
*
* @return url object if location exit, otherwise null.
*/
@@ -103,24 +94,46 @@ public class ConfigNodeDescriptor {
}
private void loadProps() {
- Properties properties = new Properties();
- URL url = getPropsUrl(ConfigNodeConstant.CONF_FILE_NAME);
+ URL url = getPropsUrl(CommonConfig.CONFIG_NAME);
+ Properties commonProperties = new Properties();
+ if (url != null) {
+ try (InputStream inputStream = url.openStream()) {
+
+ LOGGER.info("Start to read config file {}", url);
+ commonProperties.load(inputStream);
+
+ } catch (FileNotFoundException e) {
+ LOGGER.warn("Fail to find config file {}", url, e);
+ } catch (IOException e) {
+ LOGGER.warn("Cannot load config file, use default configuration", e);
+ } catch (Exception e) {
+ LOGGER.warn("Incorrect format in config file, use default configuration", e);
+ }
+ } else {
+ LOGGER.warn(
+ "Couldn't load the configuration {} from any of the known sources.",
+ CommonConfig.CONFIG_NAME);
+ }
+
+ url = getPropsUrl(ConfigNodeConstant.CONF_FILE_NAME);
if (url != null) {
try (InputStream inputStream = url.openStream()) {
- LOGGER.info("Start reading ConfigNode conf file: {}", url);
+ LOGGER.info("start reading ConfigNode conf file: {}", url);
+ Properties properties = new Properties();
properties.load(inputStream);
- loadProperties(properties);
+ commonProperties.putAll(properties);
+ loadProperties(commonProperties);
} catch (IOException | BadNodeUrlException e) {
LOGGER.warn("Couldn't load ConfigNode conf file, use default config", e);
} finally {
- CONF.formulateFolders();
-
- CommonDescriptor.getInstance().initCommonConfigDir(CONF.getCnSystemDir());
-
- MetricConfigDescriptor.getInstance().loadProps(properties);
+ conf.updatePath();
+ commonDescriptor
+ .getConfig()
+ .updatePath(System.getProperty(ConfigNodeConstant.CONFIGNODE_HOME, null));
+ MetricConfigDescriptor.getInstance().loadProps(commonProperties);
MetricConfigDescriptor.getInstance()
.getMetricConfig()
- .updateRpcInstance(CONF.getCnInternalAddress(), CONF.getCnInternalPort());
+ .updateRpcInstance(conf.getInternalAddress(), conf.getInternalPort());
}
} else {
LOGGER.warn(
@@ -130,169 +143,657 @@ public class ConfigNodeDescriptor {
}
private void loadProperties(Properties properties) throws BadNodeUrlException, IOException {
- /* ConfigNode RPC Configuration */
- loadConfigNodeRPCConfiguration(properties);
-
- /* Target ConfigNodes */
- loadTargetConfigNodes(properties);
+ conf.setClusterName(
+ properties.getProperty(IoTDBConstant.CLUSTER_NAME, conf.getClusterName()).trim());
- /* Directory Configuration */
- loadDirectoryConfiguration(properties);
-
- /* Thrift RPC Configuration */
- loadThriftRPCConfiguration(properties);
-
- /* Retain Configurations */
- // Notice: Never read any configuration through loadRetainConfiguration
- // Every parameter in retain configuration will be deleted or moved into other set
- loadRetainConfiguration(properties);
- }
-
- private void loadConfigNodeRPCConfiguration(Properties properties) {
- CONF.setCnInternalAddress(
+ conf.setInternalAddress(
properties
- .getProperty(IoTDBConstant.CN_INTERNAL_ADDRESS, CONF.getCnInternalAddress())
+ .getProperty(IoTDBConstant.CN_INTERNAL_ADDRESS, conf.getInternalAddress())
.trim());
- CONF.setCnInternalPort(
+ conf.setInternalPort(
Integer.parseInt(
properties
- .getProperty(
- IoTDBConstant.CN_INTERNAL_PORT, String.valueOf(CONF.getCnInternalPort()))
+ .getProperty(IoTDBConstant.CN_INTERNAL_PORT, String.valueOf(conf.getInternalPort()))
.trim()));
- CONF.setCnConsensusPort(
+ conf.setConsensusPort(
Integer.parseInt(
properties
.getProperty(
- IoTDBConstant.CN_CONSENSUS_PORT, String.valueOf(CONF.getCnConsensusPort()))
+ IoTDBConstant.CN_CONSENSUS_PORT, String.valueOf(conf.getConsensusPort()))
.trim()));
- }
- private void loadTargetConfigNodes(Properties properties) throws BadNodeUrlException {
// TODO: Enable multiple target_config_node_list
String targetConfigNodes =
properties.getProperty(IoTDBConstant.CN_TARGET_CONFIG_NODE_LIST, null);
if (targetConfigNodes != null) {
- CONF.setCnTargetConfigNode(NodeUrlUtils.parseTEndPointUrl(targetConfigNodes.trim()));
+ conf.setTargetConfigNode(NodeUrlUtils.parseTEndPointUrl(targetConfigNodes.trim()));
}
- }
- private void loadDirectoryConfiguration(Properties properties) {
- CONF.setCnSystemDir(properties.getProperty("cn_system_dir", CONF.getCnSystemDir()).trim());
+ conf.setSeriesSlotNum(
+ Integer.parseInt(
+ properties
+ .getProperty("series_slot_num", String.valueOf(conf.getSeriesSlotNum()))
+ .trim()));
- CONF.setCnConsensusDir(
- properties.getProperty("cn_consensus_dir", CONF.getCnConsensusDir()).trim());
- }
+ conf.setSeriesPartitionExecutorClass(
+ properties
+ .getProperty("series_partition_executor_class", conf.getSeriesPartitionExecutorClass())
+ .trim());
- private void loadThriftRPCConfiguration(Properties properties) {
- CONF.setCnRpcThriftCompressionEnable(
- Boolean.parseBoolean(
+ conf.setConfigNodeConsensusProtocolClass(
+ properties
+ .getProperty(
+ "config_node_consensus_protocol_class", conf.getConfigNodeConsensusProtocolClass())
+ .trim());
+
+ conf.setSchemaRegionConsensusProtocolClass(
+ properties
+ .getProperty(
+ "schema_region_consensus_protocol_class",
+ conf.getSchemaRegionConsensusProtocolClass())
+ .trim());
+
+ conf.setSchemaReplicationFactor(
+ Integer.parseInt(
properties
.getProperty(
- "cn_rpc_thrift_compression_enable",
- String.valueOf(CONF.isCnRpcThriftCompressionEnable()))
+ "schema_replication_factor", String.valueOf(conf.getSchemaReplicationFactor()))
.trim()));
- COMMON_CONFIG.setRpcThriftCompressionEnable(CONF.isCnRpcThriftCompressionEnable());
- CONF.setCnRpcAdvancedCompressionEnable(
- Boolean.parseBoolean(
+ conf.setDataRegionConsensusProtocolClass(
+ properties
+ .getProperty(
+ "data_region_consensus_protocol_class", conf.getDataRegionConsensusProtocolClass())
+ .trim());
+
+ conf.setDataReplicationFactor(
+ Integer.parseInt(
properties
.getProperty(
- "cn_rpc_advanced_compression_enable",
- String.valueOf(CONF.isCnRpcAdvancedCompressionEnable()))
+ "data_replication_factor", String.valueOf(conf.getDataReplicationFactor()))
+ .trim()));
+
+ conf.setSchemaRegionPerDataNode(
+ Double.parseDouble(
+ properties
+ .getProperty(
+ "schema_region_per_data_node",
+ String.valueOf(conf.getSchemaReplicationFactor()))
.trim()));
- CONF.setCnRpcMaxConcurrentClientNum(
+ conf.setSchemaRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy.parse(
+ properties.getProperty(
+ "schema_region_group_extension_policy",
+ conf.getSchemaRegionGroupExtensionPolicy().getPolicy().trim())));
+
+ conf.setSchemaRegionGroupPerDatabase(
Integer.parseInt(
+ properties.getProperty(
+ "schema_region_group_per_database",
+ String.valueOf(conf.getSchemaRegionGroupPerDatabase()).trim())));
+
+ conf.setDataRegionGroupExtensionPolicy(
+ RegionGroupExtensionPolicy.parse(
+ properties.getProperty(
+ "data_region_group_extension_policy",
+ conf.getDataRegionGroupExtensionPolicy().getPolicy().trim())));
+
+ conf.setDataRegionGroupPerDatabase(
+ Integer.parseInt(
+ properties.getProperty(
+ "data_region_group_per_database",
+ String.valueOf(conf.getDataRegionGroupPerDatabase()).trim())));
+
+ conf.setDataRegionPerProcessor(
+ Double.parseDouble(
properties
.getProperty(
- "cn_rpc_max_concurrent_client_num",
- String.valueOf(CONF.getCnRpcMaxConcurrentClientNum()))
+ "data_region_per_processor", String.valueOf(conf.getDataRegionPerProcessor()))
.trim()));
- CONF.setCnThriftMaxFrameSize(
+ conf.setLeastDataRegionGroupNum(
Integer.parseInt(
+ properties.getProperty(
+ "least_data_region_group_num", String.valueOf(conf.getLeastDataRegionGroupNum()))));
+
+ try {
+ conf.setRegionAllocateStrategy(
+ RegionBalancer.RegionGroupAllocatePolicy.valueOf(
+ properties
+ .getProperty(
+ "region_group_allocate_policy", conf.getRegionGroupAllocatePolicy().name())
+ .trim()));
+ } catch (IllegalArgumentException e) {
+ LOGGER.warn(
+ "The configured region allocate strategy does not exist, use the default: GREEDY!");
+ }
+
+ conf.setEnableDataPartitionInheritPolicy(
+ Boolean.parseBoolean(
+ properties.getProperty(
+ "enable_data_partition_inherit_policy",
+ String.valueOf(conf.isEnableDataPartitionInheritPolicy()))));
+
+ conf.setCnRpcAdvancedCompressionEnable(
+ Boolean.parseBoolean(
properties
.getProperty(
- "cn_thrift_max_frame_size", String.valueOf(CONF.getCnThriftMaxFrameSize()))
+ "cn_rpc_advanced_compression_enable",
+ String.valueOf(conf.isCnRpcAdvancedCompressionEnable()))
.trim()));
- CONF.setCnThriftInitBufferSize(
+ conf.setCnRpcMaxConcurrentClientNum(
Integer.parseInt(
properties
.getProperty(
- "cn_thrift_init_buffer_size", String.valueOf(CONF.getCnThriftInitBufferSize()))
+ "cn_rpc_max_concurrent_client_num",
+ String.valueOf(conf.getCnRpcMaxConcurrentClientNum()))
.trim()));
- CONF.setCnConnectionTimeoutMs(
+ conf.setCnThriftDefaultBufferSize(
Integer.parseInt(
properties
.getProperty(
- "cn_connection_timeout_ms", String.valueOf(CONF.getCnConnectionTimeoutMs()))
+ "cn_thrift_init_buffer_size",
+ String.valueOf(conf.getCnThriftDefaultBufferSize()))
.trim()));
- COMMON_CONFIG.setConnectionTimeoutInMS(CONF.getCnConnectionTimeoutMs());
- CONF.setCnSelectorThreadNumsOfClientManager(
+ conf.setCnThriftMaxFrameSize(
Integer.parseInt(
properties
.getProperty(
- "cn_selector_thread_nums_of_client_manager",
- String.valueOf(CONF.getCnSelectorThreadNumsOfClientManager()))
+ "cn_thrift_max_frame_size", String.valueOf(conf.getCnThriftMaxFrameSize()))
.trim()));
- COMMON_CONFIG.setSelectorThreadCountOfClientManager(
- CONF.getCnSelectorThreadNumsOfClientManager());
- CONF.setCnCoreClientCountForEachNodeInClientManager(
+ conf.setCoreClientNumForEachNode(
Integer.parseInt(
properties
.getProperty(
"cn_core_client_count_for_each_node_in_client_manager",
- String.valueOf(CONF.getCnCoreClientCountForEachNodeInClientManager()))
+ String.valueOf(conf.getCoreClientNumForEachNode()))
.trim()));
- COMMON_CONFIG.setCoreClientCountForEachNodeInClientManager(
- CONF.getCnCoreClientCountForEachNodeInClientManager());
- CONF.setCnMaxClientCountForEachNodeInClientManager(
+ conf.setMaxClientNumForEachNode(
Integer.parseInt(
properties
.getProperty(
"cn_max_client_count_for_each_node_in_client_manager",
- String.valueOf(CONF.getCnMaxClientCountForEachNodeInClientManager()))
+ String.valueOf(conf.getMaxClientNumForEachNode()))
.trim()));
- COMMON_CONFIG.setMaxClientCountForEachNodeInClientManager(
- CONF.getCnMaxClientCountForEachNodeInClientManager());
- }
- /**
- * Load retain configuration. Please don't insert any code within this function
- *
- * <p>TODO: Delete this function in the future
- */
- private void loadRetainConfiguration(Properties properties) throws IOException {
- try {
- CONF.setRegionGroupAllocatePolicy(
- RegionBalancer.RegionGroupAllocatePolicy.valueOf(
- properties
- .getProperty(
- "region_group_allocate_policy", CONF.getRegionGroupAllocatePolicy().name())
- .trim()));
- } catch (IllegalArgumentException e) {
- LOGGER.warn(
- "The configured region allocate strategy does not exist, use the default: GREEDY!");
+ conf.setSystemDir(properties.getProperty("cn_system_dir", conf.getSystemDir()).trim());
+
+ conf.setConsensusDir(properties.getProperty("cn_consensus_dir", conf.getConsensusDir()).trim());
+
+ conf.setUdfDir(properties.getProperty("udf_lib_dir", conf.getUdfDir()).trim());
+
+ conf.setTriggerDir(properties.getProperty("trigger_lib_dir", conf.getTriggerDir()).trim());
+
+ conf.setTimePartitionInterval(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "time_partition_interval", String.valueOf(conf.getTimePartitionInterval()))
+ .trim()));
+
+ conf.setHeartbeatIntervalInMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "heartbeat_interval_in_ms", String.valueOf(conf.getHeartbeatIntervalInMs()))
+ .trim()));
+
+ String leaderDistributionPolicy =
+ properties
+ .getProperty("leader_distribution_policy", conf.getLeaderDistributionPolicy())
+ .trim();
+ if (ILeaderBalancer.GREEDY_POLICY.equals(leaderDistributionPolicy)
+ || ILeaderBalancer.MIN_COST_FLOW_POLICY.equals(leaderDistributionPolicy)) {
+ conf.setLeaderDistributionPolicy(leaderDistributionPolicy);
+ } else {
+ throw new IOException(
+ String.format(
+ "Unknown leader_distribution_policy: %s, please set to \"GREEDY\" or \"MIN_COST_FLOW\"",
+ leaderDistributionPolicy));
}
+ conf.setEnableAutoLeaderBalanceForRatisConsensus(
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "enable_auto_leader_balance_for_ratis_consensus",
+ String.valueOf(conf.isEnableAutoLeaderBalanceForRatisConsensus()))
+ .trim()));
+
+ conf.setEnableAutoLeaderBalanceForIoTConsensus(
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "enable_auto_leader_balance_for_iot_consensus",
+ String.valueOf(conf.isEnableAutoLeaderBalanceForIoTConsensus()))
+ .trim()));
+
String routePriorityPolicy =
- properties.getProperty("route_priority_policy", CONF.getRoutePriorityPolicy()).trim();
+ properties.getProperty("route_priority_policy", conf.getRoutePriorityPolicy()).trim();
if (IPriorityBalancer.GREEDY_POLICY.equals(routePriorityPolicy)
|| IPriorityBalancer.LEADER_POLICY.equals(routePriorityPolicy)) {
- CONF.setRoutePriorityPolicy(routePriorityPolicy);
+ conf.setRoutePriorityPolicy(routePriorityPolicy);
} else {
throw new IOException(
String.format(
"Unknown route_priority_policy: %s, please set to \"LEADER\" or \"GREEDY\"",
routePriorityPolicy));
}
+
+ String readConsistencyLevel =
+ properties.getProperty("read_consistency_level", conf.getReadConsistencyLevel()).trim();
+ if (readConsistencyLevel.equals("strong") || readConsistencyLevel.equals("weak")) {
+ conf.setReadConsistencyLevel(readConsistencyLevel);
+ } else {
+ throw new IOException(
+ String.format(
+ "Unknown read_consistency_level: %s, please set to \"strong\" or \"weak\"",
+ readConsistencyLevel));
+ }
+
+ // commons
+ commonDescriptor.loadCommonProps(properties);
+ commonDescriptor.initCommonConfigDir(conf.getSystemDir());
+
+ conf.setProcedureCompletedEvictTTL(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "procedure_completed_evict_ttl",
+ String.valueOf(conf.getProcedureCompletedEvictTTL()))
+ .trim()));
+
+ conf.setProcedureCompletedCleanInterval(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "procedure_completed_clean_interval",
+ String.valueOf(conf.getProcedureCompletedCleanInterval()))
+ .trim()));
+
+ conf.setProcedureCoreWorkerThreadsCount(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "procedure_core_worker_thread_count",
+ String.valueOf(conf.getProcedureCoreWorkerThreadsCount()))
+ .trim()));
+
+ loadRatisConsensusConfig(properties);
+ loadCQConfig(properties);
+ }
+
+ private void loadRatisConsensusConfig(Properties properties) {
+ conf.setDataRegionRatisConsensusLogAppenderBufferSize(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_log_appender_buffer_size_max",
+ String.valueOf(conf.getDataRegionRatisConsensusLogAppenderBufferSize()))
+ .trim()));
+
+ conf.setConfigNodeRatisConsensusLogAppenderBufferSize(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_log_appender_buffer_size_max",
+ String.valueOf(conf.getConfigNodeRatisConsensusLogAppenderBufferSize()))
+ .trim()));
+
+ conf.setSchemaRegionRatisConsensusLogAppenderBufferSize(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_log_appender_buffer_size_max",
+ String.valueOf(conf.getSchemaRegionRatisConsensusLogAppenderBufferSize()))
+ .trim()));
+
+ conf.setDataRegionRatisSnapshotTriggerThreshold(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_snapshot_trigger_threshold",
+ String.valueOf(conf.getDataRegionRatisSnapshotTriggerThreshold()))
+ .trim()));
+
+ conf.setConfigNodeRatisSnapshotTriggerThreshold(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_snapshot_trigger_threshold",
+ String.valueOf(conf.getConfigNodeRatisSnapshotTriggerThreshold()))
+ .trim()));
+
+ conf.setSchemaRegionRatisSnapshotTriggerThreshold(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_snapshot_trigger_threshold",
+ String.valueOf(conf.getSchemaRegionRatisSnapshotTriggerThreshold()))
+ .trim()));
+
+ conf.setDataRegionRatisLogUnsafeFlushEnable(
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "data_region_ratis_log_unsafe_flush_enable",
+ String.valueOf(conf.isDataRegionRatisLogUnsafeFlushEnable()))
+ .trim()));
+
+ conf.setConfigNodeRatisLogUnsafeFlushEnable(
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "config_node_ratis_log_unsafe_flush_enable",
+ String.valueOf(conf.isConfigNodeRatisLogUnsafeFlushEnable()))
+ .trim()));
+
+ conf.setSchemaRegionRatisLogUnsafeFlushEnable(
+ Boolean.parseBoolean(
+ properties
+ .getProperty(
+ "schema_region_ratis_log_unsafe_flush_enable",
+ String.valueOf(conf.isSchemaRegionRatisLogUnsafeFlushEnable()))
+ .trim()));
+
+ conf.setDataRegionRatisLogSegmentSizeMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_log_segment_size_max_in_byte",
+ String.valueOf(conf.getDataRegionRatisLogSegmentSizeMax()))
+ .trim()));
+
+ conf.setConfigNodeRatisLogSegmentSizeMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_log_segment_size_max_in_byte",
+ String.valueOf(conf.getConfigNodeRatisLogSegmentSizeMax()))
+ .trim()));
+
+ conf.setSchemaRegionRatisLogSegmentSizeMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_log_segment_size_max_in_byte",
+ String.valueOf(conf.getSchemaRegionRatisLogSegmentSizeMax()))
+ .trim()));
+
+ conf.setConfigNodeSimpleConsensusLogSegmentSizeMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_simple_consensus_log_segment_size_max_in_byte",
+ String.valueOf(conf.getConfigNodeSimpleConsensusLogSegmentSizeMax()))
+ .trim()));
+
+ conf.setDataRegionRatisGrpcFlowControlWindow(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_grpc_flow_control_window",
+ String.valueOf(conf.getDataRegionRatisGrpcFlowControlWindow()))
+ .trim()));
+
+ conf.setConfigNodeRatisGrpcFlowControlWindow(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_grpc_flow_control_window",
+ String.valueOf(conf.getConfigNodeRatisGrpcFlowControlWindow()))
+ .trim()));
+
+ conf.setSchemaRegionRatisGrpcFlowControlWindow(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_grpc_flow_control_window",
+ String.valueOf(conf.getSchemaRegionRatisGrpcFlowControlWindow()))
+ .trim()));
+
+ conf.setDataRegionRatisRpcLeaderElectionTimeoutMinMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_rpc_leader_election_timeout_min_ms",
+ String.valueOf(conf.getDataRegionRatisRpcLeaderElectionTimeoutMinMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisRpcLeaderElectionTimeoutMinMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_rpc_leader_election_timeout_min_ms",
+ String.valueOf(conf.getConfigNodeRatisRpcLeaderElectionTimeoutMinMs()))
+ .trim()));
+
+ conf.setSchemaRegionRatisRpcLeaderElectionTimeoutMinMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_rpc_leader_election_timeout_min_ms",
+ String.valueOf(conf.getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs()))
+ .trim()));
+
+ conf.setDataRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_rpc_leader_election_timeout_max_ms",
+ String.valueOf(conf.getDataRegionRatisRpcLeaderElectionTimeoutMaxMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_rpc_leader_election_timeout_max_ms",
+ String.valueOf(conf.getConfigNodeRatisRpcLeaderElectionTimeoutMaxMs()))
+ .trim()));
+
+ conf.setSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_rpc_leader_election_timeout_max_ms",
+ String.valueOf(conf.getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisRequestTimeoutMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_request_timeout_ms",
+ String.valueOf(conf.getConfigNodeRatisRequestTimeoutMs()))
+ .trim()));
+ conf.setSchemaRegionRatisRequestTimeoutMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_request_timeout_ms",
+ String.valueOf(conf.getSchemaRegionRatisRequestTimeoutMs()))
+ .trim()));
+ conf.setDataRegionRatisRequestTimeoutMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_request_timeout_ms",
+ String.valueOf(conf.getDataRegionRatisRequestTimeoutMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisMaxRetryAttempts(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "config_node_ratis_max_retry_attempts",
+ String.valueOf(conf.getConfigNodeRatisMaxRetryAttempts()))
+ .trim()));
+ conf.setConfigNodeRatisInitialSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_initial_sleep_time_ms",
+ String.valueOf(conf.getConfigNodeRatisInitialSleepTimeMs()))
+ .trim()));
+ conf.setConfigNodeRatisMaxSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_max_sleep_time_ms",
+ String.valueOf(conf.getConfigNodeRatisMaxSleepTimeMs()))
+ .trim()));
+
+ conf.setDataRegionRatisMaxRetryAttempts(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "data_region_ratis_max_retry_attempts",
+ String.valueOf(conf.getDataRegionRatisMaxRetryAttempts()))
+ .trim()));
+ conf.setDataRegionRatisInitialSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_initial_sleep_time_ms",
+ String.valueOf(conf.getDataRegionRatisInitialSleepTimeMs()))
+ .trim()));
+ conf.setDataRegionRatisMaxSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_max_sleep_time_ms",
+ String.valueOf(conf.getDataRegionRatisMaxSleepTimeMs()))
+ .trim()));
+
+ conf.setSchemaRegionRatisMaxRetryAttempts(
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "schema_region_ratis_max_retry_attempts",
+ String.valueOf(conf.getSchemaRegionRatisMaxRetryAttempts()))
+ .trim()));
+ conf.setSchemaRegionRatisInitialSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_initial_sleep_time_ms",
+ String.valueOf(conf.getSchemaRegionRatisInitialSleepTimeMs()))
+ .trim()));
+ conf.setSchemaRegionRatisMaxSleepTimeMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_max_sleep_time_ms",
+ String.valueOf(conf.getSchemaRegionRatisMaxSleepTimeMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisPreserveLogsWhenPurge(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_preserve_logs_num_when_purge",
+ String.valueOf(conf.getConfigNodeRatisPreserveLogsWhenPurge()))
+ .trim()));
+
+ conf.setSchemaRegionRatisPreserveLogsWhenPurge(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_preserve_logs_num_when_purge",
+ String.valueOf(conf.getSchemaRegionRatisPreserveLogsWhenPurge()))
+ .trim()));
+
+ conf.setDataRegionRatisPreserveLogsWhenPurge(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_preserve_logs_num_when_purge",
+ String.valueOf(conf.getDataRegionRatisPreserveLogsWhenPurge()))
+ .trim()));
+
+ conf.setRatisFirstElectionTimeoutMinMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "ratis_first_election_timeout_min_ms",
+ String.valueOf(conf.getRatisFirstElectionTimeoutMinMs()))
+ .trim()));
+
+ conf.setRatisFirstElectionTimeoutMaxMs(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "ratis_first_election_timeout_max_ms",
+ String.valueOf(conf.getRatisFirstElectionTimeoutMaxMs()))
+ .trim()));
+
+ conf.setConfigNodeRatisLogMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "config_node_ratis_log_max_size",
+ String.valueOf(conf.getConfigNodeRatisLogMax()))
+ .trim()));
+
+ conf.setSchemaRegionRatisLogMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "schema_region_ratis_log_max_size",
+ String.valueOf(conf.getSchemaRegionRatisLogMax()))
+ .trim()));
+
+ conf.setDataRegionRatisLogMax(
+ Long.parseLong(
+ properties
+ .getProperty(
+ "data_region_ratis_log_max_size",
+ String.valueOf(conf.getDataRegionRatisLogMax()))
+ .trim()));
+ }
+
+ private void loadCQConfig(Properties properties) {
+ int cqSubmitThread =
+ Integer.parseInt(
+ properties
+ .getProperty(
+ "continuous_query_submit_thread_count",
+ String.valueOf(conf.getCqSubmitThread()))
+ .trim());
+ if (cqSubmitThread <= 0) {
+ LOGGER.warn(
+ "continuous_query_submit_thread should be greater than 0, but current value is {}, ignore that and use the default value {}",
+ cqSubmitThread,
+ conf.getCqSubmitThread());
+ cqSubmitThread = conf.getCqSubmitThread();
+ }
+ conf.setCqSubmitThread(cqSubmitThread);
+
+ long cqMinEveryIntervalInMs =
+ Long.parseLong(
+ properties
+ .getProperty(
+ "continuous_query_min_every_interval_in_ms",
+ String.valueOf(conf.getCqMinEveryIntervalInMs()))
+ .trim());
+ if (cqMinEveryIntervalInMs <= 0) {
+ LOGGER.warn(
+ "continuous_query_min_every_interval_in_ms should be greater than 0, but current value is {}, ignore that and use the default value {}",
+ cqMinEveryIntervalInMs,
+ conf.getCqMinEveryIntervalInMs());
+ cqMinEveryIntervalInMs = conf.getCqMinEveryIntervalInMs();
+ }
+
+ conf.setCqMinEveryIntervalInMs(cqMinEveryIntervalInMs);
}
/**
@@ -303,9 +804,22 @@ public class ConfigNodeDescriptor {
* @return True if the target_config_node_list points to itself
*/
public boolean isSeedConfigNode() {
- return (CONF.getCnInternalAddress().equals(CONF.getCnTargetConfigNode().getIp())
- || (NodeUrlUtils.isLocalAddress(CONF.getCnInternalAddress())
- && NodeUrlUtils.isLocalAddress(CONF.getCnTargetConfigNode().getIp())))
- && CONF.getCnInternalPort() == CONF.getCnTargetConfigNode().getPort();
+ return (conf.getInternalAddress().equals(conf.getTargetConfigNode().getIp())
+ || (NodeUrlUtils.isLocalAddress(conf.getInternalAddress())
+ && NodeUrlUtils.isLocalAddress(conf.getTargetConfigNode().getIp())))
+ && conf.getInternalPort() == conf.getTargetConfigNode().getPort();
+ }
+
+ public static ConfigNodeDescriptor getInstance() {
+ return ConfigNodeDescriptorHolder.INSTANCE;
+ }
+
+ private static class ConfigNodeDescriptorHolder {
+
+ private static final ConfigNodeDescriptor INSTANCE = new ConfigNodeDescriptor();
+
+ private ConfigNodeDescriptorHolder() {
+ // empty constructor
+ }
}
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
index f31fcc4016..d7c492275b 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeRemoveCheck.java
@@ -52,7 +52,7 @@ public class ConfigNodeRemoveCheck {
public ConfigNodeRemoveCheck() {
systemPropertiesFile =
- new File(CONF.getCnSystemDir() + File.separator + ConfigNodeConstant.SYSTEM_FILE_NAME);
+ new File(CONF.getSystemDir() + File.separator + ConfigNodeConstant.SYSTEM_FILE_NAME);
systemProperties = new Properties();
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index db1888c937..b70e20bb9c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -18,12 +18,10 @@
*/
package org.apache.iotdb.confignode.conf;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
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.loadbalance.LeaderDistributionPolicy;
+import org.apache.iotdb.confignode.manager.load.balancer.router.leader.ILeaderBalancer;
import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
import org.apache.iotdb.consensus.ConsensusFactory;
@@ -41,9 +39,7 @@ public class ConfigNodeStartupCheck {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNodeStartupCheck.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
public void startUpCheck() throws StartupException, IOException, ConfigurationException {
checkGlobalConfig();
@@ -57,98 +53,78 @@ public class ConfigNodeStartupCheck {
private void checkGlobalConfig() throws ConfigurationException {
// When the ConfigNode consensus protocol is set to SIMPLE_CONSENSUS,
// the target_config_node_list needs to point to itself
- if (COMMON_CONFIG
- .getConfigNodeConsensusProtocolClass()
- .getProtocol()
- .equals(ConsensusFactory.SIMPLE_CONSENSUS)
- && (!CONFIG_NODE_CONFIG
- .getCnInternalAddress()
- .equals(CONFIG_NODE_CONFIG.getCnTargetConfigNode().getIp())
- || CONFIG_NODE_CONFIG.getCnInternalPort()
- != CONFIG_NODE_CONFIG.getCnTargetConfigNode().getPort())) {
+ if (CONF.getConfigNodeConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
+ && (!CONF.getInternalAddress().equals(CONF.getTargetConfigNode().getIp())
+ || CONF.getInternalPort() != CONF.getTargetConfigNode().getPort())) {
throw new ConfigurationException(
IoTDBConstant.CN_TARGET_CONFIG_NODE_LIST,
- CONFIG_NODE_CONFIG.getCnTargetConfigNode().getIp()
- + ":"
- + CONFIG_NODE_CONFIG.getCnTargetConfigNode().getPort(),
- CONFIG_NODE_CONFIG.getCnInternalAddress() + ":" + CONFIG_NODE_CONFIG.getCnInternalPort());
+ CONF.getTargetConfigNode().getIp() + ":" + CONF.getTargetConfigNode().getPort(),
+ CONF.getInternalAddress() + ":" + CONF.getInternalPort());
}
// When the data region consensus protocol is set to SIMPLE_CONSENSUS,
// the data replication factor must be 1
- if (COMMON_CONFIG
- .getDataRegionConsensusProtocolClass()
- .getProtocol()
- .equals(ConsensusFactory.SIMPLE_CONSENSUS)
- && COMMON_CONFIG.getDataReplicationFactor() != 1) {
+ if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
+ && CONF.getDataReplicationFactor() != 1) {
throw new ConfigurationException(
"data_replication_factor",
- String.valueOf(COMMON_CONFIG.getDataReplicationFactor()),
+ String.valueOf(CONF.getDataReplicationFactor()),
String.valueOf(1));
}
// When the schema region consensus protocol is set to SIMPLE_CONSENSUS,
// the schema replication factor must be 1
- if (COMMON_CONFIG
- .getSchemaRegionConsensusProtocolClass()
- .getProtocol()
- .equals(ConsensusFactory.SIMPLE_CONSENSUS)
- && COMMON_CONFIG.getSchemaReplicationFactor() != 1) {
+ if (CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
+ && CONF.getSchemaReplicationFactor() != 1) {
throw new ConfigurationException(
"schema_replication_factor",
- String.valueOf(COMMON_CONFIG.getSchemaReplicationFactor()),
+ String.valueOf(CONF.getSchemaReplicationFactor()),
String.valueOf(1));
}
// When the schema region consensus protocol is set to IoTConsensus,
// we should report an error
- if (COMMON_CONFIG
- .getSchemaRegionConsensusProtocolClass()
- .getProtocol()
- .equals(ConsensusFactory.IOT_CONSENSUS)) {
+ if (CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.IOT_CONSENSUS)) {
throw new ConfigurationException(
"schema_region_consensus_protocol_class",
- String.valueOf(COMMON_CONFIG.getSchemaRegionConsensusProtocolClass()),
+ String.valueOf(CONF.getSchemaRegionConsensusProtocolClass()),
String.format(
"%s or %s", ConsensusFactory.SIMPLE_CONSENSUS, ConsensusFactory.RATIS_CONSENSUS));
}
// The leader distribution policy is limited
- if (!LeaderDistributionPolicy.GREEDY.equals(COMMON_CONFIG.getLeaderDistributionPolicy())
- && !LeaderDistributionPolicy.MIN_COST_FLOW.equals(
- COMMON_CONFIG.getLeaderDistributionPolicy())) {
+ if (!ILeaderBalancer.GREEDY_POLICY.equals(CONF.getLeaderDistributionPolicy())
+ && !ILeaderBalancer.MIN_COST_FLOW_POLICY.equals(CONF.getLeaderDistributionPolicy())) {
throw new ConfigurationException(
- "leader_distribution_policy",
- CONFIG_NODE_CONFIG.getRoutePriorityPolicy(),
- "GREEDY or MIN_COST_FLOW");
+ "leader_distribution_policy", CONF.getRoutePriorityPolicy(), "GREEDY or MIN_COST_FLOW");
}
// The route priority policy is limited
- if (!CONFIG_NODE_CONFIG.getRoutePriorityPolicy().equals(IPriorityBalancer.LEADER_POLICY)
- && !CONFIG_NODE_CONFIG.getRoutePriorityPolicy().equals(IPriorityBalancer.GREEDY_POLICY)) {
+ if (!CONF.getRoutePriorityPolicy().equals(IPriorityBalancer.LEADER_POLICY)
+ && !CONF.getRoutePriorityPolicy().equals(IPriorityBalancer.GREEDY_POLICY)) {
throw new ConfigurationException(
- "route_priority_policy", CONFIG_NODE_CONFIG.getRoutePriorityPolicy(), "LEADER or GREEDY");
+ "route_priority_policy", CONF.getRoutePriorityPolicy(), "LEADER or GREEDY");
}
// The ip of target ConfigNode couldn't be 0.0.0.0
- if (CONFIG_NODE_CONFIG.getCnTargetConfigNode().getIp().equals("0.0.0.0")) {
+ if (CONF.getTargetConfigNode().getIp().equals("0.0.0.0")) {
throw new ConfigurationException(
"The ip address of any target_config_node_list couldn't be 0.0.0.0");
}
// The least DataRegionGroup number should be positive
- if (COMMON_CONFIG.getLeastDataRegionGroupNum() <= 0) {
+ if (CONF.getLeastDataRegionGroupNum() <= 0) {
throw new ConfigurationException("The least_data_region_group_num should be positive");
}
}
private void createDirsIfNecessary() throws IOException {
// If systemDir does not exist, create systemDir
- File systemDir = new File(CONFIG_NODE_CONFIG.getCnSystemDir());
+ File systemDir = new File(CONF.getSystemDir());
createDirIfEmpty(systemDir);
// If consensusDir does not exist, create consensusDir
- File consensusDir = new File(CONFIG_NODE_CONFIG.getCnConsensusDir());
+ File consensusDir = new File(CONF.getConsensusDir());
createDirIfEmpty(consensusDir);
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
index 95db18a133..a5aa7e7dfc 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
@@ -19,8 +19,6 @@
package org.apache.iotdb.confignode.conf;
import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
import org.apache.iotdb.commons.exception.ConfigurationException;
import org.apache.iotdb.commons.utils.NodeUrlUtils;
@@ -46,13 +44,11 @@ public class SystemPropertiesUtils {
private static final File systemPropertiesFile =
new File(
- ConfigNodeDescriptor.getInstance().getConf().getCnSystemDir()
+ ConfigNodeDescriptor.getInstance().getConf().getSystemDir()
+ File.separator
+ ConfigNodeConstant.SYSTEM_FILE_NAME);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig conf = ConfigNodeDescriptor.getInstance().getConf();
/**
* Check if the ConfigNode is restarted
@@ -76,26 +72,26 @@ public class SystemPropertiesUtils {
// Startup configuration
String clusterName = systemProperties.getProperty(CLUSTER_NAME, null);
- if (clusterName != null && !clusterName.equals(COMMON_CONFIG.getClusterName())) {
- throw new ConfigurationException(CLUSTER_NAME, COMMON_CONFIG.getClusterName(), clusterName);
+ if (clusterName != null && !clusterName.equals(conf.getClusterName())) {
+ throw new ConfigurationException(CLUSTER_NAME, conf.getClusterName(), clusterName);
}
String internalAddress = systemProperties.getProperty("cn_internal_address", null);
if (internalAddress == null) {
needReWrite = true;
- } else if (!internalAddress.equals(CONFIG_NODE_CONFIG.getCnInternalAddress())) {
+ } else if (!internalAddress.equals(conf.getInternalAddress())) {
throw new ConfigurationException(
- "cn_internal_address", CONFIG_NODE_CONFIG.getCnInternalAddress(), internalAddress);
+ "cn_internal_address", conf.getInternalAddress(), internalAddress);
}
if (systemProperties.getProperty("cn_internal_port", null) == null) {
needReWrite = true;
} else {
int internalPort = Integer.parseInt(systemProperties.getProperty("cn_internal_port"));
- if (internalPort != CONFIG_NODE_CONFIG.getCnInternalPort()) {
+ if (internalPort != conf.getInternalPort()) {
throw new ConfigurationException(
"cn_internal_port",
- String.valueOf(CONFIG_NODE_CONFIG.getCnInternalPort()),
+ String.valueOf(conf.getInternalPort()),
String.valueOf(internalPort));
}
}
@@ -104,10 +100,10 @@ public class SystemPropertiesUtils {
needReWrite = true;
} else {
int consensusPort = Integer.parseInt(systemProperties.getProperty("cn_consensus_port"));
- if (consensusPort != CONFIG_NODE_CONFIG.getCnConsensusPort()) {
+ if (consensusPort != conf.getConsensusPort()) {
throw new ConfigurationException(
"cn_consensus_port",
- String.valueOf(CONFIG_NODE_CONFIG.getCnConsensusPort()),
+ String.valueOf(conf.getConsensusPort()),
String.valueOf(consensusPort));
}
}
@@ -118,10 +114,10 @@ public class SystemPropertiesUtils {
if (configNodeConsensusProtocolClass == null) {
needReWrite = true;
} else if (!configNodeConsensusProtocolClass.equals(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ conf.getConfigNodeConsensusProtocolClass())) {
throw new ConfigurationException(
"config_node_consensus_protocol_class",
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol(),
+ conf.getConfigNodeConsensusProtocolClass(),
configNodeConsensusProtocolClass);
}
@@ -130,10 +126,10 @@ public class SystemPropertiesUtils {
if (dataRegionConsensusProtocolClass == null) {
needReWrite = true;
} else if (!dataRegionConsensusProtocolClass.equals(
- COMMON_CONFIG.getDataRegionConsensusProtocolClass().getProtocol())) {
+ conf.getDataRegionConsensusProtocolClass())) {
throw new ConfigurationException(
"data_region_consensus_protocol_class",
- COMMON_CONFIG.getDataRegionConsensusProtocolClass().getProtocol(),
+ conf.getDataRegionConsensusProtocolClass(),
dataRegionConsensusProtocolClass);
}
@@ -142,10 +138,10 @@ public class SystemPropertiesUtils {
if (schemaRegionConsensusProtocolClass == null) {
needReWrite = true;
} else if (!schemaRegionConsensusProtocolClass.equals(
- COMMON_CONFIG.getSchemaRegionConsensusProtocolClass().getProtocol())) {
+ conf.getSchemaRegionConsensusProtocolClass())) {
throw new ConfigurationException(
"schema_region_consensus_protocol_class",
- COMMON_CONFIG.getSchemaRegionConsensusProtocolClass().getProtocol(),
+ conf.getSchemaRegionConsensusProtocolClass(),
schemaRegionConsensusProtocolClass);
}
@@ -155,10 +151,10 @@ public class SystemPropertiesUtils {
} else {
int seriesPartitionSlotNum =
Integer.parseInt(systemProperties.getProperty("series_partition_slot_num"));
- if (seriesPartitionSlotNum != COMMON_CONFIG.getSeriesSlotNum()) {
+ if (seriesPartitionSlotNum != conf.getSeriesSlotNum()) {
throw new ConfigurationException(
"series_partition_slot_num",
- String.valueOf(COMMON_CONFIG.getSeriesSlotNum()),
+ String.valueOf(conf.getSeriesSlotNum()),
String.valueOf(seriesPartitionSlotNum));
}
}
@@ -168,10 +164,10 @@ public class SystemPropertiesUtils {
if (seriesPartitionSlotExecutorClass == null) {
needReWrite = true;
} else if (!Objects.equals(
- seriesPartitionSlotExecutorClass, COMMON_CONFIG.getSeriesPartitionExecutorClass())) {
+ seriesPartitionSlotExecutorClass, conf.getSeriesPartitionExecutorClass())) {
throw new ConfigurationException(
"series_partition_executor_class",
- COMMON_CONFIG.getSeriesPartitionExecutorClass(),
+ conf.getSeriesPartitionExecutorClass(),
seriesPartitionSlotExecutorClass);
}
@@ -209,37 +205,30 @@ public class SystemPropertiesUtils {
Properties systemProperties = getSystemProperties();
// Cluster configuration
- systemProperties.setProperty("cluster_name", COMMON_CONFIG.getClusterName());
- systemProperties.setProperty(
- "config_node_id", String.valueOf(CONFIG_NODE_CONFIG.getConfigNodeId()));
+ systemProperties.setProperty("cluster_name", conf.getClusterName());
+ systemProperties.setProperty("config_node_id", String.valueOf(conf.getConfigNodeId()));
systemProperties.setProperty(
"is_seed_config_node",
String.valueOf(ConfigNodeDescriptor.getInstance().isSeedConfigNode()));
// Startup configuration
- systemProperties.setProperty(
- "cn_internal_address", String.valueOf(CONFIG_NODE_CONFIG.getCnInternalAddress()));
- systemProperties.setProperty(
- "cn_internal_port", String.valueOf(CONFIG_NODE_CONFIG.getCnInternalPort()));
- systemProperties.setProperty(
- "cn_consensus_port", String.valueOf(CONFIG_NODE_CONFIG.getCnConsensusPort()));
+ systemProperties.setProperty("cn_internal_address", String.valueOf(conf.getInternalAddress()));
+ systemProperties.setProperty("cn_internal_port", String.valueOf(conf.getInternalPort()));
+ systemProperties.setProperty("cn_consensus_port", String.valueOf(conf.getConsensusPort()));
// Consensus protocol configuration
systemProperties.setProperty(
- "config_node_consensus_protocol_class",
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol());
+ "config_node_consensus_protocol_class", conf.getConfigNodeConsensusProtocolClass());
systemProperties.setProperty(
- "data_region_consensus_protocol_class",
- COMMON_CONFIG.getDataRegionConsensusProtocolClass().getProtocol());
+ "data_region_consensus_protocol_class", conf.getDataRegionConsensusProtocolClass());
systemProperties.setProperty(
- "schema_region_consensus_protocol_class",
- COMMON_CONFIG.getSchemaRegionConsensusProtocolClass().getProtocol());
+ "schema_region_consensus_protocol_class", conf.getSchemaRegionConsensusProtocolClass());
// PartitionSlot configuration
systemProperties.setProperty(
- "series_partition_slot_num", String.valueOf(COMMON_CONFIG.getSeriesSlotNum()));
+ "series_partition_slot_num", String.valueOf(conf.getSeriesSlotNum()));
systemProperties.setProperty(
- "series_partition_executor_class", COMMON_CONFIG.getSeriesPartitionExecutorClass());
+ "series_partition_executor_class", conf.getSeriesPartitionExecutorClass());
storeSystemProperties(systemProperties);
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
index 0a35aebefe..74c5ed5784 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigNodeRegionStateMachine.java
@@ -22,7 +22,6 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.auth.AuthException;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.conf.CommonConfig;
import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
import org.apache.iotdb.commons.file.SystemFileFactory;
@@ -61,10 +60,7 @@ public class ConfigNodeRegionStateMachine
private static final ExecutorService threadPool =
IoTDBThreadPoolFactory.newCachedThreadPool("CQ-recovery");
-
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private final ConfigPlanExecutor executor;
private ConfigManager configManager;
private LogWriter logWriter;
@@ -73,16 +69,12 @@ public class ConfigNodeRegionStateMachine
private int endIndex;
private static final String CURRENT_FILE_DIR =
- CONFIG_NODE_CONFIG.getCnConsensusDir()
- + File.separator
- + "simple"
- + File.separator
- + "current";
+ CONF.getConsensusDir() + File.separator + "simple" + File.separator + "current";
private static final String PROGRESS_FILE_PATH =
CURRENT_FILE_DIR + File.separator + "log_inprogress_";
private static final String FILE_PATH = CURRENT_FILE_DIR + File.separator + "log_";
private static final long LOG_FILE_MAX_SIZE =
- COMMON_CONFIG.getConfigNodeSimpleConsensusLogSegmentSizeMax();
+ CONF.getConfigNodeSimpleConsensusLogSegmentSizeMax();
private final TEndPoint currentNodeTEndPoint;
public ConfigNodeRegionStateMachine(ConfigManager configManager, ConfigPlanExecutor executor) {
@@ -90,8 +82,8 @@ public class ConfigNodeRegionStateMachine
this.configManager = configManager;
this.currentNodeTEndPoint =
new TEndPoint()
- .setIp(ConfigNodeDescriptor.getInstance().getConf().getCnInternalAddress())
- .setPort(ConfigNodeDescriptor.getInstance().getConf().getCnConsensusPort());
+ .setIp(ConfigNodeDescriptor.getInstance().getConf().getInternalAddress())
+ .setPort(ConfigNodeDescriptor.getInstance().getConf().getConsensusPort());
}
public ConfigManager getConfigManager() {
@@ -138,8 +130,7 @@ public class ConfigNodeRegionStateMachine
result = new TSStatus(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
}
- if (ConsensusFactory.SIMPLE_CONSENSUS.equals(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ if (ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
writeLogForSimpleConsensus(plan);
}
return result;
@@ -235,8 +226,7 @@ public class ConfigNodeRegionStateMachine
@Override
public void start() {
- if (ConsensusFactory.SIMPLE_CONSENSUS.equals(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ if (ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
initStandAloneConfigNode();
}
}
@@ -248,7 +238,7 @@ public class ConfigNodeRegionStateMachine
@Override
public boolean isReadOnly() {
- return CommonDescriptor.getInstance().getConf().isReadOnly();
+ return CommonDescriptor.getInstance().getConfig().isReadOnly();
}
@Override
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
index 55cbf4cb0e..6259a753f4 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
@@ -23,8 +23,6 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeConfiguration;
import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSetTTLReq;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.exception.IllegalPathException;
import org.apache.iotdb.commons.exception.MetadataException;
import org.apache.iotdb.commons.path.PartialPath;
@@ -33,6 +31,8 @@ import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
import org.apache.iotdb.confignode.client.sync.SyncDataNodeClientPool;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.read.storagegroup.CountStorageGroupPlan;
import org.apache.iotdb.confignode.consensus.request.read.storagegroup.GetStorageGroupPlan;
import org.apache.iotdb.confignode.consensus.request.read.template.CheckTemplateSettablePlan;
@@ -99,10 +99,9 @@ public class ClusterSchemaManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ClusterSchemaManager.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final double SCHEMA_REGION_PER_DATA_NODE =
- COMMON_CONFIG.getSchemaRegionPerDataNode();
- private static final double DATA_REGION_PER_PROCESSOR = COMMON_CONFIG.getDataRegionPerProcessor();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
+ private static final double SCHEMA_REGION_PER_DATA_NODE = CONF.getSchemaRegionPerDataNode();
+ private static final double DATA_REGION_PER_PROCESSOR = CONF.getDataRegionPerProcessor();
private final IManager configManager;
private final ClusterSchemaInfo clusterSchemaInfo;
@@ -334,11 +333,11 @@ public class ClusterSchemaManager {
(int)
Math.ceil(
(double) totalCpuCoreNum
- / (double) (storageGroupNum * COMMON_CONFIG.getDataReplicationFactor()));
- if (leastDataRegionGroupNum < COMMON_CONFIG.getLeastDataRegionGroupNum()) {
+ / (double) (storageGroupNum * CONF.getDataReplicationFactor()));
+ if (leastDataRegionGroupNum < CONF.getLeastDataRegionGroupNum()) {
// The leastDataRegionGroupNum should be the maximum integer that satisfy:
// 1 <= leastDataRegionGroupNum <= 5(default)
- COMMON_CONFIG.setLeastDataRegionGroupNum(leastDataRegionGroupNum);
+ CONF.setLeastDataRegionGroupNum(leastDataRegionGroupNum);
LOGGER.info(
"[AdjustRegionGroupNum] The least number of DataRegionGroups per Database is adjusted to: {}",
leastDataRegionGroupNum);
@@ -356,7 +355,7 @@ public class ClusterSchemaManager {
storageGroupSchema.getName(), TConsensusGroupType.SchemaRegion);
int maxSchemaRegionGroupNum =
calcMaxRegionGroupNum(
- COMMON_CONFIG.getLeastSchemaRegionGroupNum(),
+ CONF.getLeastSchemaRegionGroupNum(),
SCHEMA_REGION_PER_DATA_NODE,
dataNodeNum,
storageGroupNum,
@@ -375,7 +374,7 @@ public class ClusterSchemaManager {
.getRegionGroupCount(storageGroupSchema.getName(), TConsensusGroupType.DataRegion);
int maxDataRegionGroupNum =
calcMaxRegionGroupNum(
- COMMON_CONFIG.getLeastDataRegionGroupNum(),
+ CONF.getLeastDataRegionGroupNum(),
DATA_REGION_PER_PROCESSOR,
totalCpuCoreNum,
storageGroupNum,
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index 607e8f1dc4..47ece8115c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -40,6 +40,7 @@ import org.apache.iotdb.commons.sync.pipe.PipeMessage;
import org.apache.iotdb.commons.utils.AuthUtils;
import org.apache.iotdb.commons.utils.PathUtils;
import org.apache.iotdb.commons.utils.StatusUtils;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.conf.SystemPropertiesUtils;
import org.apache.iotdb.confignode.consensus.request.auth.AuthorPlan;
@@ -178,7 +179,8 @@ public class ConfigManager implements IManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigManager.class);
- private static final CommonConfig COMMON_CONF = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
+ private static final CommonConfig COMMON_CONF = CommonDescriptor.getInstance().getConfig();
/** Manage PartitionTable read/write requests through the ConsensusLayer */
private volatile ConsensusManager consensusManager;
@@ -420,25 +422,24 @@ public class ConfigManager implements IManager {
public TClusterParameters getClusterParameters() {
TClusterParameters clusterParameters = new TClusterParameters();
- clusterParameters.setClusterName(COMMON_CONF.getClusterName());
+ clusterParameters.setClusterName(CONF.getClusterName());
clusterParameters.setConfigNodeConsensusProtocolClass(
- COMMON_CONF.getConfigNodeConsensusProtocolClass().getProtocol());
+ CONF.getConfigNodeConsensusProtocolClass());
clusterParameters.setDataRegionConsensusProtocolClass(
- COMMON_CONF.getDataRegionConsensusProtocolClass().getProtocol());
+ CONF.getDataRegionConsensusProtocolClass());
clusterParameters.setSchemaRegionConsensusProtocolClass(
- COMMON_CONF.getSchemaRegionConsensusProtocolClass().getProtocol());
- clusterParameters.setSeriesPartitionSlotNum(COMMON_CONF.getSeriesSlotNum());
- clusterParameters.setSeriesPartitionExecutorClass(
- COMMON_CONF.getSeriesPartitionExecutorClass());
- clusterParameters.setDefaultTTL(COMMON_CONF.getDefaultTtlInMs());
- clusterParameters.setTimePartitionInterval(COMMON_CONF.getTimePartitionInterval());
- clusterParameters.setDataReplicationFactor(COMMON_CONF.getDataReplicationFactor());
- clusterParameters.setSchemaReplicationFactor(COMMON_CONF.getSchemaReplicationFactor());
- clusterParameters.setDataRegionPerProcessor(COMMON_CONF.getDataRegionPerProcessor());
- clusterParameters.setSchemaRegionPerDataNode(COMMON_CONF.getSchemaRegionPerDataNode());
+ CONF.getSchemaRegionConsensusProtocolClass());
+ clusterParameters.setSeriesPartitionSlotNum(CONF.getSeriesSlotNum());
+ clusterParameters.setSeriesPartitionExecutorClass(CONF.getSeriesPartitionExecutorClass());
+ clusterParameters.setDefaultTTL(COMMON_CONF.getDefaultTTLInMs());
+ clusterParameters.setTimePartitionInterval(CONF.getTimePartitionInterval());
+ clusterParameters.setDataReplicationFactor(CONF.getDataReplicationFactor());
+ clusterParameters.setSchemaReplicationFactor(CONF.getSchemaReplicationFactor());
+ clusterParameters.setDataRegionPerProcessor(CONF.getDataRegionPerProcessor());
+ clusterParameters.setSchemaRegionPerDataNode(CONF.getSchemaRegionPerDataNode());
clusterParameters.setDiskSpaceWarningThreshold(COMMON_CONF.getDiskSpaceWarningThreshold());
- clusterParameters.setReadConsistencyLevel(COMMON_CONF.getReadConsistencyLevel());
- clusterParameters.setLeastDataRegionGroupNum(COMMON_CONF.getLeastDataRegionGroupNum());
+ clusterParameters.setReadConsistencyLevel(CONF.getReadConsistencyLevel());
+ clusterParameters.setLeastDataRegionGroupNum(CONF.getLeastDataRegionGroupNum());
return clusterParameters;
}
@@ -878,69 +879,64 @@ public class ConfigManager implements IManager {
if (!clusterParameters
.getConfigNodeConsensusProtocolClass()
- .equals(COMMON_CONF.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ .equals(CONF.getConfigNodeConsensusProtocolClass())) {
return errorStatus.setMessage(
errorPrefix + "config_node_consensus_protocol_class" + errorSuffix);
}
if (!clusterParameters
.getDataRegionConsensusProtocolClass()
- .equals(COMMON_CONF.getDataRegionConsensusProtocolClass().getProtocol())) {
+ .equals(CONF.getDataRegionConsensusProtocolClass())) {
return errorStatus.setMessage(
errorPrefix + "data_region_consensus_protocol_class" + errorSuffix);
}
if (!clusterParameters
.getSchemaRegionConsensusProtocolClass()
- .equals(COMMON_CONF.getSchemaRegionConsensusProtocolClass().getProtocol())) {
+ .equals(CONF.getSchemaRegionConsensusProtocolClass())) {
return errorStatus.setMessage(
errorPrefix + "schema_region_consensus_protocol_class" + errorSuffix);
}
- if (clusterParameters.getSeriesPartitionSlotNum() != COMMON_CONF.getSeriesSlotNum()) {
+ if (clusterParameters.getSeriesPartitionSlotNum() != CONF.getSeriesSlotNum()) {
return errorStatus.setMessage(errorPrefix + "series_partition_slot_num" + errorSuffix);
}
if (!clusterParameters
.getSeriesPartitionExecutorClass()
- .equals(COMMON_CONF.getSeriesPartitionExecutorClass())) {
+ .equals(CONF.getSeriesPartitionExecutorClass())) {
return errorStatus.setMessage(errorPrefix + "series_partition_executor_class" + errorSuffix);
}
if (clusterParameters.getDefaultTTL()
- != CommonDescriptor.getInstance().getConf().getDefaultTtlInMs()) {
+ != CommonDescriptor.getInstance().getConfig().getDefaultTTLInMs()) {
return errorStatus.setMessage(errorPrefix + "default_ttl" + errorSuffix);
}
- if (clusterParameters.getTimePartitionInterval() != COMMON_CONF.getTimePartitionInterval()) {
+ if (clusterParameters.getTimePartitionInterval() != CONF.getTimePartitionInterval()) {
return errorStatus.setMessage(errorPrefix + "time_partition_interval" + errorSuffix);
}
- if (clusterParameters.getSchemaReplicationFactor()
- != COMMON_CONF.getSchemaReplicationFactor()) {
+ if (clusterParameters.getSchemaReplicationFactor() != CONF.getSchemaReplicationFactor()) {
return errorStatus.setMessage(errorPrefix + "schema_replication_factor" + errorSuffix);
}
- if (clusterParameters.getDataReplicationFactor() != COMMON_CONF.getDataReplicationFactor()) {
+ if (clusterParameters.getDataReplicationFactor() != CONF.getDataReplicationFactor()) {
return errorStatus.setMessage(errorPrefix + "data_replication_factor" + errorSuffix);
}
- if (clusterParameters.getSchemaRegionPerDataNode()
- != COMMON_CONF.getSchemaRegionPerDataNode()) {
+ if (clusterParameters.getSchemaRegionPerDataNode() != CONF.getSchemaRegionPerDataNode()) {
return errorStatus.setMessage(errorPrefix + "schema_region_per_data_node" + errorSuffix);
}
- if (clusterParameters.getDataRegionPerProcessor() != COMMON_CONF.getDataRegionPerProcessor()) {
+ if (clusterParameters.getDataRegionPerProcessor() != CONF.getDataRegionPerProcessor()) {
return errorStatus.setMessage(errorPrefix + "data_region_per_processor" + errorSuffix);
}
- if (!clusterParameters
- .getReadConsistencyLevel()
- .equals(COMMON_CONF.getReadConsistencyLevel())) {
+ if (!clusterParameters.getReadConsistencyLevel().equals(CONF.getReadConsistencyLevel())) {
return errorStatus.setMessage(errorPrefix + "read_consistency_level" + errorSuffix);
}
if (clusterParameters.getDiskSpaceWarningThreshold()
- != CommonDescriptor.getInstance().getConf().getDiskSpaceWarningThreshold()) {
+ != CommonDescriptor.getInstance().getConfig().getDiskSpaceWarningThreshold()) {
return errorStatus.setMessage(errorPrefix + "disk_space_warning_threshold" + errorSuffix);
}
- if (clusterParameters.getLeastDataRegionGroupNum()
- != COMMON_CONF.getLeastDataRegionGroupNum()) {
+ if (clusterParameters.getLeastDataRegionGroupNum() != CONF.getLeastDataRegionGroupNum()) {
return errorStatus.setMessage(errorPrefix + "least_data_region_group_num" + errorSuffix);
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
index 4e420ed7a0..aa914cf7c0 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConsensusManager.java
@@ -21,8 +21,6 @@ package org.apache.iotdb.confignode.manager;
import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.consensus.ConfigNodeRegionId;
import org.apache.iotdb.commons.consensus.ConsensusGroupId;
import org.apache.iotdb.commons.exception.BadNodeUrlException;
@@ -60,10 +58,7 @@ import static org.apache.iotdb.consensus.ConsensusFactory.SIMPLE_CONSENSUS;
public class ConsensusManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ConsensusManager.class);
-
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private static final int SEED_CONFIG_NODE_ID = 0;
private final IManager configManager;
@@ -84,18 +79,15 @@ public class ConsensusManager {
/** ConsensusLayer local implementation */
private void setConsensusLayer(ConfigNodeRegionStateMachine stateMachine) throws IOException {
// There is only one ConfigNodeGroup
- consensusGroupId = new ConfigNodeRegionId(CONFIG_NODE_CONFIG.getConfigNodeRegionId());
+ consensusGroupId = new ConfigNodeRegionId(CONF.getConfigNodeRegionId());
- if (SIMPLE_CONSENSUS.equals(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ if (SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
consensusImpl =
ConsensusFactory.getConsensusImpl(
SIMPLE_CONSENSUS,
ConsensusConfig.newBuilder()
.setThisNode(
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort()))
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))
.setStorageDir("target" + java.io.File.separator + "simple")
.build(),
gid -> stateMachine)
@@ -107,93 +99,84 @@ public class ConsensusManager {
// Implement local ConsensusLayer by ConfigNodeConfig
consensusImpl =
ConsensusFactory.getConsensusImpl(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol(),
+ CONF.getConfigNodeConsensusProtocolClass(),
ConsensusConfig.newBuilder()
- .setThisNodeId(CONFIG_NODE_CONFIG.getConfigNodeId())
+ .setThisNodeId(CONF.getConfigNodeId())
.setThisNode(
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort()))
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))
.setRatisConfig(
RatisConfig.newBuilder()
.setLeaderLogAppender(
RatisConfig.LeaderLogAppender.newBuilder()
.setBufferByteLimit(
- COMMON_CONFIG
- .getConfigNodeRatisConsensusLogAppenderBufferSize())
+ CONF.getConfigNodeRatisConsensusLogAppenderBufferSize())
.build())
.setSnapshot(
RatisConfig.Snapshot.newBuilder()
.setAutoTriggerThreshold(
- COMMON_CONFIG
- .getConfigNodeRatisSnapshotTriggerThreshold())
+ CONF.getConfigNodeRatisSnapshotTriggerThreshold())
.build())
.setLog(
RatisConfig.Log.newBuilder()
.setUnsafeFlushEnabled(
- COMMON_CONFIG.isConfigNodeRatisLogUnsafeFlushEnable())
+ CONF.isConfigNodeRatisLogUnsafeFlushEnable())
.setSegmentCacheSizeMax(
SizeInBytes.valueOf(
- COMMON_CONFIG.getConfigNodeRatisLogSegmentSizeMax()))
+ CONF.getConfigNodeRatisLogSegmentSizeMax()))
.setPreserveNumsWhenPurge(
- COMMON_CONFIG.getConfigNodeRatisPreserveLogsWhenPurge())
+ CONF.getConfigNodeRatisPreserveLogsWhenPurge())
.build())
.setGrpc(
RatisConfig.Grpc.newBuilder()
.setFlowControlWindow(
SizeInBytes.valueOf(
- COMMON_CONFIG
- .getConfigNodeRatisGrpcFlowControlWindow()))
+ CONF.getConfigNodeRatisGrpcFlowControlWindow()))
.build())
.setRpc(
RatisConfig.Rpc.newBuilder()
.setTimeoutMin(
TimeDuration.valueOf(
- COMMON_CONFIG
+ CONF
.getConfigNodeRatisRpcLeaderElectionTimeoutMinMs(),
TimeUnit.MILLISECONDS))
.setTimeoutMax(
TimeDuration.valueOf(
- COMMON_CONFIG
+ CONF
.getConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(),
TimeUnit.MILLISECONDS))
.setRequestTimeout(
TimeDuration.valueOf(
- COMMON_CONFIG.getConfigNodeRatisRequestTimeoutMs(),
+ CONF.getConfigNodeRatisRequestTimeoutMs(),
TimeUnit.MILLISECONDS))
.setFirstElectionTimeoutMin(
TimeDuration.valueOf(
- COMMON_CONFIG.getRatisFirstElectionTimeoutMinMs(),
+ CONF.getRatisFirstElectionTimeoutMinMs(),
TimeUnit.MILLISECONDS))
.setFirstElectionTimeoutMax(
TimeDuration.valueOf(
- COMMON_CONFIG.getRatisFirstElectionTimeoutMaxMs(),
+ CONF.getRatisFirstElectionTimeoutMaxMs(),
TimeUnit.MILLISECONDS))
.build())
.setClient(
RatisConfig.Client.newBuilder()
.setClientRequestTimeoutMillis(
- COMMON_CONFIG.getConfigNodeRatisRequestTimeoutMs())
+ CONF.getConfigNodeRatisRequestTimeoutMs())
.setClientMaxRetryAttempt(
- COMMON_CONFIG.getConfigNodeRatisMaxRetryAttempts())
+ CONF.getConfigNodeRatisMaxRetryAttempts())
.setClientRetryInitialSleepTimeMs(
- COMMON_CONFIG.getConfigNodeRatisInitialSleepTimeMs())
+ CONF.getConfigNodeRatisInitialSleepTimeMs())
.setClientRetryMaxSleepTimeMs(
- COMMON_CONFIG.getConfigNodeRatisMaxSleepTimeMs())
+ CONF.getConfigNodeRatisMaxSleepTimeMs())
.setCoreClientNumForEachNode(
- CONFIG_NODE_CONFIG
- .getCnCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(
- CONFIG_NODE_CONFIG
- .getCnMaxClientCountForEachNodeInClientManager())
+ CONF.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(CONF.getMaxClientNumForEachNode())
.build())
.setImpl(
RatisConfig.Impl.newBuilder()
- .setTriggerSnapshotFileSize(
- COMMON_CONFIG.getConfigNodeRatisLogMax())
+ .setTriggerSnapshotFileSize(CONF.getConfigNodeRatisLogMax())
.build())
.build())
- .setStorageDir(CONFIG_NODE_CONFIG.getCnConsensusDir())
+ .setStorageDir(CONF.getConsensusDir())
.build(),
gid -> stateMachine)
.orElseThrow(
@@ -201,14 +184,13 @@ public class ConsensusManager {
new IllegalArgumentException(
String.format(
ConsensusFactory.CONSTRUCT_FAILED_MSG,
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass())));
+ CONF.getConfigNodeConsensusProtocolClass())));
}
consensusImpl.start();
if (SystemPropertiesUtils.isRestarted()) {
// TODO: @Itami-Sho Check and notify if current ConfigNode's ip or port has changed
- if (SIMPLE_CONSENSUS.equals(
- COMMON_CONFIG.getConfigNodeConsensusProtocolClass().getProtocol())) {
+ if (SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
// Only SIMPLE_CONSENSUS need invoking `createPeerForConsensusGroup` when restarted,
// but RATIS_CONSENSUS doesn't need it
try {
@@ -225,12 +207,8 @@ public class ConsensusManager {
Collections.singletonList(
new TConfigNodeLocation(
SEED_CONFIG_NODE_ID,
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnInternalPort()),
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort()))));
+ new TEndPoint(CONF.getInternalAddress(), CONF.getInternalPort()),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))));
}
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
index 867ba7debd..e92c5eb51f 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
@@ -25,8 +25,6 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeConfiguration;
import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.exception.IoTDBException;
import org.apache.iotdb.commons.exception.sync.PipeException;
@@ -34,6 +32,8 @@ import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.path.PathPatternTree;
import org.apache.iotdb.commons.trigger.TriggerInformation;
import org.apache.iotdb.commons.utils.StatusUtils;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.write.confignode.RemoveConfigNodePlan;
import org.apache.iotdb.confignode.consensus.request.write.datanode.RemoveDataNodePlan;
import org.apache.iotdb.confignode.consensus.request.write.procedure.UpdateProcedurePlan;
@@ -97,7 +97,8 @@ import java.util.stream.Collectors;
public class ProcedureManager {
private static final Logger LOGGER = LoggerFactory.getLogger(ProcedureManager.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
+ ConfigNodeDescriptor.getInstance().getConf();
private static final int PROCEDURE_WAIT_TIME_OUT = 30;
private static final int PROCEDURE_WAIT_RETRY_TIMEOUT = 250;
@@ -117,18 +118,20 @@ public class ProcedureManager {
this.env = new ConfigNodeProcedureEnv(configManager, scheduler);
this.executor = new ProcedureExecutor<>(env, store, scheduler);
this.planSizeLimit =
- CommonDescriptor.getInstance().getConf().getConfigNodeRatisConsensusLogAppenderBufferSize()
+ ConfigNodeDescriptor.getInstance()
+ .getConf()
+ .getConfigNodeRatisConsensusLogAppenderBufferSize()
- IoTDBConstant.RAFT_LOG_BASIC_SIZE;
}
public void shiftExecutor(boolean running) {
if (running) {
if (!executor.isRunning()) {
- executor.init(COMMON_CONFIG.getProcedureCoreWorkerThreadsCount());
+ executor.init(CONFIG_NODE_CONFIG.getProcedureCoreWorkerThreadsCount());
executor.startWorkers();
executor.startCompletedCleaner(
- COMMON_CONFIG.getProcedureCompletedCleanInterval(),
- COMMON_CONFIG.getProcedureCompletedEvictTTL());
+ CONFIG_NODE_CONFIG.getProcedureCompletedCleanInterval(),
+ CONFIG_NODE_CONFIG.getProcedureCompletedEvictTTL());
store.start();
LOGGER.info("ProcedureManager is started successfully.");
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/RetryFailedTasksThread.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/RetryFailedTasksThread.java
index 944bf85504..97666a005b 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/RetryFailedTasksThread.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/RetryFailedTasksThread.java
@@ -23,10 +23,11 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.manager.node.NodeManager;
import org.apache.iotdb.confignode.manager.node.heartbeat.BaseNodeCache;
import org.apache.iotdb.mpp.rpc.thrift.TOperatePipeOnDataNodeReq;
@@ -56,8 +57,8 @@ public class RetryFailedTasksThread {
private static final Logger LOGGER = LoggerFactory.getLogger(RetryFailedTasksThread.class);
- private static final long HEARTBEAT_INTERVAL =
- CommonDescriptor.getInstance().getConf().getHeartbeatIntervalInMs();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
+ private static final long HEARTBEAT_INTERVAL = CONF.getHeartbeatIntervalInMs();
private final IManager configManager;
private final NodeManager nodeManager;
private final ScheduledExecutorService retryFailTasksExecutor =
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/UDFManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/UDFManager.java
index 9c766818f8..38d177911c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/UDFManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/UDFManager.java
@@ -21,12 +21,12 @@ package org.apache.iotdb.confignode.manager;
import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.udf.UDFInformation;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.read.function.GetFunctionTablePlan;
import org.apache.iotdb.confignode.consensus.request.read.udf.GetUDFJarPlan;
import org.apache.iotdb.confignode.consensus.request.write.function.CreateFunctionPlan;
@@ -60,7 +60,9 @@ public class UDFManager {
private final UDFInfo udfInfo;
private final long planSizeLimit =
- CommonDescriptor.getInstance().getConf().getConfigNodeRatisConsensusLogAppenderBufferSize()
+ ConfigNodeDescriptor.getInstance()
+ .getConf()
+ .getConfigNodeRatisConsensusLogAppenderBufferSize()
- IoTDBConstant.RAFT_LOG_BASIC_SIZE;
public UDFManager(ConfigManager configManager, UDFInfo udfInfo) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
index a2a37f7c2f..b23d2fa11f 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
@@ -27,13 +27,14 @@ import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.partition.DataPartitionTable;
import org.apache.iotdb.commons.partition.SchemaPartitionTable;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.write.region.CreateRegionGroupsPlan;
import org.apache.iotdb.confignode.exception.NoAvailableRegionGroupException;
import org.apache.iotdb.confignode.exception.NotEnoughDataNodeException;
@@ -77,8 +78,8 @@ public class LoadManager {
private static final Logger LOGGER = LoggerFactory.getLogger(LoadManager.class);
- private static final long HEARTBEAT_INTERVAL =
- CommonDescriptor.getInstance().getConf().getHeartbeatIntervalInMs();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
+ private static final long HEARTBEAT_INTERVAL = CONF.getHeartbeatIntervalInMs();
private final IManager configManager;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java
index 9d68162ec8..31f28397fb 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RouteBalancer.java
@@ -27,8 +27,6 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
@@ -73,22 +71,21 @@ public class RouteBalancer {
private static final Logger LOGGER = LoggerFactory.getLogger(RouteBalancer.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private static final String SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS =
- COMMON_CONFIG.getSchemaRegionConsensusProtocolClass().getProtocol();
+ CONF.getSchemaRegionConsensusProtocolClass();
private static final String DATA_REGION_CONSENSUS_PROTOCOL_CLASS =
- COMMON_CONFIG.getDataRegionConsensusProtocolClass().getProtocol();
+ CONF.getDataRegionConsensusProtocolClass();
private static final boolean IS_ENABLE_AUTO_LEADER_BALANCE_FOR_DATA_REGION =
- (COMMON_CONFIG.isEnableAutoLeaderBalanceForRatisConsensus()
+ (CONF.isEnableAutoLeaderBalanceForRatisConsensus()
&& ConsensusFactory.RATIS_CONSENSUS.equals(DATA_REGION_CONSENSUS_PROTOCOL_CLASS))
- || (COMMON_CONFIG.isEnableAutoLeaderBalanceForIoTConsensus()
+ || (CONF.isEnableAutoLeaderBalanceForIoTConsensus()
&& ConsensusFactory.IOT_CONSENSUS.equals(DATA_REGION_CONSENSUS_PROTOCOL_CLASS));
private static final boolean IS_ENABLE_AUTO_LEADER_BALANCE_FOR_SCHEMA_REGION =
- (COMMON_CONFIG.isEnableAutoLeaderBalanceForRatisConsensus()
+ (CONF.isEnableAutoLeaderBalanceForRatisConsensus()
&& ConsensusFactory.RATIS_CONSENSUS.equals(SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS))
- || (COMMON_CONFIG.isEnableAutoLeaderBalanceForIoTConsensus()
+ || (CONF.isEnableAutoLeaderBalanceForIoTConsensus()
&& ConsensusFactory.IOT_CONSENSUS.equals(SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS));
private static final boolean IS_DATA_REGION_IOT_CONSENSUS =
@@ -122,11 +119,11 @@ public class RouteBalancer {
this.leaderCache = new ConcurrentHashMap<>();
this.regionRouteMap = new RegionRouteMap();
- switch (COMMON_CONFIG.getLeaderDistributionPolicy()) {
- case GREEDY:
+ switch (CONF.getLeaderDistributionPolicy()) {
+ case ILeaderBalancer.GREEDY_POLICY:
this.leaderBalancer = new GreedyLeaderBalancer();
break;
- case MIN_COST_FLOW:
+ case ILeaderBalancer.MIN_COST_FLOW_POLICY:
default:
this.leaderBalancer = new MinCostFlowLeaderBalancer();
break;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/partition/GreedyPartitionAllocator.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/partition/GreedyPartitionAllocator.java
index 5f1b8c622a..996cf57116 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/partition/GreedyPartitionAllocator.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/partition/GreedyPartitionAllocator.java
@@ -22,11 +22,11 @@ import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.partition.DataPartitionTable;
import org.apache.iotdb.commons.partition.SchemaPartitionTable;
import org.apache.iotdb.commons.partition.SeriesPartitionTable;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.exception.NoAvailableRegionGroupException;
import org.apache.iotdb.confignode.manager.IManager;
import org.apache.iotdb.confignode.manager.partition.PartitionManager;
@@ -42,10 +42,10 @@ import java.util.concurrent.ConcurrentHashMap;
/** Allocating new Partitions by greedy algorithm */
public class GreedyPartitionAllocator implements IPartitionAllocator {
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private static final boolean ENABLE_DATA_PARTITION_INHERIT_POLICY =
- COMMON_CONFIG.isEnableDataPartitionInheritPolicy();
- private static final long TIME_PARTITION_INTERVAL = COMMON_CONFIG.getTimePartitionInterval();
+ CONF.isEnableDataPartitionInheritPolicy();
+ private static final long TIME_PARTITION_INTERVAL = CONF.getTimePartitionInterval();
private final IManager configManager;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/leader/ILeaderBalancer.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/leader/ILeaderBalancer.java
index 9f8fb45335..a69ccc9491 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/leader/ILeaderBalancer.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/leader/ILeaderBalancer.java
@@ -26,6 +26,9 @@ import java.util.Set;
public interface ILeaderBalancer {
+ String GREEDY_POLICY = "GREEDY";
+ String MIN_COST_FLOW_POLICY = "MIN_COST_FLOW";
+
/**
* Generate an optimal leader distribution.
*
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java
index b988e0ee11..d1a118a9f2 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java
@@ -25,9 +25,9 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.cluster.NodeType;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.confignode.conf.ConfigNodeConstant;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.manager.ConfigManager;
import org.apache.iotdb.confignode.manager.node.heartbeat.BaseNodeCache;
import org.apache.iotdb.rpc.TSStatusCode;
@@ -41,7 +41,7 @@ import java.util.Set;
public class ClusterNodeStartUtils {
private static final String CLUSTER_NAME =
- CommonDescriptor.getInstance().getConf().getClusterName();
+ ConfigNodeDescriptor.getInstance().getConf().getClusterName();
private static final String POSSIBLE_SOLUTIONS = " Possible solutions are as follows:\r\n";
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
index 7805a3bee0..1c4c5bb401 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java
@@ -107,11 +107,8 @@ public class NodeManager {
private static final Logger LOGGER = LoggerFactory.getLogger(NodeManager.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
-
- public static final long HEARTBEAT_INTERVAL = COMMON_CONFIG.getHeartbeatIntervalInMs();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
+ public static final long HEARTBEAT_INTERVAL = CONF.getHeartbeatIntervalInMs();
private final IManager configManager;
private final NodeInfo nodeInfo;
@@ -154,16 +151,19 @@ public class NodeManager {
private void setGlobalConfig(ConfigurationResp dataSet) {
// Set TGlobalConfig
+ final ConfigNodeConfig configNodeConfig = ConfigNodeDescriptor.getInstance().getConf();
+ final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
TGlobalConfig globalConfig = new TGlobalConfig();
globalConfig.setDataRegionConsensusProtocolClass(
- COMMON_CONFIG.getDataRegionConsensusProtocolClass().getProtocol());
+ configNodeConfig.getDataRegionConsensusProtocolClass());
globalConfig.setSchemaRegionConsensusProtocolClass(
- COMMON_CONFIG.getSchemaRegionConsensusProtocolClass().getProtocol());
- globalConfig.setSeriesPartitionSlotNum(COMMON_CONFIG.getSeriesSlotNum());
- globalConfig.setSeriesPartitionExecutorClass(COMMON_CONFIG.getSeriesPartitionExecutorClass());
- globalConfig.setTimePartitionInterval(COMMON_CONFIG.getTimePartitionInterval());
- globalConfig.setReadConsistencyLevel(COMMON_CONFIG.getReadConsistencyLevel());
- globalConfig.setDiskSpaceWarningThreshold(COMMON_CONFIG.getDiskSpaceWarningThreshold());
+ configNodeConfig.getSchemaRegionConsensusProtocolClass());
+ globalConfig.setSeriesPartitionSlotNum(configNodeConfig.getSeriesSlotNum());
+ globalConfig.setSeriesPartitionExecutorClass(
+ configNodeConfig.getSeriesPartitionExecutorClass());
+ globalConfig.setTimePartitionInterval(configNodeConfig.getTimePartitionInterval());
+ globalConfig.setReadConsistencyLevel(configNodeConfig.getReadConsistencyLevel());
+ globalConfig.setDiskSpaceWarningThreshold(commonConfig.getDiskSpaceWarningThreshold());
dataSet.setGlobalConfig(globalConfig);
}
@@ -171,57 +171,51 @@ public class NodeManager {
final ConfigNodeConfig conf = ConfigNodeDescriptor.getInstance().getConf();
TRatisConfig ratisConfig = new TRatisConfig();
- ratisConfig.setDataAppenderBufferSize(
- COMMON_CONFIG.getDataRegionRatisConsensusLogAppenderBufferSize());
+ ratisConfig.setDataAppenderBufferSize(conf.getDataRegionRatisConsensusLogAppenderBufferSize());
ratisConfig.setSchemaAppenderBufferSize(
- COMMON_CONFIG.getSchemaRegionRatisConsensusLogAppenderBufferSize());
+ conf.getSchemaRegionRatisConsensusLogAppenderBufferSize());
- ratisConfig.setDataSnapshotTriggerThreshold(
- COMMON_CONFIG.getDataRegionRatisSnapshotTriggerThreshold());
+ ratisConfig.setDataSnapshotTriggerThreshold(conf.getDataRegionRatisSnapshotTriggerThreshold());
ratisConfig.setSchemaSnapshotTriggerThreshold(
- COMMON_CONFIG.getSchemaRegionRatisSnapshotTriggerThreshold());
+ conf.getSchemaRegionRatisSnapshotTriggerThreshold());
- ratisConfig.setDataLogUnsafeFlushEnable(COMMON_CONFIG.isDataRegionRatisLogUnsafeFlushEnable());
- ratisConfig.setSchemaLogUnsafeFlushEnable(
- COMMON_CONFIG.isSchemaRegionRatisLogUnsafeFlushEnable());
+ ratisConfig.setDataLogUnsafeFlushEnable(conf.isDataRegionRatisLogUnsafeFlushEnable());
+ ratisConfig.setSchemaLogUnsafeFlushEnable(conf.isSchemaRegionRatisLogUnsafeFlushEnable());
- ratisConfig.setDataLogSegmentSizeMax(COMMON_CONFIG.getDataRegionRatisLogSegmentSizeMax());
- ratisConfig.setSchemaLogSegmentSizeMax(COMMON_CONFIG.getSchemaRegionRatisLogSegmentSizeMax());
+ ratisConfig.setDataLogSegmentSizeMax(conf.getDataRegionRatisLogSegmentSizeMax());
+ ratisConfig.setSchemaLogSegmentSizeMax(conf.getSchemaRegionRatisLogSegmentSizeMax());
- ratisConfig.setDataGrpcFlowControlWindow(
- COMMON_CONFIG.getDataRegionRatisGrpcFlowControlWindow());
- ratisConfig.setSchemaGrpcFlowControlWindow(
- COMMON_CONFIG.getSchemaRegionRatisGrpcFlowControlWindow());
+ ratisConfig.setDataGrpcFlowControlWindow(conf.getDataRegionRatisGrpcFlowControlWindow());
+ ratisConfig.setSchemaGrpcFlowControlWindow(conf.getSchemaRegionRatisGrpcFlowControlWindow());
ratisConfig.setDataLeaderElectionTimeoutMin(
- COMMON_CONFIG.getDataRegionRatisRpcLeaderElectionTimeoutMinMs());
+ conf.getDataRegionRatisRpcLeaderElectionTimeoutMinMs());
ratisConfig.setSchemaLeaderElectionTimeoutMin(
- COMMON_CONFIG.getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs());
+ conf.getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs());
ratisConfig.setDataLeaderElectionTimeoutMax(
- COMMON_CONFIG.getDataRegionRatisRpcLeaderElectionTimeoutMaxMs());
+ conf.getDataRegionRatisRpcLeaderElectionTimeoutMaxMs());
ratisConfig.setSchemaLeaderElectionTimeoutMax(
- COMMON_CONFIG.getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs());
+ conf.getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs());
- ratisConfig.setDataRequestTimeout(COMMON_CONFIG.getDataRegionRatisRequestTimeoutMs());
- ratisConfig.setSchemaRequestTimeout(COMMON_CONFIG.getSchemaRegionRatisRequestTimeoutMs());
+ ratisConfig.setDataRequestTimeout(conf.getDataRegionRatisRequestTimeoutMs());
+ ratisConfig.setSchemaRequestTimeout(conf.getSchemaRegionRatisRequestTimeoutMs());
- ratisConfig.setDataMaxRetryAttempts(COMMON_CONFIG.getDataRegionRatisMaxRetryAttempts());
- ratisConfig.setDataInitialSleepTime(COMMON_CONFIG.getDataRegionRatisInitialSleepTimeMs());
- ratisConfig.setDataMaxSleepTime(COMMON_CONFIG.getDataRegionRatisMaxSleepTimeMs());
- ratisConfig.setSchemaMaxRetryAttempts(COMMON_CONFIG.getSchemaRegionRatisMaxRetryAttempts());
- ratisConfig.setSchemaInitialSleepTime(COMMON_CONFIG.getSchemaRegionRatisInitialSleepTimeMs());
- ratisConfig.setSchemaMaxSleepTime(COMMON_CONFIG.getSchemaRegionRatisMaxSleepTimeMs());
+ ratisConfig.setDataMaxRetryAttempts(conf.getDataRegionRatisMaxRetryAttempts());
+ ratisConfig.setDataInitialSleepTime(conf.getDataRegionRatisInitialSleepTimeMs());
+ ratisConfig.setDataMaxSleepTime(conf.getDataRegionRatisMaxSleepTimeMs());
+ ratisConfig.setSchemaMaxRetryAttempts(conf.getSchemaRegionRatisMaxRetryAttempts());
+ ratisConfig.setSchemaInitialSleepTime(conf.getSchemaRegionRatisInitialSleepTimeMs());
+ ratisConfig.setSchemaMaxSleepTime(conf.getSchemaRegionRatisMaxSleepTimeMs());
- ratisConfig.setSchemaPreserveWhenPurge(
- COMMON_CONFIG.getSchemaRegionRatisPreserveLogsWhenPurge());
- ratisConfig.setDataPreserveWhenPurge(COMMON_CONFIG.getDataRegionRatisPreserveLogsWhenPurge());
+ ratisConfig.setSchemaPreserveWhenPurge(conf.getSchemaRegionRatisPreserveLogsWhenPurge());
+ ratisConfig.setDataPreserveWhenPurge(conf.getDataRegionRatisPreserveLogsWhenPurge());
- ratisConfig.setFirstElectionTimeoutMin(COMMON_CONFIG.getRatisFirstElectionTimeoutMinMs());
- ratisConfig.setFirstElectionTimeoutMax(COMMON_CONFIG.getRatisFirstElectionTimeoutMaxMs());
+ ratisConfig.setFirstElectionTimeoutMin(conf.getRatisFirstElectionTimeoutMinMs());
+ ratisConfig.setFirstElectionTimeoutMax(conf.getRatisFirstElectionTimeoutMaxMs());
- ratisConfig.setSchemaRegionRatisLogMax(COMMON_CONFIG.getSchemaRegionRatisLogMax());
- ratisConfig.setDataRegionRatisLogMax(COMMON_CONFIG.getDataRegionRatisLogMax());
+ ratisConfig.setSchemaRegionRatisLogMax(conf.getSchemaRegionRatisLogMax());
+ ratisConfig.setDataRegionRatisLogMax(conf.getDataRegionRatisLogMax());
dataSet.setRatisConfig(ratisConfig);
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
index 36dbf2e018..8a0072971d 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
@@ -29,15 +29,14 @@ import org.apache.iotdb.commons.cluster.RegionRoleType;
import org.apache.iotdb.commons.cluster.RegionStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
-import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
import org.apache.iotdb.commons.partition.DataPartitionTable;
import org.apache.iotdb.commons.partition.SchemaPartitionTable;
import org.apache.iotdb.commons.partition.executor.SeriesPartitionExecutor;
import org.apache.iotdb.commons.service.metric.MetricService;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.sync.SyncDataNodeClientPool;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.read.partition.GetDataPartitionPlan;
import org.apache.iotdb.confignode.consensus.request.read.partition.GetNodePathsPartitionPlan;
import org.apache.iotdb.confignode.consensus.request.read.partition.GetOrCreateDataPartitionPlan;
@@ -105,15 +104,14 @@ public class PartitionManager {
private static final Logger LOGGER = LoggerFactory.getLogger(PartitionManager.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private static final RegionGroupExtensionPolicy SCHEMA_REGION_GROUP_EXTENSION_POLICY =
- COMMON_CONFIG.getSchemaRegionGroupExtensionPolicy();
+ CONF.getSchemaRegionGroupExtensionPolicy();
private static final int SCHEMA_REGION_GROUP_PER_DATABASE =
- COMMON_CONFIG.getSchemaRegionGroupPerDatabase();
+ CONF.getSchemaRegionGroupPerDatabase();
private static final RegionGroupExtensionPolicy DATA_REGION_GROUP_EXTENSION_POLICY =
- COMMON_CONFIG.getDataRegionGroupExtensionPolicy();
- private static final int DATA_REGION_GROUP_PER_DATABASE =
- COMMON_CONFIG.getDataRegionGroupPerDatabase();
+ CONF.getDataRegionGroupExtensionPolicy();
+ private static final int DATA_REGION_GROUP_PER_DATABASE = CONF.getDataRegionGroupPerDatabase();
private final IManager configManager;
private final PartitionInfo partitionInfo;
@@ -144,7 +142,7 @@ public class PartitionManager {
private void setSeriesPartitionExecutor() {
this.executor =
SeriesPartitionExecutor.getSeriesPartitionExecutor(
- COMMON_CONFIG.getSeriesPartitionExecutorClass(), COMMON_CONFIG.getSeriesSlotNum());
+ CONF.getSeriesPartitionExecutorClass(), CONF.getSeriesSlotNum());
}
// ======================================================
@@ -421,14 +419,14 @@ public class PartitionManager {
+ unassignedPartitionSlotsCount;
float maxRegionGroupCount =
getClusterSchemaManager().getMaxRegionGroupNum(storageGroup, consensusGroupType);
- float maxSlotCount = COMMON_CONFIG.getSeriesSlotNum();
+ float maxSlotCount = CONF.getSeriesSlotNum();
/* RegionGroup extension is required in the following cases */
// 1. The number of current RegionGroup of the StorageGroup is less than the least number
int leastRegionGroupNum =
TConsensusGroupType.SchemaRegion.equals(consensusGroupType)
- ? COMMON_CONFIG.getLeastSchemaRegionGroupNum()
- : COMMON_CONFIG.getLeastDataRegionGroupNum();
+ ? CONF.getLeastSchemaRegionGroupNum()
+ : CONF.getLeastDataRegionGroupNum();
if (allocatedRegionGroupCount < leastRegionGroupNum) {
// Let the sum of unassignedPartitionSlotsCount and allocatedRegionGroupCount
// no less than the leastRegionGroupNum
@@ -703,8 +701,7 @@ public class PartitionManager {
? req.getTimeSlotId()
: (req.isSetTimeStamp()
? new TTimePartitionSlot(
- req.getTimeStamp()
- - req.getTimeStamp() % COMMON_CONFIG.getTimePartitionInterval())
+ req.getTimeStamp() - req.getTimeStamp() % CONF.getTimePartitionInterval())
: null));
return (GetRegionIdResp) getConsensusManager().read(plan).getDataset();
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/loadbalance/RegionGroupExtensionPolicy.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/RegionGroupExtensionPolicy.java
similarity index 96%
rename from node-commons/src/main/java/org/apache/iotdb/commons/loadbalance/RegionGroupExtensionPolicy.java
rename to confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/RegionGroupExtensionPolicy.java
index c0d1244268..ac461d76e9 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/loadbalance/RegionGroupExtensionPolicy.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/RegionGroupExtensionPolicy.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.iotdb.commons.loadbalance;
+package org.apache.iotdb.confignode.manager.partition;
import java.io.IOException;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
index d46053de40..3f7a473bc5 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
@@ -60,7 +60,7 @@ import java.util.Set;
public class AuthorInfo implements SnapshotProcessor {
private static final Logger logger = LoggerFactory.getLogger(AuthorInfo.class);
- private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConf();
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private IAuthorizer authorizer;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ProcedureInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ProcedureInfo.java
index 69b82019de..aebab36ddb 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ProcedureInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ProcedureInfo.java
@@ -46,7 +46,7 @@ public class ProcedureInfo {
private final ProcedureFactory procedureFactory = ProcedureFactory.getInstance();
private final String procedureWalDir =
- CommonDescriptor.getInstance().getConf().getProcedureWalFolder();
+ CommonDescriptor.getInstance().getConfig().getProcedureWalFolder();
private final ConcurrentHashMap<Long, ProcedureWAL> procWALMap = new ConcurrentHashMap<>();
public void load(List<Procedure> procedureList) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TriggerInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TriggerInfo.java
index 92d1b50b40..54fa77e2da 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TriggerInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TriggerInfo.java
@@ -21,8 +21,6 @@ package org.apache.iotdb.confignode.persistence;
import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.executable.ExecutableManager;
import org.apache.iotdb.commons.snapshot.SnapshotProcessor;
import org.apache.iotdb.commons.trigger.TriggerInformation;
@@ -30,6 +28,8 @@ import org.apache.iotdb.commons.trigger.TriggerTable;
import org.apache.iotdb.commons.trigger.exception.TriggerManagementException;
import org.apache.iotdb.commons.trigger.service.TriggerExecutableManager;
import org.apache.iotdb.commons.utils.TestOnly;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.read.trigger.GetTriggerJarPlan;
import org.apache.iotdb.confignode.consensus.request.read.trigger.GetTriggerLocationPlan;
import org.apache.iotdb.confignode.consensus.request.read.trigger.GetTriggerTablePlan;
@@ -69,7 +69,8 @@ import java.util.concurrent.locks.ReentrantLock;
public class TriggerInfo implements SnapshotProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(TriggerInfo.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONFIG_NODE_CONF =
+ ConfigNodeDescriptor.getInstance().getConf();
private final TriggerTable triggerTable;
private final Map<String, String> existedJarToMD5;
@@ -87,7 +88,7 @@ public class TriggerInfo implements SnapshotProcessor {
// jarReferenceTable = new ConcurrentHashMap<>();
triggerExecutableManager =
TriggerExecutableManager.setupAndGetInstance(
- COMMON_CONFIG.getTriggerTemporaryLibDir(), COMMON_CONFIG.getTriggerDir());
+ CONFIG_NODE_CONF.getTriggerTemporaryLibDir(), CONFIG_NODE_CONF.getTriggerDir());
}
public void acquireTriggerTableLock() {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/UDFInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/UDFInfo.java
index 31ada5ce73..dc9e695d4f 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/UDFInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/UDFInfo.java
@@ -20,14 +20,14 @@
package org.apache.iotdb.confignode.persistence;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.executable.ExecutableManager;
import org.apache.iotdb.commons.snapshot.SnapshotProcessor;
import org.apache.iotdb.commons.udf.UDFInformation;
import org.apache.iotdb.commons.udf.UDFTable;
import org.apache.iotdb.commons.udf.service.UDFExecutableManager;
import org.apache.iotdb.commons.utils.TestOnly;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.read.udf.GetUDFJarPlan;
import org.apache.iotdb.confignode.consensus.request.write.function.CreateFunctionPlan;
import org.apache.iotdb.confignode.consensus.request.write.function.DropFunctionPlan;
@@ -59,7 +59,8 @@ public class UDFInfo implements SnapshotProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(UDFInfo.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONFIG_NODE_CONF =
+ ConfigNodeDescriptor.getInstance().getConf();
private final UDFTable udfTable;
private final Map<String, String> existedJarToMD5;
@@ -75,7 +76,7 @@ public class UDFInfo implements SnapshotProcessor {
existedJarToMD5 = new HashMap<>();
udfExecutableManager =
UDFExecutableManager.setupAndGetInstance(
- COMMON_CONFIG.getUdfTemporaryLibDir(), COMMON_CONFIG.getUdfDir());
+ CONFIG_NODE_CONF.getUdfTemporaryLibDir(), CONFIG_NODE_CONF.getUdfDir());
}
public void acquireUDFTableLock() {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/node/NodeInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/node/NodeInfo.java
index 90787aaa81..67790476ff 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/node/NodeInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/node/NodeInfo.java
@@ -21,8 +21,8 @@ package org.apache.iotdb.confignode.persistence.node;
import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TDataNodeConfiguration;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.snapshot.SnapshotProcessor;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.conf.SystemPropertiesUtils;
import org.apache.iotdb.confignode.consensus.request.read.datanode.GetDataNodeConfigurationPlan;
import org.apache.iotdb.confignode.consensus.request.write.confignode.ApplyConfigNodePlan;
@@ -71,8 +71,8 @@ public class NodeInfo implements SnapshotProcessor {
private static final int MINIMUM_DATANODE =
Math.max(
- CommonDescriptor.getInstance().getConf().getSchemaReplicationFactor(),
- CommonDescriptor.getInstance().getConf().getDataReplicationFactor());
+ ConfigNodeDescriptor.getInstance().getConf().getSchemaReplicationFactor(),
+ ConfigNodeDescriptor.getInstance().getConf().getDataReplicationFactor());
// Registered ConfigNodes
private final ReentrantReadWriteLock configNodeInfoReadWriteLock;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java
index 106e2e271f..4ef8c1d401 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java
@@ -28,7 +28,6 @@ import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.cluster.RegionStatus;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.trigger.TriggerInformation;
import org.apache.iotdb.confignode.client.ConfigNodeRequestType;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
@@ -36,6 +35,7 @@ import org.apache.iotdb.confignode.client.async.AsyncDataNodeClientPool;
import org.apache.iotdb.confignode.client.async.handlers.AsyncClientHandler;
import org.apache.iotdb.confignode.client.sync.SyncConfigNodeClientPool;
import org.apache.iotdb.confignode.client.sync.SyncDataNodeClientPool;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.write.confignode.RemoveConfigNodePlan;
import org.apache.iotdb.confignode.consensus.request.write.region.CreateRegionGroupsPlan;
import org.apache.iotdb.confignode.consensus.request.write.storagegroup.DeleteStorageGroupPlan;
@@ -549,10 +549,7 @@ public class ConfigNodeProcedureEnv {
// Select leader greedily for iot consensus protocol
if (TConsensusGroupType.DataRegion.equals(regionGroupId.getType())
&& ConsensusFactory.IOT_CONSENSUS.equals(
- CommonDescriptor.getInstance()
- .getConf()
- .getDataRegionConsensusProtocolClass()
- .getProtocol())) {
+ ConfigNodeDescriptor.getInstance().getConf().getDataRegionConsensusProtocolClass())) {
List<Integer> availableDataNodes = new ArrayList<>();
for (Map.Entry<Integer, RegionStatus> statusEntry : regionStatusMap.entrySet()) {
if (RegionStatus.isNormalStatus(statusEntry.getValue())) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
index 8339d027f9..5e9478b49c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java
@@ -25,10 +25,10 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.cluster.NodeStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.client.DataNodeRequestType;
import org.apache.iotdb.confignode.client.sync.SyncDataNodeClientPool;
+import org.apache.iotdb.confignode.conf.ConfigNodeConfig;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.consensus.request.write.datanode.RemoveDataNodePlan;
import org.apache.iotdb.confignode.consensus.request.write.partition.UpdateRegionLocationPlan;
import org.apache.iotdb.confignode.consensus.response.DataNodeToStatusResp;
@@ -58,7 +58,7 @@ import static org.apache.iotdb.consensus.ConsensusFactory.SIMPLE_CONSENSUS;
public class DataNodeRemoveHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(DataNodeRemoveHandler.class);
- private static final CommonConfig CONF = CommonDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private final ConfigManager configManager;
@@ -181,7 +181,7 @@ public class DataNodeRemoveHandler {
List<TDataNodeLocation> currentPeerNodes;
if (TConsensusGroupType.DataRegion.equals(regionId.getType())
- && IOT_CONSENSUS.equals(CONF.getDataRegionConsensusProtocolClass().getProtocol())) {
+ && IOT_CONSENSUS.equals(CONF.getDataRegionConsensusProtocolClass())) {
// parameter of createPeer for MultiLeader should be all peers
currentPeerNodes = new ArrayList<>(regionReplicaNodes);
currentPeerNodes.add(destDataNode);
@@ -578,7 +578,7 @@ public class DataNodeRemoveHandler {
filterDataNodeWithOtherRegionReplica(regionId, originalDataNode);
if (TConsensusGroupType.DataRegion.equals(regionId.getType())
- && IOT_CONSENSUS.equals(CONF.getDataRegionConsensusProtocolClass().getProtocol())) {
+ && IOT_CONSENSUS.equals(CONF.getDataRegionConsensusProtocolClass())) {
if (CONF.getDataReplicationFactor() == 1) {
newLeaderNode = Optional.of(migrateDestDataNode);
}
@@ -661,8 +661,8 @@ public class DataNodeRemoveHandler {
*/
private TSStatus checkClusterProtocol() {
TSStatus status = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
- if (CONF.getDataRegionConsensusProtocolClass().getProtocol().equals(SIMPLE_CONSENSUS)
- || CONF.getSchemaRegionConsensusProtocolClass().getProtocol().equals(SIMPLE_CONSENSUS)) {
+ if (CONF.getDataRegionConsensusProtocolClass().equals(SIMPLE_CONSENSUS)
+ || CONF.getSchemaRegionConsensusProtocolClass().equals(SIMPLE_CONSENSUS)) {
status.setCode(TSStatusCode.REMOVE_DATANODE_ERROR.getStatusCode());
status.setMessage("SimpleConsensus protocol is not supported to remove data node");
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
index 1a6e4b6eaa..ef27ed492f 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
@@ -41,7 +41,7 @@ public class ConfigProcedureStore implements IProcedureStore {
private volatile boolean isRunning = false;
private final ProcedureInfo procedureInfo;
private final String procedureWalDir =
- CommonDescriptor.getInstance().getConf().getProcedureWalFolder();
+ CommonDescriptor.getInstance().getConfig().getProcedureWalFolder();
private final ConfigManager configManager;
public ConfigProcedureStore(ConfigManager configManager, ProcedureInfo procedureInfo) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ProcedureStore.java b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ProcedureStore.java
index d8b115d586..123199d841 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ProcedureStore.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ProcedureStore.java
@@ -39,7 +39,8 @@ import java.util.stream.Stream;
public class ProcedureStore implements IProcedureStore {
private static final Logger LOG = LoggerFactory.getLogger(ProcedureStore.class);
- private String procedureWalDir = CommonDescriptor.getInstance().getConf().getProcedureWalFolder();
+ private String procedureWalDir =
+ CommonDescriptor.getInstance().getConfig().getProcedureWalFolder();
private final ConcurrentHashMap<Long, ProcedureWAL> procWALMap = new ConcurrentHashMap<>();
public static final String PROCEDURE_WAL_SUFFIX = ".proc.wal";
private final IProcedureFactory procedureFactory;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 8638c24a1a..f7318c9969 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -21,8 +21,6 @@ package org.apache.iotdb.confignode.service;
import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.exception.StartupException;
import org.apache.iotdb.commons.service.JMXService;
import org.apache.iotdb.commons.service.RegisterManager;
@@ -57,9 +55,7 @@ public class ConfigNode implements ConfigNodeMBean {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNode.class);
- private static final CommonConfig COMMON_CONFIG = CommonDescriptor.getInstance().getConf();
- private static final ConfigNodeConfig CONFIG_NODE_CONFIG =
- ConfigNodeDescriptor.getInstance().getConf();
+ private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
private static final int STARTUP_RETRY_NUM = 10;
private static final int SCHEDULE_WAITING_RETRY_NUM = 20;
@@ -100,8 +96,8 @@ public class ConfigNode implements ConfigNodeMBean {
LOGGER.info("{} is in restarting process...", ConfigNodeConstant.GLOBAL_NAME);
/* Always restore ClusterName and ConfigNodeId first */
- COMMON_CONFIG.setClusterName(SystemPropertiesUtils.loadClusterNameWhenRestarted());
- CONFIG_NODE_CONFIG.setConfigNodeId(SystemPropertiesUtils.loadConfigNodeIdWhenRestarted());
+ CONF.setClusterName(SystemPropertiesUtils.loadClusterNameWhenRestarted());
+ CONF.setConfigNodeId(SystemPropertiesUtils.loadConfigNodeIdWhenRestarted());
if (!SystemPropertiesUtils.isSeedConfigNode()) {
// The non-seed-ConfigNodes should send restart request
@@ -113,7 +109,7 @@ public class ConfigNode implements ConfigNodeMBean {
LOGGER.info(
"{} has successfully restarted and joined the cluster: {}.",
ConfigNodeConstant.GLOBAL_NAME,
- COMMON_CONFIG.getClusterName());
+ CONF.getClusterName());
return;
}
@@ -124,7 +120,7 @@ public class ConfigNode implements ConfigNodeMBean {
ConfigNodeConstant.GLOBAL_NAME);
/* Always set ClusterId and ConfigNodeId before initConsensusManager */
- CONFIG_NODE_CONFIG.setConfigNodeId(SEED_CONFIG_NODE_ID);
+ CONF.setConfigNodeId(SEED_CONFIG_NODE_ID);
configManager.initConsensusManager();
// Persistence system parameters after the consensusGroup is built,
@@ -137,12 +133,8 @@ public class ConfigNode implements ConfigNodeMBean {
.applyConfigNode(
new TConfigNodeLocation(
SEED_CONFIG_NODE_ID,
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnInternalPort()),
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort())));
+ new TEndPoint(CONF.getInternalAddress(), CONF.getInternalPort()),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort())));
// We always set up Seed-ConfigNode's RPC service lastly to ensure that
// the external service is not provided until Seed-ConfigNode is fully initialized
setUpRPCService();
@@ -151,7 +143,7 @@ public class ConfigNode implements ConfigNodeMBean {
LOGGER.info(
"{} has successfully started and joined the cluster: {}.",
ConfigNodeConstant.GLOBAL_NAME,
- COMMON_CONFIG.getClusterName());
+ CONF.getClusterName());
return;
}
@@ -165,8 +157,8 @@ public class ConfigNode implements ConfigNodeMBean {
LOGGER.info(
"{} {} has registered successfully. Waiting for the leader's scheduling to join the cluster: {}.",
ConfigNodeConstant.GLOBAL_NAME,
- CONFIG_NODE_CONFIG.getConfigNodeId(),
- COMMON_CONFIG.getClusterName());
+ CONF.getConfigNodeId(),
+ CONF.getClusterName());
boolean isJoinedCluster = false;
for (int retry = 0; retry < SCHEDULE_WAITING_RETRY_NUM; retry++) {
@@ -245,15 +237,11 @@ public class ConfigNode implements ConfigNodeMBean {
new TConfigNodeRegisterReq(
new TConfigNodeLocation(
INIT_NON_SEED_CONFIG_NODE_ID,
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnInternalPort()),
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort())),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getInternalPort()),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort())),
configManager.getClusterParameters());
- TEndPoint targetConfigNode = CONFIG_NODE_CONFIG.getCnTargetConfigNode();
+ TEndPoint targetConfigNode = CONF.getTargetConfigNode();
if (targetConfigNode == null) {
LOGGER.error(
"Please set the cn_target_config_node_list parameter in iotdb-confignode.properties file.");
@@ -281,7 +269,7 @@ public class ConfigNode implements ConfigNodeMBean {
throw new StartupException("The result of register ConfigNode is empty!");
}
/* Always set ConfigNodeId before initConsensusManager */
- CONFIG_NODE_CONFIG.setConfigNodeId(resp.getConfigNodeId());
+ CONF.setConfigNodeId(resp.getConfigNodeId());
configManager.initConsensusManager();
return;
} else if (status.getCode() == TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode()) {
@@ -306,17 +294,13 @@ public class ConfigNode implements ConfigNodeMBean {
private void sendRestartConfigNodeRequest() throws IOException, StartupException {
TConfigNodeRestartReq req =
new TConfigNodeRestartReq(
- COMMON_CONFIG.getClusterName(),
+ CONF.getClusterName(),
new TConfigNodeLocation(
- CONFIG_NODE_CONFIG.getConfigNodeId(),
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnInternalPort()),
- new TEndPoint(
- CONFIG_NODE_CONFIG.getCnInternalAddress(),
- CONFIG_NODE_CONFIG.getCnConsensusPort())));
-
- TEndPoint targetConfigNode = CONFIG_NODE_CONFIG.getCnTargetConfigNode();
+ CONF.getConfigNodeId(),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getInternalPort()),
+ new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort())));
+
+ TEndPoint targetConfigNode = CONF.getTargetConfigNode();
if (targetConfigNode == null) {
LOGGER.error(
"Please set the cn_target_config_node_list parameter in iotdb-confignode.properties file.");
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCService.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCService.java
index 7c65225481..824b02b3e2 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCService.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCService.java
@@ -35,7 +35,7 @@ import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
public class ConfigNodeRPCService extends ThriftService implements ConfigNodeRPCServiceMBean {
private static final ConfigNodeConfig configConf = ConfigNodeDescriptor.getInstance().getConf();
- private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConf();
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private ConfigNodeRPCServiceProcessor configNodeRPCServiceProcessor;
@@ -72,9 +72,9 @@ public class ConfigNodeRPCService extends ThriftService implements ConfigNodeRPC
getBindIP(),
getBindPort(),
configConf.getCnRpcMaxConcurrentClientNum(),
- configConf.getCnConnectionTimeoutMs() / 1000,
+ configConf.getThriftServerAwaitTimeForStopService(),
new ConfigNodeRPCServiceHandler(),
- configConf.isCnRpcThriftCompressionEnable());
+ commonConfig.isRpcThriftCompressionEnabled());
} catch (RPCServiceException e) {
throw new IllegalAccessException(e.getMessage());
}
@@ -84,11 +84,11 @@ public class ConfigNodeRPCService extends ThriftService implements ConfigNodeRPC
@Override
public String getBindIP() {
- return configConf.getCnInternalAddress();
+ return configConf.getInternalAddress();
}
@Override
public int getBindPort() {
- return configConf.getCnInternalPort();
+ return configConf.getInternalPort();
}
}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index 809038da38..f3091c0066 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -31,6 +31,7 @@ import org.apache.iotdb.commons.path.PathPatternTree;
import org.apache.iotdb.commons.utils.StatusUtils;
import org.apache.iotdb.commons.utils.TestOnly;
import org.apache.iotdb.confignode.conf.ConfigNodeConstant;
+import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.conf.SystemPropertiesUtils;
import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType;
import org.apache.iotdb.confignode.consensus.request.auth.AuthorPlan;
@@ -275,19 +276,19 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
// Set default configurations if necessary
if (!storageGroupSchema.isSetTTL()) {
- storageGroupSchema.setTTL(CommonDescriptor.getInstance().getConf().getDefaultTtlInMs());
+ storageGroupSchema.setTTL(CommonDescriptor.getInstance().getConfig().getDefaultTTLInMs());
}
if (!storageGroupSchema.isSetSchemaReplicationFactor()) {
storageGroupSchema.setSchemaReplicationFactor(
- CommonDescriptor.getInstance().getConf().getSchemaReplicationFactor());
+ ConfigNodeDescriptor.getInstance().getConf().getSchemaReplicationFactor());
}
if (!storageGroupSchema.isSetDataReplicationFactor()) {
storageGroupSchema.setDataReplicationFactor(
- CommonDescriptor.getInstance().getConf().getDataReplicationFactor());
+ ConfigNodeDescriptor.getInstance().getConf().getDataReplicationFactor());
}
if (!storageGroupSchema.isSetTimePartitionInterval()) {
storageGroupSchema.setTimePartitionInterval(
- CommonDescriptor.getInstance().getConf().getTimePartitionInterval());
+ ConfigNodeDescriptor.getInstance().getConf().getTimePartitionInterval());
}
// Initialize the maxSchemaRegionGroupCount and maxDataRegionGroupCount as 0
@@ -486,7 +487,7 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
LOGGER.info(
"{} has successfully started and joined the cluster: {}.",
ConfigNodeConstant.GLOBAL_NAME,
- CommonDescriptor.getInstance().getConf().getClusterName());
+ ConfigNodeDescriptor.getInstance().getConf().getClusterName());
return StatusUtils.OK;
}
diff --git a/confignode/src/test/resources/iotdb-confignode.properties b/confignode/src/test/resources/iotdb-confignode.properties
deleted file mode 100644
index 5bc0bba46d..0000000000
--- a/confignode/src/test/resources/iotdb-confignode.properties
+++ /dev/null
@@ -1,21 +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.
-#
-
-cn_system_dir=target/confignode/system
-cn_consensus_dir=target/confignode/consensus
\ No newline at end of file
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
index e225c8cc27..1375a88cca 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
@@ -239,7 +239,7 @@ class RatisConsensus implements IConsensus {
}
// current Peer is group leader and in ReadOnly State
- if (isLeader(consensusGroupId) && CommonDescriptor.getInstance().getConf().isReadOnly()) {
+ if (isLeader(consensusGroupId) && CommonDescriptor.getInstance().getConfig().isReadOnly()) {
try {
forceStepDownLeader(raftGroup);
} catch (Exception e) {
diff --git a/flink-tsfile-connector/src/test/java/org/apache/iotdb/flink/util/TSFileConfigUtilCompletenessTest.java b/flink-tsfile-connector/src/test/java/org/apache/iotdb/flink/util/TSFileConfigUtilCompletenessTest.java
index 0ce76f850e..c46c700f2c 100644
--- a/flink-tsfile-connector/src/test/java/org/apache/iotdb/flink/util/TSFileConfigUtilCompletenessTest.java
+++ b/flink-tsfile-connector/src/test/java/org/apache/iotdb/flink/util/TSFileConfigUtilCompletenessTest.java
@@ -78,8 +78,7 @@ public class TSFileConfigUtilCompletenessTest {
"setMaxTsBlockLineNumber",
"setMaxTsBlockSizeInBytes",
"setPatternMatchingThreshold",
- "setCustomizedProperties",
- "setFrequencyIntervalInMinute"
+ "setCustomizedProperties"
};
Set<String> addedSetters = new HashSet<>();
Collections.addAll(addedSetters, setters);
diff --git a/influxdb-protocol/src/main/java/org/apache/iotdb/influxdb/session/InfluxDBSession.java b/influxdb-protocol/src/main/java/org/apache/iotdb/influxdb/session/InfluxDBSession.java
index 614445fe06..9de7a1fde3 100644
--- a/influxdb-protocol/src/main/java/org/apache/iotdb/influxdb/session/InfluxDBSession.java
+++ b/influxdb-protocol/src/main/java/org/apache/iotdb/influxdb/session/InfluxDBSession.java
@@ -135,7 +135,7 @@ public class InfluxDBSession {
throw new IoTDBConnectionException(e);
}
- if (IoTDBDescriptor.getInstance().getConf().isDnRpcThriftCompressionEnable()) {
+ if (IoTDBDescriptor.getInstance().getConfig().isRpcThriftCompressionEnable()) {
client = new InfluxDBService.Client(new TCompactProtocol(transport));
} else {
client = new InfluxDBService.Client(new TBinaryProtocol(transport));
diff --git a/integration-test/import-control.xml b/integration-test/import-control.xml
index 02a05d5084..4c685eca80 100644
--- a/integration-test/import-control.xml
+++ b/integration-test/import-control.xml
@@ -36,13 +36,12 @@
<allow pkg="org\.apache\.commons\.lang3.*" regex="true"/>
<allow pkg="org\.slf4j.*" regex="true" />
<allow pkg="org\.apache\.iotdb\.tools.*" regex="true"/>
- <allow pkg="org\.apache\.iotdb\.commons\.conf.*" regex="true" />
<subpackage name="db.it">
<disallow pkg="org.apache.iotdb.jdbc.*"/>
<allow class="org.apache.iotdb.db.constant.TestConstant" />
<allow class="org.apache.iotdb.db.tools.watermark.WatermarkDetector" />
<allow class="org.apache.iotdb.db.utils.MathUtils" />
- <allow class="org.apache.iotdb.commons.wal.WALMode" />
+ <allow class="org.apache.iotdb.db.wal.utils.WALMode" />
<allow class="org.fusesource.mqtt.client.QoS" />
<allow class="org.apache.iotdb.commons.path.PartialPath" />
<allow pkg="java.text"/>
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
index c7d773e60e..c62618e745 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
@@ -19,9 +19,9 @@
package org.apache.iotdb.db.it;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
-import org.apache.iotdb.commons.wal.WALMode;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.wal.utils.WALMode;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
@@ -53,7 +53,7 @@ import static org.junit.Assert.fail;
@RunWith(IoTDBTestRunner.class)
@Category({LocalStandaloneIT.class, ClusterIT.class})
public class IoTDBRecoverUnclosedIT {
- private static final CommonConfig config = CommonDescriptor.getInstance().getConf();
+ private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
private static final String TIMESTAMP_STR = "Time";
private static final String TEMPERATURE_STR = "root.ln.wf01.wt01.temperature";
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
index 9f124960e8..e93497a5da 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
@@ -18,8 +18,6 @@
*/
package org.apache.iotdb.db.it;
-import org.apache.iotdb.commons.conf.CommonConfig;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.it.env.EnvFactory;
@@ -316,14 +314,13 @@ public class IoTDBRestartIT {
@Test
public void testRecoverWALDeleteSchemaCheckResourceTime() throws Exception {
- CommonConfig commonConfig = CommonDescriptor.getInstance().getConf();
- IoTDBConfig iotdbConfig = IoTDBDescriptor.getInstance().getConf();
- int avgSeriesPointNumberThreshold = commonConfig.getAvgSeriesPointNumberThreshold();
- commonConfig.setAvgSeriesPointNumberThreshold(2);
- long tsFileSize = iotdbConfig.getSeqTsFileSize();
- long unFsFileSize = iotdbConfig.getSeqTsFileSize();
- iotdbConfig.setSeqTsFileSize(10000000);
- iotdbConfig.setUnSeqTsFileSize(10000000);
+ IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
+ int avgSeriesPointNumberThreshold = config.getAvgSeriesPointNumberThreshold();
+ config.setAvgSeriesPointNumberThreshold(2);
+ long tsFileSize = config.getSeqTsFileSize();
+ long unFsFileSize = config.getSeqTsFileSize();
+ config.setSeqTsFileSize(10000000);
+ config.setUnSeqTsFileSize(10000000);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -353,9 +350,9 @@ public class IoTDBRestartIT {
assertEquals(2, cnt);
}
- commonConfig.setAvgSeriesPointNumberThreshold(avgSeriesPointNumberThreshold);
- iotdbConfig.setSeqTsFileSize(tsFileSize);
- iotdbConfig.setUnSeqTsFileSize(unFsFileSize);
+ config.setAvgSeriesPointNumberThreshold(avgSeriesPointNumberThreshold);
+ config.setSeqTsFileSize(tsFileSize);
+ config.setUnSeqTsFileSize(unFsFileSize);
}
@Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
index fc0a8bcfd1..e44c40ce99 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionComplexIT.java
@@ -266,7 +266,7 @@ public class IoTDBSessionComplexIT {
private void insertRecords(ISession session, List<String> deviceIdList)
throws IoTDBConnectionException, StatementExecutionException {
- long timePartition = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ long timePartition = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
List<String> measurements = new ArrayList<>();
measurements.add("s1");
@@ -315,7 +315,7 @@ public class IoTDBSessionComplexIT {
private void insertMultiTablets(ISession session, List<String> deviceIdList)
throws IoTDBConnectionException, StatementExecutionException {
- long timePartition = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ long timePartition = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
List<MeasurementSchema> schemaList = new ArrayList<>();
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT64));
@@ -343,7 +343,7 @@ public class IoTDBSessionComplexIT {
private void insertRecordsOfOneDevice(ISession session, String deviceId)
throws IoTDBConnectionException, StatementExecutionException {
- long timePartition = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ long timePartition = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
List<String> measurements = new ArrayList<>();
measurements.add("s1");
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
index b4930174bd..bf9f07ea2e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
@@ -18,7 +18,7 @@
*/
package org.apache.iotdb.session.it;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.conf.OperationType;
import org.apache.iotdb.isession.ISession;
import org.apache.iotdb.isession.SessionDataSet;
@@ -146,9 +146,9 @@ public class IoTDBSessionSimpleIT {
session.insertRecord(deviceId, 1L, measurements, values);
Set<String> expected = new HashSet<>();
- expected.add(CommonDescriptor.getInstance().getConf().getIntegerStringInferType().name());
- expected.add(CommonDescriptor.getInstance().getConf().getFloatingStringInferType().name());
- expected.add(CommonDescriptor.getInstance().getConf().getBooleanStringInferType().name());
+ expected.add(IoTDBDescriptor.getInstance().getConfig().getIntegerStringInferType().name());
+ expected.add(IoTDBDescriptor.getInstance().getConfig().getFloatingStringInferType().name());
+ expected.add(IoTDBDescriptor.getInstance().getConfig().getBooleanStringInferType().name());
expected.add(TSDataType.TEXT.name());
Set<String> actual = new HashSet<>();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCheckConfigIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCheckConfigIT.java
index 1e3d3bffa2..ad8b5709ed 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCheckConfigIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCheckConfigIT.java
@@ -50,7 +50,7 @@ import static org.junit.Assert.fail;
public class IoTDBCheckConfigIT {
private File propertiesFile =
SystemFileFactory.INSTANCE.getFile(
- IoTDBDescriptor.getInstance().getConf().getSchemaDir()
+ IoTDBDescriptor.getInstance().getConfig().getSchemaDir()
+ File.separator
+ "system.properties");
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionIT.java
index 0d7aca8544..7d9d5db749 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionIT.java
@@ -49,7 +49,7 @@ public class IoTDBCompactionIT {
@Before
public void setUp() throws Exception {
- prevPartitionInterval = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
ConfigFactory.getConfig().setPartitionInterval(1);
EnvFactory.getEnv().initBeforeTest();
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionWithIDTableIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionWithIDTableIT.java
index aa151ecce2..ba62d256c0 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionWithIDTableIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCompactionWithIDTableIT.java
@@ -53,11 +53,11 @@ public class IoTDBCompactionWithIDTableIT {
@Before
public void setUp() throws Exception {
- prevPartitionInterval = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
ConfigFactory.getConfig().setPartitionInterval(1);
- isEnableIDTable = IoTDBDescriptor.getInstance().getConf().isEnableIDTable();
+ isEnableIDTable = IoTDBDescriptor.getInstance().getConfig().isEnableIDTable();
originalDeviceIDTransformationMethod =
- IoTDBDescriptor.getInstance().getConf().getDeviceIDTransformationMethod();
+ IoTDBDescriptor.getInstance().getConfig().getDeviceIDTransformationMethod();
ConfigFactory.getConfig().setEnableIDTable(true);
ConfigFactory.getConfig().setDeviceIDTransformationMethod("SHA256");
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMaxTimeQueryIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMaxTimeQueryIT.java
index a8462505fb..1a8603082b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMaxTimeQueryIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMaxTimeQueryIT.java
@@ -67,27 +67,28 @@ public class IoTDBMaxTimeQueryIT {
public static void setUp() throws Exception {
EnvironmentUtils.envSetUp();
// TODO When the aligned time series support compaction, we need to set compaction to true
- enableSeqSpaceCompaction = IoTDBDescriptor.getInstance().getConf().isEnableSeqSpaceCompaction();
+ enableSeqSpaceCompaction =
+ IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
enableUnseqSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableUnseqSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
enableCrossSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableCrossSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
numOfPointsPerPage = TSFileDescriptor.getInstance().getConfig().getMaxNumberOfPointsInPage();
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableUnseqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableCrossSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableUnseqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(2);
insertData();
}
@AfterClass
public static void tearDown() throws Exception {
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
EnvironmentUtils.cleanEnv();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedChunkInUnseqIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedChunkInUnseqIT.java
index f223e7dadc..6d46814d0b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedChunkInUnseqIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedChunkInUnseqIT.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.integration;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.integration.env.ConfigFactory;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.ClusterTest;
@@ -50,7 +50,7 @@ public class IoTDBMultiOverlappedChunkInUnseqIT {
@BeforeClass
public static void setUp() throws Exception {
previousMemtableSizeThreshold =
- CommonDescriptor.getInstance().getConf().getMemtableSizeThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getMemtableSizeThreshold();
ConfigFactory.getConfig().setMemtableSizeThreshold(1024);
EnvFactory.getEnv().initBeforeClass();
insertData();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedPageIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedPageIT.java
index 64c6c3c73c..31a37ce75c 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedPageIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiOverlappedPageIT.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.db.integration;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.integration.env.ConfigFactory;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.ClusterTest;
@@ -53,7 +53,7 @@ public class IoTDBMultiOverlappedPageIT {
@BeforeClass
public static void setUp() throws Exception {
beforeMemtableSizeThreshold =
- CommonDescriptor.getInstance().getConf().getMemtableSizeThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getMemtableSizeThreshold();
ConfigFactory.getConfig().setMemtableSizeThreshold(1024 * 16);
// max_number_of_points_in_page = 10
beforeMaxNumberOfPointsInPage =
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
index 7af8e5d4f0..68d76e6402 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
@@ -71,7 +71,7 @@ public class IoTDBMultiSeriesIT {
ConfigFactory.getConfig().setPageSizeInByte(1024 * 150);
ConfigFactory.getConfig().setGroupSizeInByte(1024 * 1000);
ConfigFactory.getConfig().setMemtableSizeThreshold(1024 * 1000);
- prevPartitionInterval = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
ConfigFactory.getConfig().setPartitionInterval(100);
ConfigFactory.getConfig().setCompressor("LZ4");
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
index f8a88e021a..7f0d6ab18b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNewTsFileCompactionIT.java
@@ -18,7 +18,6 @@
*/
package org.apache.iotdb.db.integration;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.StorageEngineException;
@@ -62,10 +61,10 @@ public class IoTDBNewTsFileCompactionIT {
storageGroupPath = new PartialPath("root.newTsFileCompaction");
TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(1);
originCompactionFileNum =
- IoTDBDescriptor.getInstance().getConf().getMaxInnerCompactionCandidateFileNum();
- originSeqTsFileSize = IoTDBDescriptor.getInstance().getConf().getSeqTsFileSize();
- IoTDBDescriptor.getInstance().getConf().setMaxInnerCompactionCandidateFileNum(2);
- IoTDBDescriptor.getInstance().getConf().setSeqTsFileSize(1);
+ IoTDBDescriptor.getInstance().getConfig().getMaxInnerCompactionCandidateFileNum();
+ originSeqTsFileSize = IoTDBDescriptor.getInstance().getConfig().getSeqTsFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
+ IoTDBDescriptor.getInstance().getConfig().setSeqTsFileSize(1);
EnvironmentUtils.envSetUp();
Class.forName(Config.JDBC_DRIVER_NAME);
@@ -82,12 +81,12 @@ public class IoTDBNewTsFileCompactionIT {
public void tearDown() throws Exception {
EnvironmentUtils.cleanEnv();
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setMaxInnerCompactionCandidateFileNum(originCompactionFileNum);
TSFileDescriptor.getInstance()
.getConfig()
.setMaxNumberOfPointsInPage(preMaxNumberOfPointsInPage);
- IoTDBDescriptor.getInstance().getConf().setSeqTsFileSize(originSeqTsFileSize);
+ IoTDBDescriptor.getInstance().getConfig().setSeqTsFileSize(originSeqTsFileSize);
}
/**
@@ -101,13 +100,13 @@ public class IoTDBNewTsFileCompactionIT {
{"2", "2"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -137,8 +136,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -155,13 +154,13 @@ public class IoTDBNewTsFileCompactionIT {
{"3", "3"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// first file
// two chunks
@@ -193,8 +192,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -211,13 +210,13 @@ public class IoTDBNewTsFileCompactionIT {
{"3", "3"},
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -248,8 +247,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -268,13 +267,13 @@ public class IoTDBNewTsFileCompactionIT {
{"5", "5"},
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// first file
// one chunk with two pages
@@ -309,8 +308,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -327,13 +326,13 @@ public class IoTDBNewTsFileCompactionIT {
{"3", "3"},
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -365,8 +364,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -384,13 +383,13 @@ public class IoTDBNewTsFileCompactionIT {
{"4", "4"},
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// first file
// two chunks
@@ -398,7 +397,7 @@ public class IoTDBNewTsFileCompactionIT {
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// second file
// two pages for one chunk
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(3, 3)");
@@ -426,8 +425,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -445,13 +444,13 @@ public class IoTDBNewTsFileCompactionIT {
{"4", "4"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -483,8 +482,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -504,13 +503,13 @@ public class IoTDBNewTsFileCompactionIT {
{"6", "6"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// first file
// one chunk with two pages
@@ -547,8 +546,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -565,19 +564,19 @@ public class IoTDBNewTsFileCompactionIT {
{"3", "3"},
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// second file
// two pages for one chunk
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
@@ -604,8 +603,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -623,13 +622,13 @@ public class IoTDBNewTsFileCompactionIT {
{"4", "4"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// first file
// two chunks
@@ -670,8 +669,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -689,19 +688,19 @@ public class IoTDBNewTsFileCompactionIT {
{"4", "4"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// second file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(3, 3)");
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(4, 4)");
@@ -727,8 +726,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -748,13 +747,13 @@ public class IoTDBNewTsFileCompactionIT {
{"6", "6"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// first file
// one chunk with two pages
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -764,7 +763,7 @@ public class IoTDBNewTsFileCompactionIT {
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(4, 4)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// second file
// two pages for one chunk
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(5, 5)");
@@ -791,8 +790,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -811,19 +810,19 @@ public class IoTDBNewTsFileCompactionIT {
{"5", "5"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// second file
// one chunk with two pages
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
@@ -853,8 +852,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -874,13 +873,13 @@ public class IoTDBNewTsFileCompactionIT {
{"6", "6"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(1);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(1);
// first file
// two chunks
@@ -888,7 +887,7 @@ public class IoTDBNewTsFileCompactionIT {
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// second file
// one chunk with two pages
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(3, 3)");
@@ -918,8 +917,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -939,13 +938,13 @@ public class IoTDBNewTsFileCompactionIT {
{"6", "6"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(10000);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(10000);
// first file
// two pages for one chunk
@@ -953,7 +952,7 @@ public class IoTDBNewTsFileCompactionIT {
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(2, 2)");
statement.execute("FLUSH");
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// second file
// one chunk with two pages
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(3, 3)");
@@ -983,8 +982,8 @@ public class IoTDBNewTsFileCompactionIT {
e.printStackTrace();
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
@@ -1006,13 +1005,13 @@ public class IoTDBNewTsFileCompactionIT {
{"8", "8"}
};
int preAvgSeriesPointNumberThreshold =
- CommonDescriptor.getInstance().getConf().getAvgSeriesPointNumberThreshold();
+ IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
try (Connection connection =
DriverManager.getConnection(
Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
Statement statement = connection.createStatement()) {
- CommonDescriptor.getInstance().getConf().setAvgSeriesPointNumberThreshold(2);
+ IoTDBDescriptor.getInstance().getConfig().setAvgSeriesPointNumberThreshold(2);
// first file
// one chunk with two pages
statement.execute("INSERT INTO root.newTsFileCompaction.d1(time,s1) values(1, 1)");
@@ -1052,8 +1051,8 @@ public class IoTDBNewTsFileCompactionIT {
fail();
} finally {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
}
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java
index 21d9ac64aa..ac3b406f0c 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java
@@ -18,7 +18,6 @@
*/
package org.apache.iotdb.db.integration;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.metadata.idtable.entry.DeviceIDFactory;
import org.apache.iotdb.integration.env.ConfigFactory;
@@ -109,10 +108,10 @@ public class IoTDBQueryWithIDTableIT {
@BeforeClass
public static void setUp() throws Exception {
- CommonDescriptor.getInstance().getConf().setEnableAutoCreateSchema(true);
- isEnableIDTable = IoTDBDescriptor.getInstance().getConf().isEnableIDTable();
+ IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(true);
+ isEnableIDTable = IoTDBDescriptor.getInstance().getConfig().isEnableIDTable();
originalDeviceIDTransformationMethod =
- IoTDBDescriptor.getInstance().getConf().getDeviceIDTransformationMethod();
+ IoTDBDescriptor.getInstance().getConfig().getDeviceIDTransformationMethod();
ConfigFactory.getConfig().setEnableIDTable(true);
ConfigFactory.getConfig().setDeviceIDTransformationMethod("SHA256");
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRewriteTsFileToolIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRewriteTsFileToolIT.java
index 59deac5da7..24a19a674f 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRewriteTsFileToolIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRewriteTsFileToolIT.java
@@ -40,7 +40,7 @@ import java.sql.SQLException;
import java.sql.Statement;
public class IoTDBRewriteTsFileToolIT {
- private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConf();
+ private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConfig();
private String tmpDir;
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRpcCompressionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRpcCompressionIT.java
index 0418404b01..7b24d44c59 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRpcCompressionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBRpcCompressionIT.java
@@ -41,9 +41,9 @@ import static org.junit.Assert.assertEquals;
@Category({LocalStandaloneTest.class})
public class IoTDBRpcCompressionIT {
boolean rpcThriftCompression =
- IoTDBDescriptor.getInstance().getConf().isDnRpcThriftCompressionEnable();
+ IoTDBDescriptor.getInstance().getConfig().isRpcThriftCompressionEnable();
boolean rpcAdvancedCompression =
- IoTDBDescriptor.getInstance().getConf().isDnRpcAdvancedCompressionEnable();
+ IoTDBDescriptor.getInstance().getConfig().isRpcAdvancedCompressionEnable();
@Before
public void setUp() throws Exception {}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSessionTimeoutIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSessionTimeoutIT.java
index 16ed3944f3..19d56546ca 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSessionTimeoutIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSessionTimeoutIT.java
@@ -44,7 +44,7 @@ public class IoTDBSessionTimeoutIT {
@Before
public void setUp() throws ClassNotFoundException {
- IoTDBDescriptor.getInstance().getConf().setDnSessionTimeoutThreshold(1000);
+ IoTDBDescriptor.getInstance().getConfig().setSessionTimeoutThreshold(1000);
EnvironmentUtils.envSetUp();
Class.forName(Config.JDBC_DRIVER_NAME);
}
@@ -52,7 +52,7 @@ public class IoTDBSessionTimeoutIT {
@After
public void tearDown() throws Exception {
EnvironmentUtils.cleanEnv();
- IoTDBDescriptor.getInstance().getConf().setDnSessionTimeoutThreshold(0);
+ IoTDBDescriptor.getInstance().getConfig().setSessionTimeoutThreshold(0);
}
@Test
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSizeTieredCompactionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSizeTieredCompactionIT.java
index 96f8b096f6..f701878108 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSizeTieredCompactionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSizeTieredCompactionIT.java
@@ -47,7 +47,7 @@ public class IoTDBSizeTieredCompactionIT {
@Before
public void setUp() throws Exception {
EnvFactory.getEnv().initBeforeTest();
- IoTDBDescriptor.getInstance().getConf().setEnableUnseqSpaceCompaction(true);
+ IoTDBDescriptor.getInstance().getConfig().setEnableUnseqSpaceCompaction(true);
}
@After
@@ -1010,16 +1010,17 @@ public class IoTDBSizeTieredCompactionIT {
@Test
public void testSequenceInnerCompactionContinously() throws SQLException {
- int oriThreadNum = IoTDBDescriptor.getInstance().getConf().getCompactionThreadCount();
- long oriTargetFileSize = IoTDBDescriptor.getInstance().getConf().getTargetCompactionFileSize();
- IoTDBDescriptor.getInstance().getConf().setCompactionThreadCount(2);
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(600);
+ int oriThreadNum = IoTDBDescriptor.getInstance().getConfig().getCompactionThreadCount();
+ long oriTargetFileSize =
+ IoTDBDescriptor.getInstance().getConfig().getTargetCompactionFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setCompactionThreadCount(2);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(600);
int originCandidateNum =
- IoTDBDescriptor.getInstance().getConf().getMaxInnerCompactionCandidateFileNum();
- IoTDBDescriptor.getInstance().getConf().setMaxInnerCompactionCandidateFileNum(2);
+ IoTDBDescriptor.getInstance().getConfig().getMaxInnerCompactionCandidateFileNum();
+ IoTDBDescriptor.getInstance().getConfig().setMaxInnerCompactionCandidateFileNum(2);
CompactionPriority compactionPriority =
- IoTDBDescriptor.getInstance().getConf().getCompactionPriority();
- IoTDBDescriptor.getInstance().getConf().setCompactionPriority(CompactionPriority.INNER_CROSS);
+ IoTDBDescriptor.getInstance().getConfig().getCompactionPriority();
+ IoTDBDescriptor.getInstance().getConfig().setCompactionPriority(CompactionPriority.INNER_CROSS);
long originCompactionNum = CompactionTaskManager.getInstance().getFinishedTaskNum();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -1087,19 +1088,20 @@ public class IoTDBSizeTieredCompactionIT {
}
} finally {
- IoTDBDescriptor.getInstance().getConf().setCompactionThreadCount(oriThreadNum);
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(oriTargetFileSize);
- IoTDBDescriptor.getInstance().getConf().setCompactionPriority(compactionPriority);
+ IoTDBDescriptor.getInstance().getConfig().setCompactionThreadCount(oriThreadNum);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(oriTargetFileSize);
+ IoTDBDescriptor.getInstance().getConfig().setCompactionPriority(compactionPriority);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setMaxInnerCompactionCandidateFileNum(originCandidateNum);
}
}
@Test
public void testSequenceInnerCompactionConcurrently() throws SQLException {
- long oriTargetFileSize = IoTDBDescriptor.getInstance().getConf().getTargetCompactionFileSize();
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(600);
+ long oriTargetFileSize =
+ IoTDBDescriptor.getInstance().getConfig().getTargetCompactionFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(600);
long originCompactionNum = CompactionTaskManager.getInstance().getFinishedTaskNum();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -1154,20 +1156,21 @@ public class IoTDBSizeTieredCompactionIT {
}
} finally {
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(oriTargetFileSize);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(oriTargetFileSize);
}
}
@Test
public void testUnsequenceInnerCompactionContinously() throws SQLException {
- int oriThreadNum = IoTDBDescriptor.getInstance().getConf().getCompactionThreadCount();
- long oriTargetFileSize = IoTDBDescriptor.getInstance().getConf().getTargetCompactionFileSize();
- IoTDBDescriptor.getInstance().getConf().setCompactionThreadCount(2);
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(600);
+ int oriThreadNum = IoTDBDescriptor.getInstance().getConfig().getCompactionThreadCount();
+ long oriTargetFileSize =
+ IoTDBDescriptor.getInstance().getConfig().getTargetCompactionFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setCompactionThreadCount(2);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(600);
long originFinishCount = CompactionTaskManager.getInstance().getFinishedTaskNum();
CompactionPriority compactionPriority =
- IoTDBDescriptor.getInstance().getConf().getCompactionPriority();
- IoTDBDescriptor.getInstance().getConf().setCompactionPriority(CompactionPriority.INNER_CROSS);
+ IoTDBDescriptor.getInstance().getConfig().getCompactionPriority();
+ IoTDBDescriptor.getInstance().getConfig().setCompactionPriority(CompactionPriority.INNER_CROSS);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
for (int i = 1; i <= 3; i++) {
@@ -1223,16 +1226,19 @@ public class IoTDBSizeTieredCompactionIT {
}
}
} finally {
- IoTDBDescriptor.getInstance().getConf().setCompactionThreadCount(oriThreadNum);
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(oriTargetFileSize);
- IoTDBDescriptor.getInstance().getConf().setCompactionPriority(CompactionPriority.INNER_CROSS);
+ IoTDBDescriptor.getInstance().getConfig().setCompactionThreadCount(oriThreadNum);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(oriTargetFileSize);
+ IoTDBDescriptor.getInstance()
+ .getConfig()
+ .setCompactionPriority(CompactionPriority.INNER_CROSS);
}
}
@Test
public void testUnsequenceInnerCompactionConcurrently() throws SQLException {
- long oriTargetFileSize = IoTDBDescriptor.getInstance().getConf().getTargetCompactionFileSize();
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(600);
+ long oriTargetFileSize =
+ IoTDBDescriptor.getInstance().getConfig().getTargetCompactionFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(600);
long originCompactionNum = CompactionTaskManager.getInstance().getFinishedTaskNum();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -1289,15 +1295,16 @@ public class IoTDBSizeTieredCompactionIT {
}
} finally {
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(oriTargetFileSize);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(oriTargetFileSize);
}
}
// Test concurrent compaction in sequence space and unsequence space
@Test
public void testSequenceAndUnsequenceInnerCompactionConcurrently() throws SQLException {
- long oriTargetFileSize = IoTDBDescriptor.getInstance().getConf().getTargetCompactionFileSize();
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(600);
+ long oriTargetFileSize =
+ IoTDBDescriptor.getInstance().getConfig().getTargetCompactionFileSize();
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(600);
long originCompactionNum = CompactionTaskManager.getInstance().getFinishedTaskNum();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -1357,7 +1364,7 @@ public class IoTDBSizeTieredCompactionIT {
}
} finally {
- IoTDBDescriptor.getInstance().getConf().setTargetCompactionFileSize(oriTargetFileSize);
+ IoTDBDescriptor.getInstance().getConfig().setTargetCompactionFileSize(oriTargetFileSize);
}
}
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTimePartitionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTimePartitionIT.java
index 71bd67909a..57a85927ba 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTimePartitionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTimePartitionIT.java
@@ -43,7 +43,7 @@ public class IoTDBTimePartitionIT {
@Before
public void setUp() throws Exception {
- prevPartitionInterval = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
ConfigFactory.getConfig().setPartitionInterval(2592000);
EnvFactory.getEnv().initBeforeTest();
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
index eae907478b..1d909b158b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
@@ -322,7 +322,7 @@ public class IoTDBTtlIT {
@Test
public void testDefaultTTL() throws SQLException {
- CommonDescriptor.getInstance().getConf().setDefaultTtlInMs(10000);
+ CommonDescriptor.getInstance().getConfig().setDefaultTTLInMs(10000);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("CREATE DATABASE root.group1");
@@ -333,7 +333,7 @@ public class IoTDBTtlIT {
result.equals("root.group1,10000\n" + "root.group2,10000\n")
|| result.equals("root.group2,10000\n" + "root.group1,10000\n"));
} finally {
- CommonDescriptor.getInstance().getConf().setDefaultTtlInMs(Long.MAX_VALUE);
+ CommonDescriptor.getInstance().getConfig().setDefaultTTLInMs(Long.MAX_VALUE);
}
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/env/StandaloneEnvConfig.java b/integration/src/test/java/org/apache/iotdb/db/integration/env/StandaloneEnvConfig.java
index 4177190484..90d332da51 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/env/StandaloneEnvConfig.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/env/StandaloneEnvConfig.java
@@ -18,7 +18,6 @@
*/
package org.apache.iotdb.db.integration.env;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.itbase.env.BaseConfig;
import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
@@ -42,12 +41,17 @@ public class StandaloneEnvConfig implements BaseConfig {
}
public BaseConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
- CommonDescriptor.getInstance().getConf().setMemtableSizeThreshold(memtableSizeThreshold);
+ IoTDBDescriptor.getInstance().getConfig().setMemtableSizeThreshold(memtableSizeThreshold);
+ return this;
+ }
+
+ public BaseConfig setDataRegionNum(int dataRegionNum) {
+ IoTDBDescriptor.getInstance().getConfig().setDataRegionNum(dataRegionNum);
return this;
}
public BaseConfig setPartitionInterval(long partitionInterval) {
- IoTDBDescriptor.getInstance().getConf().setDnTimePartitionInterval(partitionInterval);
+ IoTDBDescriptor.getInstance().getConfig().setTimePartitionInterval(partitionInterval);
return this;
}
@@ -57,78 +61,80 @@ public class StandaloneEnvConfig implements BaseConfig {
}
public BaseConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
- CommonDescriptor.getInstance().getConf().setMaxDeduplicatedPathNum(maxQueryDeduplicatedPathNum);
+ IoTDBDescriptor.getInstance()
+ .getConfig()
+ .setMaxQueryDeduplicatedPathNum(maxQueryDeduplicatedPathNum);
return this;
}
public BaseConfig setRpcThriftCompressionEnable(boolean rpcThriftCompressionEnable) {
IoTDBDescriptor.getInstance()
- .getConf()
- .setDnRpcThriftCompressionEnable(rpcThriftCompressionEnable);
+ .getConfig()
+ .setRpcThriftCompressionEnable(rpcThriftCompressionEnable);
return this;
}
public BaseConfig setRpcAdvancedCompressionEnable(boolean rpcAdvancedCompressionEnable) {
IoTDBDescriptor.getInstance()
- .getConf()
- .setDnRpcAdvancedCompressionEnable(rpcAdvancedCompressionEnable);
+ .getConfig()
+ .setRpcAdvancedCompressionEnable(rpcAdvancedCompressionEnable);
return this;
}
public BaseConfig setUdfCollectorMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setUdfCollectorMemoryBudgetInMB(udfCollectorMemoryBudgetInMB);
return this;
}
public BaseConfig setUdfTransformerMemoryBudgetInMB(float udfTransformerMemoryBudgetInMB) {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setUdfTransformerMemoryBudgetInMB(udfTransformerMemoryBudgetInMB);
return this;
}
public BaseConfig setUdfReaderMemoryBudgetInMB(float udfReaderMemoryBudgetInMB) {
- CommonDescriptor.getInstance()
- .getConf()
+ IoTDBDescriptor.getInstance()
+ .getConfig()
.setUdfReaderMemoryBudgetInMB(udfReaderMemoryBudgetInMB);
return this;
}
public BaseConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
return this;
}
public BaseConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
return this;
}
public BaseConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
return this;
}
public BaseConfig setEnableIDTable(boolean isEnableIDTable) {
- IoTDBDescriptor.getInstance().getConf().setEnableIDTable(isEnableIDTable);
+ IoTDBDescriptor.getInstance().getConfig().setEnableIDTable(isEnableIDTable);
return this;
}
public BaseConfig setDeviceIDTransformationMethod(String deviceIDTransformationMethod) {
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setDeviceIDTransformationMethod(deviceIDTransformationMethod);
return this;
}
public BaseConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
- CommonDescriptor.getInstance().getConf().setEnableAutoCreateSchema(enableAutoCreateSchema);
+ IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(enableAutoCreateSchema);
return this;
}
}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
index 853924987a..c60e62d891 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverIT.java
@@ -63,17 +63,18 @@ public class IoTDBSyncReceiverIT {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- enableSeqSpaceCompaction = IoTDBDescriptor.getInstance().getConf().isEnableSeqSpaceCompaction();
+ enableSeqSpaceCompaction =
+ IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
enableUnseqSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableUnseqSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
enableCrossSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableCrossSpaceCompaction();
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableUnseqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableCrossSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableUnseqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
SyncTestUtil.insertData();
EnvironmentUtils.shutdownDaemon();
- File srcDir = new File(IoTDBDescriptor.getInstance().getConf().getDnDataDirs()[0]);
+ File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]);
if (tmpDir.exists()) {
FileUtils.deleteDirectory(tmpDir);
}
@@ -88,12 +89,12 @@ public class IoTDBSyncReceiverIT {
@After
public void tearDown() throws Exception {
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
FileUtils.deleteDirectory(tmpDir);
client.close();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
index 6d33008096..f907a03d89 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncReceiverLoaderIT.java
@@ -51,28 +51,29 @@ public class IoTDBSyncReceiverLoaderIT {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- enableSeqSpaceCompaction = IoTDBDescriptor.getInstance().getConf().isEnableSeqSpaceCompaction();
+ enableSeqSpaceCompaction =
+ IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
enableUnseqSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableUnseqSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
enableCrossSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableCrossSpaceCompaction();
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableUnseqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableCrossSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableUnseqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
SyncTestUtil.insertData();
EnvironmentUtils.shutdownDaemon();
- File srcDir = new File(IoTDBDescriptor.getInstance().getConf().getDnDataDirs()[0]);
+ File srcDir = new File(IoTDBDescriptor.getInstance().getConfig().getDataDirs()[0]);
FileUtils.moveDirectory(srcDir, tmpDir);
}
@After
public void tearDown() throws Exception {
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
FileUtils.deleteDirectory(tmpDir);
EnvironmentUtils.cleanEnv();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
index ba93a2d883..5baf7413fa 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
@@ -72,14 +72,15 @@ public class IoTDBSyncSenderIT {
@Before
public void setUp() throws Exception {
EnvironmentUtils.envSetUp();
- enableSeqSpaceCompaction = IoTDBDescriptor.getInstance().getConf().isEnableSeqSpaceCompaction();
+ enableSeqSpaceCompaction =
+ IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
enableUnseqSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableUnseqSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
enableCrossSpaceCompaction =
- IoTDBDescriptor.getInstance().getConf().isEnableCrossSpaceCompaction();
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableUnseqSpaceCompaction(false);
- IoTDBDescriptor.getInstance().getConf().setEnableCrossSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableUnseqSpaceCompaction(false);
+ IoTDBDescriptor.getInstance().getConfig().setEnableCrossSpaceCompaction(false);
Class.forName(Config.JDBC_DRIVER_NAME);
IoTDBPipeSink pipeSink = new IoTDBPipeSink(pipeSinkName);
@@ -89,12 +90,12 @@ public class IoTDBSyncSenderIT {
@After
public void tearDown() throws Exception {
- IoTDBDescriptor.getInstance().getConf().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
+ IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
IoTDBDescriptor.getInstance()
- .getConf()
+ .getConfig()
.setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
EnvironmentUtils.shutdownDaemon();
EnvironmentUtils.cleanEnv();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDeletionVersionAdaptionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDeletionVersionAdaptionIT.java
index a9d93aa91c..69b027b20c 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDeletionVersionAdaptionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDeletionVersionAdaptionIT.java
@@ -65,7 +65,7 @@ public class IoTDBDeletionVersionAdaptionIT {
@Before
public void setUp() throws Exception {
Locale.setDefault(Locale.ENGLISH);
- prevPartitionInterval = IoTDBDescriptor.getInstance().getConf().getDnTimePartitionInterval();
+ prevPartitionInterval = IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
ConfigFactory.getConfig().setPartitionInterval(1000);
EnvFactory.getEnv().initBeforeTest();
prepareSeries();
diff --git a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedABDeviceIT.java b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedABDeviceIT.java
index d3203f91f1..197b21d647 100644
--- a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedABDeviceIT.java
+++ b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedABDeviceIT.java
@@ -44,7 +44,7 @@ import static org.junit.Assert.fail;
public class IoTDBSessionAlignedABDeviceIT {
private static final String ROOT_SG1_D1 = "root.sg1.d1";
private static final String ROOT_SG1_D2 = "root.sg1.d2";
- private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConf();
+ private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConfig();
private static Session session;
private static int originCompactionThreadNum;
diff --git a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationIT.java b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationIT.java
index ebb09e5c1a..685c844401 100644
--- a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationIT.java
+++ b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationIT.java
@@ -44,7 +44,7 @@ public class IoTDBSessionAlignedAggregationIT {
private static final String ROOT_SG1_D1_VECTOR1 = "root.sg1.d1.vector1";
private static final String ROOT_SG1_D1 = "root.sg1.d1";
- private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConf();
+ private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConfig();
private static Session session;
private static int originCompactionThreadNum;
diff --git a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationWithUnSeqIT.java b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationWithUnSeqIT.java
index d9b58b2746..c1ce505497 100644
--- a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationWithUnSeqIT.java
+++ b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionAlignedAggregationWithUnSeqIT.java
@@ -43,7 +43,7 @@ import static org.junit.Assert.fail;
public class IoTDBSessionAlignedAggregationWithUnSeqIT {
private static final String ROOT_SG1_D1_VECTOR1 = "root.sg1.d1.vector1";
- private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConf();
+ private static final IoTDBConfig CONFIG = IoTDBDescriptor.getInstance().getConfig();
private static Session session;
private static int originCompactionThreadNum;
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 687f69b943..2bfc8386cd 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -25,7 +25,7 @@
cluster_name=defaultCluster
####################
-### Replication Configuration
+### Replication configuration
####################
# ConfigNode consensus protocol type.
@@ -36,7 +36,6 @@ cluster_name=defaultCluster
# Datatype: string
# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
-
# Default number of schema replicas
# Can not be changed after the first start
# Datatype: int
@@ -50,7 +49,6 @@ cluster_name=defaultCluster
# Datatype: string
# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
-
# Default number of data replicas
# Can not be changed after the first start
# Datatype: int
@@ -66,7 +64,7 @@ cluster_name=defaultCluster
# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
####################
-### Load Balancing Configuration
+### Load balancing configuration
####################
# All parameters in Partition configuration is unmodifiable after ConfigNode starts for the first time.
@@ -94,14 +92,6 @@ cluster_name=defaultCluster
# Datatype: Double
# schema_region_per_data_node=1.0
-# The maximum number of DataRegions expected to be managed by each processor
-# when using AUTO data_region_group_extension_policy.
-# Notice: Since each Database requires at least two DataRegionGroups to manage its data,
-# this parameter doesn't limit the number of DataRegions when there are too many Databases.
-# Datatype: Double
-# data_region_per_processor=1.0
-
-
# The policy of extension SchemaRegionGroup for each Database.
# These policies are currently supported:
# 1. CUSTOM(Each Database will allocate schema_region_group_per_database RegionGroups as soon as created)
@@ -126,6 +116,12 @@ cluster_name=defaultCluster
# Datatype: Integer
# data_region_group_per_database=1
+# The maximum number of DataRegions expected to be managed by each processor
+# when using AUTO data_region_group_extension_policy.
+# Notice: Since each Database requires at least two DataRegionGroups to manage its data,
+# this parameter doesn't limit the number of DataRegions when there are too many Databases.
+# Datatype: Double
+# data_region_per_processor=1.0
# The least number of DataRegionGroup for each StorageGroup.
# The ConfigNode-leader will create a DataRegionGroup for each newborn SeriesPartitionSlot
@@ -163,7 +159,7 @@ cluster_name=defaultCluster
# enable_auto_leader_balance_for_iot_consensus=true
####################
-### Cluster Management
+### Cluster management
####################
# Time partition interval in milliseconds, and partitioning data inside each data region, default is equal to one week
@@ -404,11 +400,11 @@ cluster_name=defaultCluster
# The max capacity of a TsBlock
# Datatype: int, Unit: byte
-# max_ts_block_size_in_bytes=131072
+# max_tsblock_size_in_bytes=131072
# The max number of lines in a single TsBlock
# Datatype: int
-# max_ts_block_line_number=1000
+# max_tsblock_line_number=1000
# Time cost(ms) threshold for slow query
# Datatype: long
@@ -450,7 +446,7 @@ cluster_name=defaultCluster
# When the waiting time (in ms) of an inserting exceeds this, throw an exception. 10000 by default.
# If the insertion has been rejected and the read load is low, it can be set larger
# Datatype: int
-# max_waiting_time_when_insert_blocked_in_ms=10000
+# max_waiting_time_when_insert_blocked=10000
# Add a switch to drop ouf-of-order data
# Out-of-order data will impact the aggregation query a lot. Users may not care about discarding some out-of-order data.
@@ -774,7 +770,7 @@ cluster_name=defaultCluster
####################
# Datatype: boolean
-# enable_watermark=false
+# watermark_module_opened=false
# Datatype: String
# watermark_secret_key=IoTDB*2019@Beijing
@@ -800,16 +796,16 @@ cluster_name=defaultCluster
# Datatype: string
# admin_name=root
-# admin password, default is root
-# Datatype: string
-# admin_password=root
-
# encryption provider class
# iotdb_server_encrypt_decrypt_provider=org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt
# encryption provided class parameter
# iotdb_server_encrypt_decrypt_provider_parameter=
+# admin password, default is root
+# Datatype: string
+# admin_password=root
+
# Cache size of user and role
# Datatype: int
# author_cache_size=1000
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java
index f5dcf2bd05..5e682da97f 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java
@@ -93,10 +93,10 @@ public abstract class BasicAuthorizer implements IAuthorizer, IService {
try {
c =
(Class<BasicAuthorizer>)
- Class.forName(CommonDescriptor.getInstance().getConf().getAuthorizerProvider());
+ Class.forName(CommonDescriptor.getInstance().getConfig().getAuthorizerProvider());
logger.info(
"Authorizer provider class: {}",
- CommonDescriptor.getInstance().getConf().getAuthorizerProvider());
+ CommonDescriptor.getInstance().getConfig().getAuthorizerProvider());
instance = c.getDeclaredConstructor().newInstance();
} catch (Exception e) {
// startup failed.
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/LocalFileAuthorizer.java b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/LocalFileAuthorizer.java
index 83a830b93e..cf1d8ec56d 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/LocalFileAuthorizer.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/LocalFileAuthorizer.java
@@ -26,7 +26,7 @@ import org.apache.iotdb.commons.conf.CommonDescriptor;
public class LocalFileAuthorizer extends BasicAuthorizer {
- private static final CommonConfig config = CommonDescriptor.getInstance().getConf();
+ private static final CommonConfig config = CommonDescriptor.getInstance().getConfig();
public LocalFileAuthorizer() throws AuthException {
super(
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/OpenIdAuthorizer.java b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/OpenIdAuthorizer.java
index a418bec69a..b1fd48e9b6 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/OpenIdAuthorizer.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/OpenIdAuthorizer.java
@@ -57,7 +57,7 @@ public class OpenIdAuthorizer extends BasicAuthorizer {
public static final String IOTDB_ADMIN_ROLE_NAME = "iotdb_admin";
public static final String OPENID_USER_PREFIX = "openid-";
- private static final CommonConfig config = CommonDescriptor.getInstance().getConf();
+ private static final CommonConfig config = CommonDescriptor.getInstance().getConfig();
private final RSAPublicKey providerKey;
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java b/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java
index 132e56418b..787eb560b2 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java
@@ -72,7 +72,7 @@ public abstract class BasicUserManager implements IUserManager {
private void initAdmin() throws AuthException {
User admin;
try {
- admin = getUser(CommonDescriptor.getInstance().getConf().getAdminName());
+ admin = getUser(CommonDescriptor.getInstance().getConfig().getAdminName());
} catch (AuthException e) {
logger.warn("Cannot load admin, Creating a new one", e);
admin = null;
@@ -80,9 +80,9 @@ public abstract class BasicUserManager implements IUserManager {
if (admin == null) {
createUser(
- CommonDescriptor.getInstance().getConf().getAdminName(),
- CommonDescriptor.getInstance().getConf().getAdminPassword());
- setUserUseWaterMark(CommonDescriptor.getInstance().getConf().getAdminName(), false);
+ CommonDescriptor.getInstance().getConfig().getAdminName(),
+ CommonDescriptor.getInstance().getConfig().getAdminPassword());
+ setUserUseWaterMark(CommonDescriptor.getInstance().getConfig().getAdminName(), false);
}
logger.info("Admin initialized");
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
index 2c73ea9880..b30620f8be 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
@@ -39,7 +39,7 @@ import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
public class ClientPoolFactory {
- private static final CommonConfig conf = CommonDescriptor.getInstance().getConf();
+ private static final CommonConfig conf = CommonDescriptor.getInstance().getConfig();
private ClientPoolFactory() {}
@@ -54,11 +54,11 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
.build()),
new ClientPoolProperty.Builder<SyncConfigNodeIServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -75,13 +75,13 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
- .setSelectorNumOfAsyncClientManager(conf.getSelectorThreadCountOfClientManager())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+ .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
.build(),
ThreadName.ASYNC_CONFIGNODE_CLIENT_POOL.getName()),
new ClientPoolProperty.Builder<AsyncConfigNodeIServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -98,11 +98,11 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
.build()),
new ClientPoolProperty.Builder<SyncDataNodeInternalServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -119,13 +119,13 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
- .setSelectorNumOfAsyncClientManager(conf.getSelectorThreadCountOfClientManager())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+ .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
.build(),
ThreadName.ASYNC_DATANODE_CLIENT_POOL.getName()),
new ClientPoolProperty.Builder<AsyncDataNodeInternalServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -142,13 +142,13 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
- .setSelectorNumOfAsyncClientManager(conf.getSelectorThreadCountOfClientManager())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+ .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
.build(),
ThreadName.ASYNC_CONFIGNODE_HEARTBEAT_CLIENT_POOL.getName()),
new ClientPoolProperty.Builder<AsyncConfigNodeHeartbeatServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -165,13 +165,13 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
- .setSelectorNumOfAsyncClientManager(conf.getSelectorThreadCountOfClientManager())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+ .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
.build(),
ThreadName.ASYNC_DATANODE_HEARTBEAT_CLIENT_POOL.getName()),
new ClientPoolProperty.Builder<AsyncDataNodeHeartbeatServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -188,11 +188,11 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
.build()),
new ClientPoolProperty.Builder<SyncDataNodeMPPDataExchangeServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
@@ -209,13 +209,13 @@ public class ClientPoolFactory {
manager,
new ThriftClientProperty.Builder()
.setConnectionTimeoutMs(conf.getConnectionTimeoutInMS())
- .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnable())
- .setSelectorNumOfAsyncClientManager(conf.getSelectorThreadCountOfClientManager())
+ .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+ .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
.build(),
ThreadName.ASYNC_DATANODE_MPP_DATA_EXCHANGE_CLIENT_POOL.getName()),
new ClientPoolProperty.Builder<AsyncDataNodeMPPDataExchangeServiceClient>()
- .setCoreClientNumForEachNode(conf.getCoreClientCountForEachNodeInClientManager())
- .setMaxClientNumForEachNode(conf.getMaxClientCountForEachNodeInClientManager())
+ .setCoreClientNumForEachNode(conf.getCoreClientNumForEachNode())
+ .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
.build()
.getConfig());
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 50801663c1..44e3fe410b 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -18,15 +18,9 @@
*/
package org.apache.iotdb.commons.conf;
+import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProperty;
import org.apache.iotdb.commons.cluster.NodeStatus;
-import org.apache.iotdb.commons.consensus.ConsensusProtocolClass;
import org.apache.iotdb.commons.enums.HandleSystemErrorStrategy;
-import org.apache.iotdb.commons.loadbalance.LeaderDistributionPolicy;
-import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
-import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
-import org.apache.iotdb.commons.wal.WALMode;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
import org.apache.iotdb.tsfile.fileSystem.FSType;
import org.slf4j.Logger;
@@ -34,2437 +28,283 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
public class CommonConfig {
- public static final String CONF_FILE_NAME = "iotdb-common.properties";
+ public static final String CONFIG_NAME = "iotdb-common.properties";
private static final Logger logger = LoggerFactory.getLogger(CommonConfig.class);
- /** Cluster Configuration */
- // ClusterId, the default value "defaultCluster" will be changed after join cluster
- private volatile String clusterName = "defaultCluster";
-
- /** Replication configuration */
- // ConfigNodeGroup consensus protocol
- private ConsensusProtocolClass configNodeConsensusProtocolClass =
- ConsensusProtocolClass.RATIS_CONSENSUS;
-
- // Default number of SchemaRegion replicas
- private int schemaReplicationFactor = 1;
- // SchemaRegion consensus protocol
- private ConsensusProtocolClass schemaRegionConsensusProtocolClass =
- ConsensusProtocolClass.RATIS_CONSENSUS;
-
- // Default number of DataRegion replicas
- private int dataReplicationFactor = 1;
- // DataRegion consensus protocol
- private ConsensusProtocolClass dataRegionConsensusProtocolClass =
- ConsensusProtocolClass.IOT_CONSENSUS;
-
- /** Load balancing configuration */
- // Number of SeriesPartitionSlots per StorageGroup
- private int seriesSlotNum = 10000;
- // SeriesPartitionSlot executor class
- private String seriesPartitionExecutorClass =
- "org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor";
-
- // The maximum number of SchemaRegions expected to be managed by each DataNode
- private double schemaRegionPerDataNode = schemaReplicationFactor;
- // The maximum number of DataRegions expected to be managed by each DataNode
- private double dataRegionPerProcessor = 1.0;
-
- // The policy of extension SchemaRegionGroup for each Database
- private RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy =
- RegionGroupExtensionPolicy.AUTO;
- // The number of SchemaRegionGroups for each Database when using CUSTOM extension policy
- private int schemaRegionGroupPerDatabase = 1;
- // The policy of extension DataRegionGroup for each Database
- private RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy =
- RegionGroupExtensionPolicy.AUTO;
- // The number of DataRegionGroups for each Database when using CUSTOM extension policy
- private int dataRegionGroupPerDatabase = 1;
-
- // The least number of SchemaRegionGroup for each Database
- private int leastSchemaRegionGroupNum = 1;
- // The least number of DataRegionGroup for each Database
- private int leastDataRegionGroupNum = 5;
-
- // DataPartition within the same SeriesPartitionSlot will inherit the allocation result of the
- // previous TimePartitionSlot if set true
- private boolean enableDataPartitionInheritPolicy = false;
-
- // The policy of cluster RegionGroups' leader distribution
- private LeaderDistributionPolicy leaderDistributionPolicy =
- LeaderDistributionPolicy.MIN_COST_FLOW;
- // Whether to enable auto leader balance for Ratis consensus protocol
- private boolean enableAutoLeaderBalanceForRatisConsensus = false;
- // Whether to enable auto leader balance for IoTConsensus protocol
- private boolean enableAutoLeaderBalanceForIoTConsensus = true;
-
- /** Cluster management */
- // Time partition interval in milliseconds
- private long timePartitionInterval = 604_800_000L;
- // The heartbeat interval in milliseconds
- private long heartbeatIntervalInMs = 1000;
- // Disk Monitor
- private double diskSpaceWarningThreshold = 0.05;
-
- /** Memory Control Configuration */
- // Is the writing mem control for writing enable
- private boolean enableMemControl = true;
-
- // Memory allocated for the write process
- private long allocateMemoryForStorageEngine = Runtime.getRuntime().maxMemory() * 3 / 10;
- // Memory allocated for the read process
- private long allocateMemoryForRead = Runtime.getRuntime().maxMemory() * 3 / 10;
- // Memory allocated for the MTree
- private long allocateMemoryForSchema = Runtime.getRuntime().maxMemory() / 10;
- // Memory allocated for the consensus layer
- private long allocateMemoryForConsensus = Runtime.getRuntime().maxMemory() / 10;
-
- // Whether the schema memory allocation is default config. Used for cluster mode initialization
- // judgement
- private boolean isDefaultSchemaMemoryConfig = true;
- // Memory allocated for schemaRegion
- private long allocateMemoryForSchemaRegion = allocateMemoryForSchema * 8 / 10;
- // Memory allocated for SchemaCache
- private long allocateMemoryForSchemaCache = allocateMemoryForSchema / 10;
- // Memory allocated for PartitionCache
- private long allocateMemoryForPartitionCache = 0;
- // Memory allocated for LastCache
- private long allocateMemoryForLastCache = allocateMemoryForSchema / 10;
-
- // The proportion of write memory for memtable
- private double writeProportionForMemtable = 0.8;
- // The proportion of write memory for compaction
- private double compactionProportion = 0.2;
- // Memory allocated proportion for time partition info
- private long allocateMemoryForTimePartitionInfo = allocateMemoryForStorageEngine * 50 / 1001;
-
- // The num of memtable in each database
- private int concurrentWritingTimePartition = 1;
- // The default value of primitive array size in array pool
- private int primitiveArraySize = 64;
- private double chunkMetadataSizeProportion = 0.1;
- // Flush proportion for system
- private double flushProportion = 0.4;
- // Ratio of memory allocated for buffered arrays
- private double bufferedArraysMemoryProportion = 0.6;
- // Reject proportion for system
- private double rejectProportion = 0.8;
- // If memory cost of data region increased more than proportion of {@linkplain
- // CommonConfig#getAllocateMemoryForStorageEngine()}*{@linkplain
- // CommonConfig#getWriteProportionForMemtable()}, report to system.
- private double writeMemoryVariationReportProportion = 0.001;
- // When inserting rejected, waiting period to check system again. Unit: millisecond
- private int checkPeriodWhenInsertBlocked = 50;
- // The size of ioTaskQueue
- private int ioTaskQueueSizeForFlushing = 10;
- // If true, we will estimate each query's possible memory footprint before executing it and deny
- // it if its estimated memory exceeds current free memory
- private boolean enableQueryMemoryEstimation = true;
-
- /** Schema Engine Configuration */
- // ThreadPool size for read operation in coordinator
- private int coordinatorReadExecutorSize = 20;
- // ThreadPool size for write operation in coordinator
- private int coordinatorWriteExecutorSize = 50;
-
- // Cache size of partition cache in {@link
- // org.apache.iotdb.db.mpp.plan.analyze.ClusterPartitionFetcher}
- private int partitionCacheSize = 1000;
-
- // Size of log buffer for every MetaData operation. If the size of a MetaData operation plan is
- // larger than this parameter, then the MetaData operation plan will be rejected by SchemaRegion.
- // Unit: byte
- private int mlogBufferSize = 1024 * 1024;
-
- // The cycle when metadata log is periodically forced to be written to disk(in milliseconds) If
- // set this parameter to 0 it means call channel.force(true) after every each operation
- private long syncMlogPeriodInMs = 100;
-
- // Interval num of tag and attribute records when force flushing to disk
- private int tagAttributeFlushInterval = 1000;
- // max size for tag and attribute of one time series
- private int tagAttributeTotalSize = 700;
-
- // Maximum number of measurement in one create timeseries plan node. If the number of measurement
- // in user request exceeds this limit, the request will be split.
- private int maxMeasurementNumOfInternalRequest = 10000;
-
- /** Configurations for creating schema automatically */
- // Switch of creating schema automatically
- private boolean enableAutoCreateSchema = true;
- // Database level when creating schema automatically is enabled
- private int defaultStorageGroupLevel = 1;
-
- // Register time series as which type when receiving boolean string "true" or "false"
- private TSDataType booleanStringInferType = TSDataType.BOOLEAN;
- // register time series as which type when receiving an integer string "67"
- private TSDataType integerStringInferType = TSDataType.FLOAT;
- // register time series as which type when receiving an integer string and using float may lose
- // precision num > 2 ^ 24
- private TSDataType longStringInferType = TSDataType.DOUBLE;
- // register time series as which type when receiving a floating number string "6.7"
- private TSDataType floatingStringInferType = TSDataType.FLOAT;
- // register time series as which type when receiving the Literal NaN. Values can be DOUBLE, FLOAT
- // or TEXT
- private TSDataType nanStringInferType = TSDataType.DOUBLE;
-
- // BOOLEAN encoding when creating schema automatically is enabled
- private TSEncoding defaultBooleanEncoding = TSEncoding.RLE;
- // INT32 encoding when creating schema automatically is enabled
- private TSEncoding defaultInt32Encoding = TSEncoding.RLE;
- // INT64 encoding when creating schema automatically is enabled
- private TSEncoding defaultInt64Encoding = TSEncoding.RLE;
- // FLOAT encoding when creating schema automatically is enabled
- private TSEncoding defaultFloatEncoding = TSEncoding.GORILLA;
- // DOUBLE encoding when creating schema automatically is enabled
- private TSEncoding defaultDoubleEncoding = TSEncoding.GORILLA;
- // TEXT encoding when creating schema automatically is enabled
- private TSEncoding defaultTextEncoding = TSEncoding.PLAIN;
-
- /** Query Configurations */
- // The read consistency level
- private String readConsistencyLevel = "strong";
-
- // Whether to cache metadata(ChunkMetaData and TsFileMetaData) or not
- private boolean metaDataCacheEnable = true;
-
- // Memory allocated for bloomFilter cache in read process
- private long allocateMemoryForBloomFilterCache = allocateMemoryForRead / 1001;
- // Memory allocated for chunk cache in read process
- private long allocateMemoryForChunkCache = allocateMemoryForRead * 100 / 1001;
- // Memory allocated for timeSeriesMetaData cache in read process
- private long allocateMemoryForTimeSeriesMetaDataCache = allocateMemoryForRead * 200 / 1001;
- // Memory allocated for operators
- private long allocateMemoryForCoordinator = allocateMemoryForRead * 50 / 1001;
- // Memory allocated for operators
- private long allocateMemoryForOperators = allocateMemoryForRead * 200 / 1001;
- // Memory allocated for operators
- private long allocateMemoryForDataExchange = allocateMemoryForRead * 200 / 1001;
- // Memory allocated proportion for timeIndex
- private long allocateMemoryForTimeIndex = allocateMemoryForRead * 200 / 1001;
-
- // Whether to enable last cache
- private boolean enableLastCache = true;
-
- private volatile int maxDeduplicatedPathNum = 1000;
-
- // Core pool size of mpp data exchange
- private int mppDataExchangeCorePoolSize = 10;
- // Max pool size of mpp data exchange
- private int mppDataExchangeMaxPoolSize = 10;
- // Thread keep alive time in ms of mpp data exchange
- private int mppDataExchangeKeepAliveTimeInMs = 1000;
- // Maximum execution time of a DriverTask
- private int driverTaskExecutionTimeSliceInMs = 100;
-
- // Maximum capacity of a TsBlock, allow up to two pages
- private int maxTsBlockSizeInBytes = 128 * 1024;
- // Maximum number of lines in a single TsBlock
- private int maxTsBlockLineNumber = 1000;
-
- // Time cost(ms) threshold for slow query. Unit: millisecond
- private long slowQueryThreshold = 5000;
- // The max executing time of query in ms. Unit: millisecond
- private long queryTimeoutThreshold = 60000;
- // How many queries can be concurrently executed. When <= 0, use 1000
- private int maxAllowedConcurrentQueries = 1000;
- // How many threads can concurrently execute query statement. When <= 0, use CPU core number
- private int queryThreadCount = Runtime.getRuntime().availableProcessors();
- // The amount of data iterate each time in server
- private int batchSize = 100000;
-
- /** Storage Engine Configuration */
- // This variable set timestamp precision as millisecond, microsecond or nanosecond
- private String timestampPrecision = "ms";
- // Default TTL for databases that are not set TTL by statements, in ms.
- // <p> Notice: if this property is changed, previous created database which are not set TTL will
- // also be affected. Unit: millisecond
- private long defaultTtlInMs = Long.MAX_VALUE;
-
- // When inserting rejected exceeds this, throw an exception. Unit: millisecond
- private int maxWaitingTimeWhenInsertBlockedInMs = 10000;
-
- private boolean enableDiscardOutOfOrderData = false;
-
- // What will the system do when unrecoverable error occurs
- private HandleSystemErrorStrategy handleSystemErrorStrategy =
- HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
-
- // When a memTable's size (in byte) exceeds this, the memtable is flushed to disk. Unit: byte
- private long memtableSizeThreshold = 1024 * 1024 * 1024L;
-
- // Whether to timed flush sequence tsfiles' memtables
- private boolean enableTimedFlushSeqMemtable = true;
-
- // If a memTable's created time is older than current time minus this, the memtable will be
- // flushed to disk.(only check sequence tsfiles' memtables) Unit: ms
- private long seqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
-
- // The interval to check whether sequence memtables need flushing. Unit: ms
- private long seqMemtableFlushCheckInterval = 10 * 60 * 1000L;
-
- // Whether to timed flush unsequence tsfiles' memtables
- private boolean enableTimedFlushUnseqMemtable = true;
-
- // If a memTable's created time is older than current time minus this, the memtable will be
- // flushed to disk.(only check unsequence tsfiles' memtables) Unit: ms
- private long unseqMemtableFlushInterval = 3 * 60 * 60 * 1000L;
-
- // The interval to check whether unsequence memtables need flushing. Unit: ms
- private long unseqMemtableFlushCheckInterval = 10 * 60 * 1000L;
-
- // The sort algorithm used in TVList
- private TVListSortAlgorithm tvListSortAlgorithm = TVListSortAlgorithm.TIM;
-
- // When average series point number reaches this, flush the memtable to disk
- private int avgSeriesPointNumberThreshold = 100000;
-
- // How many threads can concurrently flush. When <= 0, use CPU core number
- private int flushThreadCount = Runtime.getRuntime().availableProcessors();
-
- // In one insert (one device, one timestamp, multiple measurements),
- // if enable partial insert, one measurement failure will not impact other measurements
- private boolean enablePartialInsert = true;
-
- // The interval to log recover progress of each vsg when starting iotdb
- private long recoveryLogIntervalInMs = 5_000L;
-
- // How many threads will be set up to perform upgrade tasks
- private int upgradeThreadCount = 1;
-
- /** Compaction Configurations */
- // TODO: Move from IoTDBConfig
-
- /** Write Ahead Log Configuration */
- // Write mode of wal
- private volatile WALMode walMode = WALMode.ASYNC;
-
- // Max number of wal nodes, each node corresponds to one wal directory
- private int maxWalNodesNum = 0;
-
- // Duration a wal flush operation will wait before calling fsync. Unit: millisecond
- private volatile long fsyncWalDelayInMs = 3;
-
- // Buffer size of each wal node. Unit: byte
- private int walBufferSizeInByte = 16 * 1024 * 1024;
-
- // Blocking queue capacity of each wal buffer
- private int walBufferQueueCapacity = 50;
-
- // Size threshold of each wal file. Unit: byte
- private volatile long walFileSizeThresholdInByte = 10 * 1024 * 1024L;
-
- // Minimum ratio of effective information in wal files
- private volatile double walMinEffectiveInfoRatio = 0.1;
-
- // MemTable size threshold for triggering MemTable snapshot in wal. When a memTable's size exceeds
- // this, wal can flush this memtable to disk, otherwise wal will snapshot this memtable in wal.
- // Unit: byte
- private volatile long walMemTableSnapshotThreshold = 8 * 1024 * 1024L;
-
- // MemTable's max snapshot number in wal file
- private volatile int maxWalMemTableSnapshotNum = 1;
-
- // The period when outdated wal files are periodically deleted. Unit: millisecond
- private volatile long deleteWalFilesPeriodInMs = 20 * 1000L;
-
- // Maximum size of wal buffer used in IoTConsensus. Unit: byte
- private long iotConsensusThrottleThresholdInByte = 50 * 1024 * 1024 * 1024L;
-
- // Maximum wait time of write cache in IoTConsensus. Unit: ms
- private long iotConsensusCacheWindowTimeInMs = 10 * 1000L;
-
- /** Watermark Configuration */
- // Switch of watermark function
- private boolean enableWatermark = false;
-
- // Secret key for watermark
- private String watermarkSecretKey = "IoTDB*2019@Beijing";
-
- // Bit string of watermark
- private String watermarkBitString = "100101110100";
-
- // Watermark method and parameters
- private String watermarkMethod = "GroupBasedLSBMethod(embed_row_cycle=2,embed_lsb_num=5)";
-
- /** Authorization Configuration */
- // The authorizer provider class which extends BasicAuthorizer
- private String authorizerProvider =
- "org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer";
- // Open ID Secret
- private String openIdProviderUrl = "";
-
- private String adminName = "root";
- private String adminPassword = "root";
-
- // Encryption provider class
- private String iotdbServerEncryptDecryptProvider =
- "org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt";
- // Encryption provided class parameter
- private String iotdbServerEncryptDecryptProviderParameter;
-
- // Cache size of user and role
- private int authorCacheSize = 100;
- // Cache expire time of user and role
- private int authorCacheExpireTime = 30;
-
- /** UDF Configuration */
- // Used to estimate the memory usage of text fields in a UDF query. It is recommended to set this
- // value to be slightly larger than the average length of all text records.
- private int udfInitialByteArrayLengthForMemoryControl = 48;
-
- // How much memory may be used in ONE UDF query (in MB).
- // The upper limit is 20% of allocated memory for read.
- // udfMemoryBudgetInMB = udfReaderMemoryBudgetInMB +
- // udfTransformerMemoryBudgetInMB + udfCollectorMemoryBudgetInMB
- private float udfMemoryBudgetInMB = (float) Math.min(30.0f, 0.2 * allocateMemoryForRead);
-
- private float udfReaderMemoryBudgetInMB = (float) (1.0 / 3 * udfMemoryBudgetInMB);
-
- private float udfTransformerMemoryBudgetInMB = (float) (1.0 / 3 * udfMemoryBudgetInMB);
-
- private float udfCollectorMemoryBudgetInMB = (float) (1.0 / 3 * udfMemoryBudgetInMB);
-
- // External lib directory for UDF, stores user-uploaded JAR files
- private String udfDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.UDF_FOLDER_NAME;
- // External temporary lib directory for storing downloaded udf JAR files
- private String udfTemporaryLibDir = udfDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
-
- /** Trigger Configuration */
- // External lib directory for trigger, stores user-uploaded JAR files
- private String triggerDir =
- IoTDBConstant.EXT_FOLDER_NAME + File.separator + IoTDBConstant.TRIGGER_FOLDER_NAME;
- // External temporary lib directory for storing downloaded trigger JAR files
- private String triggerTemporaryLibDir =
- triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
-
- // How many times will we retry to find an instance of stateful trigger
- private int statefulTriggerRetryNumWhenNotFound = 3;
-
- // The size of log buffer for every trigger management operation plan. If the size of a trigger
- // management operation plan is larger than this parameter, the trigger management operation plan
- // will be rejected by TriggerManager. Unit: byte
- private int tlogBufferSize = 1024 * 1024;
-
- // Number of queues per forwarding trigger
- private int triggerForwardMaxQueueNumber = 8;
- // The length of one of the queues per forwarding trigger
- private int triggerForwardMaxSizePerQueue = 2000;
- // Trigger forwarding data size per batch
- private int triggerForwardBatchSize = 50;
- // Trigger HTTP forward pool size
- private int triggerForwardHTTPPoolSize = 200;
- // Trigger HTTP forward pool max connection for per route
- private int triggerForwardHTTPPOOLMaxPerRoute = 20;
- // Trigger MQTT forward pool size
- private int triggerForwardMQTTPoolSize = 4;
-
- /** Select-Into Configuration */
- // The maximum number of rows can be processed in insert-tablet-plan when executing select-into
- // statements.
- private int selectIntoInsertTabletPlanRowLimit = 10000;
- // The number of threads in the thread pool that execute insert-tablet tasks.
- private int intoOperationExecutionThreadCount = 2;
-
- /** Continuous Query Configuration */
- // How many thread will be set up to perform continuous queries. When <= 0, use max(1, CPU core
- // number / 2).
- private int continuousQueryThreadCount =
- Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
-
- // Minimum every interval to perform continuous query.
- // The every interval of continuous query instances should not be lower than this limit.
- private long continuousQueryMinEveryIntervalInMs = 1000;
-
- /** PIPE Configuration */
- // White list for sync
- private String ipWhiteList = "127.0.0.1/32";
- // The maximum number of retries when the sender fails to synchronize files to the receiver
- private int maxNumberOfSyncFileRetry = 5;
-
- /** RatisConsensus Configuration */
- // RatisConsensus protocol, Max size for a single log append request from leader
- private long configNodeRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
-
- private long schemaRegionRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
- private long dataRegionRatisConsensusLogAppenderBufferSize = 4 * 1024 * 1024L;
-
- // RatisConsensus protocol, trigger a snapshot when ratis_snapshot_trigger_threshold logs are
- // written
- private long configNodeRatisSnapshotTriggerThreshold = 400000L;
- private long schemaRegionRatisSnapshotTriggerThreshold = 400000L;
- private long dataRegionRatisSnapshotTriggerThreshold = 400000L;
-
- // RatisConsensus protocol, allow flushing Raft Log asynchronously
- private boolean configNodeRatisLogUnsafeFlushEnable = false;
- private boolean schemaRegionRatisLogUnsafeFlushEnable = false;
- private boolean dataRegionRatisLogUnsafeFlushEnable = false;
-
- // RatisConsensus protocol, max capacity of a single Raft Log segment
- private long configNodeRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
- private long schemaRegionRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
- private long dataRegionRatisLogSegmentSizeMax = 24 * 1024 * 1024L;
- private long configNodeSimpleConsensusLogSegmentSizeMax = 24 * 1024 * 1024L;
-
- // RatisConsensus protocol, flow control window for ratis grpc log appender
- private long configNodeRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
- private long schemaRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
- private long dataRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
-
- // RatisConsensus protocol, min election timeout for leader election
- private long configNodeRatisRpcLeaderElectionTimeoutMinMs = 2000L;
- private long schemaRegionRatisRpcLeaderElectionTimeoutMinMs = 2000L;
- private long dataRegionRatisRpcLeaderElectionTimeoutMinMs = 2000L;
-
- // RatisConsensus protocol, max election timeout for leader election
- private long configNodeRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
- private long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
- private long dataRegionRatisRpcLeaderElectionTimeoutMaxMs = 4000L;
-
- // RatisConsensus protocol, request timeout for ratis client
- private long configNodeRatisRequestTimeoutMs = 10000L;
- private long schemaRegionRatisRequestTimeoutMs = 10000L;
- private long dataRegionRatisRequestTimeoutMs = 10000L;
-
- // RatisConsensus protocol, exponential back-off retry policy params
- private int configNodeRatisMaxRetryAttempts = 10;
- private long configNodeRatisInitialSleepTimeMs = 100;
- private long configNodeRatisMaxSleepTimeMs = 10000;
-
- private int dataRegionRatisMaxRetryAttempts = 10;
- private long dataRegionRatisInitialSleepTimeMs = 100;
- private long dataRegionRatisMaxSleepTimeMs = 10000;
-
- private int schemaRegionRatisMaxRetryAttempts = 10;
- private long schemaRegionRatisInitialSleepTimeMs = 100;
- private long schemaRegionRatisMaxSleepTimeMs = 10000;
-
- private long configNodeRatisPreserveLogsWhenPurge = 1000;
- private long schemaRegionRatisPreserveLogsWhenPurge = 1000;
- private long dataRegionRatisPreserveLogsWhenPurge = 1000;
-
- // first election timeout shares between 3 regions
- private long ratisFirstElectionTimeoutMinMs = 50;
- private long ratisFirstElectionTimeoutMaxMs = 150;
-
- private long configNodeRatisLogMax = 2L * 1024 * 1024 * 1024; // 2G
- private long schemaRegionRatisLogMax = 2L * 1024 * 1024 * 1024; // 2G
- private long dataRegionRatisLogMax = 20L * 1024 * 1024 * 1024; // 20G
-
- /** Procedure Configuration */
- // Procedure Evict ttl
- private int procedureCompletedEvictTTL = 800;
- // Procedure completed clean interval
- private int procedureCompletedCleanInterval = 30;
- // Procedure core worker threads size
- private int procedureCoreWorkerThreadsCount =
- Math.max(Runtime.getRuntime().availableProcessors() / 4, 16);
-
- /** MQTT Broker Configuration */
- private boolean enableMqttService = false;
-
- // The mqtt service binding host
- private String mqttHost = "127.0.0.1";
- // The mqtt service binding port
- private int mqttPort = 1883;
- // The handler pool size for handing the mqtt messages
- private int mqttHandlerPoolSize = 1;
- // The mqtt message payload formatter
- private String mqttPayloadFormatter = "json";
- // Max mqtt message size. Unit: byte
- private int mqttMaxMessageSize = 1048576;
-
- /** REST Service Configuration */
- // TODO: Move from IoTDBConfig
-
- /** InfluxDB RPC Service Configuration */
- // Whether enable the influxdb rpc service.
- // This parameter has no a corresponding field in the iotdb-common.properties
- private boolean enableInfluxDBRpcService = false;
- // Port which the influxdb protocol server listens to
- private int influxDBRpcPort = 8086;
-
- /** Common Folders */
- private String userFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "users";
-
- private String roleFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "roles";
- private String procedureWalFolder =
- IoTDBConstant.DEFAULT_BASE_DIR
- + File.separator
- + IoTDBConstant.SYSTEM_FOLDER_NAME
- + File.separator
- + "procedure";
-
- // Sync directory, including the log and hardlink tsfiles
- private String syncDir =
- IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
-
- /** Internal Configurations(Unconfigurable in .properties file) */
- // NodeStatus
- private volatile NodeStatus status = NodeStatus.Running;
-
- private volatile String statusReason = null;
-
- // Default system file storage is in local file system (unsupported)
- private FSType systemFileStorageFs = FSType.LOCAL;
-
- private boolean rpcThriftCompressionEnable = false;
- private int connectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
- // ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its
- // clients
- private int selectorThreadCountOfClientManager =
- Runtime.getRuntime().availableProcessors() / 4 > 0
- ? Runtime.getRuntime().availableProcessors() / 4
- : 1;
- private int coreClientCountForEachNodeInClientManager = 200;
- private int maxClientCountForEachNodeInClientManager = 300;
-
- public CommonConfig() {
- // Empty constructor
- }
-
- public void formulateFolders() {
- String homeDir = System.getProperty(IoTDBConstant.IOTDB_HOME, null);
- if (homeDir == null) {
- homeDir = System.getProperty(IoTDBConstant.CONFIGNODE_HOME, null);
- }
-
- udfDir = PropertiesUtils.addHomeDir(homeDir, udfDir);
- udfTemporaryLibDir = PropertiesUtils.addHomeDir(homeDir, udfTemporaryLibDir);
- triggerDir = PropertiesUtils.addHomeDir(homeDir, triggerDir);
- triggerTemporaryLibDir = PropertiesUtils.addHomeDir(homeDir, triggerTemporaryLibDir);
-
- userFolder = PropertiesUtils.addHomeDir(homeDir, userFolder);
- roleFolder = PropertiesUtils.addHomeDir(homeDir, roleFolder);
- procedureWalFolder = PropertiesUtils.addHomeDir(homeDir, procedureWalFolder);
- }
-
- public String getClusterName() {
- return clusterName;
- }
-
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- public ConsensusProtocolClass getConfigNodeConsensusProtocolClass() {
- return configNodeConsensusProtocolClass;
- }
-
- public void setConfigNodeConsensusProtocolClass(
- ConsensusProtocolClass configNodeConsensusProtocolClass) {
- this.configNodeConsensusProtocolClass = configNodeConsensusProtocolClass;
- }
-
- public int getSchemaReplicationFactor() {
- return schemaReplicationFactor;
- }
-
- public void setSchemaReplicationFactor(int schemaReplicationFactor) {
- this.schemaReplicationFactor = schemaReplicationFactor;
- }
-
- public ConsensusProtocolClass getSchemaRegionConsensusProtocolClass() {
- return schemaRegionConsensusProtocolClass;
- }
-
- public void setSchemaRegionConsensusProtocolClass(
- ConsensusProtocolClass schemaRegionConsensusProtocolClass) {
- this.schemaRegionConsensusProtocolClass = schemaRegionConsensusProtocolClass;
- }
-
- public int getDataReplicationFactor() {
- return dataReplicationFactor;
- }
-
- public void setDataReplicationFactor(int dataReplicationFactor) {
- this.dataReplicationFactor = dataReplicationFactor;
- }
-
- public ConsensusProtocolClass getDataRegionConsensusProtocolClass() {
- return dataRegionConsensusProtocolClass;
- }
-
- public void setDataRegionConsensusProtocolClass(
- ConsensusProtocolClass dataRegionConsensusProtocolClass) {
- this.dataRegionConsensusProtocolClass = dataRegionConsensusProtocolClass;
- }
-
- public int getSeriesSlotNum() {
- return seriesSlotNum;
- }
-
- public void setSeriesSlotNum(int seriesSlotNum) {
- this.seriesSlotNum = seriesSlotNum;
- }
-
- public String getSeriesPartitionExecutorClass() {
- return seriesPartitionExecutorClass;
- }
-
- public void setSeriesPartitionExecutorClass(String seriesPartitionExecutorClass) {
- this.seriesPartitionExecutorClass = seriesPartitionExecutorClass;
- }
-
- public double getSchemaRegionPerDataNode() {
- return schemaRegionPerDataNode;
- }
-
- public void setSchemaRegionPerDataNode(double schemaRegionPerDataNode) {
- this.schemaRegionPerDataNode = schemaRegionPerDataNode;
- }
-
- public double getDataRegionPerProcessor() {
- return dataRegionPerProcessor;
- }
-
- public void setDataRegionPerProcessor(double dataRegionPerProcessor) {
- this.dataRegionPerProcessor = dataRegionPerProcessor;
- }
-
- public RegionGroupExtensionPolicy getSchemaRegionGroupExtensionPolicy() {
- return schemaRegionGroupExtensionPolicy;
- }
-
- public void setSchemaRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy schemaRegionGroupExtensionPolicy) {
- this.schemaRegionGroupExtensionPolicy = schemaRegionGroupExtensionPolicy;
- }
-
- public int getSchemaRegionGroupPerDatabase() {
- return schemaRegionGroupPerDatabase;
- }
-
- public void setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
- this.schemaRegionGroupPerDatabase = schemaRegionGroupPerDatabase;
- }
-
- public RegionGroupExtensionPolicy getDataRegionGroupExtensionPolicy() {
- return dataRegionGroupExtensionPolicy;
- }
-
- public void setDataRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy dataRegionGroupExtensionPolicy) {
- this.dataRegionGroupExtensionPolicy = dataRegionGroupExtensionPolicy;
- }
-
- public int getDataRegionGroupPerDatabase() {
- return dataRegionGroupPerDatabase;
- }
-
- public void setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
- this.dataRegionGroupPerDatabase = dataRegionGroupPerDatabase;
- }
-
- public int getLeastSchemaRegionGroupNum() {
- return leastSchemaRegionGroupNum;
- }
-
- public void setLeastSchemaRegionGroupNum(int leastSchemaRegionGroupNum) {
- this.leastSchemaRegionGroupNum = leastSchemaRegionGroupNum;
- }
-
- public int getLeastDataRegionGroupNum() {
- return leastDataRegionGroupNum;
- }
-
- public void setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
- this.leastDataRegionGroupNum = leastDataRegionGroupNum;
- }
-
- public boolean isEnableDataPartitionInheritPolicy() {
- return enableDataPartitionInheritPolicy;
- }
-
- public void setEnableDataPartitionInheritPolicy(boolean enableDataPartitionInheritPolicy) {
- this.enableDataPartitionInheritPolicy = enableDataPartitionInheritPolicy;
- }
-
- public LeaderDistributionPolicy getLeaderDistributionPolicy() {
- return leaderDistributionPolicy;
- }
-
- public void setLeaderDistributionPolicy(LeaderDistributionPolicy leaderDistributionPolicy) {
- this.leaderDistributionPolicy = leaderDistributionPolicy;
- }
-
- public boolean isEnableAutoLeaderBalanceForRatisConsensus() {
- return enableAutoLeaderBalanceForRatisConsensus;
- }
-
- public void setEnableAutoLeaderBalanceForRatisConsensus(
- boolean enableAutoLeaderBalanceForRatisConsensus) {
- this.enableAutoLeaderBalanceForRatisConsensus = enableAutoLeaderBalanceForRatisConsensus;
- }
-
- public boolean isEnableAutoLeaderBalanceForIoTConsensus() {
- return enableAutoLeaderBalanceForIoTConsensus;
- }
-
- public void setEnableAutoLeaderBalanceForIoTConsensus(
- boolean enableAutoLeaderBalanceForIoTConsensus) {
- this.enableAutoLeaderBalanceForIoTConsensus = enableAutoLeaderBalanceForIoTConsensus;
- }
-
- public long getTimePartitionInterval() {
- return timePartitionInterval;
- }
-
- public void setTimePartitionInterval(long timePartitionInterval) {
- this.timePartitionInterval = timePartitionInterval;
- }
-
- public long getHeartbeatIntervalInMs() {
- return heartbeatIntervalInMs;
- }
-
- public void setHeartbeatIntervalInMs(long heartbeatIntervalInMs) {
- this.heartbeatIntervalInMs = heartbeatIntervalInMs;
- }
-
- public double getDiskSpaceWarningThreshold() {
- return diskSpaceWarningThreshold;
- }
-
- public void setDiskSpaceWarningThreshold(double diskSpaceWarningThreshold) {
- this.diskSpaceWarningThreshold = diskSpaceWarningThreshold;
- }
-
- public String getReadConsistencyLevel() {
- return readConsistencyLevel;
- }
-
- public void setReadConsistencyLevel(String readConsistencyLevel) {
- this.readConsistencyLevel = readConsistencyLevel;
- }
-
- public long getDefaultTtlInMs() {
- return defaultTtlInMs;
- }
-
- public void setDefaultTtlInMs(long defaultTtlInMs) {
- this.defaultTtlInMs = defaultTtlInMs;
- }
-
- public String getAuthorizerProvider() {
- return authorizerProvider;
- }
-
- public void setAuthorizerProvider(String authorizerProvider) {
- this.authorizerProvider = authorizerProvider;
- }
-
- public String getOpenIdProviderUrl() {
- return openIdProviderUrl;
- }
-
- public void setOpenIdProviderUrl(String openIdProviderUrl) {
- this.openIdProviderUrl = openIdProviderUrl;
- }
-
- public String getIotdbServerEncryptDecryptProvider() {
- return iotdbServerEncryptDecryptProvider;
- }
-
- public void setIotdbServerEncryptDecryptProvider(String iotdbServerEncryptDecryptProvider) {
- this.iotdbServerEncryptDecryptProvider = iotdbServerEncryptDecryptProvider;
- }
-
- public String getIotdbServerEncryptDecryptProviderParameter() {
- return iotdbServerEncryptDecryptProviderParameter;
- }
-
- public void setIotdbServerEncryptDecryptProviderParameter(
- String iotdbServerEncryptDecryptProviderParameter) {
- this.iotdbServerEncryptDecryptProviderParameter = iotdbServerEncryptDecryptProviderParameter;
- }
-
- public String getAdminName() {
- return adminName;
- }
-
- public void setAdminName(String adminName) {
- this.adminName = adminName;
- }
-
- public String getAdminPassword() {
- return adminPassword;
- }
-
- public void setAdminPassword(String adminPassword) {
- this.adminPassword = adminPassword;
- }
-
- public String getUdfDir() {
- return udfDir;
- }
-
- public void setUdfDir(String udfDir) {
- this.udfDir = udfDir;
- updateUdfTemporaryLibDir();
- }
-
- public void updateUdfTemporaryLibDir() {
- this.udfTemporaryLibDir = udfDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
- }
-
- public String getUdfTemporaryLibDir() {
- return udfTemporaryLibDir;
- }
-
- public String getTriggerDir() {
- return triggerDir;
- }
-
- public void setTriggerDir(String triggerDir) {
- this.triggerDir = triggerDir;
- updateTriggerTemporaryLibDir();
- }
-
- public void updateTriggerTemporaryLibDir() {
- this.triggerTemporaryLibDir = triggerDir + File.separator + IoTDBConstant.TMP_FOLDER_NAME;
- }
-
- public String getTriggerTemporaryLibDir() {
- return triggerTemporaryLibDir;
- }
-
- public int getStatefulTriggerRetryNumWhenNotFound() {
- return statefulTriggerRetryNumWhenNotFound;
- }
-
- public void setStatefulTriggerRetryNumWhenNotFound(int statefulTriggerRetryNumWhenNotFound) {
- this.statefulTriggerRetryNumWhenNotFound = statefulTriggerRetryNumWhenNotFound;
- }
-
- public int getTlogBufferSize() {
- return tlogBufferSize;
- }
-
- public void setTlogBufferSize(int tlogBufferSize) {
- this.tlogBufferSize = tlogBufferSize;
- }
-
- public int getTriggerForwardMaxQueueNumber() {
- return triggerForwardMaxQueueNumber;
- }
-
- public void setTriggerForwardMaxQueueNumber(int triggerForwardMaxQueueNumber) {
- this.triggerForwardMaxQueueNumber = triggerForwardMaxQueueNumber;
- }
-
- public int getTriggerForwardMaxSizePerQueue() {
- return triggerForwardMaxSizePerQueue;
- }
-
- public void setTriggerForwardMaxSizePerQueue(int triggerForwardMaxSizePerQueue) {
- this.triggerForwardMaxSizePerQueue = triggerForwardMaxSizePerQueue;
- }
-
- public int getTriggerForwardBatchSize() {
- return triggerForwardBatchSize;
- }
-
- public void setTriggerForwardBatchSize(int triggerForwardBatchSize) {
- this.triggerForwardBatchSize = triggerForwardBatchSize;
- }
-
- public int getTriggerForwardHTTPPoolSize() {
- return triggerForwardHTTPPoolSize;
- }
-
- public void setTriggerForwardHTTPPoolSize(int triggerForwardHTTPPoolSize) {
- this.triggerForwardHTTPPoolSize = triggerForwardHTTPPoolSize;
- }
-
- public int getTriggerForwardHTTPPOOLMaxPerRoute() {
- return triggerForwardHTTPPOOLMaxPerRoute;
- }
-
- public void setTriggerForwardHTTPPOOLMaxPerRoute(int triggerForwardHTTPPOOLMaxPerRoute) {
- this.triggerForwardHTTPPOOLMaxPerRoute = triggerForwardHTTPPOOLMaxPerRoute;
- }
-
- public int getTriggerForwardMQTTPoolSize() {
- return triggerForwardMQTTPoolSize;
- }
-
- public void setTriggerForwardMQTTPoolSize(int triggerForwardMQTTPoolSize) {
- this.triggerForwardMQTTPoolSize = triggerForwardMQTTPoolSize;
- }
-
- public int getSelectIntoInsertTabletPlanRowLimit() {
- return selectIntoInsertTabletPlanRowLimit;
- }
-
- public void setSelectIntoInsertTabletPlanRowLimit(int selectIntoInsertTabletPlanRowLimit) {
- this.selectIntoInsertTabletPlanRowLimit = selectIntoInsertTabletPlanRowLimit;
- }
-
- public int getIntoOperationExecutionThreadCount() {
- return intoOperationExecutionThreadCount;
- }
-
- public void setIntoOperationExecutionThreadCount(int intoOperationExecutionThreadCount) {
- this.intoOperationExecutionThreadCount = intoOperationExecutionThreadCount;
- }
-
- public int getContinuousQueryThreadCount() {
- return continuousQueryThreadCount;
- }
-
- public void setContinuousQueryThreadCount(int continuousQueryThreadCount) {
- this.continuousQueryThreadCount = continuousQueryThreadCount;
- }
-
- public long getContinuousQueryMinEveryIntervalInMs() {
- return continuousQueryMinEveryIntervalInMs;
- }
-
- public void setContinuousQueryMinEveryIntervalInMs(long continuousQueryMinEveryIntervalInMs) {
- this.continuousQueryMinEveryIntervalInMs = continuousQueryMinEveryIntervalInMs;
- }
-
- public String getIpWhiteList() {
- return ipWhiteList;
- }
-
- public void setIpWhiteList(String ipWhiteList) {
- this.ipWhiteList = ipWhiteList;
- }
-
- public int getMaxNumberOfSyncFileRetry() {
- return maxNumberOfSyncFileRetry;
- }
-
- public void setMaxNumberOfSyncFileRetry(int maxNumberOfSyncFileRetry) {
- this.maxNumberOfSyncFileRetry = maxNumberOfSyncFileRetry;
- }
-
- public long getConfigNodeRatisConsensusLogAppenderBufferSize() {
- return configNodeRatisConsensusLogAppenderBufferSize;
- }
-
- public void setConfigNodeRatisConsensusLogAppenderBufferSize(
- long configNodeRatisConsensusLogAppenderBufferSize) {
- this.configNodeRatisConsensusLogAppenderBufferSize =
- configNodeRatisConsensusLogAppenderBufferSize;
- }
-
- public long getSchemaRegionRatisConsensusLogAppenderBufferSize() {
- return schemaRegionRatisConsensusLogAppenderBufferSize;
- }
-
- public void setSchemaRegionRatisConsensusLogAppenderBufferSize(
- long schemaRegionRatisConsensusLogAppenderBufferSize) {
- this.schemaRegionRatisConsensusLogAppenderBufferSize =
- schemaRegionRatisConsensusLogAppenderBufferSize;
- }
-
- public long getDataRegionRatisConsensusLogAppenderBufferSize() {
- return dataRegionRatisConsensusLogAppenderBufferSize;
- }
-
- public void setDataRegionRatisConsensusLogAppenderBufferSize(
- long dataRegionRatisConsensusLogAppenderBufferSize) {
- this.dataRegionRatisConsensusLogAppenderBufferSize =
- dataRegionRatisConsensusLogAppenderBufferSize;
- }
-
- public long getConfigNodeRatisSnapshotTriggerThreshold() {
- return configNodeRatisSnapshotTriggerThreshold;
- }
-
- public void setConfigNodeRatisSnapshotTriggerThreshold(
- long configNodeRatisSnapshotTriggerThreshold) {
- this.configNodeRatisSnapshotTriggerThreshold = configNodeRatisSnapshotTriggerThreshold;
- }
-
- public long getSchemaRegionRatisSnapshotTriggerThreshold() {
- return schemaRegionRatisSnapshotTriggerThreshold;
- }
-
- public void setSchemaRegionRatisSnapshotTriggerThreshold(
- long schemaRegionRatisSnapshotTriggerThreshold) {
- this.schemaRegionRatisSnapshotTriggerThreshold = schemaRegionRatisSnapshotTriggerThreshold;
- }
-
- public long getDataRegionRatisSnapshotTriggerThreshold() {
- return dataRegionRatisSnapshotTriggerThreshold;
- }
-
- public void setDataRegionRatisSnapshotTriggerThreshold(
- long dataRegionRatisSnapshotTriggerThreshold) {
- this.dataRegionRatisSnapshotTriggerThreshold = dataRegionRatisSnapshotTriggerThreshold;
- }
-
- public boolean isConfigNodeRatisLogUnsafeFlushEnable() {
- return configNodeRatisLogUnsafeFlushEnable;
- }
-
- public void setConfigNodeRatisLogUnsafeFlushEnable(boolean configNodeRatisLogUnsafeFlushEnable) {
- this.configNodeRatisLogUnsafeFlushEnable = configNodeRatisLogUnsafeFlushEnable;
- }
-
- public boolean isSchemaRegionRatisLogUnsafeFlushEnable() {
- return schemaRegionRatisLogUnsafeFlushEnable;
- }
-
- public void setSchemaRegionRatisLogUnsafeFlushEnable(
- boolean schemaRegionRatisLogUnsafeFlushEnable) {
- this.schemaRegionRatisLogUnsafeFlushEnable = schemaRegionRatisLogUnsafeFlushEnable;
- }
-
- public boolean isDataRegionRatisLogUnsafeFlushEnable() {
- return dataRegionRatisLogUnsafeFlushEnable;
- }
-
- public void setDataRegionRatisLogUnsafeFlushEnable(boolean dataRegionRatisLogUnsafeFlushEnable) {
- this.dataRegionRatisLogUnsafeFlushEnable = dataRegionRatisLogUnsafeFlushEnable;
- }
-
- public long getConfigNodeRatisLogSegmentSizeMax() {
- return configNodeRatisLogSegmentSizeMax;
- }
-
- public void setConfigNodeRatisLogSegmentSizeMax(long configNodeRatisLogSegmentSizeMax) {
- this.configNodeRatisLogSegmentSizeMax = configNodeRatisLogSegmentSizeMax;
- }
-
- public long getSchemaRegionRatisLogSegmentSizeMax() {
- return schemaRegionRatisLogSegmentSizeMax;
- }
-
- public void setSchemaRegionRatisLogSegmentSizeMax(long schemaRegionRatisLogSegmentSizeMax) {
- this.schemaRegionRatisLogSegmentSizeMax = schemaRegionRatisLogSegmentSizeMax;
- }
-
- public long getDataRegionRatisLogSegmentSizeMax() {
- return dataRegionRatisLogSegmentSizeMax;
- }
-
- public void setDataRegionRatisLogSegmentSizeMax(long dataRegionRatisLogSegmentSizeMax) {
- this.dataRegionRatisLogSegmentSizeMax = dataRegionRatisLogSegmentSizeMax;
- }
-
- public long getConfigNodeSimpleConsensusLogSegmentSizeMax() {
- return configNodeSimpleConsensusLogSegmentSizeMax;
- }
-
- public void setConfigNodeSimpleConsensusLogSegmentSizeMax(
- long configNodeSimpleConsensusLogSegmentSizeMax) {
- this.configNodeSimpleConsensusLogSegmentSizeMax = configNodeSimpleConsensusLogSegmentSizeMax;
- }
-
- public long getConfigNodeRatisGrpcFlowControlWindow() {
- return configNodeRatisGrpcFlowControlWindow;
- }
-
- public void setConfigNodeRatisGrpcFlowControlWindow(long configNodeRatisGrpcFlowControlWindow) {
- this.configNodeRatisGrpcFlowControlWindow = configNodeRatisGrpcFlowControlWindow;
- }
-
- public long getSchemaRegionRatisGrpcFlowControlWindow() {
- return schemaRegionRatisGrpcFlowControlWindow;
- }
-
- public void setSchemaRegionRatisGrpcFlowControlWindow(
- long schemaRegionRatisGrpcFlowControlWindow) {
- this.schemaRegionRatisGrpcFlowControlWindow = schemaRegionRatisGrpcFlowControlWindow;
- }
-
- public long getDataRegionRatisGrpcFlowControlWindow() {
- return dataRegionRatisGrpcFlowControlWindow;
- }
-
- public void setDataRegionRatisGrpcFlowControlWindow(long dataRegionRatisGrpcFlowControlWindow) {
- this.dataRegionRatisGrpcFlowControlWindow = dataRegionRatisGrpcFlowControlWindow;
- }
-
- public long getConfigNodeRatisRpcLeaderElectionTimeoutMinMs() {
- return configNodeRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public void setConfigNodeRatisRpcLeaderElectionTimeoutMinMs(
- long configNodeRatisRpcLeaderElectionTimeoutMinMs) {
- this.configNodeRatisRpcLeaderElectionTimeoutMinMs =
- configNodeRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public long getSchemaRegionRatisRpcLeaderElectionTimeoutMinMs() {
- return schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public void setSchemaRegionRatisRpcLeaderElectionTimeoutMinMs(
- long schemaRegionRatisRpcLeaderElectionTimeoutMinMs) {
- this.schemaRegionRatisRpcLeaderElectionTimeoutMinMs =
- schemaRegionRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public long getDataRegionRatisRpcLeaderElectionTimeoutMinMs() {
- return dataRegionRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public void setDataRegionRatisRpcLeaderElectionTimeoutMinMs(
- long dataRegionRatisRpcLeaderElectionTimeoutMinMs) {
- this.dataRegionRatisRpcLeaderElectionTimeoutMinMs =
- dataRegionRatisRpcLeaderElectionTimeoutMinMs;
- }
-
- public long getConfigNodeRatisRpcLeaderElectionTimeoutMaxMs() {
- return configNodeRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public void setConfigNodeRatisRpcLeaderElectionTimeoutMaxMs(
- long configNodeRatisRpcLeaderElectionTimeoutMaxMs) {
- this.configNodeRatisRpcLeaderElectionTimeoutMaxMs =
- configNodeRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public long getSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs() {
- return schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public void setSchemaRegionRatisRpcLeaderElectionTimeoutMaxMs(
- long schemaRegionRatisRpcLeaderElectionTimeoutMaxMs) {
- this.schemaRegionRatisRpcLeaderElectionTimeoutMaxMs =
- schemaRegionRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public long getDataRegionRatisRpcLeaderElectionTimeoutMaxMs() {
- return dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public void setDataRegionRatisRpcLeaderElectionTimeoutMaxMs(
- long dataRegionRatisRpcLeaderElectionTimeoutMaxMs) {
- this.dataRegionRatisRpcLeaderElectionTimeoutMaxMs =
- dataRegionRatisRpcLeaderElectionTimeoutMaxMs;
- }
-
- public long getConfigNodeRatisRequestTimeoutMs() {
- return configNodeRatisRequestTimeoutMs;
- }
-
- public void setConfigNodeRatisRequestTimeoutMs(long configNodeRatisRequestTimeoutMs) {
- this.configNodeRatisRequestTimeoutMs = configNodeRatisRequestTimeoutMs;
- }
-
- public long getSchemaRegionRatisRequestTimeoutMs() {
- return schemaRegionRatisRequestTimeoutMs;
- }
-
- public void setSchemaRegionRatisRequestTimeoutMs(long schemaRegionRatisRequestTimeoutMs) {
- this.schemaRegionRatisRequestTimeoutMs = schemaRegionRatisRequestTimeoutMs;
- }
-
- public long getDataRegionRatisRequestTimeoutMs() {
- return dataRegionRatisRequestTimeoutMs;
- }
-
- public void setDataRegionRatisRequestTimeoutMs(long dataRegionRatisRequestTimeoutMs) {
- this.dataRegionRatisRequestTimeoutMs = dataRegionRatisRequestTimeoutMs;
- }
-
- public int getConfigNodeRatisMaxRetryAttempts() {
- return configNodeRatisMaxRetryAttempts;
- }
-
- public void setConfigNodeRatisMaxRetryAttempts(int configNodeRatisMaxRetryAttempts) {
- this.configNodeRatisMaxRetryAttempts = configNodeRatisMaxRetryAttempts;
- }
-
- public long getConfigNodeRatisInitialSleepTimeMs() {
- return configNodeRatisInitialSleepTimeMs;
- }
-
- public void setConfigNodeRatisInitialSleepTimeMs(long configNodeRatisInitialSleepTimeMs) {
- this.configNodeRatisInitialSleepTimeMs = configNodeRatisInitialSleepTimeMs;
- }
-
- public long getConfigNodeRatisMaxSleepTimeMs() {
- return configNodeRatisMaxSleepTimeMs;
- }
-
- public void setConfigNodeRatisMaxSleepTimeMs(long configNodeRatisMaxSleepTimeMs) {
- this.configNodeRatisMaxSleepTimeMs = configNodeRatisMaxSleepTimeMs;
- }
-
- public int getDataRegionRatisMaxRetryAttempts() {
- return dataRegionRatisMaxRetryAttempts;
- }
-
- public void setDataRegionRatisMaxRetryAttempts(int dataRegionRatisMaxRetryAttempts) {
- this.dataRegionRatisMaxRetryAttempts = dataRegionRatisMaxRetryAttempts;
- }
-
- public long getDataRegionRatisInitialSleepTimeMs() {
- return dataRegionRatisInitialSleepTimeMs;
- }
-
- public void setDataRegionRatisInitialSleepTimeMs(long dataRegionRatisInitialSleepTimeMs) {
- this.dataRegionRatisInitialSleepTimeMs = dataRegionRatisInitialSleepTimeMs;
- }
-
- public long getDataRegionRatisMaxSleepTimeMs() {
- return dataRegionRatisMaxSleepTimeMs;
- }
-
- public void setDataRegionRatisMaxSleepTimeMs(long dataRegionRatisMaxSleepTimeMs) {
- this.dataRegionRatisMaxSleepTimeMs = dataRegionRatisMaxSleepTimeMs;
- }
-
- public int getSchemaRegionRatisMaxRetryAttempts() {
- return schemaRegionRatisMaxRetryAttempts;
- }
-
- public void setSchemaRegionRatisMaxRetryAttempts(int schemaRegionRatisMaxRetryAttempts) {
- this.schemaRegionRatisMaxRetryAttempts = schemaRegionRatisMaxRetryAttempts;
- }
-
- public long getSchemaRegionRatisInitialSleepTimeMs() {
- return schemaRegionRatisInitialSleepTimeMs;
- }
-
- public void setSchemaRegionRatisInitialSleepTimeMs(long schemaRegionRatisInitialSleepTimeMs) {
- this.schemaRegionRatisInitialSleepTimeMs = schemaRegionRatisInitialSleepTimeMs;
- }
-
- public long getSchemaRegionRatisMaxSleepTimeMs() {
- return schemaRegionRatisMaxSleepTimeMs;
- }
-
- public void setSchemaRegionRatisMaxSleepTimeMs(long schemaRegionRatisMaxSleepTimeMs) {
- this.schemaRegionRatisMaxSleepTimeMs = schemaRegionRatisMaxSleepTimeMs;
- }
-
- public long getConfigNodeRatisPreserveLogsWhenPurge() {
- return configNodeRatisPreserveLogsWhenPurge;
- }
-
- public void setConfigNodeRatisPreserveLogsWhenPurge(long configNodeRatisPreserveLogsWhenPurge) {
- this.configNodeRatisPreserveLogsWhenPurge = configNodeRatisPreserveLogsWhenPurge;
- }
-
- public long getSchemaRegionRatisPreserveLogsWhenPurge() {
- return schemaRegionRatisPreserveLogsWhenPurge;
- }
-
- public void setSchemaRegionRatisPreserveLogsWhenPurge(
- long schemaRegionRatisPreserveLogsWhenPurge) {
- this.schemaRegionRatisPreserveLogsWhenPurge = schemaRegionRatisPreserveLogsWhenPurge;
- }
-
- public long getDataRegionRatisPreserveLogsWhenPurge() {
- return dataRegionRatisPreserveLogsWhenPurge;
- }
-
- public void setDataRegionRatisPreserveLogsWhenPurge(long dataRegionRatisPreserveLogsWhenPurge) {
- this.dataRegionRatisPreserveLogsWhenPurge = dataRegionRatisPreserveLogsWhenPurge;
- }
-
- public long getRatisFirstElectionTimeoutMinMs() {
- return ratisFirstElectionTimeoutMinMs;
- }
-
- public void setRatisFirstElectionTimeoutMinMs(long ratisFirstElectionTimeoutMinMs) {
- this.ratisFirstElectionTimeoutMinMs = ratisFirstElectionTimeoutMinMs;
- }
-
- public long getRatisFirstElectionTimeoutMaxMs() {
- return ratisFirstElectionTimeoutMaxMs;
- }
-
- public void setRatisFirstElectionTimeoutMaxMs(long ratisFirstElectionTimeoutMaxMs) {
- this.ratisFirstElectionTimeoutMaxMs = ratisFirstElectionTimeoutMaxMs;
- }
-
- public long getConfigNodeRatisLogMax() {
- return configNodeRatisLogMax;
- }
-
- public void setConfigNodeRatisLogMax(long configNodeRatisLogMax) {
- this.configNodeRatisLogMax = configNodeRatisLogMax;
- }
-
- public long getSchemaRegionRatisLogMax() {
- return schemaRegionRatisLogMax;
- }
-
- public void setSchemaRegionRatisLogMax(long schemaRegionRatisLogMax) {
- this.schemaRegionRatisLogMax = schemaRegionRatisLogMax;
- }
-
- public long getDataRegionRatisLogMax() {
- return dataRegionRatisLogMax;
- }
-
- public void setDataRegionRatisLogMax(long dataRegionRatisLogMax) {
- this.dataRegionRatisLogMax = dataRegionRatisLogMax;
- }
-
- public int getProcedureCompletedEvictTTL() {
- return procedureCompletedEvictTTL;
- }
-
- public void setProcedureCompletedEvictTTL(int procedureCompletedEvictTTL) {
- this.procedureCompletedEvictTTL = procedureCompletedEvictTTL;
- }
-
- public int getProcedureCompletedCleanInterval() {
- return procedureCompletedCleanInterval;
- }
-
- public void setProcedureCompletedCleanInterval(int procedureCompletedCleanInterval) {
- this.procedureCompletedCleanInterval = procedureCompletedCleanInterval;
- }
-
- public int getProcedureCoreWorkerThreadsCount() {
- return procedureCoreWorkerThreadsCount;
- }
-
- public void setProcedureCoreWorkerThreadsCount(int procedureCoreWorkerThreadsCount) {
- this.procedureCoreWorkerThreadsCount = procedureCoreWorkerThreadsCount;
- }
-
- public boolean isEnableMqttService() {
- return enableMqttService;
- }
-
- public void setEnableMqttService(boolean enableMqttService) {
- this.enableMqttService = enableMqttService;
- }
-
- public String getMqttHost() {
- return mqttHost;
- }
-
- public void setMqttHost(String mqttHost) {
- this.mqttHost = mqttHost;
- }
-
- public int getMqttPort() {
- return mqttPort;
- }
-
- public void setMqttPort(int mqttPort) {
- this.mqttPort = mqttPort;
- }
-
- public int getMqttHandlerPoolSize() {
- return mqttHandlerPoolSize;
- }
-
- public void setMqttHandlerPoolSize(int mqttHandlerPoolSize) {
- this.mqttHandlerPoolSize = mqttHandlerPoolSize;
- }
-
- public String getMqttPayloadFormatter() {
- return mqttPayloadFormatter;
- }
-
- public void setMqttPayloadFormatter(String mqttPayloadFormatter) {
- this.mqttPayloadFormatter = mqttPayloadFormatter;
- }
-
- public int getMqttMaxMessageSize() {
- return mqttMaxMessageSize;
- }
-
- public void setMqttMaxMessageSize(int mqttMaxMessageSize) {
- this.mqttMaxMessageSize = mqttMaxMessageSize;
- }
-
- public NodeStatus getStatus() {
- return status;
- }
-
- public void setStatus(NodeStatus status) {
- this.status = status;
- }
-
- public String getUserFolder() {
- return userFolder;
- }
-
- public void setUserFolder(String userFolder) {
- this.userFolder = userFolder;
- }
-
- public String getRoleFolder() {
- return roleFolder;
- }
-
- public void setRoleFolder(String roleFolder) {
- this.roleFolder = roleFolder;
- }
-
- public String getProcedureWalFolder() {
- return procedureWalFolder;
- }
-
- public void setProcedureWalFolder(String procedureWalFolder) {
- this.procedureWalFolder = procedureWalFolder;
- }
-
- public String getSyncDir() {
- return syncDir;
- }
-
- public void setSyncDir(String syncDir) {
- this.syncDir = syncDir;
- }
-
- public FSType getSystemFileStorageFs() {
- return systemFileStorageFs;
- }
-
- public void setSystemFileStorageFs(FSType systemFileStorageFs) {
- this.systemFileStorageFs = systemFileStorageFs;
- }
-
- public HandleSystemErrorStrategy getHandleSystemErrorStrategy() {
- return handleSystemErrorStrategy;
- }
-
- public void setHandleSystemErrorStrategy(HandleSystemErrorStrategy handleSystemErrorStrategy) {
- this.handleSystemErrorStrategy = handleSystemErrorStrategy;
- }
-
- public void handleUnrecoverableError() {
- handleSystemErrorStrategy.handle();
- }
-
- public boolean isEnableMemControl() {
- return enableMemControl;
- }
-
- public void setEnableMemControl(boolean enableMemControl) {
- this.enableMemControl = enableMemControl;
- }
-
- public long getAllocateMemoryForStorageEngine() {
- return allocateMemoryForStorageEngine;
- }
-
- public void setAllocateMemoryForStorageEngine(long allocateMemoryForStorageEngine) {
- this.allocateMemoryForStorageEngine = allocateMemoryForStorageEngine;
- this.allocateMemoryForTimePartitionInfo = allocateMemoryForStorageEngine * 50 / 1001;
- }
-
- public long getAllocateMemoryForRead() {
- return allocateMemoryForRead;
- }
-
- public void setAllocateMemoryForRead(long allocateMemoryForRead) {
- this.allocateMemoryForRead = allocateMemoryForRead;
-
- this.allocateMemoryForBloomFilterCache = allocateMemoryForRead / 1001;
- this.allocateMemoryForTimeSeriesMetaDataCache = allocateMemoryForRead * 200 / 1001;
- this.allocateMemoryForChunkCache = allocateMemoryForRead * 100 / 1001;
- this.allocateMemoryForCoordinator = allocateMemoryForRead * 50 / 1001;
- this.allocateMemoryForOperators = allocateMemoryForRead * 200 / 1001;
- this.allocateMemoryForDataExchange = allocateMemoryForRead * 200 / 1001;
- this.allocateMemoryForTimeIndex = allocateMemoryForRead * 200 / 1001;
- }
-
- public long getAllocateMemoryForSchema() {
- return allocateMemoryForSchema;
- }
-
- public void setAllocateMemoryForSchema(long allocateMemoryForSchema) {
- this.allocateMemoryForSchema = allocateMemoryForSchema;
-
- this.allocateMemoryForSchemaRegion = allocateMemoryForSchema * 8 / 10;
- this.allocateMemoryForSchemaCache = allocateMemoryForSchema / 10;
- this.allocateMemoryForLastCache = allocateMemoryForSchema / 10;
- }
-
- public long getAllocateMemoryForConsensus() {
- return allocateMemoryForConsensus;
- }
-
- public void setAllocateMemoryForConsensus(long allocateMemoryForConsensus) {
- this.allocateMemoryForConsensus = allocateMemoryForConsensus;
- }
-
- public boolean isDefaultSchemaMemoryConfig() {
- return isDefaultSchemaMemoryConfig;
- }
-
- public void setDefaultSchemaMemoryConfig(boolean defaultSchemaMemoryConfig) {
- isDefaultSchemaMemoryConfig = defaultSchemaMemoryConfig;
- }
-
- public long getAllocateMemoryForSchemaRegion() {
- return allocateMemoryForSchemaRegion;
- }
-
- public void setAllocateMemoryForSchemaRegion(long allocateMemoryForSchemaRegion) {
- this.allocateMemoryForSchemaRegion = allocateMemoryForSchemaRegion;
- }
-
- public long getAllocateMemoryForSchemaCache() {
- return allocateMemoryForSchemaCache;
- }
-
- public void setAllocateMemoryForSchemaCache(long allocateMemoryForSchemaCache) {
- this.allocateMemoryForSchemaCache = allocateMemoryForSchemaCache;
- }
-
- public long getAllocateMemoryForPartitionCache() {
- return allocateMemoryForPartitionCache;
- }
-
- public void setAllocateMemoryForPartitionCache(long allocateMemoryForPartitionCache) {
- this.allocateMemoryForPartitionCache = allocateMemoryForPartitionCache;
- }
-
- public long getAllocateMemoryForLastCache() {
- return allocateMemoryForLastCache;
- }
-
- public void setAllocateMemoryForLastCache(long allocateMemoryForLastCache) {
- this.allocateMemoryForLastCache = allocateMemoryForLastCache;
- }
-
- public double getWriteProportionForMemtable() {
- return writeProportionForMemtable;
- }
-
- public void setWriteProportionForMemtable(double writeProportionForMemtable) {
- this.writeProportionForMemtable = writeProportionForMemtable;
- }
-
- public double getCompactionProportion() {
- return compactionProportion;
- }
-
- public void setCompactionProportion(double compactionProportion) {
- this.compactionProportion = compactionProportion;
- }
-
- public long getAllocateMemoryForBloomFilterCache() {
- return allocateMemoryForBloomFilterCache;
- }
-
- public void setAllocateMemoryForBloomFilterCache(long allocateMemoryForBloomFilterCache) {
- this.allocateMemoryForBloomFilterCache = allocateMemoryForBloomFilterCache;
- }
-
- public long getAllocateMemoryForTimeSeriesMetaDataCache() {
- return allocateMemoryForTimeSeriesMetaDataCache;
- }
-
- public void setAllocateMemoryForTimeSeriesMetaDataCache(
- long allocateMemoryForTimeSeriesMetaDataCache) {
- this.allocateMemoryForTimeSeriesMetaDataCache = allocateMemoryForTimeSeriesMetaDataCache;
- }
-
- public long getAllocateMemoryForChunkCache() {
- return allocateMemoryForChunkCache;
- }
-
- public void setAllocateMemoryForChunkCache(long allocateMemoryForChunkCache) {
- this.allocateMemoryForChunkCache = allocateMemoryForChunkCache;
- }
-
- public long getAllocateMemoryForCoordinator() {
- return allocateMemoryForCoordinator;
- }
-
- public void setAllocateMemoryForCoordinator(long allocateMemoryForCoordinator) {
- this.allocateMemoryForCoordinator = allocateMemoryForCoordinator;
- }
-
- public long getAllocateMemoryForOperators() {
- return allocateMemoryForOperators;
- }
-
- public void setAllocateMemoryForOperators(long allocateMemoryForOperators) {
- this.allocateMemoryForOperators = allocateMemoryForOperators;
- }
-
- public long getAllocateMemoryForDataExchange() {
- return allocateMemoryForDataExchange;
- }
-
- public void setAllocateMemoryForDataExchange(long allocateMemoryForDataExchange) {
- this.allocateMemoryForDataExchange = allocateMemoryForDataExchange;
- }
-
- /** Get max bytes of each fragmentInstance for DataExchange. */
- public long getMaxBytesPerFragmentInstance() {
- return allocateMemoryForDataExchange / queryThreadCount;
- }
-
- public long getAllocateMemoryForTimeIndex() {
- return allocateMemoryForTimeIndex;
- }
-
- public void setAllocateMemoryForTimeIndex(long allocateMemoryForTimeIndex) {
- this.allocateMemoryForTimeIndex = allocateMemoryForTimeIndex;
- }
-
- public long getAllocateMemoryForTimePartitionInfo() {
- return allocateMemoryForTimePartitionInfo;
- }
-
- public void setAllocateMemoryForTimePartitionInfo(long allocateMemoryForTimePartitionInfo) {
- this.allocateMemoryForTimePartitionInfo = allocateMemoryForTimePartitionInfo;
- }
-
- public int getConcurrentWritingTimePartition() {
- return concurrentWritingTimePartition;
- }
-
- public void setConcurrentWritingTimePartition(int concurrentWritingTimePartition) {
- this.concurrentWritingTimePartition = concurrentWritingTimePartition;
- }
-
- public int getPrimitiveArraySize() {
- return primitiveArraySize;
- }
-
- public void setPrimitiveArraySize(int primitiveArraySize) {
- this.primitiveArraySize = primitiveArraySize;
- }
-
- public double getChunkMetadataSizeProportion() {
- return chunkMetadataSizeProportion;
- }
-
- public void setChunkMetadataSizeProportion(double chunkMetadataSizeProportion) {
- this.chunkMetadataSizeProportion = chunkMetadataSizeProportion;
- }
-
- public double getUsableCompactionMemoryProportion() {
- return 1.0d - chunkMetadataSizeProportion;
- }
-
- public double getFlushProportion() {
- return flushProportion;
- }
-
- public void setFlushProportion(double flushProportion) {
- this.flushProportion = flushProportion;
- }
-
- public double getBufferedArraysMemoryProportion() {
- return bufferedArraysMemoryProportion;
- }
-
- public void setBufferedArraysMemoryProportion(double bufferedArraysMemoryProportion) {
- this.bufferedArraysMemoryProportion = bufferedArraysMemoryProportion;
- }
-
- public double getRejectProportion() {
- return rejectProportion;
- }
-
- public void setRejectProportion(double rejectProportion) {
- this.rejectProportion = rejectProportion;
- }
-
- public double getWriteMemoryVariationReportProportion() {
- return writeMemoryVariationReportProportion;
- }
-
- public void setWriteMemoryVariationReportProportion(double writeMemoryVariationReportProportion) {
- this.writeMemoryVariationReportProportion = writeMemoryVariationReportProportion;
- }
-
- public int getCheckPeriodWhenInsertBlocked() {
- return checkPeriodWhenInsertBlocked;
- }
-
- public void setCheckPeriodWhenInsertBlocked(int checkPeriodWhenInsertBlocked) {
- this.checkPeriodWhenInsertBlocked = checkPeriodWhenInsertBlocked;
- }
-
- public int getIoTaskQueueSizeForFlushing() {
- return ioTaskQueueSizeForFlushing;
- }
-
- public void setIoTaskQueueSizeForFlushing(int ioTaskQueueSizeForFlushing) {
- this.ioTaskQueueSizeForFlushing = ioTaskQueueSizeForFlushing;
- }
-
- public boolean isEnableQueryMemoryEstimation() {
- return enableQueryMemoryEstimation;
- }
-
- public void setEnableQueryMemoryEstimation(boolean enableQueryMemoryEstimation) {
- this.enableQueryMemoryEstimation = enableQueryMemoryEstimation;
- }
-
- public int getAuthorCacheSize() {
- return authorCacheSize;
- }
-
- public void setAuthorCacheSize(int authorCacheSize) {
- this.authorCacheSize = authorCacheSize;
- }
-
- public int getAuthorCacheExpireTime() {
- return authorCacheExpireTime;
- }
-
- public void setAuthorCacheExpireTime(int authorCacheExpireTime) {
- this.authorCacheExpireTime = authorCacheExpireTime;
- }
-
- public int getUdfInitialByteArrayLengthForMemoryControl() {
- return udfInitialByteArrayLengthForMemoryControl;
- }
-
- public void setUdfInitialByteArrayLengthForMemoryControl(
- int udfInitialByteArrayLengthForMemoryControl) {
- this.udfInitialByteArrayLengthForMemoryControl = udfInitialByteArrayLengthForMemoryControl;
- }
-
- public float getUdfMemoryBudgetInMB() {
- return udfMemoryBudgetInMB;
- }
-
- public void setUdfMemoryBudgetInMB(float udfMemoryBudgetInMB) {
- this.udfMemoryBudgetInMB = udfMemoryBudgetInMB;
- }
-
- public float getUdfReaderMemoryBudgetInMB() {
- return udfReaderMemoryBudgetInMB;
- }
-
- public void setUdfReaderMemoryBudgetInMB(float udfReaderMemoryBudgetInMB) {
- this.udfReaderMemoryBudgetInMB = udfReaderMemoryBudgetInMB;
- }
-
- public float getUdfTransformerMemoryBudgetInMB() {
- return udfTransformerMemoryBudgetInMB;
- }
-
- public void setUdfTransformerMemoryBudgetInMB(float udfTransformerMemoryBudgetInMB) {
- this.udfTransformerMemoryBudgetInMB = udfTransformerMemoryBudgetInMB;
- }
-
- public float getUdfCollectorMemoryBudgetInMB() {
- return udfCollectorMemoryBudgetInMB;
- }
-
- public void setUdfCollectorMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
- this.udfCollectorMemoryBudgetInMB = udfCollectorMemoryBudgetInMB;
- }
-
- public int getCoordinatorReadExecutorSize() {
- return coordinatorReadExecutorSize;
- }
-
- public void setCoordinatorReadExecutorSize(int coordinatorReadExecutorSize) {
- this.coordinatorReadExecutorSize = coordinatorReadExecutorSize;
- }
-
- public int getCoordinatorWriteExecutorSize() {
- return coordinatorWriteExecutorSize;
- }
-
- public void setCoordinatorWriteExecutorSize(int coordinatorWriteExecutorSize) {
- this.coordinatorWriteExecutorSize = coordinatorWriteExecutorSize;
- }
-
- public int getPartitionCacheSize() {
- return partitionCacheSize;
- }
-
- public void setPartitionCacheSize(int partitionCacheSize) {
- this.partitionCacheSize = partitionCacheSize;
- }
-
- public int getMlogBufferSize() {
- return mlogBufferSize;
- }
-
- public void setMlogBufferSize(int mlogBufferSize) {
- this.mlogBufferSize = mlogBufferSize;
- }
+ // Open ID Secret
+ private String openIdProviderUrl = "";
- public long getSyncMlogPeriodInMs() {
- return syncMlogPeriodInMs;
- }
+ // the authorizer provider class which extends BasicAuthorizer
+ private String authorizerProvider =
+ "org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer";
- public void setSyncMlogPeriodInMs(long syncMlogPeriodInMs) {
- this.syncMlogPeriodInMs = syncMlogPeriodInMs;
- }
+ /** Encryption provider class */
+ private String encryptDecryptProvider =
+ "org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt";
- public int getTagAttributeFlushInterval() {
- return tagAttributeFlushInterval;
- }
+ /** Encryption provided class parameter */
+ private String encryptDecryptProviderParameter;
- public void setTagAttributeFlushInterval(int tagAttributeFlushInterval) {
- this.tagAttributeFlushInterval = tagAttributeFlushInterval;
- }
+ private String adminName = "root";
- public int getTagAttributeTotalSize() {
- return tagAttributeTotalSize;
- }
+ private String adminPassword = "root";
- public void setTagAttributeTotalSize(int tagAttributeTotalSize) {
- this.tagAttributeTotalSize = tagAttributeTotalSize;
- }
+ private String userFolder =
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "users";
- public int getMaxMeasurementNumOfInternalRequest() {
- return maxMeasurementNumOfInternalRequest;
- }
+ private String roleFolder =
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "roles";
- public void setMaxMeasurementNumOfInternalRequest(int maxMeasurementNumOfInternalRequest) {
- this.maxMeasurementNumOfInternalRequest = maxMeasurementNumOfInternalRequest;
- }
+ private String procedureWalFolder =
+ IoTDBConstant.DEFAULT_BASE_DIR
+ + File.separator
+ + IoTDBConstant.SYSTEM_FOLDER_NAME
+ + File.separator
+ + "procedure";
- public boolean isEnableAutoCreateSchema() {
- return enableAutoCreateSchema;
- }
+ /** Sync directory, including the log and hardlink tsfiles */
+ private String syncDir =
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.SYNC_FOLDER_NAME;
- public void setEnableAutoCreateSchema(boolean enableAutoCreateSchema) {
- this.enableAutoCreateSchema = enableAutoCreateSchema;
- }
+ /** WAL directories */
+ private String[] walDirs = {
+ IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.WAL_FOLDER_NAME
+ };
- public int getDefaultStorageGroupLevel() {
- return defaultStorageGroupLevel;
- }
+ /** Default system file storage is in local file system (unsupported) */
+ private FSType systemFileStorageFs = FSType.LOCAL;
- public void setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
- this.defaultStorageGroupLevel = defaultStorageGroupLevel;
- }
+ /**
+ * default TTL for databases that are not set TTL by statements, in ms.
+ *
+ * <p>Notice: if this property is changed, previous created database which are not set TTL will
+ * also be affected. Unit: millisecond
+ */
+ private long defaultTTLInMs = Long.MAX_VALUE;
- public TSDataType getBooleanStringInferType() {
- return booleanStringInferType;
- }
+ /** Thrift socket and connection timeout between data node and config node. */
+ private int connectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
- public void setBooleanStringInferType(TSDataType booleanStringInferType) {
- this.booleanStringInferType = booleanStringInferType;
- }
+ /**
+ * ClientManager will have so many selector threads (TAsyncClientManager) to distribute to its
+ * clients.
+ */
+ private int selectorNumOfClientManager = 1;
- public TSDataType getIntegerStringInferType() {
- return integerStringInferType;
- }
+ /** whether to use thrift compression. */
+ private boolean isRpcThriftCompressionEnabled = false;
- public void setIntegerStringInferType(TSDataType integerStringInferType) {
- this.integerStringInferType = integerStringInferType;
- }
+ private int coreClientNumForEachNode = DefaultProperty.CORE_CLIENT_NUM_FOR_EACH_NODE;
+ private int maxClientNumForEachNode = DefaultProperty.MAX_CLIENT_NUM_FOR_EACH_NODE;
- public TSDataType getLongStringInferType() {
- return longStringInferType;
- }
+ /** What will the system do when unrecoverable error occurs. */
+ private HandleSystemErrorStrategy handleSystemErrorStrategy =
+ HandleSystemErrorStrategy.CHANGE_TO_READ_ONLY;
- public void setLongStringInferType(TSDataType longStringInferType) {
- this.longStringInferType = longStringInferType;
- }
+ /** Status of current system. */
+ private volatile NodeStatus status = NodeStatus.Running;
- public TSDataType getFloatingStringInferType() {
- return floatingStringInferType;
- }
+ private volatile String statusReason = null;
- public void setFloatingStringInferType(TSDataType floatingStringInferType) {
- this.floatingStringInferType = floatingStringInferType;
- }
+ /** Disk Monitor */
+ private double diskSpaceWarningThreshold = 0.05;
- public TSDataType getNanStringInferType() {
- return nanStringInferType;
- }
+ CommonConfig() {}
- public void setNanStringInferType(TSDataType nanStringInferType) {
- if (nanStringInferType != TSDataType.DOUBLE
- && nanStringInferType != TSDataType.FLOAT
- && nanStringInferType != TSDataType.TEXT) {
- throw new IllegalArgumentException(
- "Config Property nan_string_infer_type can only be FLOAT, DOUBLE or TEXT but is "
- + nanStringInferType);
+ public void updatePath(String homeDir) {
+ userFolder = addHomeDir(userFolder, homeDir);
+ roleFolder = addHomeDir(roleFolder, homeDir);
+ procedureWalFolder = addHomeDir(procedureWalFolder, homeDir);
+ syncDir = addHomeDir(syncDir, homeDir);
+ for (int i = 0; i < walDirs.length; i++) {
+ walDirs[i] = addHomeDir(walDirs[i], homeDir);
}
- this.nanStringInferType = nanStringInferType;
- }
-
- public TSEncoding getDefaultBooleanEncoding() {
- return defaultBooleanEncoding;
- }
-
- public void setDefaultBooleanEncoding(TSEncoding defaultBooleanEncoding) {
- this.defaultBooleanEncoding = defaultBooleanEncoding;
- }
-
- public TSEncoding getDefaultInt32Encoding() {
- return defaultInt32Encoding;
- }
-
- public void setDefaultInt32Encoding(TSEncoding defaultInt32Encoding) {
- this.defaultInt32Encoding = defaultInt32Encoding;
- }
-
- public TSEncoding getDefaultInt64Encoding() {
- return defaultInt64Encoding;
- }
-
- public void setDefaultInt64Encoding(TSEncoding defaultInt64Encoding) {
- this.defaultInt64Encoding = defaultInt64Encoding;
- }
-
- public TSEncoding getDefaultFloatEncoding() {
- return defaultFloatEncoding;
- }
-
- public void setDefaultFloatEncoding(TSEncoding defaultFloatEncoding) {
- this.defaultFloatEncoding = defaultFloatEncoding;
- }
-
- public TSEncoding getDefaultDoubleEncoding() {
- return defaultDoubleEncoding;
- }
-
- public void setDefaultDoubleEncoding(TSEncoding defaultDoubleEncoding) {
- this.defaultDoubleEncoding = defaultDoubleEncoding;
- }
-
- public TSEncoding getDefaultTextEncoding() {
- return defaultTextEncoding;
- }
-
- public void setDefaultTextEncoding(TSEncoding defaultTextEncoding) {
- this.defaultTextEncoding = defaultTextEncoding;
}
- public boolean isMetaDataCacheEnable() {
- return metaDataCacheEnable;
- }
-
- public void setMetaDataCacheEnable(boolean metaDataCacheEnable) {
- this.metaDataCacheEnable = metaDataCacheEnable;
- }
-
- public boolean isEnableLastCache() {
- return enableLastCache;
- }
-
- public void setEnableLastCache(boolean enableLastCache) {
- this.enableLastCache = enableLastCache;
- }
-
- public int getMaxDeduplicatedPathNum() {
- return maxDeduplicatedPathNum;
- }
-
- public void setMaxDeduplicatedPathNum(int maxDeduplicatedPathNum) {
- this.maxDeduplicatedPathNum = maxDeduplicatedPathNum;
- }
-
- public int getMppDataExchangeCorePoolSize() {
- return mppDataExchangeCorePoolSize;
- }
-
- public void setMppDataExchangeCorePoolSize(int mppDataExchangeCorePoolSize) {
- this.mppDataExchangeCorePoolSize = mppDataExchangeCorePoolSize;
- }
-
- public int getMppDataExchangeMaxPoolSize() {
- return mppDataExchangeMaxPoolSize;
- }
-
- public void setMppDataExchangeMaxPoolSize(int mppDataExchangeMaxPoolSize) {
- this.mppDataExchangeMaxPoolSize = mppDataExchangeMaxPoolSize;
- }
-
- public int getMppDataExchangeKeepAliveTimeInMs() {
- return mppDataExchangeKeepAliveTimeInMs;
- }
-
- public void setMppDataExchangeKeepAliveTimeInMs(int mppDataExchangeKeepAliveTimeInMs) {
- this.mppDataExchangeKeepAliveTimeInMs = mppDataExchangeKeepAliveTimeInMs;
- }
-
- public int getDriverTaskExecutionTimeSliceInMs() {
- return driverTaskExecutionTimeSliceInMs;
- }
-
- public void setDriverTaskExecutionTimeSliceInMs(int driverTaskExecutionTimeSliceInMs) {
- this.driverTaskExecutionTimeSliceInMs = driverTaskExecutionTimeSliceInMs;
- }
-
- public int getMaxTsBlockSizeInBytes() {
- return maxTsBlockSizeInBytes;
- }
-
- public void setMaxTsBlockSizeInBytes(int maxTsBlockSizeInBytes) {
- this.maxTsBlockSizeInBytes = maxTsBlockSizeInBytes;
- }
-
- public int getMaxTsBlockLineNumber() {
- return maxTsBlockLineNumber;
- }
-
- public void setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
- this.maxTsBlockLineNumber = maxTsBlockLineNumber;
- }
-
- public long getSlowQueryThreshold() {
- return slowQueryThreshold;
- }
-
- public void setSlowQueryThreshold(long slowQueryThreshold) {
- this.slowQueryThreshold = slowQueryThreshold;
- }
-
- public long getQueryTimeoutThreshold() {
- return queryTimeoutThreshold;
- }
-
- public void setQueryTimeoutThreshold(long queryTimeoutThreshold) {
- this.queryTimeoutThreshold = queryTimeoutThreshold;
- }
-
- public int getMaxAllowedConcurrentQueries() {
- return maxAllowedConcurrentQueries;
- }
-
- public void setMaxAllowedConcurrentQueries(int maxAllowedConcurrentQueries) {
- this.maxAllowedConcurrentQueries = maxAllowedConcurrentQueries;
- }
-
- public int getQueryThreadCount() {
- return queryThreadCount;
- }
-
- public void setQueryThreadCount(int queryThreadCount) {
- this.queryThreadCount = queryThreadCount;
- }
-
- public int getBatchSize() {
- return batchSize;
- }
-
- public void setBatchSize(int batchSize) {
- this.batchSize = batchSize;
- }
-
- public String getTimestampPrecision() {
- return timestampPrecision;
- }
-
- public void setTimestampPrecision(String timestampPrecision) {
- if (!("ms".equals(timestampPrecision)
- || "us".equals(timestampPrecision)
- || "ns".equals(timestampPrecision))) {
- logger.error(
- "Wrong timestamp precision, please set as: ms, us or ns ! Current is: {}",
- timestampPrecision);
- System.exit(-1);
+ private String addHomeDir(String dir, String homeDir) {
+ if (!new File(dir).isAbsolute() && homeDir != null && homeDir.length() > 0) {
+ if (!homeDir.endsWith(File.separator)) {
+ dir = homeDir + File.separatorChar + dir;
+ } else {
+ dir = homeDir + dir;
+ }
}
- this.timestampPrecision = timestampPrecision;
- }
-
- public int getMaxWaitingTimeWhenInsertBlockedInMs() {
- return maxWaitingTimeWhenInsertBlockedInMs;
- }
-
- public void setMaxWaitingTimeWhenInsertBlockedInMs(int maxWaitingTimeWhenInsertBlockedInMs) {
- this.maxWaitingTimeWhenInsertBlockedInMs = maxWaitingTimeWhenInsertBlockedInMs;
- }
-
- public boolean isEnableDiscardOutOfOrderData() {
- return enableDiscardOutOfOrderData;
+ return dir;
}
- public void setEnableDiscardOutOfOrderData(boolean enableDiscardOutOfOrderData) {
- this.enableDiscardOutOfOrderData = enableDiscardOutOfOrderData;
+ public String getEncryptDecryptProvider() {
+ return encryptDecryptProvider;
}
- public long getMemtableSizeThreshold() {
- return memtableSizeThreshold;
+ public void setEncryptDecryptProvider(String encryptDecryptProvider) {
+ this.encryptDecryptProvider = encryptDecryptProvider;
}
- public void setMemtableSizeThreshold(long memtableSizeThreshold) {
- this.memtableSizeThreshold = memtableSizeThreshold;
+ public String getEncryptDecryptProviderParameter() {
+ return encryptDecryptProviderParameter;
}
- public boolean isEnableTimedFlushSeqMemtable() {
- return enableTimedFlushSeqMemtable;
+ public void setEncryptDecryptProviderParameter(String encryptDecryptProviderParameter) {
+ this.encryptDecryptProviderParameter = encryptDecryptProviderParameter;
}
- public void setEnableTimedFlushSeqMemtable(boolean enableTimedFlushSeqMemtable) {
- this.enableTimedFlushSeqMemtable = enableTimedFlushSeqMemtable;
- }
-
- public long getSeqMemtableFlushInterval() {
- return seqMemtableFlushInterval;
- }
-
- public void setSeqMemtableFlushInterval(long seqMemtableFlushInterval) {
- this.seqMemtableFlushInterval = seqMemtableFlushInterval;
- }
-
- public long getSeqMemtableFlushCheckInterval() {
- return seqMemtableFlushCheckInterval;
- }
-
- public void setSeqMemtableFlushCheckInterval(long seqMemtableFlushCheckInterval) {
- this.seqMemtableFlushCheckInterval = seqMemtableFlushCheckInterval;
- }
-
- public boolean isEnableTimedFlushUnseqMemtable() {
- return enableTimedFlushUnseqMemtable;
- }
-
- public void setEnableTimedFlushUnseqMemtable(boolean enableTimedFlushUnseqMemtable) {
- this.enableTimedFlushUnseqMemtable = enableTimedFlushUnseqMemtable;
- }
-
- public long getUnseqMemtableFlushInterval() {
- return unseqMemtableFlushInterval;
- }
-
- public void setUnseqMemtableFlushInterval(long unseqMemtableFlushInterval) {
- this.unseqMemtableFlushInterval = unseqMemtableFlushInterval;
- }
-
- public long getUnseqMemtableFlushCheckInterval() {
- return unseqMemtableFlushCheckInterval;
- }
-
- public void setUnseqMemtableFlushCheckInterval(long unseqMemtableFlushCheckInterval) {
- this.unseqMemtableFlushCheckInterval = unseqMemtableFlushCheckInterval;
- }
-
- public TVListSortAlgorithm getTvListSortAlgorithm() {
- return tvListSortAlgorithm;
- }
-
- public void setTvListSortAlgorithm(TVListSortAlgorithm tvListSortAlgorithm) {
- this.tvListSortAlgorithm = tvListSortAlgorithm;
- }
-
- public int getAvgSeriesPointNumberThreshold() {
- return avgSeriesPointNumberThreshold;
- }
-
- public void setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
- this.avgSeriesPointNumberThreshold = avgSeriesPointNumberThreshold;
- }
-
- public int getFlushThreadCount() {
- return flushThreadCount;
- }
-
- public void setFlushThreadCount(int flushThreadCount) {
- this.flushThreadCount = flushThreadCount;
- }
-
- public boolean isEnablePartialInsert() {
- return enablePartialInsert;
- }
-
- public void setEnablePartialInsert(boolean enablePartialInsert) {
- this.enablePartialInsert = enablePartialInsert;
- }
-
- public long getRecoveryLogIntervalInMs() {
- return recoveryLogIntervalInMs;
- }
-
- public void setRecoveryLogIntervalInMs(long recoveryLogIntervalInMs) {
- this.recoveryLogIntervalInMs = recoveryLogIntervalInMs;
- }
-
- public int getUpgradeThreadCount() {
- return upgradeThreadCount;
- }
-
- public void setUpgradeThreadCount(int upgradeThreadCount) {
- this.upgradeThreadCount = upgradeThreadCount;
- }
-
- public WALMode getWalMode() {
- return walMode;
- }
-
- public void setWalMode(WALMode walMode) {
- this.walMode = walMode;
- }
-
- public int getMaxWalNodesNum() {
- return maxWalNodesNum;
- }
-
- public void setMaxWalNodesNum(int maxWalNodesNum) {
- this.maxWalNodesNum = maxWalNodesNum;
- }
-
- public long getFsyncWalDelayInMs() {
- return fsyncWalDelayInMs;
+ public String getOpenIdProviderUrl() {
+ return openIdProviderUrl;
}
- public void setFsyncWalDelayInMs(long fsyncWalDelayInMs) {
- this.fsyncWalDelayInMs = fsyncWalDelayInMs;
+ public void setOpenIdProviderUrl(String openIdProviderUrl) {
+ this.openIdProviderUrl = openIdProviderUrl;
}
- public int getWalBufferSizeInByte() {
- return walBufferSizeInByte;
+ public String getAuthorizerProvider() {
+ return authorizerProvider;
}
- public void setWalBufferSizeInByte(int walBufferSizeInByte) {
- this.walBufferSizeInByte = walBufferSizeInByte;
+ public void setAuthorizerProvider(String authorizerProvider) {
+ this.authorizerProvider = authorizerProvider;
}
- public int getWalBufferQueueCapacity() {
- return walBufferQueueCapacity;
+ public String getAdminName() {
+ return adminName;
}
- public void setWalBufferQueueCapacity(int walBufferQueueCapacity) {
- this.walBufferQueueCapacity = walBufferQueueCapacity;
+ public void setAdminName(String adminName) {
+ this.adminName = adminName;
}
- public long getWalFileSizeThresholdInByte() {
- return walFileSizeThresholdInByte;
+ public String getAdminPassword() {
+ return adminPassword;
}
- public void setWalFileSizeThresholdInByte(long walFileSizeThresholdInByte) {
- this.walFileSizeThresholdInByte = walFileSizeThresholdInByte;
+ public void setAdminPassword(String adminPassword) {
+ this.adminPassword = adminPassword;
}
- public double getWalMinEffectiveInfoRatio() {
- return walMinEffectiveInfoRatio;
+ public String getUserFolder() {
+ return userFolder;
}
- public void setWalMinEffectiveInfoRatio(double walMinEffectiveInfoRatio) {
- this.walMinEffectiveInfoRatio = walMinEffectiveInfoRatio;
+ public void setUserFolder(String userFolder) {
+ this.userFolder = userFolder;
}
- public long getWalMemTableSnapshotThreshold() {
- return walMemTableSnapshotThreshold;
+ public String getRoleFolder() {
+ return roleFolder;
}
- public void setWalMemTableSnapshotThreshold(long walMemTableSnapshotThreshold) {
- this.walMemTableSnapshotThreshold = walMemTableSnapshotThreshold;
+ public void setRoleFolder(String roleFolder) {
+ this.roleFolder = roleFolder;
}
- public int getMaxWalMemTableSnapshotNum() {
- return maxWalMemTableSnapshotNum;
+ public String getProcedureWalFolder() {
+ return procedureWalFolder;
}
- public void setMaxWalMemTableSnapshotNum(int maxWalMemTableSnapshotNum) {
- this.maxWalMemTableSnapshotNum = maxWalMemTableSnapshotNum;
+ public void setProcedureWalFolder(String procedureWalFolder) {
+ this.procedureWalFolder = procedureWalFolder;
}
- public long getDeleteWalFilesPeriodInMs() {
- return deleteWalFilesPeriodInMs;
+ public String getSyncDir() {
+ return syncDir;
}
- public void setDeleteWalFilesPeriodInMs(long deleteWalFilesPeriodInMs) {
- this.deleteWalFilesPeriodInMs = deleteWalFilesPeriodInMs;
+ public void setSyncDir(String syncDir) {
+ this.syncDir = syncDir;
}
- public long getIotConsensusThrottleThresholdInByte() {
- return iotConsensusThrottleThresholdInByte;
+ public String[] getWalDirs() {
+ return walDirs;
}
- public void setIotConsensusThrottleThresholdInByte(long iotConsensusThrottleThresholdInByte) {
- this.iotConsensusThrottleThresholdInByte = iotConsensusThrottleThresholdInByte;
+ public void setWalDirs(String[] walDirs) {
+ this.walDirs = walDirs;
}
- public long getIotConsensusCacheWindowTimeInMs() {
- return iotConsensusCacheWindowTimeInMs;
+ public FSType getSystemFileStorageFs() {
+ return systemFileStorageFs;
}
- public void setIotConsensusCacheWindowTimeInMs(long iotConsensusCacheWindowTimeInMs) {
- this.iotConsensusCacheWindowTimeInMs = iotConsensusCacheWindowTimeInMs;
+ public void setSystemFileStorageFs(FSType systemFileStorageFs) {
+ this.systemFileStorageFs = systemFileStorageFs;
}
- public boolean isEnableWatermark() {
- return enableWatermark;
+ public long getDefaultTTLInMs() {
+ return defaultTTLInMs;
}
- public void setEnableWatermark(boolean enableWatermark) {
- this.enableWatermark = enableWatermark;
+ public void setDefaultTTLInMs(long defaultTTLInMs) {
+ this.defaultTTLInMs = defaultTTLInMs;
}
- public String getWatermarkSecretKey() {
- return watermarkSecretKey;
+ public int getConnectionTimeoutInMS() {
+ return connectionTimeoutInMS;
}
- public void setWatermarkSecretKey(String watermarkSecretKey) {
- this.watermarkSecretKey = watermarkSecretKey;
+ public void setConnectionTimeoutInMS(int connectionTimeoutInMS) {
+ this.connectionTimeoutInMS = connectionTimeoutInMS;
}
- public String getWatermarkBitString() {
- return watermarkBitString;
+ public int getSelectorNumOfClientManager() {
+ return selectorNumOfClientManager;
}
- public void setWatermarkBitString(String watermarkBitString) {
- this.watermarkBitString = watermarkBitString;
+ public void setSelectorNumOfClientManager(int selectorNumOfClientManager) {
+ this.selectorNumOfClientManager = selectorNumOfClientManager;
}
- public String getWatermarkMethod() {
- return watermarkMethod;
+ public boolean isRpcThriftCompressionEnabled() {
+ return isRpcThriftCompressionEnabled;
}
- public void setWatermarkMethod(String watermarkMethod) {
- this.watermarkMethod = watermarkMethod;
+ public void setRpcThriftCompressionEnabled(boolean rpcThriftCompressionEnabled) {
+ isRpcThriftCompressionEnabled = rpcThriftCompressionEnabled;
}
- public String getWatermarkMethodName() {
- return watermarkMethod.split("\\(")[0];
+ public int getMaxClientNumForEachNode() {
+ return maxClientNumForEachNode;
}
- public int getWatermarkParamMarkRate() {
- return Integer.parseInt(getWatermarkParamValue("embed_row_cycle", "5"));
+ public void setMaxClientNumForEachNode(int maxClientNumForEachNode) {
+ this.maxClientNumForEachNode = maxClientNumForEachNode;
}
- public int getWatermarkParamMaxRightBit() {
- return Integer.parseInt(getWatermarkParamValue("embed_lsb_num", "5"));
+ public int getCoreClientNumForEachNode() {
+ return coreClientNumForEachNode;
}
- private String getWatermarkParamValue(String key, String defaultValue) {
- String res = getWatermarkParamValue(key);
- if (res != null) {
- return res;
- }
- return defaultValue;
+ public void setCoreClientNumForEachNode(int coreClientNumForEachNode) {
+ this.coreClientNumForEachNode = coreClientNumForEachNode;
}
- private String getWatermarkParamValue(String key) {
- String pattern = key + "=(\\w*)";
- Pattern r = Pattern.compile(pattern);
- Matcher m = r.matcher(watermarkMethod);
- if (m.find() && m.groupCount() > 0) {
- return m.group(1);
- }
- return null;
+ HandleSystemErrorStrategy getHandleSystemErrorStrategy() {
+ return handleSystemErrorStrategy;
}
- public boolean isEnableInfluxDBRpcService() {
- return enableInfluxDBRpcService;
+ void setHandleSystemErrorStrategy(HandleSystemErrorStrategy handleSystemErrorStrategy) {
+ this.handleSystemErrorStrategy = handleSystemErrorStrategy;
}
- public void setEnableInfluxDBRpcService(boolean enableInfluxDBRpcService) {
- this.enableInfluxDBRpcService = enableInfluxDBRpcService;
+ public void handleUnrecoverableError() {
+ handleSystemErrorStrategy.handle();
}
- public int getInfluxDBRpcPort() {
- return influxDBRpcPort;
+ public double getDiskSpaceWarningThreshold() {
+ return diskSpaceWarningThreshold;
}
- public void setInfluxDBRpcPort(int influxDBRpcPort) {
- this.influxDBRpcPort = influxDBRpcPort;
+ public void setDiskSpaceWarningThreshold(double diskSpaceWarningThreshold) {
+ this.diskSpaceWarningThreshold = diskSpaceWarningThreshold;
}
public boolean isReadOnly() {
@@ -2488,12 +328,12 @@ public class CommonConfig {
switch (newStatus) {
case ReadOnly:
logger.error(
- "Change system status to ReadOnly! Only query statements are permitted!",
- new RuntimeException("System mode is set to READ_ONLY"));
+ "Change system status to ReadOnly! Only query statements are permitted!",
+ new RuntimeException("System mode is set to READ_ONLY"));
break;
case Removing:
logger.info(
- "Change system status to Removing! The current Node is being removed from cluster!");
+ "Change system status to Removing! The current Node is being removed from cluster!");
break;
default:
break;
@@ -2507,46 +347,4 @@ public class CommonConfig {
public void setStatusReason(String statusReason) {
this.statusReason = statusReason;
}
-
- public boolean isRpcThriftCompressionEnable() {
- return rpcThriftCompressionEnable;
- }
-
- public void setRpcThriftCompressionEnable(boolean rpcThriftCompressionEnable) {
- this.rpcThriftCompressionEnable = rpcThriftCompressionEnable;
- }
-
- public int getConnectionTimeoutInMS() {
- return connectionTimeoutInMS;
- }
-
- public void setConnectionTimeoutInMS(int connectionTimeoutInMS) {
- this.connectionTimeoutInMS = connectionTimeoutInMS;
- }
-
- public int getSelectorThreadCountOfClientManager() {
- return selectorThreadCountOfClientManager;
- }
-
- public void setSelectorThreadCountOfClientManager(int selectorThreadCountOfClientManager) {
- this.selectorThreadCountOfClientManager = selectorThreadCountOfClientManager;
- }
-
- public int getCoreClientCountForEachNodeInClientManager() {
- return coreClientCountForEachNodeInClientManager;
- }
-
- public void setCoreClientCountForEachNodeInClientManager(
- int coreClientCountForEachNodeInClientManager) {
- this.coreClientCountForEachNodeInClientManager = coreClientCountForEachNodeInClientManager;
- }
-
- public int getMaxClientCountForEachNodeInClientManager() {
- return maxClientCountForEachNodeInClientManager;
- }
-
- public void setMaxClientCountForEachNodeInClientManager(
- int maxClientCountForEachNodeInClientManager) {
- this.maxClientCountForEachNodeInClientManager = maxClientCountForEachNodeInClientManager;
- }
}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
index cdf4adb0bf..d0b932b53e 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonDescriptor.java
@@ -19,37 +19,22 @@
package org.apache.iotdb.commons.conf;
-import org.apache.iotdb.commons.consensus.ConsensusProtocolClass;
import org.apache.iotdb.commons.enums.HandleSystemErrorStrategy;
-import org.apache.iotdb.commons.loadbalance.LeaderDistributionPolicy;
-import org.apache.iotdb.commons.loadbalance.RegionGroupExtensionPolicy;
-import org.apache.iotdb.commons.utils.datastructure.TVListSortAlgorithm;
-import org.apache.iotdb.commons.wal.WALMode;
import org.apache.iotdb.confignode.rpc.thrift.TGlobalConfig;
-import org.apache.iotdb.confignode.rpc.thrift.TRatisConfig;
-import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
-import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
import java.util.Properties;
public class CommonDescriptor {
private static final Logger LOGGER = LoggerFactory.getLogger(CommonDescriptor.class);
- private final CommonConfig CONF = new CommonConfig();
+ private final CommonConfig config = new CommonConfig();
- private CommonDescriptor() {
- loadProps();
- }
+ private CommonDescriptor() {}
public static CommonDescriptor getInstance() {
return CommonDescriptorHolder.INSTANCE;
@@ -60,1887 +45,149 @@ public class CommonDescriptor {
private static final CommonDescriptor INSTANCE = new CommonDescriptor();
private CommonDescriptorHolder() {
- // Empty constructor
+ // empty constructor
}
}
- public CommonConfig getConf() {
- return CONF;
+ public CommonConfig getConfig() {
+ return config;
}
public void initCommonConfigDir(String systemDir) {
- CONF.setUserFolder(systemDir + File.separator + "users");
- CONF.setRoleFolder(systemDir + File.separator + "roles");
- CONF.setProcedureWalFolder(systemDir + File.separator + "procedure");
- }
-
- /**
- * get props url location
- *
- * @return url object if location exit, otherwise null.
- */
- public URL getPropsUrl() {
- URL url = PropertiesUtils.getPropsUrlFromIOTDB(CommonConfig.CONF_FILE_NAME);
- if (url != null) {
- return url;
- }
-
- url = PropertiesUtils.getPropsUrlFromConfigNode(CommonConfig.CONF_FILE_NAME);
- if (url != null) {
- return url;
- }
-
- // Try to find a default config in the root of the classpath.
- URL uri = CommonConfig.class.getResource("/" + CommonConfig.CONF_FILE_NAME);
- if (uri != null) {
- return uri;
- }
- LOGGER.warn(
- "Cannot find IOTDB_HOME, IOTDB_CONF, CONFIGNODE_HOME and CONFIGNODE_CONF environment variable when loading "
- + "config file {}, use default configuration",
- CommonConfig.CONF_FILE_NAME);
- return null;
+ config.setUserFolder(systemDir + File.separator + "users");
+ config.setRoleFolder(systemDir + File.separator + "roles");
+ config.setProcedureWalFolder(systemDir + File.separator + "procedure");
}
- private void loadProps() {
- Properties properties = new Properties();
- URL url = getPropsUrl();
- if (url != null) {
- try (InputStream inputStream = url.openStream()) {
- LOGGER.info("Start reading common config file: {}", url);
- properties.load(inputStream);
- loadCommonProps(properties);
- } catch (IOException e) {
- LOGGER.warn("Couldn't load ConfigNode conf file, use default config", e);
- } finally {
- CONF.formulateFolders();
- }
- } else {
- LOGGER.warn(
- "Couldn't load the configuration {} from any of the known sources.",
- CommonConfig.CONF_FILE_NAME);
- }
- }
-
- private void loadCommonProps(Properties properties) throws IOException {
-
- /* Cluster Configuration */
- CONF.setClusterName(
- properties.getProperty(IoTDBConstant.CLUSTER_NAME, CONF.getClusterName()).trim());
-
- /* Replication Configuration */
- loadReplicationConfiguration(properties);
-
- /* Load Balancing Configuration */
- loadLoadBalancingConfiguration(properties);
-
- /* Cluster Management */
- loadClusterManagement(properties);
-
- /* Memory Control Configuration */
- loadMemoryControlConfiguration(properties);
-
- /* Schema Engine Configuration */
- loadSchemaEngineConfiguration(properties);
-
- /* Configurations for creating schema automatically */
- loadAutoCreateSchemaProps(properties);
-
- /* Query Configurations */
- loadQueryConfigurations(properties);
-
- /* Storage Engine Configuration */
- loadStorageEngineConfiguration(properties);
-
- /* Compaction Configurations */
- // TODO: Move from IoTDBConfig
-
- /* Write Ahead Log Configuration */
- loadWALConfiguration(properties);
-
- /* TsFile Configurations */
- loadTsFileConfiguration(properties);
-
- /* Watermark Configuration */
- loadWatermarkConfiguration(properties);
-
- /* Authorization Configuration */
- loadAuthorizationConfiguration(properties);
-
- /* UDF Configuration */
- loadUDFConfiguration(properties);
-
- /* Trigger Configuration */
- loadTriggerConfiguration(properties);
-
- /* Select-Into Configuration */
- loadSelectIntoConfiguration(properties);
-
- /* Continuous Query Configuration */
- loadCQConfig(properties);
-
- /* PIPE Configuration */
- loadPipeConfiguration(properties);
-
- /* RatisConsensus Configuration */
- loadRatisConsensusConfig(properties);
-
- /* Procedure Configuration */
- loadProcedureConfiguration(properties);
-
- /* MQTT Broker Configuration */
- loadMqttConfiguration(properties);
+ public void loadCommonProps(Properties properties) {
+ config.setAuthorizerProvider(
+ properties.getProperty("authorizer_provider_class", config.getAuthorizerProvider()).trim());
+ // if using org.apache.iotdb.db.auth.authorizer.OpenIdAuthorizer, openID_url is needed.
+ config.setOpenIdProviderUrl(
+ properties.getProperty("openID_url", config.getOpenIdProviderUrl()).trim());
+ config.setAdminName(properties.getProperty("admin_name", config.getAdminName()).trim());
- /* REST Service Configuration */
- // TODO: Rest service
+ config.setAdminPassword(
+ properties.getProperty("admin_password", config.getAdminPassword()).trim());
+ config.setEncryptDecryptProvider(
+ properties
+ .getProperty(
+ "iotdb_server_encrypt_decrypt_provider", config.getEncryptDecryptProvider())
+ .trim());
- /* InfluxDB RPC Service Configuration */
- loadInfluxDBRPCServiceConfiguration(properties);
- }
+ config.setEncryptDecryptProviderParameter(
+ properties.getProperty(
+ "iotdb_server_encrypt_decrypt_provider_parameter",
+ config.getEncryptDecryptProviderParameter()));
- private void loadReplicationConfiguration(Properties properties) throws IOException {
- CONF.setConfigNodeConsensusProtocolClass(
- ConsensusProtocolClass.parse(
+ config.setDefaultTTLInMs(
+ Long.parseLong(
properties
- .getProperty(
- "config_node_consensus_protocol_class",
- CONF.getConfigNodeConsensusProtocolClass().getProtocol())
+ .getProperty("default_ttl_in_ms", String.valueOf(config.getDefaultTTLInMs()))
.trim()));
+ config.setSyncDir(properties.getProperty("dn_sync_dir", config.getSyncDir()).trim());
- CONF.setSchemaReplicationFactor(
- Integer.parseInt(
- properties
- .getProperty(
- "schema_replication_factor", String.valueOf(CONF.getSchemaReplicationFactor()))
- .trim()));
+ config.setWalDirs(
+ properties
+ .getProperty("dn_wal_dirs", String.join(",", config.getWalDirs()))
+ .trim()
+ .split(","));
- CONF.setSchemaRegionConsensusProtocolClass(
- ConsensusProtocolClass.parse(
+ config.setRpcThriftCompressionEnabled(
+ Boolean.parseBoolean(
properties
.getProperty(
- "schema_region_consensus_protocol_class",
- CONF.getSchemaRegionConsensusProtocolClass().getProtocol())
+ "cn_rpc_thrift_compression_enable",
+ String.valueOf(config.isRpcThriftCompressionEnabled()))
.trim()));
- CONF.setDataReplicationFactor(
+ config.setConnectionTimeoutInMS(
Integer.parseInt(
properties
.getProperty(
- "data_replication_factor", String.valueOf(CONF.getDataReplicationFactor()))
+ "cn_connection_timeout_ms", String.valueOf(config.getConnectionTimeoutInMS()))
.trim()));
- CONF.setDataRegionConsensusProtocolClass(
- ConsensusProtocolClass.parse(
+ config.setSelectorNumOfClientManager(
+ Integer.parseInt(
properties
.getProperty(
- "data_region_consensus_protocol_class",
- CONF.getDataRegionConsensusProtocolClass().getProtocol())
+ "cn_selector_thread_nums_of_client_manager",
+ String.valueOf(config.getSelectorNumOfClientManager()))
.trim()));
- }
- private void loadLoadBalancingConfiguration(Properties properties) {
- CONF.setSeriesSlotNum(
+ config.setCoreClientNumForEachNode(
Integer.parseInt(
- properties
- .getProperty("series_slot_num", String.valueOf(CONF.getSeriesSlotNum()))
- .trim()));
-
- CONF.setSeriesPartitionExecutorClass(
- properties
- .getProperty("series_partition_executor_class", CONF.getSeriesPartitionExecutorClass())
- .trim());
-
- CONF.setSchemaRegionPerDataNode(
- Double.parseDouble(
properties
.getProperty(
- "schema_region_per_data_node",
- String.valueOf(CONF.getSchemaReplicationFactor()))
+ "cn_core_client_count_for_each_node_in_client_manager",
+ String.valueOf(config.getCoreClientNumForEachNode()))
.trim()));
- CONF.setDataRegionPerProcessor(
- Double.parseDouble(
+ config.setMaxClientNumForEachNode(
+ Integer.parseInt(
properties
.getProperty(
- "data_region_per_processor", String.valueOf(CONF.getDataRegionPerProcessor()))
+ "cn_max_client_count_for_each_node_in_client_manager",
+ String.valueOf(config.getMaxClientNumForEachNode()))
.trim()));
- try {
- CONF.setSchemaRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy.parse(
- properties.getProperty(
- "schema_region_group_extension_policy",
- CONF.getSchemaRegionGroupExtensionPolicy().getPolicy().trim())));
- } catch (IOException e) {
- LOGGER.warn(
- "Unknown schema_region_group_extension_policy in iotdb-common.properties file, use default config",
- e);
- }
-
- CONF.setSchemaRegionGroupPerDatabase(
- Integer.parseInt(
- properties.getProperty(
- "schema_region_group_per_database",
- String.valueOf(CONF.getSchemaRegionGroupPerDatabase()).trim())));
-
- try {
- CONF.setDataRegionGroupExtensionPolicy(
- RegionGroupExtensionPolicy.parse(
- properties.getProperty(
- "data_region_group_extension_policy",
- CONF.getDataRegionGroupExtensionPolicy().getPolicy().trim())));
- } catch (IOException e) {
- LOGGER.warn(
- "Unknown data_region_group_extension_policy in iotdb-common.properties file, use default config",
- e);
- }
-
- CONF.setDataRegionGroupPerDatabase(
- Integer.parseInt(
- properties.getProperty(
- "data_region_group_per_database",
- String.valueOf(CONF.getDataRegionGroupPerDatabase()).trim())));
-
- CONF.setLeastDataRegionGroupNum(
+ config.setConnectionTimeoutInMS(
Integer.parseInt(
- properties.getProperty(
- "least_data_region_group_num", String.valueOf(CONF.getLeastDataRegionGroupNum()))));
-
- CONF.setEnableDataPartitionInheritPolicy(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_data_partition_inherit_policy",
- String.valueOf(CONF.isEnableDataPartitionInheritPolicy()))));
-
- try {
- CONF.setLeaderDistributionPolicy(
- LeaderDistributionPolicy.parse(
- properties.getProperty(
- "leader_distribution_policy",
- CONF.getLeaderDistributionPolicy().getPolicy().trim())));
- } catch (IOException e) {
- LOGGER.warn(
- "Unknown leader_distribution_policy in iotdb-common.properties file, use default config",
- e);
- }
-
- CONF.setEnableAutoLeaderBalanceForRatisConsensus(
- Boolean.parseBoolean(
properties
.getProperty(
- "enable_auto_leader_balance_for_ratis_consensus",
- String.valueOf(CONF.isEnableAutoLeaderBalanceForRatisConsensus()))
+ "dn_connection_timeout_ms", String.valueOf(config.getConnectionTimeoutInMS()))
.trim()));
- CONF.setEnableAutoLeaderBalanceForIoTConsensus(
+ config.setRpcThriftCompressionEnabled(
Boolean.parseBoolean(
properties
.getProperty(
- "enable_auto_leader_balance_for_iot_consensus",
- String.valueOf(CONF.isEnableAutoLeaderBalanceForIoTConsensus()))
- .trim()));
- }
-
- private void loadClusterManagement(Properties properties) {
- CONF.setTimePartitionInterval(
- Long.parseLong(
- properties
- .getProperty(
- "time_partition_interval", String.valueOf(CONF.getTimePartitionInterval()))
- .trim()));
-
- CONF.setHeartbeatIntervalInMs(
- Long.parseLong(
- properties
- .getProperty(
- "heartbeat_interval_in_ms", String.valueOf(CONF.getHeartbeatIntervalInMs()))
- .trim()));
-
- CONF.setDiskSpaceWarningThreshold(
- Double.parseDouble(
- properties
- .getProperty(
- "disk_space_warning_threshold",
- String.valueOf(CONF.getDiskSpaceWarningThreshold()))
+ "dn_rpc_thrift_compression_enable",
+ String.valueOf(config.isRpcThriftCompressionEnabled()))
.trim()));
- }
-
- private void loadMemoryControlConfiguration(Properties properties) {
- CONF.setEnableMemControl(
- (Boolean.parseBoolean(
- properties.getProperty(
- "enable_mem_control", Boolean.toString(CONF.isEnableMemControl())))));
- LOGGER.info("IoTDB enable memory control: {}", CONF.isEnableMemControl());
-
- String memoryAllocateProportion =
- properties.getProperty("storage_query_schema_consensus_free_memory_proportion");
- if (memoryAllocateProportion != null) {
- String[] proportions = memoryAllocateProportion.split(":");
- int proportionSum = 0;
- for (String proportion : proportions) {
- proportionSum += Integer.parseInt(proportion.trim());
- }
- long maxMemoryAvailable = Runtime.getRuntime().maxMemory();
- if (proportionSum != 0) {
- CONF.setAllocateMemoryForStorageEngine(
- maxMemoryAvailable * Integer.parseInt(proportions[0].trim()) / proportionSum);
- CONF.setAllocateMemoryForRead(
- maxMemoryAvailable * Integer.parseInt(proportions[1].trim()) / proportionSum);
- CONF.setAllocateMemoryForSchema(
- maxMemoryAvailable * Integer.parseInt(proportions[2].trim()) / proportionSum);
- CONF.setAllocateMemoryForConsensus(
- maxMemoryAvailable * Integer.parseInt(proportions[3].trim()) / proportionSum);
- }
- }
-
- LOGGER.info("initial allocateMemoryForRead = {}", CONF.getAllocateMemoryForRead());
- LOGGER.info("initial allocateMemoryForWrite = {}", CONF.getAllocateMemoryForStorageEngine());
- LOGGER.info("initial allocateMemoryForSchema = {}", CONF.getAllocateMemoryForSchema());
- LOGGER.info("initial allocateMemoryForConsensus = {}", CONF.getAllocateMemoryForConsensus());
-
- initSchemaMemoryAllocate(properties);
- initStorageEngineAllocate(properties);
- CONF.setConcurrentWritingTimePartition(
+ config.setSelectorNumOfClientManager(
Integer.parseInt(
- properties.getProperty(
- "concurrent_writing_time_partition",
- String.valueOf(CONF.getConcurrentWritingTimePartition()))));
-
- CONF.setPrimitiveArraySize(
- (Integer.parseInt(
- properties.getProperty(
- "primitive_array_size", String.valueOf(CONF.getPrimitiveArraySize())))));
-
- CONF.setChunkMetadataSizeProportion(
- Double.parseDouble(
- properties.getProperty(
- "chunk_metadata_size_proportion",
- Double.toString(CONF.getChunkMetadataSizeProportion()))));
-
- CONF.setFlushProportion(
- Double.parseDouble(
- properties
- .getProperty("flush_proportion", Double.toString(CONF.getFlushProportion()))
- .trim()));
-
- CONF.setBufferedArraysMemoryProportion(
- Double.parseDouble(
- properties
- .getProperty(
- "buffered_arrays_memory_proportion",
- Double.toString(CONF.getBufferedArraysMemoryProportion()))
- .trim()));
-
- CONF.setRejectProportion(
- Double.parseDouble(
- properties
- .getProperty("reject_proportion", Double.toString(CONF.getRejectProportion()))
- .trim()));
-
- CONF.setWriteMemoryVariationReportProportion(
- Double.parseDouble(
properties
.getProperty(
- "write_memory_variation_report_proportion",
- Double.toString(CONF.getWriteMemoryVariationReportProportion()))
+ "dn_selector_thread_nums_of_client_manager",
+ String.valueOf(config.getSelectorNumOfClientManager()))
.trim()));
- CONF.setCheckPeriodWhenInsertBlocked(
- Integer.parseInt(
- properties.getProperty(
- "check_period_when_insert_blocked",
- Integer.toString(CONF.getCheckPeriodWhenInsertBlocked()))));
-
- CONF.setIoTaskQueueSizeForFlushing(
- Integer.parseInt(
- properties.getProperty(
- "io_task_queue_size_for_flushing",
- Integer.toString(CONF.getIoTaskQueueSizeForFlushing()))));
-
- CONF.setEnableQueryMemoryEstimation(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_query_memory_estimation",
- Boolean.toString(CONF.isEnableQueryMemoryEstimation()))));
- }
-
- private void initSchemaMemoryAllocate(Properties properties) {
- long schemaMemoryTotal = CONF.getAllocateMemoryForSchema();
-
- int proportionSum = 10;
- int schemaRegionProportion = 8;
- int schemaCacheProportion = 1;
- int partitionCacheProportion = 0;
- int lastCacheProportion = 1;
-
- String schemaMemoryAllocatePortion =
- properties.getProperty("schema_memory_allocate_proportion");
- if (schemaMemoryAllocatePortion != null) {
- CONF.setDefaultSchemaMemoryConfig(false);
- String[] proportions = schemaMemoryAllocatePortion.split(":");
- int loadedProportionSum = 0;
- for (String proportion : proportions) {
- loadedProportionSum += Integer.parseInt(proportion.trim());
- }
-
- if (loadedProportionSum != 0) {
- proportionSum = loadedProportionSum;
- schemaRegionProportion = Integer.parseInt(proportions[0].trim());
- schemaCacheProportion = Integer.parseInt(proportions[1].trim());
- partitionCacheProportion = Integer.parseInt(proportions[2].trim());
- lastCacheProportion = Integer.parseInt(proportions[3].trim());
- }
- } else {
- CONF.setDefaultSchemaMemoryConfig(true);
- }
-
- CONF.setAllocateMemoryForSchemaRegion(
- schemaMemoryTotal * schemaRegionProportion / proportionSum);
- LOGGER.info("allocateMemoryForSchemaRegion = {}", CONF.getAllocateMemoryForSchemaRegion());
-
- CONF.setAllocateMemoryForSchemaCache(schemaMemoryTotal * schemaCacheProportion / proportionSum);
- LOGGER.info("allocateMemoryForSchemaCache = {}", CONF.getAllocateMemoryForSchemaCache());
-
- CONF.setAllocateMemoryForPartitionCache(
- schemaMemoryTotal * partitionCacheProportion / proportionSum);
- LOGGER.info("allocateMemoryForPartitionCache = {}", CONF.getAllocateMemoryForPartitionCache());
-
- CONF.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion / proportionSum);
- LOGGER.info("allocateMemoryForLastCache = {}", CONF.getAllocateMemoryForLastCache());
- }
-
- private void initStorageEngineAllocate(Properties properties) {
- String allocationRatio = properties.getProperty("storage_engine_memory_proportion", "8:2");
- String[] proportions = allocationRatio.split(":");
- int proportionForWrite = Integer.parseInt(proportions[0].trim());
- int proportionForCompaction = Integer.parseInt(proportions[1].trim());
-
- double writeProportion =
- ((double) (proportionForWrite) / (double) (proportionForCompaction + proportionForWrite));
-
- String allocationRatioForWrite = properties.getProperty("write_memory_proportion", "19:1");
- proportions = allocationRatioForWrite.split(":");
- int proportionForMemTable = Integer.parseInt(proportions[0].trim());
- int proportionForTimePartitionInfo = Integer.parseInt(proportions[1].trim());
-
- double memtableProportionForWrite =
- ((double) (proportionForMemTable)
- / (double) (proportionForMemTable + proportionForTimePartitionInfo));
- double timePartitionInfoForWrite =
- ((double) (proportionForTimePartitionInfo)
- / (double) (proportionForMemTable + proportionForTimePartitionInfo));
- CONF.setWriteProportionForMemtable(writeProportion * memtableProportionForWrite);
-
- CONF.setAllocateMemoryForTimePartitionInfo(
- (long)
- ((writeProportion * timePartitionInfoForWrite)
- * CONF.getAllocateMemoryForStorageEngine()));
-
- CONF.setCompactionProportion(
- ((double) (proportionForCompaction)
- / (double) (proportionForCompaction + proportionForWrite)));
- }
-
- private void loadSchemaEngineConfiguration(Properties properties) {
- CONF.setCoordinatorReadExecutorSize(
- Integer.parseInt(
- properties.getProperty(
- "coordinator_read_executor_size",
- Integer.toString(CONF.getCoordinatorReadExecutorSize()))));
-
- CONF.setCoordinatorWriteExecutorSize(
- Integer.parseInt(
- properties.getProperty(
- "coordinator_write_executor_size",
- Integer.toString(CONF.getCoordinatorWriteExecutorSize()))));
-
- CONF.setPartitionCacheSize(
- Integer.parseInt(
- properties.getProperty(
- "partition_cache_size", Integer.toString(CONF.getPartitionCacheSize()))));
-
- int mlogBufferSize =
- Integer.parseInt(
- properties.getProperty("mlog_buffer_size", Integer.toString(CONF.getMlogBufferSize())));
- if (mlogBufferSize > 0) {
- CONF.setMlogBufferSize(mlogBufferSize);
- }
-
- long forceMlogPeriodInMs =
- Long.parseLong(
- properties.getProperty(
- "sync_mlog_period_in_ms", Long.toString(CONF.getSyncMlogPeriodInMs())));
- if (forceMlogPeriodInMs > 0) {
- CONF.setSyncMlogPeriodInMs(forceMlogPeriodInMs);
- }
-
- CONF.setTagAttributeFlushInterval(
- Integer.parseInt(
- properties.getProperty(
- "tag_attribute_flush_interval",
- String.valueOf(CONF.getTagAttributeFlushInterval()))));
-
- CONF.setTagAttributeTotalSize(
- Integer.parseInt(
- properties.getProperty(
- "tag_attribute_total_size", String.valueOf(CONF.getTagAttributeTotalSize()))));
-
- CONF.setMaxMeasurementNumOfInternalRequest(
- Integer.parseInt(
- properties.getProperty(
- "max_measurement_num_of_internal_request",
- String.valueOf(CONF.getMaxMeasurementNumOfInternalRequest()))));
- }
-
- private void loadAutoCreateSchemaProps(Properties properties) {
-
- CONF.setEnableAutoCreateSchema(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_auto_create_schema",
- Boolean.toString(CONF.isEnableAutoCreateSchema()).trim())));
-
- CONF.setDefaultStorageGroupLevel(
+ config.setCoreClientNumForEachNode(
Integer.parseInt(
- properties.getProperty(
- "default_storage_group_level",
- Integer.toString(CONF.getDefaultStorageGroupLevel()))));
-
- CONF.setBooleanStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "boolean_string_infer_type", CONF.getBooleanStringInferType().toString())));
- CONF.setIntegerStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "integer_string_infer_type", CONF.getIntegerStringInferType().toString())));
- CONF.setLongStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "long_string_infer_type", CONF.getLongStringInferType().toString())));
- CONF.setFloatingStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "floating_string_infer_type", CONF.getFloatingStringInferType().toString())));
- CONF.setNanStringInferType(
- TSDataType.valueOf(
- properties.getProperty(
- "nan_string_infer_type", CONF.getNanStringInferType().toString())));
-
- CONF.setDefaultBooleanEncoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_boolean_encoding", CONF.getDefaultBooleanEncoding().toString())));
- CONF.setDefaultInt32Encoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_int32_encoding", CONF.getDefaultInt32Encoding().toString())));
- CONF.setDefaultInt64Encoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_int64_encoding", CONF.getDefaultInt64Encoding().toString())));
- CONF.setDefaultFloatEncoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_float_encoding", CONF.getDefaultFloatEncoding().toString())));
- CONF.setDefaultDoubleEncoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_double_encoding", CONF.getDefaultDoubleEncoding().toString())));
- CONF.setDefaultTextEncoding(
- TSEncoding.parse(
- properties.getProperty(
- "default_text_encoding", CONF.getDefaultTextEncoding().toString())));
- }
-
- private void loadQueryConfigurations(Properties properties) {
- String readConsistencyLevel =
- properties.getProperty("read_consistency_level", CONF.getReadConsistencyLevel()).trim();
- if (readConsistencyLevel.equals("strong") || readConsistencyLevel.equals("weak")) {
- CONF.setReadConsistencyLevel(readConsistencyLevel);
- } else {
- LOGGER.warn(
- String.format(
- "Unknown read_consistency_level: %s, please set to \"strong\" or \"weak\"",
- readConsistencyLevel));
- }
-
- CONF.setMetaDataCacheEnable(
- Boolean.parseBoolean(
properties
.getProperty(
- "meta_data_cache_enable", Boolean.toString(CONF.isMetaDataCacheEnable()))
+ "dn_core_client_count_for_each_node_in_client_manager",
+ String.valueOf(config.getCoreClientNumForEachNode()))
.trim()));
- String queryMemoryAllocateProportion =
- properties.getProperty("chunk_timeseriesmeta_free_memory_proportion");
- if (queryMemoryAllocateProportion != null) {
- String[] proportions = queryMemoryAllocateProportion.split(":");
- int proportionSum = 0;
- for (String proportion : proportions) {
- proportionSum += Integer.parseInt(proportion.trim());
- }
- long maxMemoryAvailable = CONF.getAllocateMemoryForRead();
- if (proportionSum != 0) {
- try {
- CONF.setAllocateMemoryForBloomFilterCache(
- maxMemoryAvailable * Integer.parseInt(proportions[0].trim()) / proportionSum);
- CONF.setAllocateMemoryForChunkCache(
- maxMemoryAvailable * Integer.parseInt(proportions[1].trim()) / proportionSum);
- CONF.setAllocateMemoryForTimeSeriesMetaDataCache(
- maxMemoryAvailable * Integer.parseInt(proportions[2].trim()) / proportionSum);
- CONF.setAllocateMemoryForCoordinator(
- maxMemoryAvailable * Integer.parseInt(proportions[3].trim()) / proportionSum);
- CONF.setAllocateMemoryForOperators(
- maxMemoryAvailable * Integer.parseInt(proportions[4].trim()) / proportionSum);
- CONF.setAllocateMemoryForDataExchange(
- maxMemoryAvailable * Integer.parseInt(proportions[5].trim()) / proportionSum);
- CONF.setAllocateMemoryForTimeIndex(
- maxMemoryAvailable * Integer.parseInt(proportions[6].trim()) / proportionSum);
- } catch (Exception e) {
- throw new RuntimeException(
- "Each subsection of configuration item chunkmeta_chunk_timeseriesmeta_free_memory_proportion"
- + " should be an integer, which is "
- + queryMemoryAllocateProportion);
- }
- }
- }
-
- // metadata cache is disabled, we need to move all their allocated memory to other parts
- if (!CONF.isMetaDataCacheEnable()) {
- long sum =
- CONF.getAllocateMemoryForBloomFilterCache()
- + CONF.getAllocateMemoryForChunkCache()
- + CONF.getAllocateMemoryForTimeSeriesMetaDataCache();
- CONF.setAllocateMemoryForBloomFilterCache(0);
- CONF.setAllocateMemoryForChunkCache(0);
- CONF.setAllocateMemoryForTimeSeriesMetaDataCache(0);
- long partForDataExchange = sum / 2;
- long partForOperators = sum - partForDataExchange;
- CONF.setAllocateMemoryForDataExchange(
- CONF.getAllocateMemoryForDataExchange() + partForDataExchange);
- CONF.setAllocateMemoryForOperators(CONF.getAllocateMemoryForOperators() + partForOperators);
- }
-
- CONF.setEnableLastCache(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_last_cache", Boolean.toString(CONF.isEnableLastCache()))));
-
- CONF.setMaxDeduplicatedPathNum(
- Integer.parseInt(
- properties.getProperty(
- "max_deduplicated_path_num", Integer.toString(CONF.getMaxDeduplicatedPathNum()))));
-
- loadShuffleProps(properties);
-
- CONF.setMaxTsBlockSizeInBytes(
+ config.setMaxClientNumForEachNode(
Integer.parseInt(
- properties.getProperty(
- "max_ts_block_size_in_bytes", Integer.toString(CONF.getMaxTsBlockSizeInBytes()))));
- TSFileDescriptor.getInstance()
- .getConfig()
- .setMaxTsBlockSizeInBytes(CONF.getMaxTsBlockSizeInBytes());
-
- CONF.setMaxTsBlockLineNumber(
- Integer.parseInt(
- properties.getProperty(
- "max_ts_block_line_number", Integer.toString(CONF.getMaxTsBlockLineNumber()))));
- TSFileDescriptor.getInstance()
- .getConfig()
- .setMaxTsBlockLineNumber(CONF.getMaxTsBlockLineNumber());
-
- CONF.setSlowQueryThreshold(
- Long.parseLong(
- properties.getProperty(
- "slow_query_threshold", String.valueOf(CONF.getSlowQueryThreshold()))));
-
- CONF.setQueryTimeoutThreshold(
- Long.parseLong(
- properties.getProperty(
- "query_timeout_threshold", Long.toString(CONF.getQueryTimeoutThreshold()))));
-
- CONF.setMaxAllowedConcurrentQueries(
- Integer.parseInt(
- properties.getProperty(
- "max_allowed_concurrent_queries",
- Integer.toString(CONF.getMaxAllowedConcurrentQueries()))));
- if (CONF.getMaxAllowedConcurrentQueries() <= 0) {
- CONF.setMaxAllowedConcurrentQueries(1000);
- }
-
- CONF.setQueryThreadCount(
- Integer.parseInt(
- properties.getProperty(
- "query_thread_count", Integer.toString(CONF.getQueryThreadCount()))));
- if (CONF.getQueryThreadCount() <= 0) {
- CONF.setQueryThreadCount(Runtime.getRuntime().availableProcessors());
- }
-
- CONF.setBatchSize(
- Integer.parseInt(
- properties.getProperty("batch_size", Integer.toString(CONF.getBatchSize()))));
- }
-
- // Timed flush memtable
- private void loadTimedService(Properties properties) {
- CONF.setEnableTimedFlushSeqMemtable(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_timed_flush_seq_memtable",
- Boolean.toString(CONF.isEnableTimedFlushSeqMemtable()))));
-
- long seqMemTableFlushInterval =
- Long.parseLong(
- properties
- .getProperty(
- "seq_memtable_flush_interval_in_ms",
- Long.toString(CONF.getSeqMemtableFlushInterval()))
- .trim());
- if (seqMemTableFlushInterval > 0) {
- CONF.setSeqMemtableFlushInterval(seqMemTableFlushInterval);
- }
-
- long seqMemTableFlushCheckInterval =
- Long.parseLong(
- properties
- .getProperty(
- "seq_memtable_flush_check_interval_in_ms",
- Long.toString(CONF.getSeqMemtableFlushCheckInterval()))
- .trim());
- if (seqMemTableFlushCheckInterval > 0) {
- CONF.setSeqMemtableFlushCheckInterval(seqMemTableFlushCheckInterval);
- }
-
- CONF.setEnableTimedFlushUnseqMemtable(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_timed_flush_unseq_memtable",
- Boolean.toString(CONF.isEnableTimedFlushUnseqMemtable()))));
-
- long unseqMemTableFlushInterval =
- Long.parseLong(
- properties
- .getProperty(
- "unseq_memtable_flush_interval_in_ms",
- Long.toString(CONF.getUnseqMemtableFlushInterval()))
- .trim());
- if (unseqMemTableFlushInterval > 0) {
- CONF.setUnseqMemtableFlushInterval(unseqMemTableFlushInterval);
- }
-
- long unseqMemTableFlushCheckInterval =
- Long.parseLong(
properties
.getProperty(
- "unseq_memtable_flush_check_interval_in_ms",
- Long.toString(CONF.getUnseqMemtableFlushCheckInterval()))
- .trim());
- if (unseqMemTableFlushCheckInterval > 0) {
- CONF.setUnseqMemtableFlushCheckInterval(unseqMemTableFlushCheckInterval);
- }
- }
-
- private void loadShuffleProps(Properties properties) {
- CONF.setMppDataExchangeCorePoolSize(
- Integer.parseInt(
- properties.getProperty(
- "mpp_data_exchange_core_pool_size",
- Integer.toString(CONF.getMppDataExchangeCorePoolSize()))));
- CONF.setMppDataExchangeMaxPoolSize(
- Integer.parseInt(
- properties.getProperty(
- "mpp_data_exchange_max_pool_size",
- Integer.toString(CONF.getMppDataExchangeMaxPoolSize()))));
- CONF.setMppDataExchangeKeepAliveTimeInMs(
- Integer.parseInt(
- properties.getProperty(
- "mpp_data_exchange_keep_alive_time_in_ms",
- Integer.toString(CONF.getMppDataExchangeKeepAliveTimeInMs()))));
-
- CONF.setDriverTaskExecutionTimeSliceInMs(
- Integer.parseInt(
- properties.getProperty(
- "driver_task_execution_time_slice_in_ms",
- Integer.toString(CONF.getDriverTaskExecutionTimeSliceInMs()))));
- }
-
- private void loadStorageEngineConfiguration(Properties properties) {
- CONF.setTimestampPrecision(
- properties.getProperty("timestamp_precision", CONF.getTimestampPrecision()).trim());
-
- CONF.setDefaultTtlInMs(
- Long.parseLong(
- properties
- .getProperty("default_ttl_in_ms", String.valueOf(CONF.getDefaultTtlInMs()))
+ "dn_max_client_count_for_each_node_in_client_manager",
+ String.valueOf(config.getMaxClientNumForEachNode()))
.trim()));
- CONF.setMaxWaitingTimeWhenInsertBlockedInMs(
- Integer.parseInt(
- properties.getProperty(
- "max_waiting_time_when_insert_blocked",
- Integer.toString(CONF.getMaxWaitingTimeWhenInsertBlockedInMs()))));
-
- CONF.setEnableDiscardOutOfOrderData(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_discard_out_of_order_data",
- Boolean.toString(CONF.isEnableDiscardOutOfOrderData()))));
-
- CONF.setHandleSystemErrorStrategy(
+ config.setHandleSystemErrorStrategy(
HandleSystemErrorStrategy.valueOf(
properties
.getProperty(
- "handle_system_error", String.valueOf(CONF.getHandleSystemErrorStrategy()))
+ "handle_system_error", String.valueOf(config.getHandleSystemErrorStrategy()))
.trim()));
- long memTableSizeThreshold =
- Long.parseLong(
+ config.setDiskSpaceWarningThreshold(
+ Double.parseDouble(
properties
.getProperty(
- "memtable_size_threshold", Long.toString(CONF.getMemtableSizeThreshold()))
- .trim());
- if (memTableSizeThreshold > 0) {
- CONF.setMemtableSizeThreshold(memTableSizeThreshold);
- }
-
- loadTimedService(properties);
-
- CONF.setTvListSortAlgorithm(
- TVListSortAlgorithm.valueOf(
- properties.getProperty(
- "tvlist_sort_algorithm", CONF.getTvListSortAlgorithm().toString())));
-
- CONF.setAvgSeriesPointNumberThreshold(
- Integer.parseInt(
- properties.getProperty(
- "avg_series_point_number_threshold",
- Integer.toString(CONF.getAvgSeriesPointNumberThreshold()))));
-
- CONF.setFlushThreadCount(
- Integer.parseInt(
- properties.getProperty(
- "flush_thread_count", Integer.toString(CONF.getFlushThreadCount()))));
- if (CONF.getFlushThreadCount() <= 0) {
- CONF.setFlushThreadCount(Runtime.getRuntime().availableProcessors());
- }
-
- CONF.setEnablePartialInsert(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_partial_insert", String.valueOf(CONF.isEnablePartialInsert()))));
-
- CONF.setRecoveryLogIntervalInMs(
- Long.parseLong(
- properties.getProperty(
- "recovery_log_interval_in_ms", String.valueOf(CONF.getRecoveryLogIntervalInMs()))));
-
- CONF.setUpgradeThreadCount(
- Integer.parseInt(
- properties.getProperty(
- "upgrade_thread_count", Integer.toString(CONF.getUpgradeThreadCount()))));
- }
-
- private void loadWALConfiguration(Properties properties) {
- CONF.setWalMode(
- WALMode.valueOf((properties.getProperty("wal_mode", CONF.getWalMode().toString()))));
-
- int maxWalNodesNum =
- Integer.parseInt(
- properties.getProperty(
- "max_wal_nodes_num", Integer.toString(CONF.getMaxWalNodesNum())));
- if (maxWalNodesNum > 0) {
- CONF.setMaxWalNodesNum(maxWalNodesNum);
- }
-
- long fsyncWalDelayInMs =
- Long.parseLong(
- properties.getProperty(
- "fsync_wal_delay_in_ms", Long.toString(CONF.getFsyncWalDelayInMs())));
- if (fsyncWalDelayInMs > 0) {
- CONF.setFsyncWalDelayInMs(fsyncWalDelayInMs);
- }
-
- int walBufferSize =
- Integer.parseInt(
- properties.getProperty(
- "wal_buffer_size_in_byte", Integer.toString(CONF.getWalBufferSizeInByte())));
- if (walBufferSize > 0) {
- CONF.setWalBufferSizeInByte(walBufferSize);
- }
-
- int walBufferQueueCapacity =
- Integer.parseInt(
- properties.getProperty(
- "wal_buffer_queue_capacity", Integer.toString(CONF.getWalBufferQueueCapacity())));
- if (walBufferQueueCapacity > 0) {
- CONF.setWalBufferQueueCapacity(walBufferQueueCapacity);
- }
-
- long walFileSizeThreshold =
- Long.parseLong(
- properties.getProperty(
- "wal_file_size_threshold_in_byte",
- Long.toString(CONF.getWalFileSizeThresholdInByte())));
- if (walFileSizeThreshold > 0) {
- CONF.setWalFileSizeThresholdInByte(walFileSizeThreshold);
- }
-
- double walMinEffectiveInfoRatio =
- Double.parseDouble(
- properties.getProperty(
- "wal_min_effective_info_ratio",
- Double.toString(CONF.getWalMinEffectiveInfoRatio())));
- if (walMinEffectiveInfoRatio > 0) {
- CONF.setWalMinEffectiveInfoRatio(walMinEffectiveInfoRatio);
- }
-
- long walMemTableSnapshotThreshold =
- Long.parseLong(
- properties.getProperty(
- "wal_memtable_snapshot_threshold_in_byte",
- Long.toString(CONF.getWalMemTableSnapshotThreshold())));
- if (walMemTableSnapshotThreshold > 0) {
- CONF.setWalMemTableSnapshotThreshold(walMemTableSnapshotThreshold);
- }
-
- int maxWalMemTableSnapshotNum =
- Integer.parseInt(
- properties.getProperty(
- "max_wal_memtable_snapshot_num",
- Integer.toString(CONF.getMaxWalMemTableSnapshotNum())));
- if (maxWalMemTableSnapshotNum > 0) {
- CONF.setMaxWalMemTableSnapshotNum(maxWalMemTableSnapshotNum);
- }
-
- long deleteWalFilesPeriod =
- Long.parseLong(
- properties.getProperty(
- "delete_wal_files_period_in_ms",
- Long.toString(CONF.getDeleteWalFilesPeriodInMs())));
- if (deleteWalFilesPeriod > 0) {
- CONF.setDeleteWalFilesPeriodInMs(deleteWalFilesPeriod);
- }
-
- long throttleDownThresholdInByte =
- Long.parseLong(
- properties.getProperty(
- "iot_consensus_throttle_threshold_in_byte",
- Long.toString(CONF.getIotConsensusThrottleThresholdInByte())));
- if (throttleDownThresholdInByte > 0) {
- CONF.setIotConsensusThrottleThresholdInByte(throttleDownThresholdInByte);
- }
-
- long cacheWindowInMs =
- Long.parseLong(
- properties.getProperty(
- "iot_consensus_cache_window_time_in_ms",
- Long.toString(CONF.getIotConsensusCacheWindowTimeInMs())));
- if (cacheWindowInMs > 0) {
- CONF.setIotConsensusCacheWindowTimeInMs(cacheWindowInMs);
- }
- }
-
- private void loadTsFileConfiguration(Properties properties) {
- TSFileConfig tsFileConfig = TSFileDescriptor.getInstance().getConfig();
-
- tsFileConfig.setGroupSizeInByte(
- Integer.parseInt(
- properties.getProperty(
- "group_size_in_byte", Integer.toString(tsFileConfig.getGroupSizeInByte()))));
-
- tsFileConfig.setPageSizeInByte(
- Integer.parseInt(
- properties.getProperty(
- "page_size_in_byte", Integer.toString(tsFileConfig.getPageSizeInByte()))));
- if (tsFileConfig.getPageSizeInByte() > tsFileConfig.getGroupSizeInByte()) {
- LOGGER.warn("page_size is greater than group size, will set it as the same with group size");
- tsFileConfig.setPageSizeInByte(tsFileConfig.getGroupSizeInByte());
- }
-
- tsFileConfig.setMaxNumberOfPointsInPage(
- Integer.parseInt(
- properties.getProperty(
- "max_number_of_points_in_page",
- Integer.toString(tsFileConfig.getMaxNumberOfPointsInPage()))));
-
- tsFileConfig.setPatternMatchingThreshold(
- Integer.parseInt(
- properties.getProperty(
- "pattern_matching_threshold",
- String.valueOf(tsFileConfig.getPatternMatchingThreshold()))));
-
- tsFileConfig.setMaxStringLength(
- Integer.parseInt(
- properties.getProperty(
- "max_string_length", Integer.toString(tsFileConfig.getMaxStringLength()))));
-
- tsFileConfig.setFloatPrecision(
- Integer.parseInt(
- properties.getProperty(
- "float_precision", Integer.toString(tsFileConfig.getFloatPrecision()))));
-
- tsFileConfig.setTimeEncoder(
- properties.getProperty("time_encoder", tsFileConfig.getTimeEncoder()));
-
- tsFileConfig.setValueEncoder(
- properties.getProperty("value_encoder", tsFileConfig.getValueEncoder()));
-
- tsFileConfig.setCompressor(
- properties.getProperty("compressor", tsFileConfig.getCompressor().getName()));
-
- tsFileConfig.setMaxDegreeOfIndexNode(
- Integer.parseInt(
- properties.getProperty(
- "max_degree_of_index_node",
- Integer.toString(tsFileConfig.getMaxDegreeOfIndexNode()))));
-
- tsFileConfig.setFrequencyIntervalInMinute(
- Integer.parseInt(
- properties.getProperty(
- "frequency_interval_in_minute",
- Integer.toString(tsFileConfig.getFrequencyIntervalInMinute()))));
-
- TSFileDescriptor.getInstance().overwriteConfigByCustomSettings(properties);
- }
-
- private void loadWatermarkConfiguration(Properties properties) {
- CONF.setEnableWatermark(
- Boolean.parseBoolean(
- properties.getProperty(
- "enable_watermark", Boolean.toString(CONF.isEnableWatermark()).trim())));
- CONF.setWatermarkSecretKey(
- properties.getProperty("watermark_secret_key", CONF.getWatermarkSecretKey()));
- CONF.setWatermarkBitString(
- properties.getProperty("watermark_bit_string", CONF.getWatermarkBitString()));
- CONF.setWatermarkMethod(properties.getProperty("watermark_method", CONF.getWatermarkMethod()));
- }
-
- private void loadAuthorizationConfiguration(Properties properties) {
- CONF.setAuthorizerProvider(
- properties.getProperty("authorizer_provider_class", CONF.getAuthorizerProvider()).trim());
-
- // if using org.apache.iotdb.db.auth.authorizer.OpenIdAuthorizer, openID_url is needed.
- CONF.setOpenIdProviderUrl(
- properties.getProperty("openID_url", CONF.getOpenIdProviderUrl()).trim());
-
- CONF.setAdminName(properties.getProperty("admin_name", CONF.getAdminName()).trim());
-
- CONF.setAdminPassword(properties.getProperty("admin_password", CONF.getAdminPassword()).trim());
-
- CONF.setIotdbServerEncryptDecryptProvider(
- properties
- .getProperty(
- "iotdb_server_encrypt_decrypt_provider",
- CONF.getIotdbServerEncryptDecryptProvider())
- .trim());
-
... 20328 lines suppressed ...