@InterfaceAudience.Private public class FSReplicationPeerStorage extends Object implements ReplicationPeerStorage
hbase
|
--peers
|
--<peer_id>
|
--peer_config
|
--disabled
|
--sync-rep-state
Notice that, if the peer is enabled, we will not have a disabled file.
And for other files, to avoid depending on atomic rename, we will use two files for storing the
content. When loading, we will try to read both the files and load the newer one. And when
writing, we will write to the older file.| Modifier and Type | Field and Description |
|---|---|
static String |
PEERS_DIR |
static String |
PEERS_DIR_DEFAULT |
| Constructor and Description |
|---|
FSReplicationPeerStorage(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPeer(String peerId,
ReplicationPeerConfig peerConfig,
boolean enabled)
Add a replication peer.
|
ReplicationPeerConfig |
getPeerConfig(String peerId)
Get the peer config of a replication peer.
|
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.
|
public static final String PEERS_DIR
public static final String PEERS_DIR_DEFAULT
public FSReplicationPeerStorage(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf)
throws IOException
IOExceptionpublic void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException
ReplicationPeerStorageaddPeer in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public void removePeer(String peerId) throws ReplicationException
ReplicationPeerStorageremovePeer in interface 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 in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public void updatePeerConfig(String peerId, ReplicationPeerConfig peerConfig) throws ReplicationException
ReplicationPeerStorageupdatePeerConfig in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public List<String> listPeerIds() throws ReplicationException
ReplicationPeerStoragelistPeerIds in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public boolean isPeerEnabled(String peerId) throws ReplicationException
ReplicationPeerStorageisPeerEnabled in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.public ReplicationPeerConfig getPeerConfig(String peerId) throws ReplicationException
ReplicationPeerStoragegetPeerConfig in interface ReplicationPeerStorageReplicationException - if there are errors accessing the storage service.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.