Java 类org.apache.hadoop.hbase.replication.ReplicationPeer.PeerState 实例源码

项目:hbase    文件:PeerProcedureHandlerImpl.java   
private void refreshPeerState(String peerId) throws ReplicationException, IOException {
  PeerState newState;
  Lock peerLock = peersLock.acquireLock(peerId);
  try {
    ReplicationPeerImpl peer = replicationSourceManager.getReplicationPeers().getPeer(peerId);
    if (peer == null) {
      throw new ReplicationException("Peer with id=" + peerId + " is not cached.");
    }
    PeerState oldState = peer.getPeerState();
    newState = replicationSourceManager.getReplicationPeers().refreshPeerState(peerId);
    // RS need to start work with the new replication state change
    if (oldState.equals(PeerState.ENABLED) && newState.equals(PeerState.DISABLED)) {
      replicationSourceManager.refreshSources(peerId);
    }
  } finally {
    peerLock.unlock();
  }
}
项目:ditb    文件:ReplicationPeersZKImpl.java   
@Override
public boolean getStatusOfPeer(String id) {
  ReplicationPeer replicationPeer = this.peerClusters.get(id);
  if (replicationPeer == null) {
    throw new IllegalArgumentException("Peer with id= " + id + " is not connected");
  }
  return replicationPeer.getPeerState() == PeerState.ENABLED;
}
项目:pbase    文件:ReplicationPeersZKImpl.java   
@Override
public boolean getStatusOfPeer(String id) {
  ReplicationPeer replicationPeer = this.peerClusters.get(id);
  if (replicationPeer == null) {
    throw new IllegalArgumentException("Peer with id= " + id + " is not connected");
  }
  return replicationPeer.getPeerState() == PeerState.ENABLED;
}
项目:hbase    文件:ReplicationPeers.java   
public PeerState refreshPeerState(String peerId) throws ReplicationException {
  ReplicationPeerImpl peer = peerCache.get(peerId);
  if (peer == null) {
    throw new ReplicationException("Peer with id=" + peerId + " is not cached.");
  }
  peer.setPeerState(peerStorage.isPeerEnabled(peerId));
  return peer.getPeerState();
}
项目:ditb    文件:HBaseInterClusterReplicationEndpoint.java   
protected boolean isPeerEnabled() {
  return ctx.getReplicationPeer().getPeerState() == PeerState.ENABLED;
}
项目:pbase    文件:HBaseInterClusterReplicationEndpoint.java   
protected boolean isPeerEnabled() {
  return ctx.getReplicationPeer().getPeerState() == PeerState.ENABLED;
}