@InterfaceAudience.Private public final class ReplicationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LEGACY_REGION_REPLICATION_ENDPOINT_NAME |
private static org.slf4j.Logger |
LOG |
static String |
REMOTE_WAL_DIR_NAME |
static String |
REMOTE_WAL_REPLAY_SUFFIX |
static String |
REMOTE_WAL_SNAPSHOT_SUFFIX |
static String |
RENAME_WAL_SUFFIX |
static String |
REPLICATION_ATTR_NAME |
static String |
SYNC_WAL_SUFFIX |
Modifier | Constructor and Description |
---|---|
private |
ReplicationUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getAdaptiveTimeout(int initialValue,
int retries)
Get the adaptive timeout value when performing a retry
|
static org.apache.hadoop.conf.Configuration |
getPeerClusterConfiguration(ReplicationPeerConfig peerConfig,
org.apache.hadoop.conf.Configuration baseConf) |
static org.apache.hadoop.fs.Path |
getPeerRemoteWALDir(org.apache.hadoop.fs.Path remoteWALDir,
String peerId) |
static org.apache.hadoop.fs.Path |
getPeerRemoteWALDir(String remoteWALDir,
String peerId) |
static org.apache.hadoop.fs.Path |
getPeerReplayWALDir(org.apache.hadoop.fs.Path remoteWALDir,
String peerId) |
static org.apache.hadoop.fs.Path |
getPeerSnapshotWALDir(org.apache.hadoop.fs.Path remoteWALDir,
String peerId) |
static org.apache.hadoop.fs.Path |
getPeerSnapshotWALDir(String remoteWALDir,
String peerId) |
static org.apache.hadoop.fs.FileSystem |
getRemoteWALFileSystem(org.apache.hadoop.conf.Configuration conf,
String remoteWALDir) |
private static boolean |
isCollectionEqual(Collection<String> c1,
Collection<String> c2) |
static boolean |
isNamespacesAndTableCFsEqual(ReplicationPeerConfig rpc1,
ReplicationPeerConfig rpc2) |
private static boolean |
isNamespacesEqual(Set<String> ns1,
Set<String> ns2) |
static boolean |
isReplicationForBulkLoadDataEnabled(org.apache.hadoop.conf.Configuration c) |
private static boolean |
isTableCFsEqual(Map<TableName,List<String>> tableCFs1,
Map<TableName,List<String>> tableCFs2) |
static boolean |
sleepForRetries(String msg,
long sleepForRetries,
int sleepMultiplier,
int maxRetriesMultiplier)
Do the sleeping logic
|
private static final org.slf4j.Logger LOG
public static final String REPLICATION_ATTR_NAME
public static final String REMOTE_WAL_DIR_NAME
public static final String SYNC_WAL_SUFFIX
public static final String REMOTE_WAL_REPLAY_SUFFIX
public static final String REMOTE_WAL_SNAPSHOT_SUFFIX
public static final String RENAME_WAL_SUFFIX
public static final String LEGACY_REGION_REPLICATION_ENDPOINT_NAME
private ReplicationUtils()
public static org.apache.hadoop.conf.Configuration getPeerClusterConfiguration(ReplicationPeerConfig peerConfig, org.apache.hadoop.conf.Configuration baseConf) throws ReplicationException
ReplicationException
private static boolean isCollectionEqual(Collection<String> c1, Collection<String> c2)
private static boolean isNamespacesEqual(Set<String> ns1, Set<String> ns2)
private static boolean isTableCFsEqual(Map<TableName,List<String>> tableCFs1, Map<TableName,List<String>> tableCFs2)
public static boolean isNamespacesAndTableCFsEqual(ReplicationPeerConfig rpc1, ReplicationPeerConfig rpc2)
public static boolean isReplicationForBulkLoadDataEnabled(org.apache.hadoop.conf.Configuration c)
c
- Configuration to look atpublic static org.apache.hadoop.fs.FileSystem getRemoteWALFileSystem(org.apache.hadoop.conf.Configuration conf, String remoteWALDir) throws IOException
IOException
public static org.apache.hadoop.fs.Path getPeerRemoteWALDir(String remoteWALDir, String peerId)
public static org.apache.hadoop.fs.Path getPeerRemoteWALDir(org.apache.hadoop.fs.Path remoteWALDir, String peerId)
public static org.apache.hadoop.fs.Path getPeerReplayWALDir(org.apache.hadoop.fs.Path remoteWALDir, String peerId)
public static org.apache.hadoop.fs.Path getPeerSnapshotWALDir(String remoteWALDir, String peerId)
public static org.apache.hadoop.fs.Path getPeerSnapshotWALDir(org.apache.hadoop.fs.Path remoteWALDir, String peerId)
public static boolean sleepForRetries(String msg, long sleepForRetries, int sleepMultiplier, int maxRetriesMultiplier)
msg
- Why we sleepsleepForRetries
- the base sleep time.sleepMultiplier
- by how many times the default sleeping time is augmentedmaxRetriesMultiplier
- the max retry multipliersleepMultiplier
is < maxRetriesMultiplier
public static int getAdaptiveTimeout(int initialValue, int retries)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.