Example usage for com.amazonaws.services.glue.model GetDatabaseRequest GetDatabaseRequest

List of usage examples for com.amazonaws.services.glue.model GetDatabaseRequest GetDatabaseRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.glue.model GetDatabaseRequest GetDatabaseRequest.

Prototype

GetDatabaseRequest

Source Link

Usage

From source file:com.facebook.presto.hive.metastore.glue.GlueHiveMetastore.java

License:Apache License

@Override
public Optional<Database> getDatabase(String databaseName) {
    try {/*from   w  w w . j  a  v a  2 s  .c o m*/
        GetDatabaseResult result = glueClient.getDatabase(new GetDatabaseRequest().withName(databaseName));
        return Optional.of(GlueToPrestoConverter.convertDatabase(result.getDatabase()));
    } catch (EntityNotFoundException e) {
        return Optional.empty();
    } catch (AmazonServiceException e) {
        throw new PrestoException(HIVE_METASTORE_ERROR, e);
    }
}