Skip to content

Commit e816bc1

Browse files
authored
Refactor ConfigNode client/info and DirectoryChecker into node-common… (#18561)
1 parent d6b3afb commit e816bc1

19 files changed

Lines changed: 1964 additions & 699 deletions

File tree

‎iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -132,34 +132,6 @@ private DataNodeMiscMessages() {}
132132
public static final String SET_SERVER_CONTEXT_FACTORY =
133133
"Will set ServerContextFactory from {} ";
134134

135-
// ---------------------------------------------------------------------------
136-
// protocol – ConfigNodeInfo
137-
// ---------------------------------------------------------------------------
138-
public static final String UPDATE_CONFIG_NODE_SUCCESSFULLY =
139-
"Update ConfigNode Successfully: {}, which takes {} ms.";
140-
public static final String UPDATE_CONFIG_NODE_FAILED = "Update ConfigNode failed.";
141-
public static final String SYSTEM_PROPERTIES_NOT_EXIST =
142-
"System properties file not exist, not necessary to store ConfigNode list";
143-
public static final String LOAD_CONFIG_NODE_SUCCESSFULLY =
144-
"Load ConfigNode successfully: {}, which takes {} ms.";
145-
public static final String CANNOT_PARSE_CONFIG_NODE_LIST =
146-
"Cannot parse config node list in system.properties";
147-
148-
// ---------------------------------------------------------------------------
149-
// protocol – ConfigNodeClient
150-
// ---------------------------------------------------------------------------
151-
public static final String NODE_LEADER_MAY_DOWN_TRY_NEXT =
152-
"The current node leader may have been down {}, try next node";
153-
public static final String UNEXPECTED_INTERRUPTION_CONNECT_CONFIG_NODE =
154-
"Unexpected interruption when waiting to try to connect to ConfigNode";
155-
public static final String NODE_MAY_DOWN_TRY_NEXT =
156-
"The current node may have been down {},try next node";
157-
public static final String FAILED_CONNECT_CONFIG_NODE_NOT_LEADER =
158-
"Failed to connect to ConfigNode {} from DataNode {}, because the current node is not "
159-
+ "leader or not ready yet, will try again later";
160-
public static final String UNEXPECTED_INTERRUPTION_CONNECT_CONFIG_NODE_BREAK =
161-
"Unexpected interruption when waiting to try to connect to ConfigNode, may because current node has been down. Will break current execution process to avoid meaningless wait.";
162-
163135
// ---------------------------------------------------------------------------
164136
// protocol – DataNodeInternalClient
165137
// ---------------------------------------------------------------------------
@@ -670,8 +642,6 @@ private DataNodeMiscMessages() {}
670642
public static final String STARTING_IOTDB = "Starting IoTDB {}";
671643
public static final String CANNOT_CREATE_SCHEMA_DIR = "Can not create schema dir: {}";
672644
public static final String SCHEMA_DIR_CREATED = " {} dir has been created.";
673-
public static final String IOTDB_VERSION_TOO_OLD = "IoTDB version is too old";
674-
public static final String REPAIR_SYSTEM_PROPERTIES = "repair system.properties, lack {}";
675645
public static final String UNEXPECTED_CONSENSUS_GROUP_TYPE =
676646
"Unexpected consensus group type";
677647
public static final String ENCRYPT_MAGIC_STRING_NOT_MATCHED =
@@ -1149,12 +1119,8 @@ private DataNodeMiscMessages() {}
11491119
"Totally find {} tsFiles to be settled.";
11501120
public static final String MISC_LOG_SYSTEM_PROPERTIES_FILE_HAS_BEEN_MOVED_SUCCESSFULLY_4445A448 =
11511121
"system.properties file has been moved successfully: {} -> {}";
1152-
public static final String MISC_LOG_SERIALIZE_MUTABLE_SYSTEM_PROPERTIES_SUCCESSFULLY_WHICH_TAKES_4656A206 =
1153-
"Serialize mutable system properties successfully, which takes {} ms.";
11541122
public static final String MISC_LOG_SYSTEMPROPERTIES_NORMALIZE_FROM_TO_FOR_COMPATIBILITY_BE1C725F =
11551123
"[SystemProperties] Normalize {} from {} to {} for compatibility.";
1156-
public static final String MISC_LOG_DO_NOT_UPGRADE_IOTDB_FROM_V0_9_OR_LOWER_VERSION_TO_V1_0_9878EC88 =
1157-
"DO NOT UPGRADE IoTDB from v0.9 or lower version to v1.0! Please upgrade to v0.10 first";
11581124
public static final String MISC_LOG_CANNOT_FIND_IOTDB_HOME_OR_IOTDB_CONF_ENVIRONMENT_VARIABLE_BE01B2FE =
11591125
"Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading config file {}, use "
11601126
+ "default configuration";
@@ -1402,10 +1368,6 @@ private DataNodeMiscMessages() {}
14021368
"Illegal defaultDatabaseLevel: %d, should >= 1";
14031369
public static final String MISC_EXCEPTION_LOADTSFILESPILTPARTITIONMAXSIZE_SHOULD_BE_GREATER_THAN_OR_95B4DB23 =
14041370
"loadTsFileSpiltPartitionMaxSize should be greater than or equal to 0";
1405-
public static final String MISC_EXCEPTION_REMOVING_IS_ONLY_ALLOWED_IN_AN_ENVIRONMENT_WHERE_THE_DATANODE_5A3E1FEA =
1406-
"Removing is only allowed in an environment where the datanode has been successfully "
1407-
+ "started. Please check whether it is removed on the confignode, or if you have deleted the "
1408-
+ "system.properties file by mistake.";
14091371
public static final String MISC_EXCEPTION_STATEMENTID_SDOESN_T_EXIST_IN_THIS_SESSION_S_BD5B4733 =
14101372
"StatementId: %sdoesn't exist in this session %s";
14111373
public static final String MISC_EXCEPTION_INTERNALCLIENTSESSION_SHOULD_NEVER_CALL_PREPARE_STATEMENT_CCAB3CDC =
@@ -1428,8 +1390,6 @@ private DataNodeMiscMessages() {}
14281390
"%s is not allowed, only support %s";
14291391
public static final String MISC_EXCEPTION_S_IS_NOT_ALLOWED_ONLY_SUPPORT_S_1B06E0B7 =
14301392
" %s is not allowed, only support %s";
1431-
public static final String PARAMETER_CANNOT_BE_MODIFIED_AFTER_FIRST_STARTUP_FMT =
1432-
"%s can't be modified after first startup";
14331393
public static final String UNSUPPORTED_INVOCATION_BY_DATANODE =
14341394
"This method is not supported for invocation by DataNode";
14351395
public static final String UNSUPPORTED_INVOCATION_BY_DATANODE_USE_SUBMIT_LOAD_CONFIGURATION_TASK =
@@ -1494,9 +1454,6 @@ private DataNodeMiscMessages() {}
14941454
public static final String EXCEPTION_RUNTIMESTATE_D4D018BA = "runtimeState";
14951455
public static final String EXCEPTION_STATEMENTNAME_IS_NULL_C03BB8D4 = "statementName is null";
14961456
public static final String EXCEPTION_SQL_IS_NULL_BEDB2B7A = "sql is null";
1497-
public static final String MESSAGE_CONFIGNODE_LEADER_ARG_IS_WARMING_UP_BEFORE_SERVING_DATANODE_ARG_WILL_WAIT_AND_RETRY_AAB5F962 = "ConfigNode leader {} is warming up before serving DataNode {}, will wait and retry.";
1498-
public static final String MESSAGE_CONFIGNODE_LEADER_ARG_IS_WARMING_UP_BEFORE_SERVING_DATANODE_ARG_WILL_WAIT_AND_RETRY_REASON_ARG_3A2A4163 =
1499-
"ConfigNode leader {} is warming up before serving DataNode {}, will wait and retry. Reason: {}";
15001457
public static final String EXCEPTION_TRUST_STORE_PATH_MUST_BE_SET_WHEN_THRIFT_SSL_CLIENT_AUTH_IS_TRUE_36016171 = "trust_store_path must be set when thrift_ssl_client_auth is true";
15011458
public static final String EXCEPTION_CONTINUOUS_QUERY_MIN_EVERY_INTERVAL_IN_MS_SHOULD_BE_GREATER_THAN_0_BUT_CURRENT_VALUE_IS_F9A1BEC4 = "continuous_query_min_every_interval_in_ms should be greater than 0, but current value is ";
15021459
public static final String EXCEPTION_UNKNOWN_READ_CONSISTENCY_LEVEL_ARG_PLEASE_SET_TO_STRONG_OR_WEAK_8CF29949 = "Unknown read_consistency_level: %s, please set to \"strong\" or \"weak\"";

‎iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/StorageEngineMessages.java‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ private StorageEngineMessages() {}
6262

6363
// ======================== Resource Control - Disk ========================
6464

65-
public static final String FAILED_TO_DEREGISTER_FILE_LOCK = "Failed to deregister file lock because {}";
6665
public static final String ALL_FOLDERS_FULL_CHANGE_TO_READ_ONLY = "All folders are full, change system mode to read-only.";
6766
public static final String FAILED_TO_PROCESS_FOLDER = "Failed to process folder '";
6867
public static final String FAIL_TO_GET_CANONICAL_PATH = "Fail to get canonical path of data dir {}";
@@ -1442,14 +1441,6 @@ private StorageEngineMessages() {}
14421441
"number of read requests exceeded - wait %sms";
14431442
public static final String STORAGE_EXCEPTION_READ_SIZE_LIMIT_EXCEEDED_WAIT_SMS_E19598BA =
14441443
"read size limit exceeded - wait %sms";
1445-
public static final String STORAGE_EXCEPTION_UNABLE_TO_CREATE_DIRECTORY_S_BECAUSE_THERE_IS_FILE_UNDER_1C59ACFC =
1446-
"Unable to create directory %s because there is file under the path, please check "
1447-
+ "configuration and restart.";
1448-
public static final String STORAGE_EXCEPTION_UNABLE_TO_CREATE_DIRECTORY_S_PLEASE_CHECK_CONFIGURATION_BA580B67 =
1449-
"Unable to create directory %s, please check configuration and restart.";
1450-
public static final String STORAGE_EXCEPTION_CONFLICT_IS_DETECTED_IN_DIRECTORY_S_WHICH_MAY_BE_BEING_USED_CB5C77FC =
1451-
"Conflict is detected in directory %s, which may be being used by another IoTDB "
1452-
+ "(ProcessId=%s). Please check configuration and restart.";
14531444
public static final String COMPACTION_INNER_SPACE = "inner";
14541445
public static final String COMPACTION_CROSS_SPACE = "cross";
14551446
public static final String DEVICE_DOES_NOT_EXIST_IN_RESOURCE_FILE_FMT =

‎iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -132,33 +132,6 @@ private DataNodeMiscMessages() {}
132132
public static final String SET_SERVER_CONTEXT_FACTORY =
133133
"将从 {} 设置 ServerContextFactory";
134134

135-
// ---------------------------------------------------------------------------
136-
// protocol – ConfigNodeInfo
137-
// ---------------------------------------------------------------------------
138-
public static final String UPDATE_CONFIG_NODE_SUCCESSFULLY =
139-
"成功更新 ConfigNode:{},耗时 {} 毫秒。";
140-
public static final String UPDATE_CONFIG_NODE_FAILED = "更新 ConfigNode 失败。";
141-
public static final String SYSTEM_PROPERTIES_NOT_EXIST =
142-
"系统属性文件不存在,无需存储 ConfigNode 列表";
143-
public static final String LOAD_CONFIG_NODE_SUCCESSFULLY =
144-
"成功加载 ConfigNode:{},耗时 {} 毫秒。";
145-
public static final String CANNOT_PARSE_CONFIG_NODE_LIST =
146-
"无法解析 system.properties 中的 ConfigNode 列表";
147-
148-
// ---------------------------------------------------------------------------
149-
// protocol – ConfigNodeClient
150-
// ---------------------------------------------------------------------------
151-
public static final String NODE_LEADER_MAY_DOWN_TRY_NEXT =
152-
"当前节点 Leader {} 可能已宕机,尝试下一个节点";
153-
public static final String UNEXPECTED_INTERRUPTION_CONNECT_CONFIG_NODE =
154-
"等待连接 ConfigNode 时发生意外中断";
155-
public static final String NODE_MAY_DOWN_TRY_NEXT =
156-
"当前节点 {} 可能已宕机,尝试下一个节点";
157-
public static final String FAILED_CONNECT_CONFIG_NODE_NOT_LEADER =
158-
"从 DataNode {} 连接 ConfigNode {} 失败,因为当前节点不是 Leader 或尚未就绪,稍后将重试";
159-
public static final String UNEXPECTED_INTERRUPTION_CONNECT_CONFIG_NODE_BREAK =
160-
"等待连接 ConfigNode 时发生意外中断,可能是当前节点已宕机,将中断当前执行流程以避免无意义等待。";
161-
162135
// ---------------------------------------------------------------------------
163136
// protocol – DataNodeInternalClient
164137
// ---------------------------------------------------------------------------
@@ -669,8 +642,6 @@ private DataNodeMiscMessages() {}
669642
public static final String STARTING_IOTDB = "正在启动 IoTDB {}";
670643
public static final String CANNOT_CREATE_SCHEMA_DIR = "无法创建 Schema 目录:{}";
671644
public static final String SCHEMA_DIR_CREATED = " {} 目录已创建。";
672-
public static final String IOTDB_VERSION_TOO_OLD = "IoTDB 版本过旧";
673-
public static final String REPAIR_SYSTEM_PROPERTIES = "修复 system.properties,缺少 {}";
674645
public static final String UNEXPECTED_CONSENSUS_GROUP_TYPE =
675646
"未预期的共识组类型";
676647
public static final String ENCRYPT_MAGIC_STRING_NOT_MATCHED =
@@ -1143,12 +1114,8 @@ private DataNodeMiscMessages() {}
11431114
"共找到 {} 个待 settle 的 TsFile。";
11441115
public static final String MISC_LOG_SYSTEM_PROPERTIES_FILE_HAS_BEEN_MOVED_SUCCESSFULLY_4445A448 =
11451116
"system.properties 文件已成功移动:{} -> {}";
1146-
public static final String MISC_LOG_SERIALIZE_MUTABLE_SYSTEM_PROPERTIES_SUCCESSFULLY_WHICH_TAKES_4656A206 =
1147-
"成功序列化 mutable system properties,耗时 {} ms。";
11481117
public static final String MISC_LOG_SYSTEMPROPERTIES_NORMALIZE_FROM_TO_FOR_COMPATIBILITY_BE1C725F =
11491118
"[SystemProperties] 为兼容性将 {} 从 {} 规范化为 {}。";
1150-
public static final String MISC_LOG_DO_NOT_UPGRADE_IOTDB_FROM_V0_9_OR_LOWER_VERSION_TO_V1_0_9878EC88 =
1151-
"请勿将 IoTDB 从 v0.9 或更低版本直接升级到 v1.0!请先升级到 v0.10";
11521119
public static final String MISC_LOG_CANNOT_FIND_IOTDB_HOME_OR_IOTDB_CONF_ENVIRONMENT_VARIABLE_BE01B2FE =
11531120
"加载配置文件 {} 时找不到 IOTDB_HOME 或 IOTDB_CONF 环境变量,使用默认配置";
11541121
public static final String MISC_LOG_COULDN_T_LOAD_THE_CONFIGURATION_FROM_ANY_OF_THE_KNOWN_SOURCES_EE3ED103 =
@@ -1372,8 +1339,6 @@ private DataNodeMiscMessages() {}
13721339
"非法的 defaultDatabaseLevel:%d,应 >= 1";
13731340
public static final String MISC_EXCEPTION_LOADTSFILESPILTPARTITIONMAXSIZE_SHOULD_BE_GREATER_THAN_OR_95B4DB23 =
13741341
"loadTsFileSpiltPartitionMaxSize 应大于或等于 0";
1375-
public static final String MISC_EXCEPTION_REMOVING_IS_ONLY_ALLOWED_IN_AN_ENVIRONMENT_WHERE_THE_DATANODE_5A3E1FEA =
1376-
"只有在 DataNode 已成功启动的环境中才允许移除。请检查它是否已在 ConfigNode 上移除,或是否误删了 system.properties 文件。";
13771342
public static final String MISC_EXCEPTION_STATEMENTID_SDOESN_T_EXIST_IN_THIS_SESSION_S_BD5B4733 =
13781343
"StatementId:%s 在会话 %s 中不存在";
13791344
public static final String MISC_EXCEPTION_INTERNALCLIENTSESSION_SHOULD_NEVER_CALL_PREPARE_STATEMENT_CCAB3CDC =
@@ -1396,8 +1361,6 @@ private DataNodeMiscMessages() {}
13961361
"%s 不允许,仅支持 %s";
13971362
public static final String MISC_EXCEPTION_S_IS_NOT_ALLOWED_ONLY_SUPPORT_S_1B06E0B7 =
13981363
" %s 不允许,仅支持 %s";
1399-
public static final String PARAMETER_CANNOT_BE_MODIFIED_AFTER_FIRST_STARTUP_FMT =
1400-
"%s 首次启动后不能修改";
14011364
public static final String UNSUPPORTED_INVOCATION_BY_DATANODE =
14021365
"DataNode 不支持调用此方法";
14031366
public static final String UNSUPPORTED_INVOCATION_BY_DATANODE_USE_SUBMIT_LOAD_CONFIGURATION_TASK =
@@ -1473,9 +1436,6 @@ private DataNodeMiscMessages() {}
14731436
public static final String EXCEPTION_RUNTIMESTATE_D4D018BA = "runtimeState";
14741437
public static final String EXCEPTION_STATEMENTNAME_IS_NULL_C03BB8D4 = "statementName 不能为空";
14751438
public static final String EXCEPTION_SQL_IS_NULL_BEDB2B7A = "sql 不能为空";
1476-
public static final String MESSAGE_CONFIGNODE_LEADER_ARG_IS_WARMING_UP_BEFORE_SERVING_DATANODE_ARG_WILL_WAIT_AND_RETRY_AAB5F962 = "ConfigNode leader {} 正在预热,暂未对 DataNode {} 提供服务,将等待并重试。";
1477-
public static final String MESSAGE_CONFIGNODE_LEADER_ARG_IS_WARMING_UP_BEFORE_SERVING_DATANODE_ARG_WILL_WAIT_AND_RETRY_REASON_ARG_3A2A4163 =
1478-
"ConfigNode leader {} 正在预热,暂未对 DataNode {} 提供服务,将等待并重试。原因:{}";
14791439
public static final String EXCEPTION_TRUST_STORE_PATH_MUST_BE_SET_WHEN_THRIFT_SSL_CLIENT_AUTH_IS_TRUE_36016171 = "当 thrift_ssl_client_auth 为 true 时,必须设置 trust_store_path";
14801440
public static final String EXCEPTION_CONTINUOUS_QUERY_MIN_EVERY_INTERVAL_IN_MS_SHOULD_BE_GREATER_THAN_0_BUT_CURRENT_VALUE_IS_F9A1BEC4 = "continuous_query_min_every_interval_in_ms 必须大于 0,但当前值为 ";
14811441
public static final String EXCEPTION_UNKNOWN_READ_CONSISTENCY_LEVEL_ARG_PLEASE_SET_TO_STRONG_OR_WEAK_8CF29949 = "未知的 read_consistency_level:%s,请设置为 \"strong\" 或 \"weak\"";

‎iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/StorageEngineMessages.java‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ private StorageEngineMessages() {}
6161
public static final String FILE_NO_SUCH_TIME_SERIES = "文件中不包含该时间序列 {}。";
6262

6363
// ======================== Resource Control - Disk ========================
64-
65-
public static final String FAILED_TO_DEREGISTER_FILE_LOCK = "注销文件锁失败,原因: {}";
64+
6665
public static final String ALL_FOLDERS_FULL_CHANGE_TO_READ_ONLY = "所有目录已满,切换系统为只读模式。";
6766
public static final String FAILED_TO_PROCESS_FOLDER = "处理目录失败 '";
6867
public static final String FAIL_TO_GET_CANONICAL_PATH = "获取数据目录 {} 的规范路径失败";
@@ -1371,12 +1370,6 @@ private StorageEngineMessages() {}
13711370
"读取请求数量超限 - 等待 %sms";
13721371
public static final String STORAGE_EXCEPTION_READ_SIZE_LIMIT_EXCEEDED_WAIT_SMS_E19598BA =
13731372
"读取大小超限 - 等待 %sms";
1374-
public static final String STORAGE_EXCEPTION_UNABLE_TO_CREATE_DIRECTORY_S_BECAUSE_THERE_IS_FILE_UNDER_1C59ACFC =
1375-
"无法创建目录 %s,原因:该路径下存在文件,请检查配置并重启。";
1376-
public static final String STORAGE_EXCEPTION_UNABLE_TO_CREATE_DIRECTORY_S_PLEASE_CHECK_CONFIGURATION_BA580B67 =
1377-
"无法创建目录 %s,请检查配置并重启。";
1378-
public static final String STORAGE_EXCEPTION_CONFLICT_IS_DETECTED_IN_DIRECTORY_S_WHICH_MAY_BE_BEING_USED_CB5C77FC =
1379-
"目录 %s 检测到冲突,可能正被另一个 IoTDB 使用 (ProcessId=%s)。请检查配置并重启。";
13801373
public static final String COMPACTION_INNER_SPACE = "内部";
13811374
public static final String COMPACTION_CROSS_SPACE = "跨空间";
13821375
public static final String DEVICE_DOES_NOT_EXIST_IN_RESOURCE_FILE_FMT =

0 commit comments

Comments
 (0)