/** * Sets the amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed, and returns the * updated ClientConfiguration object so that additional method calls may be chained together. * * @param socketTimeout * The amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed. * @return The updated ClientConfiguration object. */ public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
static ClientConfiguration s3ClientCfg() { ClientConfiguration cfg = new ClientConfiguration(); Properties prop = System.getProperties(); if( prop.containsKey(S3_SOCKET_TIMEOUT_PROP) ) cfg.setSocketTimeout(Integer.getInteger(S3_SOCKET_TIMEOUT_PROP)); if( prop.containsKey(S3_CONNECTION_TIMEOUT_PROP) ) cfg.setConnectionTimeout(Integer .getInteger(S3_CONNECTION_TIMEOUT_PROP)); if( prop.containsKey(S3_MAX_ERROR_RETRY_PROP) ) cfg.setMaxErrorRetry(Integer.getInteger(S3_MAX_ERROR_RETRY_PROP)); if( prop.containsKey(S3_MAX_HTTP_CONNECTIONS_PROP) ) cfg.setMaxConnections(Integer .getInteger(S3_MAX_HTTP_CONNECTIONS_PROP)); cfg.setProtocol(Protocol.HTTP); return cfg; }
/** * Sets the amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed, and returns the * updated ClientConfiguration object so that additional method calls may be chained together. * * @param socketTimeout * The amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed. * @return The updated ClientConfiguration object. */ public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
/** * Sets the amount of time to wait (in milliseconds) for data to be * transfered over an established, open connection before the connection * times out and is closed, and returns the updated ClientConfiguration * object so that additional method calls may be chained together. * * @param socketTimeout The amount of time to wait (in milliseconds) for * data to be transfered over an established, open connection * before the connection is times out and is closed. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
.setSocketTimeout((int) alluxioConf.getMs(PropertyKey.UNDERFS_S3A_SOCKET_TIMEOUT_MS));
final int commsTimeout = context.getProperty(TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(); config.setConnectionTimeout(commsTimeout); config.setSocketTimeout(commsTimeout);
@Test public void testGetSocketTimeout() { assertEquals(HttpUtils.getSocketTimeout(null), ClientConfiguration.DEFAULT_SOCKET_TIMEOUT); final ClientConfiguration conf = new ClientConfiguration(); conf.setSocketTimeout(10); assertEquals(HttpUtils.getSocketTimeout(conf), 10); }
/** * Sets the amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed, and returns the * updated ClientConfiguration object so that additional method calls may be chained together. * * @param socketTimeout * The amount of time to wait (in milliseconds) for data to be transfered over an * established, open connection before the connection times out and is closed. * @return The updated ClientConfiguration object. */ public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
/** * Sets the amount of time to wait (in milliseconds) for data to be * transfered over an established, open connection before the connection * times out and is closed, and returns the updated ClientConfiguration * object so that additional method calls may be chained together. * * @param socketTimeout The amount of time to wait (in milliseconds) for * data to be transfered over an established, open connection * before the connection is times out and is closed. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
/** * Sets the amount of time to wait (in milliseconds) for data to be * transfered over an established, open connection before the connection * times out and is closed, and returns the updated ClientConfiguration * object so that additional method calls may be chained together. * * @param socketTimeout The amount of time to wait (in milliseconds) for * data to be transfered over an established, open connection * before the connection is times out and is closed. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withSocketTimeout(int socketTimeout) { setSocketTimeout(socketTimeout); return this; }
configuration.setSocketTimeout(clientOptions.getSocketTimeout());
ClientConfiguration config = new ClientConfiguration(); config.setSocketTimeout(0); AmazonS3 s3 = new AmazonS3Client(/* credentials */, config);
ClientConfiguration config = new ClientConfiguration(); config.setConnectionTimeout(connectionTimeout); config.setSocketTimeout(readTimeout); AmazonS3 s3 = new AmazonS3Client(credentials, config);
ClientConfiguration config = new ClientConfiguration(); config.setConnectionTimeout(60 * 1000); // 60 sec config.setSocketTimeout(60 * 1000); // 60 sec AmazonS3Client s3Client = new AmazonS3Client(Constants.MANAGER.getCredentials(), config);
static ClientConfiguration s3ClientCfg() { ClientConfiguration cfg = new ClientConfiguration(); Properties prop = System.getProperties(); if (prop.containsKey(S3_SOCKET_TIMEOUT_PROP)) cfg.setSocketTimeout(Integer.getInteger(S3_SOCKET_TIMEOUT_PROP)); if (prop.containsKey(S3_CONNECTION_TIMEOUT_PROP)) cfg.setConnectionTimeout(Integer.getInteger(S3_CONNECTION_TIMEOUT_PROP)); if (prop.containsKey(S3_MAX_ERROR_RETRY_PROP)) cfg.setMaxErrorRetry(Integer.getInteger(S3_MAX_ERROR_RETRY_PROP)); if (prop.containsKey(S3_MAX_HTTP_CONNECTIONS_PROP)) cfg.setMaxConnections(Integer.getInteger(S3_MAX_HTTP_CONNECTIONS_PROP)); if (prop.containsKey(S3_FORCE_HTTP)) cfg.setProtocol(Protocol.HTTP); return cfg; }
protected ClientConfiguration getClientConfiguration(PluginTask task) { ClientConfiguration clientConfig = new ClientConfiguration(); //clientConfig.setProtocol(Protocol.HTTP); clientConfig.setMaxConnections(50); // SDK default: 50 // clientConfig.setMaxErrorRetry(3); // SDK default: 3 clientConfig.setSocketTimeout(8 * 60 * 1000); // SDK default: 50*1000 clientConfig.setRetryPolicy(PredefinedRetryPolicies.NO_RETRY_POLICY); // set http proxy if (task.getHttpProxy().isPresent()) { setHttpProxyInAwsClient(clientConfig, task.getHttpProxy().get()); } return clientConfig; }
private void buildS3Client() { // override default timeout for S3Client ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setConnectionTimeout(SDK_TIME_OUT); clientConfiguration.setSocketTimeout(SDK_TIME_OUT); if (s3Client == null) { s3Client = AmazonS3ClientBuilder.standard() .withCredentials(config.getAwsCredentialsProvider()) .withClientConfiguration(clientConfiguration) .withRegion(config.getS3Region()) .build(); } } private void buildSqsClient() {
public ClientConfiguration getAwsClientConfiguration() { ClientConfiguration config = new ClientConfiguration(); config.setUserAgent(userAgent(config)); config.setMaxConnections(maxConnections()); config.setConnectionTimeout(connectionTimeoutMillis()); config.setSocketTimeout(socketTimeoutMillis()); config.setUseTcpKeepAlive(useTcpKeepAlive()); config.setConnectionTTL(connectionTTLMillis()); config.setUseGzip(useHttpGzip()); return config; }
public AmazonIdentityConfiguration(final Host bookmark, final int timeout) { this.bookmark = bookmark; this.configuration = new ClientConfiguration(); this.configuration.setConnectionTimeout(timeout); this.configuration.setSocketTimeout(timeout); final UseragentProvider ua = new PreferencesUseragentProvider(); this.configuration.setUserAgentPrefix(ua.get()); this.configuration.setMaxErrorRetry(0); this.configuration.setMaxConnections(1); this.configuration.setUseGzip(PreferencesFactory.get().getBoolean("http.compression.enable")); final Proxy proxy = ProxyFactory.get().find(bookmark); switch(proxy.getType()) { case HTTP: case HTTPS: this.configuration.setProxyHost(proxy.getHostname()); this.configuration.setProxyPort(proxy.getPort()); } }
c.setSocketTimeout(1); assertEquals(c.getSocketTimeout(), 1);