@InterfaceAudience.Private public class ZKReplicationPeerStorage extends ZKReplicationStorageBase implements ReplicationPeerStorage
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
DISABLED_ZNODE_BYTES |
static byte[] |
ENABLED_ZNODE_BYTES |
static String |
PEERS_STATE_ZNODE |
static String |
PEERS_STATE_ZNODE_DEFAULT |
static String |
PEERS_ZNODE |
static String |
PEERS_ZNODE_DEFAULT |
conf, REPLICATION_ZNODE, REPLICATION_ZNODE_DEFAULT, replicationZNode, zookeeper| 构造器和说明 |
|---|
ZKReplicationPeerStorage(ZKWatcher zookeeper,
org.apache.hadoop.conf.Configuration conf) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPeer(String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
Add a replication peer.
|
ReplicationPeerConfig |
getPeerConfig(String peerId)
Get the peer config of a replication peer.
|
String |
getPeerNode(String peerId) |
String |
getPeerStateNode(String peerId) |
boolean |
isPeerEnabled(String peerId)
Test whether a replication peer is enabled.
|
List<String> |
listPeerIds()
Return the peer ids of all replication peers.
|
void |
removePeer(String peerId)
Remove a replication peer.
|
void |
setPeerState(String peerId,
boolean enabled)
Set the state of peer,
true to ENABLED, otherwise to DISABLED. |
void |
updatePeerConfig(String peerId,
ReplicationPeerConfig peerConfig)
Update the config a replication peer.
|
toByteArraypublic static final byte[] ENABLED_ZNODE_BYTES
public static final byte[] DISABLED_ZNODE_BYTES
public ZKReplicationPeerStorage(ZKWatcher zookeeper, org.apache.hadoop.conf.Configuration conf)
public void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException
ReplicationPeerStorageaddPeer 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public void removePeer(String peerId) throws ReplicationException
ReplicationPeerStorageremovePeer 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public void setPeerState(String peerId, boolean enabled) throws ReplicationException
ReplicationPeerStoragetrue to ENABLED, otherwise to DISABLED.setPeerState 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public void updatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException
ReplicationPeerStorageupdatePeerConfig 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public List<String> listPeerIds() throws ReplicationException
ReplicationPeerStoragelistPeerIds 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public boolean isPeerEnabled(String peerId) throws ReplicationException
ReplicationPeerStorageisPeerEnabled 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public ReplicationPeerConfig getPeerConfig(String peerId) throws ReplicationException
ReplicationPeerStoragegetPeerConfig 在接口中 ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.