Package org.apache.hadoop.hbase.replication

Examples of org.apache.hadoop.hbase.replication.ReplicationZookeeper$ReplicationStatusTracker


    this.server = server;
    this.conf = this.server.getConfiguration();
    this.replication = isReplication(this.conf);
    if (replication) {
      try {
        this.zkHelper = new ReplicationZookeeper(server, this.replicating);
      } catch (KeeperException ke) {
        throw new IOException("Failed replication handler create " +
           "(replicating=" + this.replicating, ke);
      }
      this.replicationManager = new ReplicationSourceManager(zkHelper, conf,
View Full Code Here


    // I can close myself when comes time.
    Configuration conf = new Configuration(config);
    super.setConf(conf);
    try {
      ZooKeeperWatcher zkw = new ZooKeeperWatcher(conf, "replicationLogCleaner", null);
      this.zkHelper = new ReplicationZookeeper(this, conf, zkw);
    } catch (KeeperException e) {
      LOG.error("Error while configuring " + this.getClass().getName(), e);
    } catch (IOException e) {
      LOG.error("Error while configuring " + this.getClass().getName(), e);
    }
View Full Code Here

      filter = instantiateFilter(conf);

      try {
        HConnection connection = HConnectionManager.getConnection(conf);
        ZooKeeperWatcher zkw = connection.getZooKeeperWatcher();
        ReplicationZookeeper zkHelper = new ReplicationZookeeper(connection, conf, zkw);
        clusterId = zkHelper.getUUIDForCluster(zkw);
      } catch (ZooKeeperConnectionException e) {
        LOG.error("Problem connecting to ZooKeper during task setup", e);
      } catch (KeeperException e) {
        LOG.error("Problem reading ZooKeeper data during task setup", e);
      } catch (IOException e) {
View Full Code Here

          "enable it in order to use replication");
    }
    this.connection = HConnectionManager.getConnection(conf);
    ZooKeeperWatcher zkw = this.connection.getZooKeeperWatcher();
    try {
      this.replicationZk = new ReplicationZookeeper(this.connection, conf, zkw);
    } catch (KeeperException e) {
      throw new IOException("Unable setup the ZooKeeper connection", e);
    }
  }
View Full Code Here

  public void testNodeFailoverWorkerCopyQueuesFromRSUsingMulti() throws Exception {
    LOG.debug("testNodeFailoverWorkerCopyQueuesFromRSUsingMulti");
    conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
    final Server server = new DummyServer("hostname0.example.org");
    AtomicBoolean replicating = new AtomicBoolean(true);
    ReplicationZookeeper rz = new ReplicationZookeeper(server, replicating);
    // populate some znodes in the peer znode
    files.add("log1");
    files.add("log2");
    for (String file : files) {
      rz.addLogToList(file, "1");
    }
    // create 3 DummyServers
    Server s1 = new DummyServer("dummyserver1.example.org");
    Server s2 = new DummyServer("dummyserver2.example.org");
    Server s3 = new DummyServer("dummyserver3.example.org");
View Full Code Here

  public void testNodeFailoverDeadServerParsing() throws Exception {
    LOG.debug("testNodeFailoverDeadServerParsing");
    conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
    final Server server = new DummyServer("ec2-54-234-230-108.compute-1.amazonaws.com");
    AtomicBoolean replicating = new AtomicBoolean(true);
    ReplicationZookeeper rz = new ReplicationZookeeper(server, replicating);
    // populate some znodes in the peer znode
    files.add("log1");
    files.add("log2");
    for (String file : files) {
      rz.addLogToList(file, "1");
    }
    // create 3 DummyServers
    Server s1 = new DummyServer("ip-10-8-101-114.ec2.internal");
    Server s2 = new DummyServer("ec2-107-20-52-47.compute-1.amazonaws.com");
    Server s3 = new DummyServer("ec2-23-20-187-167.compute-1.amazonaws.com");

    // simulate three server fail sequentially
    ReplicationZookeeper rz1 = new ReplicationZookeeper(s1, new AtomicBoolean(true));
    SortedMap<String, SortedSet<String>> testMap =
        rz1.copyQueuesFromRSUsingMulti(server.getServerName().getServerName());
    ReplicationZookeeper rz2 = new ReplicationZookeeper(s2, new AtomicBoolean(true));
    testMap = rz2.copyQueuesFromRSUsingMulti(s1.getServerName().getServerName());
    ReplicationZookeeper rz3 = new ReplicationZookeeper(s3, new AtomicBoolean(true));
    testMap = rz3.copyQueuesFromRSUsingMulti(s2.getServerName().getServerName());

    ReplicationSource s = new ReplicationSource();
    s.checkIfQueueRecovered(testMap.firstKey());
    List<String> result = s.getDeadRegionServers();
View Full Code Here

    ReplicationZookeeper rz;

    public DummyNodeFailoverWorker(String znode, Server s) throws Exception {
      this.deadRsZnode = znode;
      this.server = s;
      rz = new ReplicationZookeeper(server, new AtomicBoolean(true));
    }
View Full Code Here

    this.server = server;
    this.conf = this.server.getConfiguration();
    this.replication = isReplication(this.conf);
    if (replication) {
      try {
        this.zkHelper = new ReplicationZookeeper(server, this.replicating);
      } catch (KeeperException ke) {
        throw new IOException("Failed replication handler create " +
           "(replicating=" + this.replicating, ke);
      }
      this.replicationManager = new ReplicationSourceManager(zkHelper, conf,
View Full Code Here

  }

  private static String getPeerQuorumAddress(final Configuration conf) throws IOException {
    HConnection conn = HConnectionManager.getConnection(conf);
    try {
      ReplicationZookeeper zk = new ReplicationZookeeper(conn, conf,
          conn.getZooKeeperWatcher());

      ReplicationPeer peer = zk.getPeer(peerId);
      if (peer == null) {
        throw new IOException("Couldn't get peer conf!");
      }

      Configuration peerConf = peer.getConfiguration();
View Full Code Here

    }
    HConnectionManager.execute(new HConnectable<Void>(conf) {
      @Override
      public Void connect(HConnection conn) throws IOException {
        try {
          ReplicationZookeeper zk = new ReplicationZookeeper(conn, conf,
              conn.getZooKeeperWatcher());
          // Just verifying it we can connect
          ReplicationPeer peer = zk.getPeer(peerId);
          if (peer == null) {
            throw new IOException("Couldn't get access to the slave cluster," +
                "please see the log");
          }
        } catch (KeeperException ex) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.replication.ReplicationZookeeper$ReplicationStatusTracker

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.