From 231e790114d919e5972f58fc26e2e69580e9e798 Mon Sep 17 00:00:00 2001 From: gongzhongqiang Date: Thu, 19 Oct 2023 18:01:08 +0800 Subject: [PATCH] Address comment --- .../com/netease/arctic/server/table/DefaultTableService.java | 5 ++--- .../apache/hadoop/hive/metastore/HiveMetaStoreClient.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ams/server/src/main/java/com/netease/arctic/server/table/DefaultTableService.java b/ams/server/src/main/java/com/netease/arctic/server/table/DefaultTableService.java index 6673f3379b..2f627f9dac 100644 --- a/ams/server/src/main/java/com/netease/arctic/server/table/DefaultTableService.java +++ b/ams/server/src/main/java/com/netease/arctic/server/table/DefaultTableService.java @@ -1,6 +1,7 @@ package com.netease.arctic.server.table; import com.google.common.base.Objects; +import com.google.common.base.Preconditions; import com.google.common.collect.Sets; import com.netease.arctic.AmoroTable; import com.netease.arctic.ams.api.BlockableOperation; @@ -319,9 +320,7 @@ public void initialize() { } public TableRuntime getAndCheckExist(ServerTableIdentifier tableIdentifier) { - if (tableIdentifier == null) { - throw new IllegalArgumentException("ServerTableIdentifier is null"); - } + Preconditions.checkArgument(tableIdentifier != null, "tableIdentifier cannot be null"); TableRuntime tableRuntime = getRuntime(tableIdentifier); if (tableRuntime == null) { throw new ObjectNotExistsException(tableIdentifier); diff --git a/trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index 711a3c4bfa..be1a6650f6 100644 --- a/trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -515,7 +515,7 @@ private void open() throws MetaException { LOG.info("Waiting " + retryDelaySeconds + " seconds before next connection attempt."); Thread.sleep(retryDelaySeconds * 1000); } catch (InterruptedException ignore) { - LOG.warn("Unexpected InterruptedException while waiting between connection retries.", ignore); + ignore.printStackTrace(); } } } @@ -2310,7 +2310,7 @@ public NotificationEventResponse getNextNotification( return rsp; } else { NotificationEventResponse filtered = new NotificationEventResponse(); - if (rsp.getEvents() != null) { + if (rsp != null && rsp.getEvents() != null) { for (NotificationEvent e : rsp.getEvents()) { if (filter.accept(e)) { filtered.addToEvents(e);