Example usage for com.amazonaws ClientConfiguration withMaxErrorRetry

List of usage examples for com.amazonaws ClientConfiguration withMaxErrorRetry

Introduction

In this page you can find the example usage for com.amazonaws ClientConfiguration withMaxErrorRetry.

Prototype

public ClientConfiguration withMaxErrorRetry(int maxErrorRetry) 

Source Link

Document

Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from services), and returns the updated ClientConfiguration object.

Usage

From source file:com.streamsets.pipeline.lib.aws.s3.S3Accessor.java

License:Apache License

ClientConfiguration createClientConfiguration() throws StageException {
    ClientConfiguration clientConfig = new ClientConfiguration();

    clientConfig.setConnectionTimeout(connectionConfigs.getConnectionTimeoutMillis());
    clientConfig.setSocketTimeout(connectionConfigs.getSocketTimeoutMillis());
    clientConfig.withMaxErrorRetry(connectionConfigs.getMaxErrorRetry());

    if (connectionConfigs.isProxyEnabled()) {
        clientConfig.setProxyHost(connectionConfigs.getProxyHost());
        clientConfig.setProxyPort(connectionConfigs.getProxyPort());
        if (connectionConfigs.isProxyAuthenticationEnabled()) {
            clientConfig.setProxyUsername(connectionConfigs.getProxyUser().get());
            clientConfig.setProxyPassword(connectionConfigs.getProxyPassword().get());
        }/*from  w  w w . ja  va2s .  c om*/
    }
    return clientConfig;
}

From source file:io.fineo.drill.exec.store.dynamo.config.ClientProperties.java

License:Apache License

@JsonIgnore
public ClientConfiguration getConfiguration() {
    ClientConfiguration clientConfig = new ClientConfiguration();
    if (connectionTimeout > 0) {
        clientConfig.withClientExecutionTimeout(connectionTimeout);
    }//from w w w . ja  v  a 2  s. c o m
    if (maxConnections > 0) {
        clientConfig.withMaxConnections(maxConnections);
    }
    if (maxErrorRetry > 0) {
        clientConfig.withMaxErrorRetry(maxErrorRetry);
    }
    if (socketTimeout > 0) {
        clientConfig.withSocketTimeout(socketTimeout);
    }
    clientConfig.withSocketBufferSizeHints(socketSendBufferHint, socketReceiveBufferHint);
    if (withGzip != null) {
        clientConfig.setUseGzip(withGzip.booleanValue());
    }
    if (withReaper != null) {
        clientConfig.setUseReaper(withReaper.booleanValue());
    }

    return clientConfig;
}