Class ReplicationAdmin
java.lang.Object
org.apache.hadoop.hbase.client.replication.ReplicationAdmin
- All Implemented Interfaces:
Closeable,AutoCloseable
Deprecated.
This class provides the administrative interface to HBase cluster replication.
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 WAL, 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReplicationAdmin(org.apache.hadoop.conf.Configuration conf) Deprecated.Constructor that creates a connection to the local ZooKeeper ensemble. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeer(String id, ReplicationPeerConfig peerConfig) Deprecated.voidaddPeer(String id, ReplicationPeerConfig peerConfig, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useaddPeer(String, ReplicationPeerConfig)instead.voidappendPeerTableCFs(String id, String tableCfs) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useappendPeerTableCFs(String, Map)instead.voidappendPeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.voidclose()Deprecated.copyTableCFs(Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.voiddisablePeer(String id) Deprecated.useAdmin.disableReplicationPeer(String)insteadvoiddisableTableRep(TableName tableName) Deprecated.useAdmin.disableTableReplication(TableName)insteadvoidenablePeer(String id) Deprecated.useAdmin.enableReplicationPeer(String)insteadvoidenableTableRep(TableName tableName) Deprecated.useAdmin.enableTableReplication(TableName)insteadgetPeerConfig(String id) Deprecated.useAdmin.getReplicationPeerConfig(String)insteadintDeprecated.booleangetPeerState(String id) Deprecated.Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, usegetPeerConfig(String)instead.Deprecated.useAdmin.listReplicationPeers()insteadDeprecated.useAdmin.listReplicatedTableCFs()instead(package private) List<ReplicationPeerDescription>Deprecated.useAdmin.listReplicationPeers()insteadparseTableCFsFromConfig(String tableCFsConfig) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0voidremovePeer(String id) Deprecated.useAdmin.removeReplicationPeer(String)insteadvoidremovePeerTableCFs(String id, String tableCf) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useremovePeerTableCFs(String, Map)instead.voidremovePeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.voidsetPeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.voidupdatePeerConfig(String id, ReplicationPeerConfig peerConfig) Deprecated.
-
Field Details
-
TNAME
Deprecated.- See Also:
-
CFNAME
Deprecated.- See Also:
-
REPLICATIONTYPE
Deprecated.- See Also:
-
REPLICATIONGLOBAL
Deprecated. -
connection
Deprecated. -
admin
Deprecated.
-
-
Constructor Details
-
ReplicationAdmin
Deprecated.Constructor that creates a connection to the local ZooKeeper ensemble.- Parameters:
conf- Configuration to use- Throws:
IOException- if an internal replication error occursRuntimeException- if replication isn't enabled.
-
-
Method Details
-
addPeer
@Deprecated public void addPeer(String id, ReplicationPeerConfig peerConfig, Map<TableName, ? extends Collection<String>> tableCfs) throws ReplicationException, IOExceptionDeprecated.as release of 2.0.0, and it will be removed in 3.0.0, useaddPeer(String, ReplicationPeerConfig)instead.Add a new remote slave cluster for replication.- Parameters:
id- a short name that identifies the clusterpeerConfig- configuration for the replication slave clustertableCfs- the table and column-family list which will be replicated for this peer. A map from tableName to column family names. An empty collection can be passed to indicate replicating all column families. Pass null for replicating all table and column families- Throws:
ReplicationExceptionIOException
-
addPeer
@Deprecated public void addPeer(String id, ReplicationPeerConfig peerConfig) throws ReplicationException, IOException Deprecated.Add a new remote slave cluster for replication.- Parameters:
id- a short name that identifies the clusterpeerConfig- configuration for the replication slave cluster- Throws:
ReplicationExceptionIOException
-
parseTableCFsFromConfig
@Deprecated public static Map<TableName,List<String>> parseTableCFsFromConfig(String tableCFsConfig) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0 -
updatePeerConfig
@Deprecated public void updatePeerConfig(String id, ReplicationPeerConfig peerConfig) throws IOException Deprecated.- Throws:
IOException
-
removePeer
Deprecated.useAdmin.removeReplicationPeer(String)insteadRemoves a peer cluster and stops the replication to it.- Parameters:
id- a short name that identifies the cluster- Throws:
IOException
-
enablePeer
Deprecated.useAdmin.enableReplicationPeer(String)insteadRestart the replication stream to the specified peer.- Parameters:
id- a short name that identifies the cluster- Throws:
IOException
-
disablePeer
Deprecated.useAdmin.disableReplicationPeer(String)insteadStop the replication stream to the specified peer.- Parameters:
id- a short name that identifies the cluster- Throws:
IOException
-
getPeersCount
Deprecated.Get the number of slave clusters the local cluster has.- Returns:
- number of slave clusters
- Throws:
IOException
-
listPeerConfigs
Deprecated.useAdmin.listReplicationPeers()instead- Throws:
IOException
-
getPeerConfig
Deprecated.useAdmin.getReplicationPeerConfig(String)instead- Throws:
IOException
-
getPeerTableCFs
Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, usegetPeerConfig(String)instead.Get the replicable table-cf config of the specified peer.- Parameters:
id- a short name that identifies the cluster- Throws:
IOException
-
appendPeerTableCFs
@Deprecated public void appendPeerTableCFs(String id, String tableCfs) throws ReplicationException, IOException Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useappendPeerTableCFs(String, Map)instead.Append the replicable table-cf config of the specified peer- Parameters:
id- a short that identifies the clustertableCfs- table-cfs config str- Throws:
ReplicationExceptionIOException
-
appendPeerTableCFs
@Deprecated public void appendPeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) throws ReplicationException, IOExceptionDeprecated.Append the replicable table-cf config of the specified peer- Parameters:
id- a short that identifies the clustertableCfs- A map from tableName to column family names- Throws:
ReplicationExceptionIOException
-
removePeerTableCFs
@Deprecated public void removePeerTableCFs(String id, String tableCf) throws ReplicationException, IOException Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useremovePeerTableCFs(String, Map)instead.Remove some table-cfs from table-cfs config of the specified peer- Parameters:
id- a short name that identifies the clustertableCf- table-cfs config str- Throws:
ReplicationExceptionIOException
-
removePeerTableCFs
@Deprecated public void removePeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) throws ReplicationException, IOExceptionDeprecated.Remove some table-cfs from config of the specified peer- Parameters:
id- a short name that identifies the clustertableCfs- A map from tableName to column family names- Throws:
ReplicationExceptionIOException
-
copyTableCFs
private Map<TableName,List<String>> copyTableCFs(Map<TableName, ? extends Collection<String>> tableCfs) Deprecated. -
setPeerTableCFs
@Deprecated public void setPeerTableCFs(String id, Map<TableName, ? extends Collection<String>> tableCfs) throws IOExceptionDeprecated.Set the replicable table-cf config of the specified peer- Parameters:
id- a short name that identifies the clustertableCfs- the table and column-family list which will be replicated for this peer. A map from tableName to column family names. An empty collection can be passed to indicate replicating all column families. Pass null for replicating all table and column families- Throws:
IOException
-
getPeerState
Deprecated.Get the state of the specified peer cluster- Parameters:
id- String format of the Short name that identifies the peer, an IllegalArgumentException is thrown if it doesn't exist- Returns:
- true if replication is enabled to that peer, false if it isn't
- Throws:
ReplicationExceptionIOException
-
close
Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
listReplicated
Deprecated.useAdmin.listReplicatedTableCFs()insteadFind all column families that are replicated from this cluster- Returns:
- the full list of the replicated column families of this cluster as: tableName, family name, replicationType Currently replicationType is Global. In the future, more replication types may be extended here. For example 1) the replication may only apply to selected peers instead of all peers 2) the replicationType may indicate the host Cluster servers as Slave for the table:columnFam.
- Throws:
IOException
-
enableTableRep
Deprecated.useAdmin.enableTableReplication(TableName)insteadEnable a table's replication switch.- Parameters:
tableName- name of the table- Throws:
IOException- if a remote or network exception occurs
-
disableTableRep
Deprecated.useAdmin.disableTableReplication(TableName)insteadDisable a table's replication switch.- Parameters:
tableName- name of the table- Throws:
IOException- if a remote or network exception occurs
-
listReplicationPeers
Deprecated.useAdmin.listReplicationPeers()instead- Throws:
IOException
-
Admininstead.