Permalink
Browse files

Removed ExhaustedPolicy as it seems it is not used, and will cause co…

…nfusion if configured
  • Loading branch information...
1 parent 0666efa commit c53f75065577c9993bccae50c47d5d14ca66c4e9 @btoddb btoddb committed Apr 12, 2012
View
4 CHANGELOG
@@ -6,6 +6,10 @@ Changes by version:
Versions above 0.7.0-17 work well with cassandra's 0.7.* (after 0.7.0-beta2)
See object-mapper/CHANGELOG for HOM specifics
+1.0-5
+=====
+Remove ExhaustedPolicy as it doesn't seem to be used anymore. This will probably break some folks' configuration - watch out for spring config!
+
1.0-4
=====
Made Composite Serializable
View
2 core/src/main/java/me/prettyprint/cassandra/service/CassandraClientMonitorMBean.java
@@ -93,8 +93,6 @@
/**
* Number of threads that are currently blocked, waiting for a free connection.
- * This number may be greater than 0 only if the {@link ExhaustedPolicy} is
- * {@link ExhaustedPolicy#WHEN_EXHAUSTED_BLOCK}
*/
int getNumBlockedThreads();
View
9 core/src/main/java/me/prettyprint/cassandra/service/CassandraHost.java
@@ -46,7 +46,6 @@
private long maxWaitTimeWhenExhausted = DEFAULT_MAX_WAITTIME_WHEN_EXHAUSTED;
private int cassandraThriftSocketTimeout;
- private ExhaustedPolicy exhaustedPolicy = ExhaustedPolicy.WHEN_EXHAUSTED_BLOCK;
private boolean useThriftFramedTransport = DEFAULT_USE_FRAMED_THRIFT_TRANSPORT;
private boolean useSocketKeepalive;
//TODO(ran): private FailoverPolicy failoverPolicy = DEFAULT_FAILOVER_POLICY;
@@ -151,14 +150,6 @@ public void setMaxWaitTimeWhenExhausted(long maxWaitTimeWhenExhausted) {
this.maxWaitTimeWhenExhausted = maxWaitTimeWhenExhausted;
}
- public ExhaustedPolicy getExhaustedPolicy() {
- return exhaustedPolicy;
- }
-
- public void setExhaustedPolicy(ExhaustedPolicy exhaustedPolicy) {
- this.exhaustedPolicy = exhaustedPolicy;
- }
-
public int getCassandraThriftSocketTimeout() {
return cassandraThriftSocketTimeout;
}
View
10 core/src/main/java/me/prettyprint/cassandra/service/CassandraHostConfigurator.java
@@ -25,7 +25,6 @@
private boolean lifo = CassandraHost.DEFAULT_LIFO;
private long maxWaitTimeWhenExhausted = CassandraHost.DEFAULT_MAX_WAITTIME_WHEN_EXHAUSTED;
private int cassandraThriftSocketTimeout;
- private ExhaustedPolicy exhaustedPolicy;
private ClockResolution clockResolution = DEF_CLOCK_RESOLUTION;
private boolean useThriftFramedTransport = CassandraHost.DEFAULT_USE_FRAMED_THRIFT_TRANSPORT;
@@ -84,9 +83,6 @@ public void applyConfig(CassandraHost cassandraHost) {
if (cassandraThriftSocketTimeout > 0) {
cassandraHost.setCassandraThriftSocketTimeout(cassandraThriftSocketTimeout);
}
- if (exhaustedPolicy != null) {
- cassandraHost.setExhaustedPolicy(exhaustedPolicy);
- }
}
public void setHosts(String hosts) {
@@ -110,10 +106,6 @@ public void setCassandraThriftSocketTimeout(int cassandraThriftSocketTimeout) {
this.cassandraThriftSocketTimeout = cassandraThriftSocketTimeout;
}
- public void setExhaustedPolicy(ExhaustedPolicy exhaustedPolicy) {
- this.exhaustedPolicy = exhaustedPolicy;
- }
-
public boolean getRetryDownedHosts() {
return this.retryDownedHosts;
}
@@ -159,8 +151,6 @@ public String toString() {
s.append("CassandraHostConfigurator<");
s.append("clockResolution=");
s.append(clockResolution);
- s.append("&exhaustedPolicy=");
- s.append(exhaustedPolicy);
s.append("&cassandraThriftSocketTimeout=");
s.append(cassandraThriftSocketTimeout);
s.append("&maxWaitTimeWhenExhausted=");
View
22 core/src/main/java/me/prettyprint/cassandra/service/ExhaustedPolicy.java
@@ -1,22 +0,0 @@
-package me.prettyprint.cassandra.service;
-
-
-/**
- * Policy what to do when the connection pool is exhausted.
- * @author Ran Tavory (rantav@gmail.com)
- *
- */
-public enum ExhaustedPolicy {
- /**
- * If the pool is full, fail with the exception {@link PoolExhaustedException}
- */
- WHEN_EXHAUSTED_FAIL,
- /**
- * When pool exhausted, grow.
- */
- WHEN_EXHAUSTED_GROW,
- /**
- * Block the requesting thread when the pool is exhausted until new connections are available.
- */
- WHEN_EXHAUSTED_BLOCK
-}
View
2 core/src/test/java/me/prettyprint/cassandra/service/CassandraHostConfiguratorTest.java
@@ -40,12 +40,10 @@ public void testConfigValuesPropogated() {
cassandraHostConfigurator.setMaxActive(20);
cassandraHostConfigurator.setCassandraThriftSocketTimeout(3000);
cassandraHostConfigurator.setMaxWaitTimeWhenExhausted(4000);
- cassandraHostConfigurator.setExhaustedPolicy(ExhaustedPolicy.WHEN_EXHAUSTED_GROW);
CassandraHost[] cassandraHosts = cassandraHostConfigurator.buildCassandraHosts();
// no need to test all, just a smattering
assertEquals(20, cassandraHosts[1].getMaxActive());
assertEquals(20, cassandraHosts[0].getMaxActive());
- assertEquals(ExhaustedPolicy.WHEN_EXHAUSTED_GROW, cassandraHosts[1].getExhaustedPolicy());
assertEquals(4000, cassandraHosts[1].getMaxWaitTimeWhenExhausted());
assertEquals(3000, cassandraHosts[2].getCassandraThriftSocketTimeout());
assertEquals(3000, cassandraHosts[0].getCassandraThriftSocketTimeout());

0 comments on commit c53f750

Please sign in to comment.