diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java index d5097ad6..19df1df8 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaClient.java @@ -457,11 +457,11 @@ public synchronized Set listHosts() { } } catch (TException e) { LOGGER.error("listHosts error", e); - return null; + throw new RuntimeException("listHosts error", e); } if (resp.getCode() != ErrorCode.SUCCEEDED) { LOGGER.error("listHosts execute failed, errorCode: " + resp.getCode()); - return null; + throw new RuntimeException("listHosts execute failed, errorCode:" + resp.getCode()); } Set hostAddrs = new HashSet<>(); for (HostItem hostItem : resp.hosts) { diff --git a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java index 5e2da04b..ba1506ef 100644 --- a/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java +++ b/client/src/main/java/com/vesoft/nebula/client/meta/MetaManager.java @@ -393,9 +393,6 @@ public void updateLeader(String spaceName, int part, HostAddr newLeader) */ public Set listHosts() { Set hosts = metaClient.listHosts(); - if (hosts == null) { - return new HashSet<>(); - } if (!storageAddressMapping.isEmpty()) { hosts = hosts .stream()