wuchunfu commented on code in PR #3557:
URL:
https://github.com/apache/incubator-seatunnel/pull/3557#discussion_r1031165462
##########
seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/sink/IoTDBSinkClient.java:
##########
@@ -144,30 +148,31 @@ synchronized void flush() throws IOException {
try {
if (batchRecords.getTypesList().isEmpty()) {
session.insertRecords(batchRecords.getDeviceIds(),
- batchRecords.getTimestamps(),
- batchRecords.getMeasurementsList(),
- batchRecords.getStringValuesList());
+ batchRecords.getTimestamps(),
+ batchRecords.getMeasurementsList(),
+ batchRecords.getStringValuesList());
} else {
session.insertRecords(batchRecords.getDeviceIds(),
- batchRecords.getTimestamps(),
- batchRecords.getMeasurementsList(),
- batchRecords.getTypesList(),
- batchRecords.getValuesList());
+ batchRecords.getTimestamps(),
+ batchRecords.getMeasurementsList(),
+ batchRecords.getTypesList(),
+ batchRecords.getValuesList());
}
} catch (IoTDBConnectionException | StatementExecutionException e)
{
log.error("Writing records to IoTDB failed, retry times = {}",
i, e);
if (i >= sinkConfig.getMaxRetries()) {
- throw new IOException("Writing records to IoTDB failed.",
e);
+ throw new
IotdbConnectorException(IotdbConnectorErrorCode.WRITING_RECORDS_FAILED,
+ "Writing records to IoTDB failed.", e);
}
try {
long backoff =
Math.min(sinkConfig.getRetryBackoffMultiplierMs() * i,
- sinkConfig.getMaxRetryBackoffMs());
+ sinkConfig.getMaxRetryBackoffMs());
Thread.sleep(backoff);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
- throw new IOException(
- "Unable to flush; interrupted while doing another
attempt.", e);
+ throw new
IotdbConnectorException(IotdbConnectorErrorCode.FLUSH_RECORDS_FAILED,
Review Comment:
Done, Thank you for your reminder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]