Skip to content

Commit

Permalink
Avoid NPE for optional ownerType field
Browse files Browse the repository at this point in the history
fixes #11131

pr-link: #11130
change-id: cid-cb1e33b31114f6d2196398ea40275b4b891fc1a6
  • Loading branch information
gpang committed Mar 6, 2020
1 parent d549200 commit 89fc2d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public SyncStatus sync(JournalContext context, ExecutorService service) throws I
try {
CommonUtils.invokeAll(service, tasks, mUdbSyncTimeoutMs);
} catch (Exception e) {
throw new IOException("Failed to sync database " + mName, e);
throw new IOException("Failed to sync database " + mName + ". error: " + e.getMessage(), e);
}

for (Table existingTable : mTables.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public DatabaseInfo getDatabaseInfo() throws IOException {
try (CloseableResource<IMetaStoreClient> client = mClientPool.acquireClientResource()) {
Database hiveDb = client.get().getDatabase(mHiveDbName);
alluxio.grpc.table.PrincipalType type = alluxio.grpc.table.PrincipalType.USER;
if (hiveDb.getOwnerType().equals(PrincipalType.ROLE)) {
if (Objects.equals(hiveDb.getOwnerType(), PrincipalType.ROLE)) {
type = alluxio.grpc.table.PrincipalType.ROLE;
}
return new DatabaseInfo(hiveDb.getLocationUri(), hiveDb.getOwnerName(), type,
Expand Down

0 comments on commit 89fc2d3

Please sign in to comment.