From 24817a347f1b18497bc5a7b8c263e7545eb8a546 Mon Sep 17 00:00:00 2001 From: liyuheng Date: Thu, 21 Sep 2023 12:16:43 +0800 Subject: [PATCH] insertByTablet execute synchronize --- .../benchmark/iotdb110/IoTDBSessionBase.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/iotdb-1.1/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb110/IoTDBSessionBase.java b/iotdb-1.1/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb110/IoTDBSessionBase.java index 01c474ffd..a4a8f6d47 100644 --- a/iotdb-1.1/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb110/IoTDBSessionBase.java +++ b/iotdb-1.1/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb110/IoTDBSessionBase.java @@ -71,20 +71,16 @@ public IoTDBSessionBase(DBConfig dbConfig) { public Status insertOneBatchByTablet(IBatch batch) { Tablet tablet = genTablet(batch); - future = - service.submit( - () -> { - try { - if (config.isVECTOR()) { - sessionWrapper.insertAlignedTablet(tablet); - } else { - sessionWrapper.insertTablet(tablet); - } - } catch (IoTDBConnectionException | StatementExecutionException e) { - LOGGER.error("insert tablet failed", e); - } - }); - return waitFuture(); + try { + if (config.isVECTOR()) { + sessionWrapper.insertAlignedTablet(tablet); + } else { + sessionWrapper.insertTablet(tablet); + } + return new Status(true); + } catch (IoTDBConnectionException | StatementExecutionException e) { + return new Status(false, 0, e, e.toString()); + } } public Status insertOneBatchByRecord(IBatch batch) {