Example usage for com.amazonaws.services.glue AWSGlueAsyncClientBuilder standard

List of usage examples for com.amazonaws.services.glue AWSGlueAsyncClientBuilder standard

Introduction

In this page you can find the example usage for com.amazonaws.services.glue AWSGlueAsyncClientBuilder standard.

Prototype

public static AWSGlueAsyncClientBuilder standard() 

Source Link

Usage

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

License:Apache License

private static AWSGlueAsync createAsyncGlueClient(GlueHiveMetastoreConfig config) {
    ClientConfiguration clientConfig = new ClientConfiguration()
            .withMaxConnections(config.getMaxGlueConnections());
    AWSGlueAsyncClientBuilder asyncGlueClientBuilder = AWSGlueAsyncClientBuilder.standard()
            .withClientConfiguration(clientConfig);

    if (config.getGlueRegion().isPresent()) {
        asyncGlueClientBuilder.setRegion(config.getGlueRegion().get());
    } else if (config.getPinGlueClientToCurrentRegion()) {
        Region currentRegion = Regions.getCurrentRegion();
        if (currentRegion != null) {
            asyncGlueClientBuilder.setRegion(currentRegion.getName());
        }//  w w  w  . java  2  s  .c o  m
    }

    return asyncGlueClientBuilder.build();
}