Java 类org.apache.hadoop.hbase.MasterAddressTracker 实例源码

项目:LCIndex-HBase-0.94.16    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:IRIndex    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:RStore    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf,
    this, this.conf.getInt("hbase.regionserver.catalog.timeout", Integer.MAX_VALUE));
  catalogTracker.start();
}
项目:HBase-Research    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:hbase-0.94.8-qod    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:hbase-0.94.8-qod    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:hindex    文件:TestRSStatusServlet.java   
@SuppressWarnings("deprecation")
@Before
public void setupBasicMocks() throws IOException {
  rs = Mockito.mock(HRegionServer.class);
  Mockito.doReturn(HBaseConfiguration.create())
    .when(rs).getConfiguration();
  Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
  Mockito.doReturn(metrics).when(rs).getMetrics();

  // Fake ZKW
  ZooKeeperWatcher zkw = Mockito.mock(ZooKeeperWatcher.class);
  Mockito.doReturn("fakequorum").when(zkw).getQuorum();
  Mockito.doReturn(zkw).when(rs).getZooKeeper();

  // Fake MasterAddressTracker
  MasterAddressTracker mat = Mockito.mock(MasterAddressTracker.class);
  Mockito.doReturn(fakeMasterAddress).when(mat).getMasterAddress();
  Mockito.doReturn(mat).when(rs).getMasterAddressManager();
}
项目:LCIndex-HBase-0.94.16    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this cluster and then after
 * that, wait until cluster 'up' flag has been set. This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" + 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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:IRIndex    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:RStore    文件:HConnectionManager.java   
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();

  this.clusterId = new ClusterId(this.zooKeeper, this);
}
项目:HBase-Research    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:hindex    文件:HRegionServer.java   
/**
 * Bring up connection to zk ensemble and then wait until a master for this
 * cluster and then after that, wait until cluster 'up' flag has been set.
 * This is the order in which master does things.
 * Finally put up a catalog tracker.
 * @throws IOException
 * @throws InterruptedException
 */
private void initializeZooKeeper() throws IOException, InterruptedException {
  // Open connection to zookeeper and set primary watcher
  this.zooKeeper = new ZooKeeperWatcher(conf, REGIONSERVER + ":" +
    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.
  this.clusterStatusTracker = new ClusterStatusTracker(this.zooKeeper, this);
  this.clusterStatusTracker.start();
  blockAndCheckIfStopped(this.clusterStatusTracker);

  // Create the catalog tracker and start it;
  this.catalogTracker = new CatalogTracker(this.zooKeeper, this.conf, this);
  catalogTracker.start();

  // watch for snapshots
  try {
    this.snapshotManager = new RegionServerSnapshotManager(this);
  } catch (KeeperException e) {
    this.abort("Failed to reach zk cluster when creating snapshot handler.");
  }
}
项目:LCIndex-HBase-0.94.16    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}
项目:IRIndex    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}
项目:HBase-Research    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}
项目:hbase-0.94.8-qod    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}
项目:hindex    文件:HRegionServer.java   
/**
 * @return Master address tracker instance.
 */
public MasterAddressTracker getMasterAddressManager() {
  return this.masterAddressManager;
}