{
hosts.add( DEFAULT_HOST );
}
bucketKey = config.bucket().get() == null ? DEFAULT_BUCKET_KEY : config.bucket().get();
PBClusterConfig pbClusterConfig = new PBClusterConfig( maxConnections );
for( String host : hosts )
{
String[] splitted = host.split( ":" );
int port = DEFAULT_PORT;
if( splitted.length > 1 )
{
host = splitted[0];
port = Integer.valueOf( splitted[1] );
}
PBClientConfig clientConfig = new PBClientConfig.Builder().withConnectionTimeoutMillis( connectionTimeout ).
withIdleConnectionTTLMillis( idleConnectionTTL ).
withPoolSize( maxPoolSize ).
withInitialPoolSize( initialPoolSize ).
withSocketBufferSizeKb( socketBufferSize ).
withHost( host ).withPort( port ).build();
pbClusterConfig.addClient( clientConfig );
}
riakClient = RiakFactory.newClient( pbClusterConfig );
if( !riakClient.listBuckets().contains( bucketKey ) )
{