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
-
Constructor Summary
ConstructorDescriptionReplicationAdmin
(org.apache.hadoop.conf.Configuration conf) Deprecated.Constructor that creates a connection to the local ZooKeeper ensemble. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPeer
(String id, ReplicationPeerConfig peerConfig) Deprecated.void
addPeer
(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.void
appendPeerTableCFs
(String id, String tableCfs) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useappendPeerTableCFs(String, Map)
instead.void
appendPeerTableCFs
(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.void
close()
Deprecated.copyTableCFs
(Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.void
disablePeer
(String id) Deprecated.useAdmin.disableReplicationPeer(String)
insteadvoid
disableTableRep
(TableName tableName) Deprecated.useAdmin.disableTableReplication(TableName)
insteadvoid
enablePeer
(String id) Deprecated.useAdmin.enableReplicationPeer(String)
insteadvoid
enableTableRep
(TableName tableName) Deprecated.useAdmin.enableTableReplication(TableName)
insteadgetPeerConfig
(String id) Deprecated.useAdmin.getReplicationPeerConfig(String)
insteadint
Deprecated.boolean
getPeerState
(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.0void
removePeer
(String id) Deprecated.useAdmin.removeReplicationPeer(String)
insteadvoid
removePeerTableCFs
(String id, String tableCf) Deprecated.as release of 2.0.0, and it will be removed in 3.0.0, useremovePeerTableCFs(String, Map)
instead.void
removePeerTableCFs
(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.void
setPeerTableCFs
(String id, Map<TableName, ? extends Collection<String>> tableCfs) Deprecated.void
updatePeerConfig
(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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
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:
ReplicationException
IOException
-
close
Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-
Admin
instead.