MCPcopy Create free account
hub / github.com/apache/impala / getDbs

Method getDbs

fe/src/main/java/org/apache/impala/service/Frontend.java:1520–1541  ·  view source on GitHub ↗

Returns all databases in catalog cache that match the pattern of 'matcher' and are accessible to 'user'. Callers should handle InconsistentMetadataFetchException when using these dbs.

(PatternMatcher matcher, User user)

Source from the content-addressed store, hash-verified

1518 * using these dbs.
1519 */
1520 public List<? extends FeDb> getDbs(PatternMatcher matcher, User user)
1521 throws UserCancelledException, InternalException {
1522 List<? extends FeDb> dbs = getCatalog().getDbs(matcher);
1523
1524 boolean needsAuthChecks = authzFactory_.getAuthorizationConfig().isEnabled()
1525 && !userHasAccessForWholeServer(user);
1526
1527 // Filter out the databases the user does not have permissions on.
1528 if (needsAuthChecks) {
1529 Iterator<? extends FeDb> iter = dbs.iterator();
1530 List<Future<Boolean>> pendingCheckTasks = Lists.newArrayList();
1531 while (iter.hasNext()) {
1532 FeDb db = iter.next();
1533 pendingCheckTasks.add(checkAuthorizationPool_.submit(
1534 new CheckDbAuthorization(db, user)));
1535 }
1536
1537 filterUnaccessibleElements(pendingCheckTasks, dbs);
1538 }
1539
1540 return dbs;
1541 }
1542
1543 /**
1544 * Returns thrift representation of all databases in catalog cache that match the

Callers 1

getThriftDbsMethod · 0.95

Calls 10

getCatalogMethod · 0.95
getDbsMethod · 0.65
isEnabledMethod · 0.65
iteratorMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected