Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ com.google.j2objc:j2objc-annotations:2.8
com.zaxxer:HikariCP:2.4.7
commons-cli:commons-cli:1.5.0
commons-codec:commons-codec:1.16.1
io.airlift:airline:0.9
io.airlift:units:1.7
io.dropwizard.metrics:metrics-core:4.2.19
io.micrometer:micrometer-commons:1.11.4
Expand Down
1 change: 0 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"commons-cli:commons-cli",
"commons-codec:commons-codec",
"commons-logging:commons-logging",
"io.airlift:airline",
"io.airlift:units",
"io.dropwizard.metrics:metrics-core",
"io.github.classgraph:classgraph",
Expand Down
4 changes: 0 additions & 4 deletions iotdb-core/datanode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,6 @@
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1642,15 +1642,6 @@ private DataNodeMiscMessages() {}
"Request name: TSFastLastDataQueryForOneDeviceReq, db: %s, deviceId: %s, sensorSize: %s,"
+ " sensors: %s";

public static final String LOG_NODE_TOOL_ARG_076E307A = "node-tool: %s";

public static final String LOG_SEE_NODE_TOOL_HELP_OR_NODE_TOOL_HELP_COMMAND_BB9F5146 =
"See 'node-tool help' or 'node-tool help <command>'.";

public static final String LOG_ERROR_ARG_76028BAA = "error: %s";

public static final String LOG_STACKTRACE_131CBB85 = "-- StackTrace --";

public static final String
EXCEPTION_FAILED_TO_REGISTERED_TRIGGER_ARG_BECAUSE_EXISTED_MD5_OF_JAR_FILE_FOR_TRIGGER_ARG_IS_DIFFERENT_FROM_THE_NEW_JAR_FILE_4069F2F9 =
"Failed to registered trigger %s, because existed md5 of jar file for trigger %s is"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1620,15 +1620,6 @@ private DataNodeMiscMessages() {}
EXCEPTION_REQUEST_NAME_TSFASTLASTDATAQUERYFORONEDEVICEREQ_DB_ARG_DEVICEID_ARG_SENSORSIZE_ARG_SENSORS_ARG_D1F9A498 =
"请求名称:TSFastLastDataQueryForOneDeviceReq,数据库:%s,deviceId:%s,传感器数:%s,传感器:%s";

public static final String LOG_NODE_TOOL_ARG_076E307A = "node-tool:%s";

public static final String LOG_SEE_NODE_TOOL_HELP_OR_NODE_TOOL_HELP_COMMAND_BB9F5146 =
"参见 'node-tool help' 或 'node-tool help <command>'。";

public static final String LOG_ERROR_ARG_76028BAA = "错误:%s";

public static final String LOG_STACKTRACE_131CBB85 = "-- 堆栈跟踪 --";

public static final String
EXCEPTION_FAILED_TO_REGISTERED_TRIGGER_ARG_BECAUSE_EXISTED_MD5_OF_JAR_FILE_FOR_TRIGGER_ARG_IS_DIFFERENT_FROM_THE_NEW_JAR_FILE_4069F2F9 =
"注册触发器 %s 失败,因为触发器 %s 已有的 jar 文件 md5 与新 jar 文件不同。 ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@
import org.apache.iotdb.service.rpc.thrift.TSLastDataQueryReq;
import org.apache.iotdb.service.rpc.thrift.TSRawDataQueryReq;

import com.google.common.base.Throwables;
import io.airlift.airline.Cli;
import io.airlift.airline.Help;
import io.airlift.airline.ParseArgumentsMissingException;
import io.airlift.airline.ParseArgumentsUnexpectedException;
import io.airlift.airline.ParseCommandMissingException;
import io.airlift.airline.ParseCommandUnrecognizedException;
import io.airlift.airline.ParseOptionConversionException;
import io.airlift.airline.ParseOptionMissingException;
import io.airlift.airline.ParseOptionMissingValueException;
import org.apache.tsfile.block.column.Column;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.external.commons.lang3.StringUtils;
Expand All @@ -59,13 +49,10 @@
import org.apache.tsfile.read.common.type.Type;

import java.time.ZoneId;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

import static org.apache.iotdb.db.utils.TypeServices.ValueConversion.VALUE_PARSER_SERVICE;

@SuppressWarnings("java:S106") // for console outputs
public class CommonUtils {

private static final int MAX_SLOW_NATIVE_API_OUTPUT_NUM = 10;
Expand Down Expand Up @@ -211,39 +198,6 @@ public static String getContentOfTSFastLastDataQueryForOneDeviceReq(
req.getSensors());
}

public static int runCli(
List<Class<? extends Runnable>> commands,
String[] args,
String cliName,
String cliDescription) {
Cli.CliBuilder<Runnable> builder = Cli.builder(cliName);

builder.withDescription(cliDescription).withDefaultCommand(Help.class).withCommands(commands);

Cli<Runnable> parser = builder.build();

int status = 0;
try {
Runnable parse = parser.parse(args);
parse.run();
} catch (IllegalArgumentException
| IllegalStateException
| ParseArgumentsMissingException
| ParseArgumentsUnexpectedException
| ParseOptionConversionException
| ParseOptionMissingException
| ParseOptionMissingValueException
| ParseCommandMissingException
| ParseCommandUnrecognizedException e) {
badUse(e);
status = 1;
} catch (Exception e) {
err(Throwables.getRootCause(e));
status = 2;
}
return status;
}

/**
* Converts a string into a byte array based on the encoding format (hex or escape).
*
Expand All @@ -260,22 +214,6 @@ public static byte[] parseBlobStringToByteArray(String input) throws IllegalArgu
}
}

private static void badUse(Exception e) {
System.out.println(
String.format(
DataNodeMiscMessages.LOG_NODE_TOOL_ARG_076E307A, Objects.toString(e.getMessage())));
System.out.println(
DataNodeMiscMessages.LOG_SEE_NODE_TOOL_HELP_OR_NODE_TOOL_HELP_COMMAND_BB9F5146);
}

private static void err(Throwable e) {
System.err.println(
String.format(
DataNodeMiscMessages.LOG_ERROR_ARG_76028BAA, Objects.toString(e.getMessage())));
System.err.println(DataNodeMiscMessages.LOG_STACKTRACE_131CBB85);
System.err.println(Throwables.getStackTraceAsString(e));
}

public static String[] deviceIdToStringArray(IDeviceID deviceID) {
String[] ret = new String[deviceID.segmentNum()];
for (int i = 0; i < ret.length; i++) {
Expand Down
13 changes: 0 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<airlift-units.version>1.7</airlift-units.version>
<airlift.version>206</airlift.version>
<!--airlift-stats.version>235</airlift-stats.version-->
<airline.version>0.9</airline.version>
<antlr4.version>4.13.2</antlr4.version>
<!-- By default, the argLine is empty-->
<argLine/>
Expand Down Expand Up @@ -354,18 +353,6 @@
<artifactId>units</artifactId>
<version>${airlift-units.version}</version>
</dependency>
<!-- TODO: Deprecated: Use Airline 2 or Picocli instead -->
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>
<version>${airline.version}</version>
<exclusions>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
Expand Down
Loading