Package org.apache.hadoop.hbase.replication

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


    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();
      return ZKUtil.getZooKeeperClusterKey(peerConf);
    } catch (KeeperException e) {
      throw new IOException("Got a ZK exception", e);
    } finally {
      conn.close();
View Full Code Here

      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

        }
        HConnectionManager.execute(new HConnectable<Void>(conf) {
          @Override
          public Void connect(HConnection conn) 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!");
              }
              HTable replicatedTable = new HTable(peerConf, conf.get(NAME + ".tableName"));
              scan.setStartRow(value.getRow());
              replicatedScanner = replicatedTable.getScanner(scan);
            } 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

    }
  }

  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

      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

          @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

        }
        HConnectionManager.execute(new HConnectable<Void>(conf) {
          @Override
          public Void connect(HConnection conn) 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!");
              }
              HTable replicatedTable = new HTable(peerConf, conf.get(NAME + ".tableName"));
              scan.setStartRow(value.getRow());
              replicatedScanner = replicatedTable.getScanner(scan);
            } catch (KeeperException e) {
              throw new IOException("Got a ZK exception", e);
            } finally {
              if (peer != null) {
                peer.close();
              }
              if (localZKW != null) {
                localZKW.close();
              }
            }
View Full Code Here

    HConnectionManager.execute(new HConnectable<Void>(conf) {
      @Override
      public Void connect(HConnection conn) throws IOException {
        ZooKeeperWatcher localZKW = null;
        ReplicationZookeeper zk = 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;}
          });
          zk = new ReplicationZookeeper(conn, conf, localZKW);
          // Just verifying it we can connect
          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) {
          throw new IOException("Couldn't get access to the slave cluster" +
              " because: ", ex);
        } finally {
          if (peer != null){
             peer.close();
          }
          if (zk != null){
            zk.close();
          }
          if (localZKW != null){
View Full Code Here

        HConnectionManager.execute(new HConnectable<Void>(conf) {
          @Override
          public Void connect(HConnection conn) throws IOException {
            ZooKeeperWatcher localZKW = null;
            ReplicationZookeeper zk = 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;}
              });
              zk = new ReplicationZookeeper(conn, conf, localZKW);
              // Just verifying it we can connect
              peer = zk.getPeer(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);
            } finally {
              if (peer != null) {
                peer.close();
              }
              if (zk != null) {
                zk.close();
              }
              if (localZKW != null) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.replication.ReplicationPeer

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.