From 32904690f9f516bd1894ccefad22e96b84cb12e3 Mon Sep 17 00:00:00 2001 From: Yee <2520865+yixinglu@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:09:59 +0800 Subject: [PATCH] Set default value when there's no option in config file (#82) * getOrDefault * Fix printErrors --- .../snb/impls/workloads/nebula/NebulaDbConnectionState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nebula/src/main/java/org/ldbcouncil/snb/impls/workloads/nebula/NebulaDbConnectionState.java b/nebula/src/main/java/org/ldbcouncil/snb/impls/workloads/nebula/NebulaDbConnectionState.java index 1655e302c..488e247e6 100644 --- a/nebula/src/main/java/org/ldbcouncil/snb/impls/workloads/nebula/NebulaDbConnectionState.java +++ b/nebula/src/main/java/org/ldbcouncil/snb/impls/workloads/nebula/NebulaDbConnectionState.java @@ -38,8 +38,8 @@ public NebulaDbConnectionState(Map properties, NebulaQueryStore password = properties.get("password"); String endPoint = properties.get("endpoint"); spaceName = properties.get("spaceName"); - printErrors = Boolean.parseBoolean(properties.get("printErrors")); - int maxConnSize = Integer.parseInt(properties.get("max_conn_size")); + printErrors = Boolean.parseBoolean(properties.getOrDefault("printErrors", "false")); + int maxConnSize = Integer.parseInt(properties.getOrDefault("max_conn_size", "500")); NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig(); nebulaPoolConfig.setMaxConnSize(maxConnSize);