Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents 0d4d6f6 + 6c70d67 commit c1d40cdee9117faeea3b2a491ac29c4bb76d071d @patricioe patricioe committed Apr 12, 2012
View
@@ -14,3 +14,4 @@ out
*.iml
.springBeans
*.swp
+.pmd
View
@@ -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
@@ -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();
@@ -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;
}
@@ -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=");
@@ -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
-}
@@ -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 c1d40cd

Please sign in to comment.