List of usage examples for com.amazonaws.services.glue.model GetDatabasesResult getDatabaseList
public java.util.List<Database> getDatabaseList()
A list of Database
objects from the specified catalog.
From source file:com.facebook.presto.hive.metastore.glue.GlueHiveMetastore.java
License:Apache License
@Override public List<String> getAllDatabases() { try {/*w w w.j ava 2 s.c om*/ List<String> databaseNames = new ArrayList<>(); String nextToken = null; do { GetDatabasesResult result = glueClient .getDatabases(new GetDatabasesRequest().withNextToken(nextToken)); nextToken = result.getNextToken(); result.getDatabaseList().forEach(database -> databaseNames.add(database.getName())); } while (nextToken != null); return databaseNames; } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }