@InterfaceAudience.Private public class ReplicationPeerZKImpl extends Object implements ReplicationPeer, Abortable, Closeable
| 限定符和类型 | 类和说明 |
|---|---|
class |
ReplicationPeerZKImpl.PeerStateTracker
Tracker for state of this peer
|
class |
ReplicationPeerZKImpl.TableCFsTracker
Tracker for (table, cf-list) map of this peer
|
ReplicationPeer.PeerState| 构造器和说明 |
|---|
ReplicationPeerZKImpl(org.apache.hadoop.conf.Configuration conf,
String id,
ReplicationPeerConfig peerConfig)
Constructor that takes all the objects required to communicate with the
specified peer, except for the region server addresses.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
void |
close() |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Get the configuration object required to communicate with this peer
|
String |
getId()
Get the identifier of this peer
|
ReplicationPeerConfig |
getPeerConfig()
Get the peer config object
|
ReplicationPeer.PeerState |
getPeerState()
Returns the state of the peer
|
Map<org.apache.hadoop.hbase.TableName,List<String>> |
getTableCFs()
Get replicable (table, cf-list) map of this peer
|
boolean |
isAborted()
Check if the server or client was aborted.
|
static boolean |
isStateEnabled(byte[] bytes)
Parse the raw data from ZK to get a peer's state
|
void |
startStateTracker(ZooKeeperWatcher zookeeper,
String peerStateNode)
start a state tracker to check whether this peer is enabled or not
|
void |
startTableCFsTracker(ZooKeeperWatcher zookeeper,
String tableCFsNode)
start a table-cfs tracker to listen the (table, cf-list) map change
|
public ReplicationPeerZKImpl(org.apache.hadoop.conf.Configuration conf,
String id,
ReplicationPeerConfig peerConfig)
throws ReplicationException
conf - configuration object to this peerid - string representation of this peer's identifierpeerConfig - configuration for the replication peerReplicationExceptionpublic void startStateTracker(ZooKeeperWatcher zookeeper, String peerStateNode) throws org.apache.zookeeper.KeeperException
zookeeper - zk watcher for the local clusterpeerStateNode - path to zk node which stores peer stateorg.apache.zookeeper.KeeperExceptionpublic void startTableCFsTracker(ZooKeeperWatcher zookeeper, String tableCFsNode) throws org.apache.zookeeper.KeeperException
zookeeper - zk watcher for the local clustertableCFsNode - path to zk node which stores table-cfsorg.apache.zookeeper.KeeperExceptionpublic ReplicationPeer.PeerState getPeerState()
ReplicationPeergetPeerState 在接口中 ReplicationPeerpublic String getId()
getId 在接口中 ReplicationPeerpublic ReplicationPeerConfig getPeerConfig()
getPeerConfig 在接口中 ReplicationPeerpublic org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration 在接口中 ReplicationPeerpublic Map<org.apache.hadoop.hbase.TableName,List<String>> getTableCFs()
getTableCFs 在接口中 ReplicationPeerpublic boolean isAborted()
Abortablepublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic static boolean isStateEnabled(byte[] bytes)
throws DeserializationException
bytes - raw ZK databytes are those of a pb serialized ENABLED state.DeserializationExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.