use of org.apache.hadoop.hbase.replication.ReplicationPeerConfig in project hbase by apache.
the class HMaster method getReplicationPeerConfig.
@Override
public ReplicationPeerConfig getReplicationPeerConfig(String peerId) throws ReplicationException, IOException {
if (cpHost != null) {
cpHost.preGetReplicationPeerConfig(peerId);
}
final ReplicationPeerConfig peerConfig = this.replicationManager.getPeerConfig(peerId);
LOG.info(getClientIdAuditPrefix() + " get replication peer config, id=" + peerId + ", config=" + peerConfig);
if (cpHost != null) {
cpHost.postGetReplicationPeerConfig(peerId);
}
return peerConfig;
}
use of org.apache.hadoop.hbase.replication.ReplicationPeerConfig in project hbase by apache.
the class VerifyReplication method getPeerQuorumConfig.
private static Pair<ReplicationPeerConfig, Configuration> getPeerQuorumConfig(final Configuration conf) throws IOException {
ZooKeeperWatcher localZKW = null;
ReplicationPeerZKImpl 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();
Pair<ReplicationPeerConfig, Configuration> pair = rp.getPeerConf(peerId);
if (pair == null) {
throw new IOException("Couldn't get peer conf!");
}
return pair;
} catch (ReplicationException e) {
throw new IOException("An error occurred while trying to connect to the remove peer cluster", e);
} finally {
if (peer != null) {
peer.close();
}
if (localZKW != null) {
localZKW.close();
}
}
}
Aggregations