@InterfaceAudience.Private @InterfaceStability.Stable public final class ReplicationPeerConfigUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HBASE_REPLICATION_PEER_BASE_CONFIG |
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ReplicationPeerConfigUtil() |
Modifier and Type | Method and Description |
---|---|
static ReplicationPeerConfig |
appendExcludeTableCFsToReplicationPeerConfig(Map<TableName,List<String>> excludeTableCfs,
ReplicationPeerConfig peerConfig) |
static ReplicationPeerConfig |
appendTableCFsToReplicationPeerConfig(Map<TableName,List<String>> tableCfs,
ReplicationPeerConfig peerConfig) |
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] |
convert(Map<TableName,? extends Collection<String>> tableCfs)
convert map to TableCFs Object
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeer |
convert(ReplicationPeerConfig peerConfig) |
static ReplicationPeerConfig |
convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeer peer) |
static String |
convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs)
Convert TableCFs Object to String.
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] |
convert(String tableCFsConfig)
Convert string to TableCFs Object.
|
static Map<TableName,List<String>> |
convert2Map(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs)
Convert tableCFs Object to Map.
|
static String |
convertToString(Map<TableName,? extends Collection<String>> tableCfs) |
static String |
convertToString(Set<String> namespaces) |
private static Map<TableName,List<String>> |
copyTableCFsMap(Map<TableName,List<String>> preTableCfs) |
static org.apache.hadoop.conf.Configuration |
getPeerClusterConfiguration(org.apache.hadoop.conf.Configuration conf,
ReplicationPeerDescription peer)
Returns the configuration needed to talk to the remote slave cluster.
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF |
getTableCF(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs,
String table)
Get TableCF in TableCFs, if not exist, return null.
|
private static Map<TableName,List<String>> |
mergeTableCFs(Map<TableName,List<String>> preTableCfs,
Map<TableName,List<String>> tableCfs) |
static ReplicationPeerConfig |
parsePeerFrom(byte[] bytes)
Parse the serialized representation of a peer configuration.
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] |
parseTableCFs(byte[] bytes)
Parse bytes into TableCFs.
|
static Map<TableName,List<String>> |
parseTableCFsFromConfig(String tableCFsConfig)
Convert tableCFs string into Map.
|
static ReplicationPeerConfig |
removeExcludeTableCFsFromReplicationPeerConfig(Map<TableName,List<String>> excludeTableCfs,
ReplicationPeerConfig peerConfig,
String id) |
static ReplicationPeerConfig |
removeTableCFsFromReplicationPeerConfig(Map<TableName,List<String>> tableCfs,
ReplicationPeerConfig peerConfig,
String id) |
static byte[] |
toByteArray(ReplicationPeerConfig peerConfig)
Returns Serialized protobuf of
peerConfig with pb magic prefix prepended suitable
for use as content of a this.peersZNode; i.e. |
static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription |
toProtoReplicationPeerDescription(ReplicationPeerDescription desc) |
static ReplicationPeerDescription |
toReplicationPeerDescription(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription desc) |
static ReplicationPeerConfig |
updateReplicationBasePeerConfigs(org.apache.hadoop.conf.Configuration conf,
ReplicationPeerConfig receivedPeerConfig)
Helper method to add/removev base peer configs from Configuration to ReplicationPeerConfig This
merges the user supplied peer configuration
ReplicationPeerConfig with peer configs provided as
property hbase.replication.peer.base.configs in hbase configuration. |
private static final org.slf4j.Logger LOG
public static final String HBASE_REPLICATION_PEER_BASE_CONFIG
private ReplicationPeerConfigUtil()
public static String convertToString(Set<String> namespaces)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] convert(Map<TableName,? extends Collection<String>> tableCfs)
public static String convertToString(Map<TableName,? extends Collection<String>> tableCfs)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] convert(String tableCFsConfig)
public static String convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF getTableCF(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs, String table)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] parseTableCFs(byte[] bytes) throws IOException
IOException
public static Map<TableName,List<String>> parseTableCFsFromConfig(String tableCFsConfig)
public static Map<TableName,List<String>> convert2Map(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.TableCF[] tableCFs)
public static ReplicationPeerConfig parsePeerFrom(byte[] bytes) throws DeserializationException
bytes
- Content of a peer znode.DeserializationException
- deserialization exceptionpublic static ReplicationPeerConfig convert(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeer peer)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeer convert(ReplicationPeerConfig peerConfig)
public static byte[] toByteArray(ReplicationPeerConfig peerConfig)
peerConfig
with pb magic prefix prepended suitable
for use as content of a this.peersZNode; i.e. the content of PEER_ID znode under
/hbase/replication/peers/PEER_IDpublic static ReplicationPeerDescription toReplicationPeerDescription(org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription desc)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.ReplicationPeerDescription toProtoReplicationPeerDescription(ReplicationPeerDescription desc)
public static ReplicationPeerConfig appendTableCFsToReplicationPeerConfig(Map<TableName,List<String>> tableCfs, ReplicationPeerConfig peerConfig)
public static ReplicationPeerConfig updateReplicationBasePeerConfigs(org.apache.hadoop.conf.Configuration conf, ReplicationPeerConfig receivedPeerConfig)
ReplicationPeerConfig
with peer configs provided as
property hbase.replication.peer.base.configs in hbase configuration. Expected format for this
hbase configuration is "k1=v1;k2=v2,v2_1;k3=""". If value is empty, it will remove the existing
key-value from peer config.conf
- Configurationpublic static ReplicationPeerConfig appendExcludeTableCFsToReplicationPeerConfig(Map<TableName,List<String>> excludeTableCfs, ReplicationPeerConfig peerConfig) throws ReplicationException
ReplicationException
private static Map<TableName,List<String>> mergeTableCFs(Map<TableName,List<String>> preTableCfs, Map<TableName,List<String>> tableCfs)
private static Map<TableName,List<String>> copyTableCFsMap(Map<TableName,List<String>> preTableCfs)
public static ReplicationPeerConfig removeTableCFsFromReplicationPeerConfig(Map<TableName,List<String>> tableCfs, ReplicationPeerConfig peerConfig, String id) throws ReplicationException
ReplicationException
public static ReplicationPeerConfig removeExcludeTableCFsFromReplicationPeerConfig(Map<TableName,List<String>> excludeTableCfs, ReplicationPeerConfig peerConfig, String id) throws ReplicationException
ReplicationException
public static org.apache.hadoop.conf.Configuration getPeerClusterConfiguration(org.apache.hadoop.conf.Configuration conf, ReplicationPeerDescription peer) throws IOException
conf
- the base configurationpeer
- the description of replication peerIOException
- when create peer cluster configuration failedCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.