merge from 1.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/af008a41 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/af008a41 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/af008a41 Branch: refs/heads/trunk Commit: af008a41a50d8af3a0610333e0cd1ad73b247c62 Parents: 78b0dbe 9ba0ff0 Author: Jonathan Ellis <[email protected]> Authored: Wed Jun 19 16:31:14 2013 -0500 Committer: Jonathan Ellis <[email protected]> Committed: Wed Jun 19 16:31:14 2013 -0500 ---------------------------------------------------------------------- .../org/apache/cassandra/service/StorageService.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/af008a41/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/StorageService.java index 583f8da,34ecec8..f6becd0 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -65,11 -63,9 +65,8 @@@ import org.apache.cassandra.gms.* import org.apache.cassandra.io.sstable.SSTableDeletingTask; import org.apache.cassandra.io.sstable.SSTableLoader; import org.apache.cassandra.io.util.FileUtils; - import org.apache.cassandra.locator.AbstractReplicationStrategy; - import org.apache.cassandra.locator.DynamicEndpointSnitch; - import org.apache.cassandra.locator.IEndpointSnitch; - import org.apache.cassandra.locator.TokenMetadata; + import org.apache.cassandra.locator.*; -import org.apache.cassandra.metrics.StorageMetrics; -import org.apache.cassandra.net.IAsyncResult; +import org.apache.cassandra.net.AsyncOneResponse; import org.apache.cassandra.net.MessageOut; import org.apache.cassandra.net.MessagingService; import org.apache.cassandra.net.ResponseVerbHandler; @@@ -389,24 -392,29 +386,22 @@@ public class StorageService extends Not // We don't wait, because we're going to actually try to work on initClient(0); - try + // sleep a while to allow gossip to warm up (the other nodes need to know about this one before they can reply). - boolean isUp = false; - while (!isUp) ++ outer: ++ while (true) { - // sleep a while to allow gossip to warm up (the other nodes need to know about this one before they can reply). - outer: - while (true) + Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); + for (InetAddress address : Gossiper.instance.getLiveMembers()) { - Thread.sleep(1000); - for (InetAddress address : Gossiper.instance.getLiveMembers()) - { - if (!Gossiper.instance.isFatClient(address)) - break outer; - } - } - - // sleep until any schema migrations have finished - while (!MigrationManager.isReadyForBootstrap()) - { - Thread.sleep(1000); + if (!Gossiper.instance.isFatClient(address)) - { - isUp = true; - } ++ break outer; } } - catch (InterruptedException e) + + // sleep until any schema migrations have finished + while (!MigrationManager.isReadyForBootstrap()) { - throw new AssertionError(e); + Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); } }
