/** * Sets the maximum number of allowed open HTTP connections and returns the updated * ClientConfiguration object. * * @param maxConnections * The maximum number of allowed open HTTP connections. * @return The updated ClientConfiguration object with the new max HTTP connections setting. */ public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); 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; }
clientConfig.setMaxConnections(Integer.parseInt(maxConnections));
AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile)); ClientConfiguration cconfig = new ClientConfiguration(); cconfig.setMaxConnections(maxConnects); dynamoDB = new AmazonDynamoDBClient(credentials, cconfig); dynamoDB.setEndpoint(this.endpoint);
/** * Sets the maximum number of allowed open HTTP connections and returns the updated * ClientConfiguration object. * * @param maxConnections * The maximum number of allowed open HTTP connections. * @return The updated ClientConfiguration object with the new max HTTP connections setting. */ public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); return this; }
/** * Sets the maximum number of allowed open HTTP connections and returns the * updated ClientConfiguration object. * * @param maxConnections The maximum number of allowed open HTTP * connections. * @return The updated ClientConfiguration object with the new max HTTP * connections setting. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); return this; }
numThreads = numAdminThreads + numTransferThreads; clientConf.setMaxConnections(numThreads);
protected ClientConfiguration createConfiguration(final ProcessContext context) { final ClientConfiguration config = new ClientConfiguration(); config.setMaxConnections(context.getMaxConcurrentTasks()); config.setMaxErrorRetry(0); config.setUserAgent(DEFAULT_USER_AGENT);
/** * Sets the maximum number of allowed open HTTP connections and returns the updated * ClientConfiguration object. * * @param maxConnections * The maximum number of allowed open HTTP connections. * @return The updated ClientConfiguration object with the new max HTTP connections setting. */ public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); return this; }
/** * Sets the maximum number of allowed open HTTP connections and returns the * updated ClientConfiguration object. * * @param maxConnections The maximum number of allowed open HTTP * connections. * @return The updated ClientConfiguration object with the new max HTTP * connections setting. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); return this; }
/** * Sets the maximum number of allowed open HTTP connections and returns the * updated ClientConfiguration object. * * @param maxConnections The maximum number of allowed open HTTP * connections. * @return The updated ClientConfiguration object with the new max HTTP * connections setting. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withMaxConnections(int maxConnections) { setMaxConnections(maxConnections); return this; }
@Test(expected=java.lang.IllegalArgumentException.class) public void testConstructors4() { ClientConfiguration c = new ClientConfiguration(); c.setUserAgent("test"); c.setMaxConnections(2); c.getMaxConnections(); c.getUserAgent(); LambdaInvokerFactory f = new LambdaInvokerFactory.Builder() .clientConfiguration(c) .build(); }
@Test public void testConstructors3() { ClientConfiguration c = new ClientConfiguration(); c.setUserAgent("test"); c.setMaxConnections(2); c.getMaxConnections(); c.getUserAgent(); LambdaInvokerFactory f = new LambdaInvokerFactory.Builder() .clientConfiguration(c) .lambdaClient(lambda).build(); }
@Test public void testConstructors6() { ClientConfiguration c = new ClientConfiguration(); c.setUserAgent("test"); c.setMaxConnections(2); c.getMaxConnections(); c.getUserAgent(); AWSCredentials creds = new BasicAWSCredentials("random", "test"); StaticCredentialsProvider credProvider = new StaticCredentialsProvider(creds); LambdaInvokerFactory f = new LambdaInvokerFactory.Builder() .clientConfiguration(c) .credentialsProvider(credProvider) .region(Regions.US_WEST_2) .build(); }
@Test public void testConstructors5() { ClientConfiguration c = new ClientConfiguration(); c.setUserAgent("test"); c.setMaxConnections(2); c.getMaxConnections(); c.getUserAgent(); LambdaInvokerFactory f = new LambdaInvokerFactory.Builder() .clientConfiguration(c) .lambdaClient(lambda) .region(Regions.US_WEST_2) .build(); }
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; }
public ClientConfiguration getClientConfig() { clientConfig.setCacheResponseMetadata(enableCacheResponseMetadata); clientConfig.setProtocol(protocol); clientConfig.setMaxConnections(maxConnections); return clientConfig; }
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; }
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; }
c.setMaxConnections(2); assertEquals(c.getMaxConnections(), 2);