From 7902db41b229786ab6e53d48ce75f042b1c4e010 Mon Sep 17 00:00:00 2001 From: Hishida Masato Date: Thu, 6 Jun 2024 11:04:18 +0900 Subject: [PATCH] feat: Update error message in TsurugidbWatcher and disabled default --- .../src/dist/bin/example-tsurugi.properties | 1 + .../src/dist/cb/cb.tsurugi.large1.online_ltx.properties | 1 + .../src/dist/cb/cb.tsurugi.large1.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.large1.online_occ.properties | 1 + .../src/dist/cb/cb.tsurugi.large1.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.large1.properties | 1 + .../src/dist/cb/cb.tsurugi.large10.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.large10.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.large10.properties | 1 + .../dist/cb/cb.tsurugi.large100.online_mix.properties | 1 + .../dist/cb/cb.tsurugi.large100.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.large100.properties | 1 + .../src/dist/cb/cb.tsurugi.large50.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.large50.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.large50.properties | 1 + .../src/dist/cb/cb.tsurugi.medium.online_ltx.properties | 1 + .../src/dist/cb/cb.tsurugi.medium.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.medium.online_occ.properties | 1 + .../src/dist/cb/cb.tsurugi.medium.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.medium.properties | 1 + .../src/dist/cb/cb.tsurugi.small.online_ltx.properties | 1 + .../src/dist/cb/cb.tsurugi.small.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.small.online_occ.properties | 1 + .../src/dist/cb/cb.tsurugi.small.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.small.properties | 1 + .../src/dist/cb/cb.tsurugi.tiny.online_ltx.properties | 1 + .../src/dist/cb/cb.tsurugi.tiny.online_mix.properties | 1 + .../src/dist/cb/cb.tsurugi.tiny.online_occ.properties | 1 + .../src/dist/cb/cb.tsurugi.tiny.online_var.properties | 1 + .../src/dist/cb/cb.tsurugi.tiny.properties | 1 + .../benchmark/costaccounting/batch/BatchConfig.java | 9 +++++++++ .../costaccounting/batch/command/BatchCbCommand.java | 3 ++- .../benchmark/costaccounting/online/OnlineConfig.java | 9 +++++++++ .../costaccounting/online/command/OnlineCbCommand.java | 3 ++- .../benchmark/costaccounting/util/BenchConst.java | 4 ++++ .../costaccounting/watcher/TsurugidbWatcher.java | 5 ++++- .../costaccounting/watcher/TsurugidbWatcherService.java | 4 ++-- 37 files changed, 62 insertions(+), 5 deletions(-) diff --git a/java/cost-accounting-benchmark/src/dist/bin/example-tsurugi.properties b/java/cost-accounting-benchmark/src/dist/bin/example-tsurugi.properties index b5804844..2ceea92d 100755 --- a/java/cost-accounting-benchmark/src/dist/bin/example-tsurugi.properties +++ b/java/cost-accounting-benchmark/src/dist/bin/example-tsurugi.properties @@ -3,6 +3,7 @@ tsurugi.endpoint=ipc:tsurugi #tsurugi.endpoint=tcp://localhost:12345 tsurugi.user=cost-accounting tsurugi.password=cost-accounting +tsurugi.watcher.enable=false ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_ltx.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_ltx.properties index c013d901..97cb0e27 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_ltx.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_ltx.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_mix.properties index d88bd6ee..1067e58d 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_occ.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_occ.properties index d96b184c..14f5fc38 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_occ.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_occ.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_var.properties index 1c216457..4821df58 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.properties index 77cf9321..d88c5818 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large1.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_mix.properties index 1750cf93..a1760b0d 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_var.properties index 53c2f063..978245e4 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.properties index c272188d..6750ab63 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large10.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_mix.properties index 170c00e9..864924c5 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_var.properties index 5da442e2..0e340fc8 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.properties index 998cf90a..d3813417 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large100.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_mix.properties index dc8a1396..46c16a88 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_var.properties index cd32669d..d5481ee2 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.properties index 21af786f..1735baf4 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.large50.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_ltx.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_ltx.properties index 2f55e0ee..5c67f0d2 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_ltx.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_ltx.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_mix.properties index 070388b8..fbceb966 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_occ.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_occ.properties index 2b994825..ced92879 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_occ.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_occ.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_var.properties index 4b63f13f..570e4418 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.properties index 1d0c29d7..27b9a476 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.medium.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_ltx.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_ltx.properties index 005086eb..a5da13b7 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_ltx.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_ltx.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_mix.properties index a6ce0d96..a5cb5024 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_occ.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_occ.properties index 15da42df..cec4ed8f 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_occ.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_occ.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_var.properties index ef704598..26f3e831 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.properties index aa21a238..a5dfa227 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.small.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_ltx.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_ltx.properties index 11d6df6c..c4315603 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_ltx.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_ltx.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_mix.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_mix.properties index 0636e230..67f5a3f7 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_mix.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_mix.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_occ.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_occ.properties index 3e3fb7db..014da873 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_occ.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_occ.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_var.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_var.properties index 557eb254..e64c2241 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_var.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.online_var.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.properties b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.properties index bb0d46ec..b695e84c 100755 --- a/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.properties +++ b/java/cost-accounting-benchmark/src/dist/cb/cb.tsurugi.tiny.properties @@ -3,6 +3,7 @@ dbms.type=tsurugi tsurugi.endpoint=ipc:tsurugi tsurugi.user=cbdb tsurugi.password=cbdb +tsurugi.watcher.enable=true ## initial data diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/BatchConfig.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/BatchConfig.java index 1698905f..0aac2b26 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/BatchConfig.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/BatchConfig.java @@ -26,6 +26,7 @@ public class BatchConfig { private int threadSize; private final int commitRatio; private IsolationLevel isolationLevel; + private boolean enableTsurugidbWatcher = false; private TgTxOption defaultTxOption; private Map txOptionMap; private BatchFactoryOrder batchFactoryOrder = BatchFactoryOrder.NONE; @@ -118,6 +119,14 @@ public IsolationLevel getIsolationLevel() { return this.isolationLevel; } + public void setEnableTsurugidbWatcher(boolean enableTsurugidbWatcher) { + this.enableTsurugidbWatcher = enableTsurugidbWatcher; + } + + public boolean enableTsurugidbWatcher() { + return this.enableTsurugidbWatcher; + } + public void setTxOptions(String txOptionProperty) { String s = txOptionProperty.toUpperCase(); diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/command/BatchCbCommand.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/command/BatchCbCommand.java index 7c7b9bf4..a060e39e 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/command/BatchCbCommand.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/batch/command/BatchCbCommand.java @@ -98,6 +98,7 @@ public int executeCommand(String... args) throws Exception { config.setDefaultTxOption(getOption(txOption)); config.setBatchFactoryOrder(BenchConst.getBatchCommandFactoryOrder()); config.setThreadSize(threadSize); + config.setEnableTsurugidbWatcher(BenchConst.tsurugiWatcherEnable()); OnlineConfig onlineConfig = null; if (withOnline) { @@ -145,7 +146,7 @@ private int execute1(int id, BatchConfig config, OnlineConfig onlineConfig, int int exitCode; TsurugidbWatcher watcher; - try (var watcherService = TsurugidbWatcherService.of()) { + try (var watcherService = TsurugidbWatcherService.of(config.enableTsurugidbWatcher())) { watcher = watcherService.start(); exitCode = execute1Main(config, onlineConfig, attempt, records); } diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/OnlineConfig.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/OnlineConfig.java index e0297655..37561925 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/OnlineConfig.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/OnlineConfig.java @@ -23,6 +23,7 @@ public class OnlineConfig { private IsolationLevel isolationLevel; private boolean isMultiSession = true; private int coverRate = 100; + private boolean enableTsurugidbWatcher = false; private final Map optionMap = new HashMap<>(); private final Map threadSizeMap = new HashMap<>(); private int executeTime; @@ -82,6 +83,14 @@ public String getCoverRateForReport(String taskName) { return "-"; } + public void setEnableTsurugidbWatcher(boolean enableTsurugidbWatcher) { + this.enableTsurugidbWatcher = enableTsurugidbWatcher; + } + + public boolean enableTsurugidbWatcher() { + return this.enableTsurugidbWatcher; + } + public void setTxOption(String taskName, String option) { optionMap.put(taskName, option); } diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/command/OnlineCbCommand.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/command/OnlineCbCommand.java index f99b008b..22dd0e0c 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/command/OnlineCbCommand.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/online/command/OnlineCbCommand.java @@ -68,6 +68,7 @@ public int executeCommand(String... args) throws Exception { config.setCoverRate(coverRate); setTxOption(config, txOption); config.setExecuteTime(executeTime); + config.setEnableTsurugidbWatcher(BenchConst.tsurugiWatcherEnable()); exitCode |= execute1(config, i, records); @@ -121,7 +122,7 @@ private int execute1(OnlineConfig config, int attempt, List record int exitCode; TsurugidbWatcher watcher; - try (var watcherService = TsurugidbWatcherService.of()) { + try (var watcherService = TsurugidbWatcherService.of(config.enableTsurugidbWatcher())) { watcher = watcherService.start(); exitCode = execute1Main(config, attempt, records); } diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/util/BenchConst.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/util/BenchConst.java index eb9e4657..1ad1d113 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/util/BenchConst.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/util/BenchConst.java @@ -54,6 +54,10 @@ public static String tsurugiPassword() { return getProperty("tsurugi.password"); } + public static boolean tsurugiWatcherEnable() { + return getPropertyBoolean("tsurugi.watcher.enable", false); + } + public static String docDir() { return getProperty("doc.dir"); } diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcher.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcher.java index 6e676ca7..a724063b 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcher.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcher.java @@ -48,7 +48,10 @@ public void run() { } } } catch (IOException e) { - String msg = "Unable to retrieve memory info for tsurugidb. It is possible that the server has crashed."; + String msg = String.format( // + "Failed to access the process status file for tsurugidb at %s: " + // + "The server might be shut down. Check server status and logs.", // + path.toString()); // LOG.error(msg, e); throw new UncheckedIOException(e); } diff --git a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcherService.java b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcherService.java index b818ccbe..8d9cdc28 100755 --- a/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcherService.java +++ b/java/cost-accounting-benchmark/src/main/java/com/tsurugidb/benchmark/costaccounting/watcher/TsurugidbWatcherService.java @@ -26,9 +26,9 @@ public class TsurugidbWatcherService implements AutoCloseable { private ExecutorService service; private Future future; - public static TsurugidbWatcherService of() { + public static TsurugidbWatcherService of(boolean enableTsurugidbWatcher) { TsurugidbWatcher task = null; - if (BenchConst.dbmsType() == DbmsType.TSURUGI) { + if (BenchConst.dbmsType() == DbmsType.TSURUGI && enableTsurugidbWatcher) { int pid = findServerPid(); task = new TsurugidbWatcher(pid); }