From b9ec8dfa29458dc185da74dbf63fd730f5899262 Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Wed, 20 Nov 2024 16:06:53 +0800 Subject: [PATCH 1/7] The system shuts down automatically if the template creation fails. --- .../cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java | 2 ++ .../java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java | 5 +++++ .../iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index 84cb89b0d..a4a81f6db 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -22,6 +22,7 @@ import cn.edu.tsinghua.iot.benchmark.conf.Config; import cn.edu.tsinghua.iot.benchmark.conf.ConfigDescriptor; import cn.edu.tsinghua.iot.benchmark.measurement.Measurement; +import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import cn.edu.tsinghua.iot.benchmark.schema.MetaDataSchema; import cn.edu.tsinghua.iot.benchmark.schema.schemaImpl.DeviceSchema; import cn.edu.tsinghua.iot.benchmark.tsdb.DBConfig; @@ -92,6 +93,7 @@ public void run() { } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e); result = false; + BaseMode.flag = false; } } catch (Exception e) { LOGGER.error("Unexpected error: ", e); diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java index cdfbab85f..f7ec99113 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java @@ -66,6 +66,7 @@ public abstract class BaseMode { protected List dataClients = new ArrayList<>(); protected List schemaClients = new ArrayList<>(); protected Measurement baseModeMeasurement = new Measurement(); + public static volatile boolean flag = true; protected long startTime = 0; protected abstract boolean preCheck(); @@ -184,6 +185,10 @@ protected boolean registerSchema() { try { // wait for all dataClients finish test schemaDownLatch.await(); + if (!flag) { + LOGGER.error("Registering schema failed!"); + return false; + } schemaClients.stream() .map(SchemaClient::getMeasurement) .forEach(baseModeMeasurement::mergeCreateSchemaFinishTime); diff --git a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java index d5a4fe4b9..b84501deb 100644 --- a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java +++ b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java @@ -54,6 +54,7 @@ import java.util.Random; import java.util.Set; import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -88,7 +89,7 @@ public void registerSchema( Session templateSession = new ArrayList<>(sessionListMap.keySet()).get(sessionIndex); registerTemplate(templateSession, template); } - templateBarrier.await(); + templateBarrier.await(5, TimeUnit.SECONDS); for (Map.Entry> pair : sessionListMap.entrySet()) { registerDatabases(pair.getKey(), pair.getValue()); } From fd61fbc05689a7fe6da14bee9c59683a82ff8aa9 Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Fri, 22 Nov 2024 15:59:06 +0800 Subject: [PATCH 2/7] delete magic number --- .../cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java | 2 +- .../java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index a4a81f6db..d2443c1b7 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -93,7 +93,7 @@ public void run() { } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e); result = false; - BaseMode.flag = false; + BaseMode.stopAllSchemaClient = false; } } catch (Exception e) { LOGGER.error("Unexpected error: ", e); diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java index f7ec99113..8af3aba04 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java @@ -66,7 +66,7 @@ public abstract class BaseMode { protected List dataClients = new ArrayList<>(); protected List schemaClients = new ArrayList<>(); protected Measurement baseModeMeasurement = new Measurement(); - public static volatile boolean flag = true; + public static volatile boolean stopAllSchemaClient = true; protected long startTime = 0; protected abstract boolean preCheck(); @@ -185,7 +185,7 @@ protected boolean registerSchema() { try { // wait for all dataClients finish test schemaDownLatch.await(); - if (!flag) { + if (!stopAllSchemaClient) { LOGGER.error("Registering schema failed!"); return false; } From 6e90d16b43ef3590ab1b2289611bcaac86d671fc Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Mon, 25 Nov 2024 15:07:42 +0800 Subject: [PATCH 3/7] Resolve metadata registration deadlock issue in BM. --- .../iot/benchmark/client/SchemaClient.java | 2 - .../tsinghua/iot/benchmark/mode/BaseMode.java | 12 ++++- .../iotdb200/ModelStrategy/TreeStrategy.java | 51 ++++++++++++++----- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index d2443c1b7..84cb89b0d 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -22,7 +22,6 @@ import cn.edu.tsinghua.iot.benchmark.conf.Config; import cn.edu.tsinghua.iot.benchmark.conf.ConfigDescriptor; import cn.edu.tsinghua.iot.benchmark.measurement.Measurement; -import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import cn.edu.tsinghua.iot.benchmark.schema.MetaDataSchema; import cn.edu.tsinghua.iot.benchmark.schema.schemaImpl.DeviceSchema; import cn.edu.tsinghua.iot.benchmark.tsdb.DBConfig; @@ -93,7 +92,6 @@ public void run() { } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e); result = false; - BaseMode.stopAllSchemaClient = false; } } catch (Exception e) { LOGGER.error("Unexpected error: ", e); diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java index 8af3aba04..44b58d867 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java @@ -66,7 +66,7 @@ public abstract class BaseMode { protected List dataClients = new ArrayList<>(); protected List schemaClients = new ArrayList<>(); protected Measurement baseModeMeasurement = new Measurement(); - public static volatile boolean stopAllSchemaClient = true; + public static volatile boolean stopAllSchemaClient = false; protected long startTime = 0; protected abstract boolean preCheck(); @@ -185,7 +185,7 @@ protected boolean registerSchema() { try { // wait for all dataClients finish test schemaDownLatch.await(); - if (!stopAllSchemaClient) { + if (isStopAllSchemaClient()) { LOGGER.error("Registering schema failed!"); return false; } @@ -266,4 +266,12 @@ private static void measure( measurement.outputCSV(); } } + + public static boolean isStopAllSchemaClient() { + return stopAllSchemaClient; + } + + public static void setStopAllSchemaClient(boolean stopAllSchemaClient) { + BaseMode.stopAllSchemaClient = stopAllSchemaClient; + } } diff --git a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java index b84501deb..dc7da6897 100644 --- a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java +++ b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java @@ -19,6 +19,7 @@ package cn.edu.tsinghua.iot.benchmark.iotdb200.ModelStrategy; +import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import org.apache.iotdb.isession.template.Template; import org.apache.iotdb.rpc.IoTDBConnectionException; import org.apache.iotdb.rpc.StatementExecutionException; @@ -53,8 +54,8 @@ import java.util.Objects; import java.util.Random; import java.util.Set; +import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -80,32 +81,58 @@ public void registerSchema( Map> sessionListMap, List schemaList) throws TsdbException { try { - if (config.isTEMPLATE() && templateInit.compareAndSet(false, true)) { - Template template = null; - if (config.isTEMPLATE() && !schemaList.isEmpty()) { - template = createTemplate(schemaList.get(0)); + try { + if (config.isTEMPLATE() && templateInit.compareAndSet(false, true)) { + Template template = null; + if (config.isTEMPLATE() && !schemaList.isEmpty()) { + template = createTemplate(schemaList.get(0)); + } + int sessionIndex = random.nextInt(sessionListMap.size()); + Session templateSession = new ArrayList<>(sessionListMap.keySet()).get(sessionIndex); + registerTemplate(templateSession, template); + } + } finally { + templateBarrier.await(); + if (BaseMode.isStopAllSchemaClient()) { + return; } - int sessionIndex = random.nextInt(sessionListMap.size()); - Session templateSession = new ArrayList<>(sessionListMap.keySet()).get(sessionIndex); - registerTemplate(templateSession, template); } - templateBarrier.await(5, TimeUnit.SECONDS); - for (Map.Entry> pair : sessionListMap.entrySet()) { - registerDatabases(pair.getKey(), pair.getValue()); + try { + for (Map.Entry> pair : sessionListMap.entrySet()) { + registerDatabases(pair.getKey(), pair.getValue()); + } + } finally { + schemaBarrier.await(); + if (BaseMode.isStopAllSchemaClient()) { + return; + } } - schemaBarrier.await(); if (config.isTEMPLATE()) { for (Map.Entry> pair : sessionListMap.entrySet()) { activateTemplate(pair.getKey(), pair.getValue()); } activateTemplateBarrier.await(); + if (BaseMode.isStopAllSchemaClient()) { + return; + } } if (!config.isTEMPLATE()) { for (Map.Entry> pair : sessionListMap.entrySet()) { registerTimeSeries(pair.getKey(), pair.getValue()); } } + } catch (BrokenBarrierException exception) { + LOGGER.error("Barrier was broken", exception); + BaseMode.setStopAllSchemaClient(true); + templateBarrier.reset(); + throw new TsdbException(exception); + } catch (InterruptedException exception) { + Thread.currentThread().interrupt(); + LOGGER.warn("Thread was interrupted", exception); + BaseMode.setStopAllSchemaClient(true); + throw new TsdbException(exception); } catch (Exception e) { + BaseMode.setStopAllSchemaClient(true); throw new TsdbException(e); } } From febef214bd456b89946a0fbeec83a26a75d5a98e Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Mon, 25 Nov 2024 15:08:39 +0800 Subject: [PATCH 4/7] spotless:apply --- .../iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java index dc7da6897..219c268d8 100644 --- a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java +++ b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java @@ -19,7 +19,6 @@ package cn.edu.tsinghua.iot.benchmark.iotdb200.ModelStrategy; -import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import org.apache.iotdb.isession.template.Template; import org.apache.iotdb.rpc.IoTDBConnectionException; import org.apache.iotdb.rpc.StatementExecutionException; @@ -33,6 +32,7 @@ import cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDB; import cn.edu.tsinghua.iot.benchmark.iotdb200.TimeseriesSchema; import cn.edu.tsinghua.iot.benchmark.iotdb200.utils.IoTDBUtils; +import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import cn.edu.tsinghua.iot.benchmark.schema.schemaImpl.DeviceSchema; import cn.edu.tsinghua.iot.benchmark.tsdb.DBConfig; import cn.edu.tsinghua.iot.benchmark.tsdb.TsdbException; From ff69e7bd65637c6474418023484752c1413433f5 Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Mon, 25 Nov 2024 20:55:47 +0800 Subject: [PATCH 5/7] Fix bm not exiting --- .../iot/benchmark/client/SchemaClient.java | 8 ++-- .../tsinghua/iot/benchmark/mode/BaseMode.java | 27 ++++++------ .../iotdb200/ModelStrategy/TreeStrategy.java | 44 ++++++------------- 3 files changed, 33 insertions(+), 46 deletions(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index 84cb89b0d..3d00f3609 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -32,10 +32,11 @@ import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; -public class SchemaClient implements Runnable { +public class SchemaClient implements Callable { private static final Logger LOGGER = LoggerFactory.getLogger(SchemaClient.class); protected static Config config = ConfigDescriptor.getInstance().getConfig(); @@ -77,7 +78,7 @@ private void initDBWrappers() { } @Override - public void run() { + public Boolean call() { try { try { if (dbWrapper != null) { @@ -88,7 +89,7 @@ public void run() { // register try { - result = (null == dbWrapper.registerSchema(deviceSchemas)); + result = (null != dbWrapper.registerSchema(deviceSchemas)); } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e); result = false; @@ -106,6 +107,7 @@ public void run() { } } finally { countDownLatch.countDown(); + return result; } } diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java index 44b58d867..84b58f52f 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/mode/BaseMode.java @@ -38,8 +38,10 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; @@ -66,7 +68,6 @@ public abstract class BaseMode { protected List dataClients = new ArrayList<>(); protected List schemaClients = new ArrayList<>(); protected Measurement baseModeMeasurement = new Measurement(); - public static volatile boolean stopAllSchemaClient = false; protected long startTime = 0; protected abstract boolean preCheck(); @@ -177,17 +178,22 @@ protected boolean registerSchema() { SchemaClient schemaClient = new SchemaClient(i, schemaDownLatch, schemaBarrier); schemaClients.add(schemaClient); } + List> futures = new ArrayList<>(); for (SchemaClient schemaClient : schemaClients) { - schemaExecutorService.submit(schemaClient); + Future future = schemaExecutorService.submit(schemaClient); + futures.add(future); } startTime = System.nanoTime(); schemaExecutorService.shutdown(); try { // wait for all dataClients finish test schemaDownLatch.await(); - if (isStopAllSchemaClient()) { - LOGGER.error("Registering schema failed!"); - return false; + for (Future future : futures) { + Boolean result = future.get(); + if (!result) { + LOGGER.error("Registering schema failed!"); + return false; + } } schemaClients.stream() .map(SchemaClient::getMeasurement) @@ -195,6 +201,9 @@ protected boolean registerSchema() { } catch (InterruptedException e) { LOGGER.error("Exception occurred during waiting for all threads finish.", e); Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + LOGGER.error("Exception occurred during getting result of tasks.", e); + Thread.currentThread().interrupt(); } LOGGER.info("Registering schema successful!"); MetaDataSchema.clearSchemaClientDataSchema(); @@ -266,12 +275,4 @@ private static void measure( measurement.outputCSV(); } } - - public static boolean isStopAllSchemaClient() { - return stopAllSchemaClient; - } - - public static void setStopAllSchemaClient(boolean stopAllSchemaClient) { - BaseMode.stopAllSchemaClient = stopAllSchemaClient; - } } diff --git a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java index 219c268d8..b30b30570 100644 --- a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java +++ b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java @@ -81,40 +81,25 @@ public void registerSchema( Map> sessionListMap, List schemaList) throws TsdbException { try { - try { - if (config.isTEMPLATE() && templateInit.compareAndSet(false, true)) { - Template template = null; - if (config.isTEMPLATE() && !schemaList.isEmpty()) { - template = createTemplate(schemaList.get(0)); - } - int sessionIndex = random.nextInt(sessionListMap.size()); - Session templateSession = new ArrayList<>(sessionListMap.keySet()).get(sessionIndex); - registerTemplate(templateSession, template); - } - } finally { - templateBarrier.await(); - if (BaseMode.isStopAllSchemaClient()) { - return; + if (config.isTEMPLATE() && templateInit.compareAndSet(false, true)) { + Template template = null; + if (config.isTEMPLATE() && !schemaList.isEmpty()) { + template = createTemplate(schemaList.get(0)); } + int sessionIndex = random.nextInt(sessionListMap.size()); + Session templateSession = new ArrayList<>(sessionListMap.keySet()).get(sessionIndex); + registerTemplate(templateSession, template); } - try { - for (Map.Entry> pair : sessionListMap.entrySet()) { - registerDatabases(pair.getKey(), pair.getValue()); - } - } finally { - schemaBarrier.await(); - if (BaseMode.isStopAllSchemaClient()) { - return; - } + templateBarrier.await(); + for (Map.Entry> pair : sessionListMap.entrySet()) { + registerDatabases(pair.getKey(), pair.getValue()); } + schemaBarrier.await(); if (config.isTEMPLATE()) { for (Map.Entry> pair : sessionListMap.entrySet()) { activateTemplate(pair.getKey(), pair.getValue()); } activateTemplateBarrier.await(); - if (BaseMode.isStopAllSchemaClient()) { - return; - } } if (!config.isTEMPLATE()) { for (Map.Entry> pair : sessionListMap.entrySet()) { @@ -123,16 +108,15 @@ public void registerSchema( } } catch (BrokenBarrierException exception) { LOGGER.error("Barrier was broken", exception); - BaseMode.setStopAllSchemaClient(true); - templateBarrier.reset(); throw new TsdbException(exception); } catch (InterruptedException exception) { Thread.currentThread().interrupt(); LOGGER.warn("Thread was interrupted", exception); - BaseMode.setStopAllSchemaClient(true); throw new TsdbException(exception); } catch (Exception e) { - BaseMode.setStopAllSchemaClient(true); + templateBarrier.reset(); + schemaBarrier.reset(); + activateTemplateBarrier.reset(); throw new TsdbException(e); } } From 6b2bf3eda3d7f97c551893cc47f30934d88c55b7 Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Mon, 25 Nov 2024 21:02:02 +0800 Subject: [PATCH 6/7] spotless:apply --- .../java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java | 1 + .../iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index 3d00f3609..e86b04dc7 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -89,6 +89,7 @@ public Boolean call() { // register try { + // When the return value is non-empty, the registerSchema is successful. result = (null != dbWrapper.registerSchema(deviceSchemas)); } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e); diff --git a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java index b30b30570..5af0fc95e 100644 --- a/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java +++ b/iotdb-2.0/src/main/java/cn/edu/tsinghua/iot/benchmark/iotdb200/ModelStrategy/TreeStrategy.java @@ -32,7 +32,6 @@ import cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDB; import cn.edu.tsinghua.iot.benchmark.iotdb200.TimeseriesSchema; import cn.edu.tsinghua.iot.benchmark.iotdb200.utils.IoTDBUtils; -import cn.edu.tsinghua.iot.benchmark.mode.BaseMode; import cn.edu.tsinghua.iot.benchmark.schema.schemaImpl.DeviceSchema; import cn.edu.tsinghua.iot.benchmark.tsdb.DBConfig; import cn.edu.tsinghua.iot.benchmark.tsdb.TsdbException; From 53f073494c8398c19896119ce7a487bd9528dc56 Mon Sep 17 00:00:00 2001 From: Yangyuming <2822758820@qq.com> Date: Mon, 25 Nov 2024 21:18:04 +0800 Subject: [PATCH 7/7] spotless:apply --- .../java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java index e86b04dc7..409ee466e 100644 --- a/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java +++ b/core/src/main/java/cn/edu/tsinghua/iot/benchmark/client/SchemaClient.java @@ -89,7 +89,7 @@ public Boolean call() { // register try { - // When the return value is non-empty, the registerSchema is successful. + // When the return value is not null, the registerSchema is successful. result = (null != dbWrapper.registerSchema(deviceSchemas)); } catch (TsdbException e) { LOGGER.error("Register {} schema failed because ", config.getNET_DEVICE(), e);