All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.athena.AmazonAthenaAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Athena module holds the client classes that are used for communicating with Amazon Athena Service

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.athena;

import javax.annotation.Generated;

import com.amazonaws.services.athena.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing Amazon Athena asynchronously. Each asynchronous method will return a Java Future object
 * representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
 * notification when an asynchronous operation completes.
 * 

*

* Amazon Athena is an interactive query service that lets you use standard SQL to analyze data directly in Amazon S3. * You can point Athena at your data in Amazon S3 and run ad-hoc queries and get results in seconds. Athena is * serverless, so there is no infrastructure to set up or manage. You pay only for the queries you run. Athena scales * automatically—executing queries in parallel—so results are fast, even with large datasets and complex queries. For * more information, see What is Amazon Athena in * the Amazon Athena User Guide. *

*

* If you connect to Athena using the JDBC driver, use version 1.1.0 of the driver or later with the Amazon Athena API. * Earlier version drivers do not support the API. For more information and to download the driver, see Accessing Amazon Athena with JDBC. *

*

* For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon * Athena User Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonAthenaAsyncClient extends AmazonAthenaClient implements AmazonAthenaAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonAthenaAsyncClientBuilder asyncBuilder() { return AmazonAthenaAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Athena using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonAthenaAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Athena using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonAthenaAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) { super(asyncClientParams, endpointDiscoveryEnabled); this.executorService = asyncClientParams.getExecutor(); } /** * Returns the executor service used by this client to execute async requests. * * @return The executor service used by this client to execute async requests. */ public ExecutorService getExecutorService() { return executorService; } @Override public java.util.concurrent.Future batchGetNamedQueryAsync(BatchGetNamedQueryRequest request) { return batchGetNamedQueryAsync(request, null); } @Override public java.util.concurrent.Future batchGetNamedQueryAsync(final BatchGetNamedQueryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final BatchGetNamedQueryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public BatchGetNamedQueryResult call() throws Exception { BatchGetNamedQueryResult result = null; try { result = executeBatchGetNamedQuery(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future batchGetQueryExecutionAsync(BatchGetQueryExecutionRequest request) { return batchGetQueryExecutionAsync(request, null); } @Override public java.util.concurrent.Future batchGetQueryExecutionAsync(final BatchGetQueryExecutionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final BatchGetQueryExecutionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public BatchGetQueryExecutionResult call() throws Exception { BatchGetQueryExecutionResult result = null; try { result = executeBatchGetQueryExecution(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createDataCatalogAsync(CreateDataCatalogRequest request) { return createDataCatalogAsync(request, null); } @Override public java.util.concurrent.Future createDataCatalogAsync(final CreateDataCatalogRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDataCatalogRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateDataCatalogResult call() throws Exception { CreateDataCatalogResult result = null; try { result = executeCreateDataCatalog(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createNamedQueryAsync(CreateNamedQueryRequest request) { return createNamedQueryAsync(request, null); } @Override public java.util.concurrent.Future createNamedQueryAsync(final CreateNamedQueryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateNamedQueryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateNamedQueryResult call() throws Exception { CreateNamedQueryResult result = null; try { result = executeCreateNamedQuery(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createWorkGroupAsync(CreateWorkGroupRequest request) { return createWorkGroupAsync(request, null); } @Override public java.util.concurrent.Future createWorkGroupAsync(final CreateWorkGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateWorkGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateWorkGroupResult call() throws Exception { CreateWorkGroupResult result = null; try { result = executeCreateWorkGroup(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteDataCatalogAsync(DeleteDataCatalogRequest request) { return deleteDataCatalogAsync(request, null); } @Override public java.util.concurrent.Future deleteDataCatalogAsync(final DeleteDataCatalogRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDataCatalogRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteDataCatalogResult call() throws Exception { DeleteDataCatalogResult result = null; try { result = executeDeleteDataCatalog(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteNamedQueryAsync(DeleteNamedQueryRequest request) { return deleteNamedQueryAsync(request, null); } @Override public java.util.concurrent.Future deleteNamedQueryAsync(final DeleteNamedQueryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteNamedQueryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteNamedQueryResult call() throws Exception { DeleteNamedQueryResult result = null; try { result = executeDeleteNamedQuery(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteWorkGroupAsync(DeleteWorkGroupRequest request) { return deleteWorkGroupAsync(request, null); } @Override public java.util.concurrent.Future deleteWorkGroupAsync(final DeleteWorkGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteWorkGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteWorkGroupResult call() throws Exception { DeleteWorkGroupResult result = null; try { result = executeDeleteWorkGroup(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getDataCatalogAsync(GetDataCatalogRequest request) { return getDataCatalogAsync(request, null); } @Override public java.util.concurrent.Future getDataCatalogAsync(final GetDataCatalogRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetDataCatalogRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetDataCatalogResult call() throws Exception { GetDataCatalogResult result = null; try { result = executeGetDataCatalog(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getDatabaseAsync(GetDatabaseRequest request) { return getDatabaseAsync(request, null); } @Override public java.util.concurrent.Future getDatabaseAsync(final GetDatabaseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetDatabaseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetDatabaseResult call() throws Exception { GetDatabaseResult result = null; try { result = executeGetDatabase(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getNamedQueryAsync(GetNamedQueryRequest request) { return getNamedQueryAsync(request, null); } @Override public java.util.concurrent.Future getNamedQueryAsync(final GetNamedQueryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetNamedQueryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetNamedQueryResult call() throws Exception { GetNamedQueryResult result = null; try { result = executeGetNamedQuery(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getQueryExecutionAsync(GetQueryExecutionRequest request) { return getQueryExecutionAsync(request, null); } @Override public java.util.concurrent.Future getQueryExecutionAsync(final GetQueryExecutionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetQueryExecutionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetQueryExecutionResult call() throws Exception { GetQueryExecutionResult result = null; try { result = executeGetQueryExecution(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getQueryResultsAsync(GetQueryResultsRequest request) { return getQueryResultsAsync(request, null); } @Override public java.util.concurrent.Future getQueryResultsAsync(final GetQueryResultsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetQueryResultsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetQueryResultsResult call() throws Exception { GetQueryResultsResult result = null; try { result = executeGetQueryResults(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getTableMetadataAsync(GetTableMetadataRequest request) { return getTableMetadataAsync(request, null); } @Override public java.util.concurrent.Future getTableMetadataAsync(final GetTableMetadataRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetTableMetadataRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetTableMetadataResult call() throws Exception { GetTableMetadataResult result = null; try { result = executeGetTableMetadata(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future getWorkGroupAsync(GetWorkGroupRequest request) { return getWorkGroupAsync(request, null); } @Override public java.util.concurrent.Future getWorkGroupAsync(final GetWorkGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetWorkGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetWorkGroupResult call() throws Exception { GetWorkGroupResult result = null; try { result = executeGetWorkGroup(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listDataCatalogsAsync(ListDataCatalogsRequest request) { return listDataCatalogsAsync(request, null); } @Override public java.util.concurrent.Future listDataCatalogsAsync(final ListDataCatalogsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListDataCatalogsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListDataCatalogsResult call() throws Exception { ListDataCatalogsResult result = null; try { result = executeListDataCatalogs(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listDatabasesAsync(ListDatabasesRequest request) { return listDatabasesAsync(request, null); } @Override public java.util.concurrent.Future listDatabasesAsync(final ListDatabasesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListDatabasesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListDatabasesResult call() throws Exception { ListDatabasesResult result = null; try { result = executeListDatabases(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listEngineVersionsAsync(ListEngineVersionsRequest request) { return listEngineVersionsAsync(request, null); } @Override public java.util.concurrent.Future listEngineVersionsAsync(final ListEngineVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListEngineVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListEngineVersionsResult call() throws Exception { ListEngineVersionsResult result = null; try { result = executeListEngineVersions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listNamedQueriesAsync(ListNamedQueriesRequest request) { return listNamedQueriesAsync(request, null); } @Override public java.util.concurrent.Future listNamedQueriesAsync(final ListNamedQueriesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListNamedQueriesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListNamedQueriesResult call() throws Exception { ListNamedQueriesResult result = null; try { result = executeListNamedQueries(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listQueryExecutionsAsync(ListQueryExecutionsRequest request) { return listQueryExecutionsAsync(request, null); } @Override public java.util.concurrent.Future listQueryExecutionsAsync(final ListQueryExecutionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListQueryExecutionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListQueryExecutionsResult call() throws Exception { ListQueryExecutionsResult result = null; try { result = executeListQueryExecutions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listTableMetadataAsync(ListTableMetadataRequest request) { return listTableMetadataAsync(request, null); } @Override public java.util.concurrent.Future listTableMetadataAsync(final ListTableMetadataRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTableMetadataRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTableMetadataResult call() throws Exception { ListTableMetadataResult result = null; try { result = executeListTableMetadata(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) { return listTagsForResourceAsync(request, null); } @Override public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTagsForResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = executeListTagsForResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listWorkGroupsAsync(ListWorkGroupsRequest request) { return listWorkGroupsAsync(request, null); } @Override public java.util.concurrent.Future listWorkGroupsAsync(final ListWorkGroupsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListWorkGroupsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListWorkGroupsResult call() throws Exception { ListWorkGroupsResult result = null; try { result = executeListWorkGroups(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future startQueryExecutionAsync(StartQueryExecutionRequest request) { return startQueryExecutionAsync(request, null); } @Override public java.util.concurrent.Future startQueryExecutionAsync(final StartQueryExecutionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartQueryExecutionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartQueryExecutionResult call() throws Exception { StartQueryExecutionResult result = null; try { result = executeStartQueryExecution(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future stopQueryExecutionAsync(StopQueryExecutionRequest request) { return stopQueryExecutionAsync(request, null); } @Override public java.util.concurrent.Future stopQueryExecutionAsync(final StopQueryExecutionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StopQueryExecutionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StopQueryExecutionResult call() throws Exception { StopQueryExecutionResult result = null; try { result = executeStopQueryExecution(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future tagResourceAsync(TagResourceRequest request) { return tagResourceAsync(request, null); } @Override public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final TagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = executeTagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future untagResourceAsync(UntagResourceRequest request) { return untagResourceAsync(request, null); } @Override public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UntagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = executeUntagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future updateDataCatalogAsync(UpdateDataCatalogRequest request) { return updateDataCatalogAsync(request, null); } @Override public java.util.concurrent.Future updateDataCatalogAsync(final UpdateDataCatalogRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateDataCatalogRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateDataCatalogResult call() throws Exception { UpdateDataCatalogResult result = null; try { result = executeUpdateDataCatalog(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future updateWorkGroupAsync(UpdateWorkGroupRequest request) { return updateWorkGroupAsync(request, null); } @Override public java.util.concurrent.Future updateWorkGroupAsync(final UpdateWorkGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateWorkGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateWorkGroupResult call() throws Exception { UpdateWorkGroupResult result = null; try { result = executeUpdateWorkGroup(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending * asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should * call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to * calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy