private CassandraContainer(String dockerComposeFile, String name) { String keyspace = UUID.randomUUID().toString().replace("-", "_"); this.config = ImmutableCassandraKeyValueServiceConfig.builder() .addServers(forService(name)) .keyspace(keyspace) .credentials(ImmutableCassandraCredentialsConfig.builder() .username(USERNAME) .password(PASSWORD) .build()) .poolSize(20) .mutationBatchCount(10000) .mutationBatchSizeBytes(10000000) .fetchBatchCount(1000) .replicationFactor(1) .build(); this.dockerComposeFile = dockerComposeFile; this.name = name; }
static CassandraKeyValueServiceConfig getConfig(Class<?> testClass) { return ImmutableCassandraKeyValueServiceConfig.builder() .from(CONFIG) .keyspace(testClass.getSimpleName()) .build(); }
public static CassandraKeyValueServiceConfig copyWithKeyspace( CassandraKeyValueServiceConfig cassandraConfig, String recommendedKeyspace) { return ImmutableCassandraKeyValueServiceConfig.builder() .from(cassandraConfig) .keyspace(recommendedKeyspace) .build(); } }
@Override public KeyValueServiceConfig getKeyValueServiceConfig(InetSocketAddress addr) { return ImmutableCassandraKeyValueServiceConfig.builder() .addServers(addr) .poolSize(20) .keyspace("atlasdb") .credentials(ImmutableCassandraCredentialsConfig.builder() .username("cassandra") .password("cassandra") .build()) .ssl(false) .replicationFactor(1) .mutationBatchCount(10000) .mutationBatchSizeBytes(10000000) .fetchBatchCount(1000) .autoRefreshNodes(false) .build(); }
public static CassandraKeyValueServiceConfig copyWithKeyspace( CassandraKeyValueServiceConfig cassandraConfig, String recommendedKeyspace) { return ImmutableCassandraKeyValueServiceConfig.builder() .from(cassandraConfig) .keyspace(recommendedKeyspace) .build(); } }