Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
hector-client#302 made the sleep time when waiting for schema agreeme…
Browse files Browse the repository at this point in the history
…nt customizable
  • Loading branch information
mpfau committed Oct 18, 2011
1 parent 80056e5 commit b0673bf
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public abstract class AbstractCluster implements Cluster {
/**
* Linked to Cassandra StorageProxy.
*/
private static final int RING_DELAY = 30 * 1000; // delay after which we assume ring has stablized
public static final int RING_DELAY = 30 * 1000; // delay after which we assume ring has stablized
public static final int WAIT_FOR_SCHEMA_AGREEMENT_SLEEP_TIME = 1000;

protected final HConnectionManager connectionManager;
private final String name;
Expand Down Expand Up @@ -315,8 +316,8 @@ protected static void waitForSchemaAgreement(Cassandra.Client cassandra) throws
}

if (versions != 1) {
Thread.sleep(1000);
waited += 1000;
Thread.sleep(WAIT_FOR_SCHEMA_AGREEMENT_SLEEP_TIME);
waited += WAIT_FOR_SCHEMA_AGREEMENT_SLEEP_TIME;
if (waited > RING_DELAY)
throw new RuntimeException("Could not reach schema agreement in " + RING_DELAY + "ms");
}
Expand Down

0 comments on commit b0673bf

Please sign in to comment.