TyrantLucifer commented on code in PR #3558:
URL:
https://github.com/apache/incubator-seatunnel/pull/3558#discussion_r1031163271
##########
seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/sink/InfluxDBSinkWriter.java:
##########
@@ -131,21 +133,22 @@ public void flush() throws IOException {
for (int i = 0; i <= sinkConfig.getMaxRetries(); i++) {
try {
batchPoints.points(batchList);
- influxDB.write(batchPoints.build());
+ influxdb.write(batchPoints.build());
} catch (Exception e) {
log.error("Writing records to influxdb failed, retry times =
{}", i, e);
if (i >= sinkConfig.getMaxRetries()) {
- throw new IOException("Writing records to InfluxDB
failed.", e);
+ throw new
InfluxdbConnectorException(InfluxdbConnectorErrorCode.WRITING_RECORDS_FAILED,
+ "Writing records to InfluxDB 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
InfluxdbConnectorException(InfluxdbConnectorErrorCode.FLUSH_FAILED,
Review Comment:
CommonErrorCode.FLUSH_DATA_FAILED is better
--
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]