Skip to content

Commit

Permalink
Merge pull request #462 from elyrank/master
Browse files Browse the repository at this point in the history
issue #461 - cannot change delay of CassandraHostRetryService
  • Loading branch information
Nate McCall committed May 1, 2012
2 parents 38bdaa8 + 1e1e21b commit a498ad2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,9 @@ public void shutdown() {
}
}

public void setCassandraHostRetryDelay(int retryDelay) {
cassandraHostRetryService.setRetryDelayInSeconds(retryDelay);
cassandraHostRetryService.applyRetryDelay();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,7 @@ public interface CassandraClientMonitorMBean {
*/
boolean unsuspendCassandraHost(String hostStr);

Set<String> getSuspendedCassandraHosts();
Set<String> getSuspendedCassandraHosts();

boolean setCassandraHostRetryDelay(String retryDelay);
}

0 comments on commit a498ad2

Please sign in to comment.