Examples of MasterAddressTracker


Examples of org.apache.hadoop.hbase.MasterAddressTracker

    ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
        "testMasterAddressManagerFromZK", null);
    ZKUtil.createAndFailSilent(zk, zk.baseZNode);

    // Should not have a master yet
    MasterAddressTracker addressManager = new MasterAddressTracker(zk, null);
    addressManager.start();
    assertFalse(addressManager.hasMaster());
    zk.registerListener(addressManager);

    // Use a listener to capture when the node is actually created
    NodeCreationListener listener = new NodeCreationListener(zk, zk.masterAddressZNode);
    zk.registerListener(listener);

    // Create the master node with a dummy address
    String host = "localhost";
    int port = 1234;
    ServerName sn = new ServerName(host, port, System.currentTimeMillis());
    LOG.info("Creating master node");
    ZKUtil.createEphemeralNodeAndWatch(zk, zk.masterAddressZNode, sn.getVersionedBytes());

    // Wait for the node to be created
    LOG.info("Waiting for master address manager to be notified");
    listener.waitForCreation();
    LOG.info("Master node created");
    assertTrue(addressManager.hasMaster());
    ServerName pulledAddress = addressManager.getMasterAddress();
    assertTrue(pulledAddress.equals(sn));

  }
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

      this.isa.getPort(), this);

    // Create the master address manager, register with zk, and start it.  Then
    // block until a master is available.  No point in starting up if no master
    // running.
    this.masterAddressManager = new MasterAddressTracker(this.zooKeeper, this);
    this.masterAddressManager.start();
    blockAndCheckIfStopped(this.masterAddressManager);

    // Wait on cluster being up.  Master will set this flag up in zookeeper
    // when ready.
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

    private synchronized void setupZookeeperTrackers()
        throws ZooKeeperConnectionException{
      // initialize zookeeper and master address manager
      this.zooKeeper = getZooKeeperWatcher();
      masterAddressTracker = new MasterAddressTracker(this.zooKeeper, this);
      masterAddressTracker.start();

      this.rootRegionTracker = new RootRegionTracker(this.zooKeeper, this);
      this.rootRegionTracker.start();
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

      this.isa.getPort(), this);

    // Create the master address manager, register with zk, and start it.  Then
    // block until a master is available.  No point in starting up if no master
    // running.
    this.masterAddressManager = new MasterAddressTracker(this.zooKeeper, this);
    this.masterAddressManager.start();
    blockAndCheckIfStopped(this.masterAddressManager);

    // Wait on cluster being up.  Master will set this flag up in zookeeper
    // when ready.
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

      serverInfo.getServerAddress().getPort(), this);

    // Create the master address manager, register with zk, and start it.  Then
    // block until a master is available.  No point in starting up if no master
    // running.
    this.masterAddressManager = new MasterAddressTracker(this.zooKeeper, this);
    this.masterAddressManager.start();
    blockAndCheckIfStopped(this.masterAddressManager);

    // Wait on cluster being up.  Master will set this flag up in zookeeper
    // when ready.
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

    private synchronized void setupZookeeperTrackers()
        throws ZooKeeperConnectionException{
      // initialize zookeeper and master address manager
      this.zooKeeper = getZooKeeperWatcher();
      masterAddressTracker = new MasterAddressTracker(this.zooKeeper, this);
      masterAddressTracker.start();

      this.rootRegionTracker = new RootRegionTracker(this.zooKeeper, this);
      this.rootRegionTracker.start();
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.MasterAddressTracker

      this.isa.getPort(), this);

    // Create the master address manager, register with zk, and start it.  Then
    // block until a master is available.  No point in starting up if no master
    // running.
    this.masterAddressManager = new MasterAddressTracker(this.zooKeeper, this);
    this.masterAddressManager.start();
    blockAndCheckIfStopped(this.masterAddressManager);

    // Wait on cluster being up.  Master will set this flag up in zookeeper
    // when ready.
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MasterAddressTracker

      this.isa.getPort(), this);

    // Create the master address manager, register with zk, and start it.  Then
    // block until a master is available.  No point in starting up if no master
    // running.
    this.masterAddressManager = new MasterAddressTracker(this.zooKeeper, this);
    this.masterAddressManager.start();
    blockAndCheckIfStopped(this.masterAddressManager);

    // Wait on cluster being up.  Master will set this flag up in zookeeper
    // when ready.
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MasterAddressTracker

      TaskMonitor.get().createStatus("Master startup");
    startupStatus.setDescription("Master startup");
    masterStartTime = System.currentTimeMillis();
    try {
      this.registeredZKListenersBeforeRecovery = this.zooKeeper.getListeners();
      this.masterAddressManager = new MasterAddressTracker(getZooKeeperWatcher(), this);
      this.masterAddressManager.start();

      // Put up info server.
      int port = this.conf.getInt("hbase.master.info.port", 60010);
      if (port >= 0) {
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.MasterAddressTracker

    ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
    Mockito.doReturn("fakequorum").when(zkw).getQuorum();
    Mockito.doReturn(zkw).when(master).getZooKeeperWatcher();

    // Fake MasterAddressTracker
    MasterAddressTracker tracker = Mockito.mock(MasterAddressTracker.class);
    Mockito.doReturn(tracker).when(master).getMasterAddressManager();
    Mockito.doReturn(FAKE_HOST).when(tracker).getMasterAddress();

    // Mock admin
    admin = Mockito.mock(HBaseAdmin.class);
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.