- private void validateSystemStartup() throws InterruptedException {
-
- ActorPath gossiper1Path = new ChildActorPath(new ChildActorPath(registry1.path(), "store"), "gossiper");
- ActorPath gossiper2Path = new ChildActorPath(new ChildActorPath(registry2.path(), "store"), "gossiper");
- ActorPath gossiper3Path = new ChildActorPath(new ChildActorPath(registry3.path(), "store"), "gossiper");
-
- ActorSelection gossiper1 = node1.actorSelection(gossiper1Path);
- ActorSelection gossiper2 = node2.actorSelection(gossiper2Path);
- ActorSelection gossiper3 = node3.actorSelection(gossiper3Path);
-
-
- if (!resolveReference(gossiper1, gossiper2, gossiper3))
- Assert.fail("Could not find gossipers");
- }
-
- private Boolean resolveReference(ActorSelection... gossipers) {
-
- Boolean resolved = true;
- for (int i = 0; i < 5; i++) {
-
- resolved = true;
- System.out.println(System.currentTimeMillis() + " Resolving gossipers; trial #" + i);
-
- for (ActorSelection gossiper : gossipers) {
- ActorRef ref = null;
-
- try {
- Future<ActorRef> future = gossiper.resolveOne(new FiniteDuration(15000, TimeUnit.MILLISECONDS));
- ref = Await.result(future, new FiniteDuration(10000, TimeUnit.MILLISECONDS));
- } catch (Exception e) {
- System.out.println("Could not find gossiper in attempt#" + i + ". Got exception " + e.getMessage());
- }
-
- if (ref == null)
- resolved = false;
- }
-
- if (resolved) break;
-
- }
- return resolved;
- }
-