Examples of ReplicationPeer


Examples of org.apache.hadoop.hbase.replication.ReplicationPeer

        }
        try {
          HConnection conn = HConnectionManager.getConnection(conf);
          ReplicationZookeeper zk = new ReplicationZookeeper(conn, conf,
              conn.getZooKeeperWatcher());
          ReplicationPeer peer = zk.getPeer(conf.get(NAME+".peerId"));
          HTable replicatedTable = new HTable(peer.getConfiguration(),
              conf.get(NAME+".tableName"));
          scan.setStartRow(value.getRow());
          replicatedScanner = replicatedTable.getScanner(scan);
        } catch (KeeperException e) {
          throw new IOException("Got a ZK exception", e);
View Full Code Here

Examples of org.apache.hadoop.hbase.replication.ReplicationPeer

    }
  }

  private static String getPeerQuorumAddress(final Configuration conf) throws IOException {
    ZooKeeperWatcher localZKW = null;
    ReplicationPeer peer = null;
    try {
      localZKW = new ZooKeeperWatcher(conf, "VerifyReplication",
          new Abortable() {
            @Override public void abort(String why, Throwable e) {}
            @Override public boolean isAborted() {return false;}
          });

      ReplicationPeers rp = ReplicationFactory.getReplicationPeers(localZKW, conf, localZKW);
      rp.init();

      Configuration peerConf = rp.getPeerConf(peerId);
      if (peerConf == null) {
        throw new IOException("Couldn't get peer conf!");
      }

      return ZKUtil.getZooKeeperClusterKey(peerConf);
    } catch (ReplicationException e) {
      throw new IOException(
          "An error occured while trying to connect to the remove peer cluster", e);
    } finally {
      if (peer != null) {
        peer.close();
      }
      if (localZKW != null) {
        localZKW.close();
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.replication.ReplicationPeer

      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

Examples of org.apache.hadoop.hbase.replication.ReplicationPeer

          @Override
          public Void connect(HConnection conn) throws IOException {
            try {
              ReplicationZookeeper zk = new ReplicationZookeeper(conn, conf,
                  conn.getZooKeeperWatcher());
              ReplicationPeer peer = zk.getPeer(conf.get(NAME+".peerId"));
              HTable replicatedTable = new HTable(peer.getConfiguration(),
                  conf.get(NAME+".tableName"));
              scan.setStartRow(value.getRow());
              replicatedScanner = replicatedTable.getScanner(scan);
            } catch (KeeperException e) {
              throw new IOException("Got a ZK exception", e);
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.