in backup-command/src/main/java/org/apache/iotdb/backup/command/ExportTool.java [168:246]
private static void parseSpecialParams(CommandLine commandLine)
throws ArgsErrorException, ParamCheckException {
fileFloder = checkRequiredArg(FILE_FLODER_ARGS, FILE_FLODER_NAME, commandLine);
iotPath = checkRequiredArg(IOT_PATH_ARGS, IOT_PATH_NAME, commandLine);
// timeFormat = commandLine.getOptionValue(TIME_FORMAT_ARGS);
// if (timeFormat == null) {
// timeFormat = "default";
// }
timeZoneID = commandLine.getOptionValue(TIME_ZONE_ARGS);
if (!fileFloder.endsWith("/") && !fileFloder.endsWith("\\")) {
fileFloder += File.separator;
}
String compressAlgorithm = commandLine.getOptionValue(COMPRESS_ARGS);
if ("snappy".equals(compressAlgorithm)) {
compressEnum = CompressEnum.SNAPPY;
} else if ("gzip".equals(compressAlgorithm)) {
compressEnum = CompressEnum.GZIP;
} else if ("sql".equals(compressAlgorithm)) {
compressEnum = CompressEnum.SQL;
} else if ("lz4".equals(compressAlgorithm)) {
compressEnum = CompressEnum.LZ4;
} else if ("tsfile".equals(compressAlgorithm)) {
compressEnum = CompressEnum.TSFILE;
} else {
compressEnum = CompressEnum.CSV;
}
String whereClauseAlgorithm = commandLine.getOptionValue(WHERE_CLASUSE_ARGS);
if (whereClauseAlgorithm == null || "".equals(whereClauseAlgorithm)) {
whereClause = "";
} else {
whereClause = whereClauseAlgorithm;
}
String charSetAlgorithm = commandLine.getOptionValue(CHAR_SET_ARGS);
if (charSetAlgorithm == null || "".equals(charSetAlgorithm)) {
charSet = "utf8";
} else {
charSet = charSetAlgorithm;
}
String fileSinkStrategyAlgorithm = commandLine.getOptionValue(FILE_SINK_STRATEGY_ARGS);
if (fileSinkStrategyAlgorithm == null || "".equals(fileSinkStrategyAlgorithm)) {
fileSinkStrategy = FileSinkStrategyEnum.EXTRA_CATALOG;
} else if ("file".equals(fileSinkStrategyAlgorithm.trim())) {
fileSinkStrategy = FileSinkStrategyEnum.PATH_FILENAME;
} else {
fileSinkStrategy = FileSinkStrategyEnum.EXTRA_CATALOG;
}
String needTimeseriesStructureAlgorithm =
commandLine.getOptionValue(NEED_TIMESERIES_STRUCTURE_ARGS);
if (needTimeseriesStructureAlgorithm == null || "".equals(needTimeseriesStructureAlgorithm)) {
needTimeseriesStructure = true;
} else if ("true".equals(needTimeseriesStructureAlgorithm.trim())) {
needTimeseriesStructure = true;
} else {
needTimeseriesStructure = false;
}
String virualSGAlgorithm = commandLine.getOptionValue(VIRTUAL_STORAGE_GROUP_NUM_ARGS);
if (virualSGAlgorithm == null || "".equals(virualSGAlgorithm)) {
virtualStoragroupNum = 0;
} else {
virualSGAlgorithm = virualSGAlgorithm.trim();
virtualStoragroupNum = Integer.parseInt(virualSGAlgorithm);
}
String partitionIntervalAlgorithm = commandLine.getOptionValue(PARTITION_INTERVAL_ARGS);
if (partitionIntervalAlgorithm == null || "".equals(partitionIntervalAlgorithm)) {
partitionInterval = 0;
} else {
partitionIntervalAlgorithm = partitionIntervalAlgorithm.trim();
partitionInterval = Long.parseLong(partitionIntervalAlgorithm);
}
}