cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(Integer.parseInt((String)maxWaitTimeWhenExhausted.getContent())); if (maxExhaustedTimeBeforeMarkingAsDown != null) { cassandraHostConfigurator.setMaxExhaustedTimeBeforeMarkingAsDown(Integer.parseInt((String) maxExhaustedTimeBeforeMarkingAsDown.getContent()));
configurator.setMaxActive(maxActive); configurator.setMaxWaitTimeWhenExhausted(50); configurator.setMaxExhaustedTimeBeforeMarkingAsDown(0); configurator.setRetryDownedHosts(false);
@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()); }
cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(Integer.parseInt((String)maxWaitTimeWhenExhausted.getContent())); if (maxExhaustedTimeBeforeMarkingAsDown != null) { cassandraHostConfigurator.setMaxExhaustedTimeBeforeMarkingAsDown(Integer.parseInt((String) maxExhaustedTimeBeforeMarkingAsDown.getContent()));