Examples of startHeartbeats()


Examples of org.apache.sling.discovery.impl.setup.Instance.startHeartbeats()

      // without any heartbeat action, the discovery service reports its local instance
      // in so called 'isolated' mode - lets test for that
        assertEquals(IsolatedInstanceDescription.class, firstInstance
                .getClusterViewService().getClusterView().getInstances().get(0)
                .getClass());
        firstInstance.startHeartbeats(1);
        Thread.sleep(4000);
        // after a heartbeat and letting it settle, the discovery service must have
        // established a view - test for that
        assertEquals(EstablishedInstanceDescription.class, firstInstance
                .getClusterViewService().getClusterView().getInstances().get(0)
View Full Code Here

Examples of org.apache.sling.discovery.impl.setup.Instance.startHeartbeats()

                .getClusterViewService().getClusterView().getInstances().get(0)
                .getClass());

        Instance secondInstance = Instance.newClusterInstance("/var/discovery/impl/ClusterLoadTest/testFramework/", "secondInstance", firstInstance, false, 2, 0);
        instances.add(secondInstance);
        secondInstance.startHeartbeats(1);
        Thread.sleep(4000);
        assertEquals(firstInstance.getClusterViewService().getClusterView().getInstances().size(), 2);
        assertEquals(secondInstance.getClusterViewService().getClusterView().getInstances().size(), 2);
    }
View Full Code Here

Examples of org.apache.sling.discovery.impl.setup.Instance.startHeartbeats()

  private void doDoTest(final int size, final int loopCnt) throws Throwable {
    if (size<2) {
      fail("can only test 2 or more instances");
    }
    Instance firstInstance = Instance.newStandaloneInstance("/var/discovery/impl/ClusterLoadTest/doTest-"+size+"-"+loopCnt+"/", "firstInstance", false, 2, 0);
    firstInstance.startHeartbeats(1);
    instances.add(firstInstance);
    for(int i=1; i<size; i++) {
      Instance subsequentInstance = Instance.newClusterInstance("/var/discovery/impl/ClusterLoadTest/doTest-"+size+"-"+loopCnt+"/", "subsequentInstance-"+i, firstInstance, false, 2, 0);
      instances.add(subsequentInstance);
      subsequentInstance.startHeartbeats(1);
View Full Code Here

Examples of org.apache.sling.discovery.impl.setup.Instance.startHeartbeats()

    firstInstance.startHeartbeats(1);
    instances.add(firstInstance);
    for(int i=1; i<size; i++) {
      Instance subsequentInstance = Instance.newClusterInstance("/var/discovery/impl/ClusterLoadTest/doTest-"+size+"-"+loopCnt+"/", "subsequentInstance-"+i, firstInstance, false, 2, 0);
      instances.add(subsequentInstance);
      subsequentInstance.startHeartbeats(1);
    }

    for(int i=0; i<loopCnt; i++) {
      logger.info("=====================");
      logger.info(" START of LOOP "+i);
View Full Code Here

Examples of org.apache.sling.discovery.impl.setup.Instance.startHeartbeats()

      logger.info("Starting/Stopping heartbeats with count="+instances.size());
      for (Iterator<Instance> it = instances.iterator(); it.hasNext();) {
        Instance instance = it.next();
        if (random.nextBoolean()) {
          logger.info("Starting heartbeats with "+instance.slingId);
          instance.startHeartbeats(1);
          logger.info("Started heartbeats with "+instance.slingId);
        } else {
          logger.info("Stopping heartbeats with "+instance.slingId);
          instance.stopHeartbeats();
          logger.info("Stopped heartbeats with "+instance.slingId);
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.