19
19
20
20
package org .apache .iotdb .tool ;
21
21
22
+ import org .apache .iotdb .commons .conf .CommonConfig ;
22
23
import org .apache .iotdb .commons .conf .IoTDBConstant ;
23
- import org .apache .iotdb .db .conf .IoTDBConfig ;
24
24
import org .apache .iotdb .db .conf .IoTDBDescriptor ;
25
25
26
26
import org .slf4j .Logger ;
@@ -62,8 +62,6 @@ public class IoTDBDataBackTool {
62
62
static String targetWalDirParam = "" ;
63
63
static String remoteDnDataDir = "" ;
64
64
65
- static String DATA_NODE_CONF_NAME = IoTDBConfig .CONFIG_NAME ;
66
- static String CONFIG_NODE_CONF_NAME = "iotdb-confignode.properties" ;
67
65
static AtomicInteger fileCount = new AtomicInteger (0 );
68
66
static AtomicInteger targetFileCount = new AtomicInteger (0 );
69
67
static AtomicInteger processFileCount = new AtomicInteger (0 );
@@ -177,10 +175,10 @@ public static void main(String[] args) {
177
175
System .setProperty ("IOTDB_HOME" , System .getenv ("IOTDB_HOME" ));
178
176
argsParse (args );
179
177
File sourceDir = new File (sourcePath );
180
- Properties dataProperties = getProperties ( IoTDBConfig . CONFIG_NAME );
181
- initDataNodeProperties ( dataProperties );
182
- Properties configProperties = getProperties ( CONFIG_NODE_CONF_NAME );
183
- initConfigNodeProperties (configProperties );
178
+
179
+ Properties properties = getProperties ( CommonConfig . SYSTEM_CONFIG_NAME );
180
+ initDataNodeProperties ( properties );
181
+ initConfigNodeProperties (properties );
184
182
185
183
StringBuilder targetDirString = new StringBuilder ();
186
184
Map <String , String > copyMap = new HashMap <>();
@@ -215,7 +213,7 @@ public static void main(String[] args) {
215
213
+ File .separatorChar
216
214
+ "conf"
217
215
+ File .separatorChar
218
- + CONFIG_NODE_CONF_NAME ,
216
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
219
217
cnMapProperties );
220
218
} else if (nodeTypeParam .equalsIgnoreCase ("datanode" )) {
221
219
countDataNodeFile (targetDirString .toString (), copyMap , dnDataDirsMap , dnMapProperties );
@@ -237,7 +235,7 @@ public static void main(String[] args) {
237
235
+ File .separatorChar
238
236
+ "conf"
239
237
+ File .separatorChar
240
- + DATA_NODE_CONF_NAME ,
238
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
241
239
dnMapProperties );
242
240
} else if (nodeTypeParam .equalsIgnoreCase ("all" ) || nodeTypeParam .isEmpty ()) {
243
241
countConfigNodeFile (targetDirString .toString (), copyMap , cnMapProperties );
@@ -260,14 +258,14 @@ public static void main(String[] args) {
260
258
+ File .separatorChar
261
259
+ "conf"
262
260
+ File .separatorChar
263
- + CONFIG_NODE_CONF_NAME ,
261
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
264
262
cnMapProperties );
265
263
propertiesFileUpdate (
266
264
targetDirString .toString ()
267
265
+ File .separatorChar
268
266
+ "conf"
269
267
+ File .separatorChar
270
- + DATA_NODE_CONF_NAME ,
268
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
271
269
dnMapProperties );
272
270
}
273
271
@@ -293,7 +291,7 @@ public static void main(String[] args) {
293
291
+ File .separatorChar
294
292
+ "conf"
295
293
+ File .separatorChar
296
- + CONFIG_NODE_CONF_NAME ,
294
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
297
295
cnMapProperties );
298
296
} else if (nodeTypeParam .equalsIgnoreCase ("datanode" )) {
299
297
countNodeBack (targetDirString .toString (), copyMap );
@@ -313,7 +311,7 @@ public static void main(String[] args) {
313
311
+ File .separatorChar
314
312
+ "conf"
315
313
+ File .separatorChar
316
- + DATA_NODE_CONF_NAME ,
314
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
317
315
dnMapProperties );
318
316
} else if (nodeTypeParam .equalsIgnoreCase ("all" ) || nodeTypeParam .isEmpty ()) {
319
317
countNodeBack (targetDirString .toString (), copyMap );
@@ -335,14 +333,14 @@ public static void main(String[] args) {
335
333
+ File .separatorChar
336
334
+ "conf"
337
335
+ File .separatorChar
338
- + CONFIG_NODE_CONF_NAME ,
336
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
339
337
cnMapProperties );
340
338
propertiesFileUpdate (
341
339
targetDirString .toString ()
342
340
+ File .separatorChar
343
341
+ "conf"
344
342
+ File .separatorChar
345
- + DATA_NODE_CONF_NAME ,
343
+ + CommonConfig . SYSTEM_CONFIG_NAME ,
346
344
dnMapProperties );
347
345
}
348
346
}
@@ -444,10 +442,9 @@ private static void ioTDBDataBack(
444
442
445
443
private static void countNodeBack (String targetDirString , Map <String , String > copyMap ) {
446
444
File sourceDir = new File (sourcePath );
447
- Properties dataProperties = getProperties (IoTDBConfig .CONFIG_NAME );
448
- initDataNodeProperties (dataProperties );
449
- Properties configProperties = getProperties (CONFIG_NODE_CONF_NAME );
450
- initConfigNodeProperties (configProperties );
445
+ Properties properties = getProperties (CommonConfig .SYSTEM_CONFIG_NAME );
446
+ initDataNodeProperties (properties );
447
+ initConfigNodeProperties (properties );
451
448
452
449
copyMap .put (
453
450
sourceDir .getAbsolutePath () + File .separatorChar + ".env" ,
@@ -495,7 +492,7 @@ private static void countDataNodeFile(
495
492
Map <String , String > copyMap ,
496
493
Map <String , String > dnDataDirsMap ,
497
494
Map <String , String > dnMapProperties ) {
498
- Properties dataProperties = getProperties (IoTDBConfig . CONFIG_NAME );
495
+ Properties dataProperties = getProperties (CommonConfig . SYSTEM_CONFIG_NAME );
499
496
initDataNodeProperties (dataProperties );
500
497
501
498
String dnSystemDir = dataProperties .getProperty ("dn_system_dir" );
@@ -593,7 +590,7 @@ private static String isObjectStorage(String dnDataDirs) {
593
590
594
591
private static void countConfigNodeFile (
595
592
String targetDirString , Map <String , String > copyMap , Map <String , String > cnMapProperties ) {
596
- Properties configProperties = getProperties (CONFIG_NODE_CONF_NAME );
593
+ Properties configProperties = getProperties (CommonConfig . SYSTEM_CONFIG_NAME );
597
594
initConfigNodeProperties (configProperties );
598
595
599
596
String bakCnSystemDir = targetDirString + File .separatorChar + DEFAULT_CN_SYSTEM_DIR ;
0 commit comments