From 2926102025ed31185d2afa3f2531aa65b258aec9 Mon Sep 17 00:00:00 2001 From: Anqi Date: Fri, 21 Jan 2022 11:51:16 +0800 Subject: [PATCH] add check for pool init (#431) --- .../com/vesoft/nebula/examples/GraphClientExample.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java b/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java index 761994f69..e1bf026ac 100644 --- a/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java +++ b/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java @@ -91,7 +91,12 @@ public static void main(String[] args) { NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig(); nebulaPoolConfig.setMaxConnSize(100); List addresses = Arrays.asList(new HostAddress("127.0.0.1", 9669)); - pool.init(addresses, nebulaPoolConfig); + Boolean initResult = pool.init(addresses, nebulaPoolConfig); + if (!initResult) { + log.error("pool init failed."); + return; + } + session = pool.getSession("root", "nebula", false); { String createSchema = "CREATE SPACE IF NOT EXISTS test(vid_type=fixed_string(20)); "