|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.replication.ReplicationAdmin
@InterfaceAudience.Public @InterfaceStability.Evolving public class ReplicationAdmin
This class provides the administrative interface to HBase cluster
replication. In order to use it, the cluster and the client using
ReplicationAdmin must be configured with hbase.replication
set to true.
Adding a new peer results in creating new outbound connections from every region server to a subset of region servers on the slave cluster. Each new stream of replication will start replicating from the beginning of the current HLog, meaning that edits from that past will be replicated.
Removing a peer is a destructive and irreversible operation that stops all the replication streams for the given cluster and deletes the metadata used to keep track of the replication state.
To see which commands are available in the shell, type
replication
.
Field Summary | |
---|---|
static String |
CFNAME
|
static String |
REPLICATIONGLOBAL
|
static String |
REPLICATIONTYPE
|
static String |
TNAME
|
Constructor Summary | |
---|---|
ReplicationAdmin(org.apache.hadoop.conf.Configuration conf)
Constructor that creates a connection to the local ZooKeeper ensemble. |
Method Summary | |
---|---|
void |
addPeer(String id,
String clusterKey)
Add a new peer cluster to replicate to. |
void |
close()
|
void |
disablePeer(String id)
Stop the replication stream to the specified peer. |
void |
enablePeer(String id)
Restart the replication stream to the specified peer. |
int |
getPeersCount()
Get the number of slave clusters the local cluster has. |
boolean |
getPeerState(String id)
Get the state of the specified peer cluster |
Map<String,String> |
listPeers()
Map of this cluster's peers for display. |
List<HashMap<String,String>> |
listReplicated()
Find all column families that are replicated from this cluster |
void |
removePeer(String id)
Removes a peer cluster and stops the replication to it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TNAME
public static final String CFNAME
public static final String REPLICATIONTYPE
public static final String REPLICATIONGLOBAL
Constructor Detail |
---|
public ReplicationAdmin(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- Configuration to use
IOException
- if an internal replication error occurs
RuntimeException
- if replication isn't enabled.Method Detail |
---|
public void addPeer(String id, String clusterKey) throws ReplicationException
id
- a short that identifies the clusterclusterKey
- the concatenation of the slave cluster's
hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parent
IllegalStateException
- if there's already one slave since
multi-slave isn't supported yet.
ReplicationException
public void removePeer(String id) throws ReplicationException
id
- a short that identifies the cluster
ReplicationException
public void enablePeer(String id) throws ReplicationException
id
- a short that identifies the cluster
ReplicationException
public void disablePeer(String id) throws ReplicationException
id
- a short that identifies the cluster
ReplicationException
public int getPeersCount()
public Map<String,String> listPeers()
public boolean getPeerState(String id) throws ReplicationException
id
- String format of the Short that identifies the peer, an IllegalArgumentException
is thrown if it doesn't exist
ReplicationException
public void close() throws IOException
close
in interface Closeable
IOException
public List<HashMap<String,String>> listReplicated() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |