Skip to content

Commit 77c9cd3

Browse files
committed
clean-sit
1 parent 20095a1 commit 77c9cd3

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/client/ClientRunner.java

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public class ClientRunner {
5050
Security.addProvider(new BouncyCastleProvider());
5151
}
5252

53-
private final CompletableFuture<OpcUaClient> future = new CompletableFuture<>();
54-
5553
private final IoTDBOpcUaClient configurableUaClient;
5654
private final Path securityDir;
5755
private final String password;
@@ -104,29 +102,15 @@ public void run() {
104102
try {
105103
final OpcUaClient client = createClient();
106104

107-
future.whenCompleteAsync(
108-
(c, ex) -> {
109-
if (ex != null) {
110-
logger.warn("Error running opc client: ", ex);
111-
}
112-
113-
try {
114-
client.disconnect().get();
115-
} catch (final InterruptedException | ExecutionException e) {
116-
Thread.currentThread().interrupt();
117-
logger.warn("Error disconnecting: ", e);
118-
}
119-
});
120-
121105
try {
122106
configurableUaClient.run(client);
123-
future.get(
124-
PipeConfig.getInstance().getPipeConnectorHandshakeTimeoutMs(), TimeUnit.MICROSECONDS);
125107
} catch (final Exception e) {
126-
throw new PipeException("Error running opc client: " + e.getMessage());
108+
throw new PipeException(
109+
"Error running opc client: " + e.getClass().getSimpleName() + ": " + e.getMessage());
127110
}
128111
} catch (final Exception e) {
129-
throw new PipeException("Error getting opc client: " + e.getMessage());
112+
throw new PipeException(
113+
"Error getting opc client: " + e.getClass().getSimpleName() + ": " + e.getMessage());
130114
}
131115
}
132116
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/client/IoTDBKeyStoreLoaderClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ IoTDBKeyStoreLoaderClient load(final Path baseDir, final char[] password) throws
6666
.setOrganizationalUnit("dev")
6767
.setLocalityName("Beijing")
6868
.setStateName("China")
69-
.setCountryCode("UN")
69+
.setCountryCode("CN")
7070
.setApplicationUri("urn:apache:iotdb:opc-ua-client")
7171
.addDnsName("localhost")
7272
.addIpAddress("127.0.0.1");

0 commit comments

Comments
 (0)