protected CassandraHostConfigurator getCHCForTest() { CassandraHostConfigurator chc = new CassandraHostConfigurator("127.0.0.1:9170"); chc.setMaxActive(2); return chc; } }
protected void configure(CassandraHostConfigurator configurator) { configurator.setMaxActive(1); configurator.setMaxConnectTimeMillis(3 * 1000); }
cassandraHostConfigurator.setMaxActive(Integer.parseInt((String)maxActiveRefAddr.getContent())); if ( maxWaitTimeWhenExhausted != null ) cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(Integer.parseInt((String)maxWaitTimeWhenExhausted.getContent()));
protected void configure(CassandraHostConfigurator configurator) { configurator.setMaxActive(1); configurator.setMaxLastSuccessTimeMillis(3 * 1000); }
configurator.setMaxActive(maxActive); configurator.setMaxWaitTimeWhenExhausted(50); configurator.setMaxExhaustedTimeBeforeMarkingAsDown(0);
@Test public void testApplyConfig() { CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator("localhost:9170"); cassandraHostConfigurator.setMaxActive(15); cassandraHostConfigurator.setMaxConnectTimeMillis(30000); cassandraHostConfigurator.setMaxLastSuccessTimeMillis(40000); CassandraHost extraHost = new CassandraHost("localhost:9171"); cassandraHostConfigurator.applyConfig(extraHost); assertEquals(15, extraHost.getMaxActive()); assertEquals(30000, extraHost.getMaxConnectTimeMillis()); assertEquals(40000, extraHost.getMaxLastSuccessTimeMillis()); }
@Test public void testConfigValuesPropogated() { CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator("localhost:9170,localhost:9171,localhost:9172"); cassandraHostConfigurator.setMaxActive(20); cassandraHostConfigurator.setCassandraThriftSocketTimeout(3000); cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(4000); cassandraHostConfigurator.setMaxExhaustedTimeBeforeMarkingAsDown(5000); CassandraHost[] cassandraHosts = cassandraHostConfigurator.buildCassandraHosts(); // no need to test all, just a smattering assertEquals(20, cassandraHosts[1].getMaxActive()); assertEquals(20, cassandraHosts[0].getMaxActive()); assertEquals(4000, cassandraHosts[1].getMaxWaitTimeWhenExhausted()); assertEquals(5000, cassandraHosts[0].getMaxExhaustedTimeBeforeMarkingAsDown()); assertEquals(3000, cassandraHosts[2].getCassandraThriftSocketTimeout()); assertEquals(3000, cassandraHosts[0].getCassandraThriftSocketTimeout()); }
@Before public void setupCase() { CassandraHostConfigurator chc = new CassandraHostConfigurator("127.0.0.1:9170"); chc.setMaxActive(2); cluster = getOrCreateCluster("MyCluster", chc); keyspace = createKeyspace(KEYSPACE, cluster); createMutator(keyspace, se) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear1", 1974L, se, le)) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear2", 1975L, se, le)) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear3", 1976L, se, le)) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear4", 1977L, se, le)) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear5", 1978L, se, le)) .addInsertion("getSliceTest_key3", cf, createColumn("birthyear6", 1979L, se, le)) .execute(); }
cassandraHostConfigurator.setMaxActive(Integer.parseInt((String)maxActiveRefAddr.getContent())); if ( maxWaitTimeWhenExhausted != null ) cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(Integer.parseInt((String)maxWaitTimeWhenExhausted.getContent()));
cassandraHostConfigurator.setMaxActive(Integer.parseInt((String)maxActiveRefAddr.getContent())); if ( maxWaitTimeWhenExhausted != null ) cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(Integer.parseInt((String)maxWaitTimeWhenExhausted.getContent()));
cassandraHostConfigurator.setMaxActive(hectorPoolSize); cassandraHostConfigurator.setCassandraThriftSocketTimeout(CMBProperties.getInstance().getCassandraThriftSocketTimeOutMS());
cassandraHostConfigurator.setCassandraThriftSocketTimeout(getIntValueOrExit(cmd, "thrift-timeout")); cassandraHostConfigurator.setMaxActive(commandArgs.clients);
public CassandraSirona() { final CassandraHostConfigurator configurator = new CassandraHostConfigurator(builder.getHosts()); configurator.setMaxActive(builder.getMaxActive());
public CassandraSirona() { final CassandraHostConfigurator configurator = new CassandraHostConfigurator(builder.getHosts()); configurator.setMaxActive(builder.getMaxActive());
configurator.setMaxActive( maxActive );