Package com.alibaba.wasp.zookeeper

Examples of com.alibaba.wasp.zookeeper.ClusterStatusTracker


    stallIfBackupMaster(this.conf, this.activeMasterManager);

    // The ClusterStatusTracker is setup before the other
    // ZKBasedSystemTrackers because it's needed by the activeMasterManager
    // to check if the cluster should be shutdown.
    this.clusterStatusTracker = new ClusterStatusTracker(getZooKeeper(), this);
    this.clusterStatusTracker.start();
    return this.activeMasterManager.blockUntilBecomingActiveMaster(
        startupStatus, this.clusterStatusTracker);
  }
View Full Code Here


    // Create the master node with a dummy address
    ServerName master = new ServerName("localhost", 1,
        System.currentTimeMillis());
    // Should not have a master yet
    DummyMaster dummyMaster = new DummyMaster(zk, master);
    ClusterStatusTracker clusterStatusTracker = dummyMaster
        .getClusterStatusTracker();
    ActiveMasterManager activeMasterManager = dummyMaster
        .getActiveMasterManager();
    assertFalse(activeMasterManager.clusterHasActiveMaster.get());

    // First test becoming the active master uninterrupted
    MonitoredTask status = Mockito.mock(MonitoredTask.class);
    clusterStatusTracker.setClusterUp();

    activeMasterManager.blockUntilBecomingActiveMaster(status,
        clusterStatusTracker);
    assertTrue(activeMasterManager.clusterHasActiveMaster.get());
    assertMaster(zk, master);
View Full Code Here

    DummyMaster ms1 = new DummyMaster(zk, firstMasterAddress);
    ActiveMasterManager activeMasterManager = ms1.getActiveMasterManager();
    assertFalse(activeMasterManager.clusterHasActiveMaster.get());

    // First test becoming the active master uninterrupted
    ClusterStatusTracker clusterStatusTracker = ms1.getClusterStatusTracker();
    clusterStatusTracker.setClusterUp();
    activeMasterManager.blockUntilBecomingActiveMaster(
        Mockito.mock(MonitoredTask.class), clusterStatusTracker);
    assertTrue(activeMasterManager.clusterHasActiveMaster.get());
    assertMaster(zk, firstMasterAddress);
View Full Code Here

    private volatile boolean stopped;
    private ClusterStatusTracker clusterStatusTracker;
    private ActiveMasterManager activeMasterManager;

    public DummyMaster(ZooKeeperWatcher zk, ServerName master) {
      this.clusterStatusTracker = new ClusterStatusTracker(zk, this);
      clusterStatusTracker.start();

      this.activeMasterManager = new ActiveMasterManager(zk, master, this);
      zk.registerListener(activeMasterManager);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.zookeeper.ClusterStatusTracker

Copyright © 2018 www.massapicom. 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.