Examples of LiveInstance


Examples of org.apache.helix.model.LiveInstance

  }

  private List<LiveInstance> deepCopy(List<LiveInstance> instances) {
    List<LiveInstance> result = new ArrayList<LiveInstance>();
    for (LiveInstance instance : instances) {
      result.add(new LiveInstance(instance.getRecord()));
    }
    return result;
  }
View Full Code Here

Examples of org.apache.helix.model.LiveInstance

      String newSessionId = ZkTestHelper.getSessionId(client);
      Assert.assertEquals(newSessionId, oldSessionId);
    }
    client.unsubscribeStateChanges(listener);
    // make sure participant is NOT disconnected
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instanceName));
    Assert.assertNotNull(liveInstance, "Live-instance should exist after " + n + " disconnects");

    // trigger flapping
    ZkTestHelper.simulateZkStateDisconnected(client);
    // wait until we get invoked by zk state change to disconnected
    boolean success = TestHelper.verify(new Verifier() {

      @Override
      public boolean verify() throws Exception {
        return client.getShutdownTrigger();
      }
    }, 30 * 1000);

    Assert.assertTrue(success, "The " + (n + 1)
        + "th disconnect event should trigger ZkHelixManager#disonnect");

    // make sure participant is disconnected
    success = TestHelper.verify(new TestHelper.Verifier() {

      @Override
      public boolean verify() throws Exception {
        LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instanceName));
        return liveInstance == null;
      }
    }, 3 * 1000);
    Assert.assertTrue(success, "Live-instance should be gone after " + (n + 1) + " disconnects");

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.