Skip to content
Browse files

Merge pull request #462 from elyrank/master

issue #461 - cannot change delay of CassandraHostRetryService
  • Loading branch information...
2 parents 38bdaa8 + 1e1e21b commit a498ad2271b75076e6538828f75de0d44e04185a Nate McCall committed
View
4 core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java
@@ -463,5 +463,9 @@ public void shutdown() {
}
}
+ public void setCassandraHostRetryDelay(int retryDelay) {
+ cassandraHostRetryService.setRetryDelayInSeconds(retryDelay);
+ cassandraHostRetryService.applyRetryDelay();
+ }
}
View
17 core/src/main/java/me/prettyprint/cassandra/service/CassandraClientMonitor.java
@@ -231,7 +231,22 @@ public boolean unsuspendCassandraHost(String hostStr) {
return connectionManager.unsuspendCassandraHost(new CassandraHost(hostStr));
}
-
+ @Override
+ public boolean setCassandraHostRetryDelay(String retryDelay) {
+ int delay;
+ try {
+ delay = Integer.parseInt(retryDelay);
+ if (delay > 0) {
+ connectionManager.setCassandraHostRetryDelay(delay);
+ return true;
+ } else {
+ return false;
+ }
+ } catch (NumberFormatException e) {
+ log.error("Invalid number entered: " + retryDelay);
+ return false;
+ }
+ }
View
4 core/src/main/java/me/prettyprint/cassandra/service/CassandraClientMonitorMBean.java
@@ -149,5 +149,7 @@
*/
boolean unsuspendCassandraHost(String hostStr);
- Set<String> getSuspendedCassandraHosts();
+ Set<String> getSuspendedCassandraHosts();
+
+ boolean setCassandraHostRetryDelay(String retryDelay);
}

0 comments on commit a498ad2

Please sign in to comment.
Something went wrong with that request. Please try again.