@InterfaceAudience.Private abstract class ReplicationTableBase extends Object
Modifier and Type | Class and Description |
---|---|
private class |
ReplicationTableBase.CreateReplicationTableWorker
Attempts to build the Replication Table.
|
Modifier and Type | Field and Description |
---|---|
protected Abortable |
abortable |
static byte[] |
CF_QUEUE |
private static int |
CLIENT_RETRIES |
static byte[] |
COL_QUEUE_OWNER |
static byte[] |
COL_QUEUE_OWNER_HISTORY |
protected org.apache.hadoop.conf.Configuration |
conf |
private Connection |
connection |
private Executor |
executor |
private static int |
NUM_INITIALIZE_WORKERS |
private static int |
OPERATION_TIMEOUT |
static String |
QUEUE_HISTORY_DELIMITER |
private static HColumnDescriptor |
REPLICATION_COL_DESCRIPTOR |
static TableName |
REPLICATION_TABLE_NAME
Name of the HBase Table used for tracking replication
|
private CountDownLatch |
replicationTableInitialized |
static String |
ROW_KEY_DELIMITER |
private static int |
RPC_TIMEOUT |
Constructor and Description |
---|
ReplicationTableBase(org.apache.hadoop.conf.Configuration conf,
Abortable abort) |
Modifier and Type | Method and Description |
---|---|
protected String |
buildClaimedQueueHistory(String originalHistory,
String oldServer)
Creates a "|" delimited record of the queue's past region server owners.
|
protected String |
buildQueueRowKey(String serverName,
String queueId)
Build the row key for the given queueId.
|
private void |
createReplicationTableInBackground()
Builds the Replication Table in a background thread.
|
private void |
decorateConf()
Modify the connection's config so that operations run on the Replication Table have longer and
a larger number of retries
|
protected List<String> |
getAllQueues(String serverName) |
private Table |
getAndSetUpReplicationTable()
Creates a new copy of the Replication Table and sets up the proper Table time outs for it
|
boolean |
getInitializationStatus()
Get whether the Replication Table has been successfully initialized yet
|
protected List<String> |
getListOfReplicators()
Get a list of all region servers that have outstanding replication queues.
|
protected List<String> |
getLogsInQueue(byte[] rowKey) |
protected List<String> |
getLogsInQueue(String serverName,
String queueId) |
protected Table |
getOrBlockOnReplicationTable()
Attempts to acquire the Replication Table.
|
protected ResultScanner |
getQueuesBelongingToServer(String server)
Get the queue id's and meta data (Owner and History) for the queues belonging to the named
server
|
protected String |
getRawQueueIdFromRowKey(String rowKey)
Parse the original queueId from a row key
|
protected byte[] |
queueIdToRowKey(String serverName,
String queueId)
Returns a queue's row key given either its raw or reclaimed queueId
|
protected List<String> |
readWALsFromResult(Result queue)
Read all of the WAL's from a queue into a list
|
private Table |
setReplicationTableTimeOuts(Table replicationTable)
Increases the RPC and operations timeouts for the Replication Table
|
private Executor |
setUpExecutor()
Sets up the thread pool executor used to build the Replication Table in the background
|
public static final TableName REPLICATION_TABLE_NAME
public static final byte[] CF_QUEUE
public static final byte[] COL_QUEUE_OWNER
public static final byte[] COL_QUEUE_OWNER_HISTORY
private static final HColumnDescriptor REPLICATION_COL_DESCRIPTOR
public static final String ROW_KEY_DELIMITER
public static final String QUEUE_HISTORY_DELIMITER
private static final int CLIENT_RETRIES
private static final int RPC_TIMEOUT
private static final int OPERATION_TIMEOUT
private static final int NUM_INITIALIZE_WORKERS
protected final org.apache.hadoop.conf.Configuration conf
private final Connection connection
private volatile CountDownLatch replicationTableInitialized
public ReplicationTableBase(org.apache.hadoop.conf.Configuration conf, Abortable abort) throws IOException
IOException
private void decorateConf()
private Executor setUpExecutor()
public boolean getInitializationStatus()
private Table setReplicationTableTimeOuts(Table replicationTable)
protected String buildQueueRowKey(String serverName, String queueId)
serverName
- The owner of the queuequeueId
- String identifier of the queueprotected String getRawQueueIdFromRowKey(String rowKey)
rowKey
- String representation of a queue's row keyprotected byte[] queueIdToRowKey(String serverName, String queueId)
queueId
- queueId of the queueprotected String buildClaimedQueueHistory(String originalHistory, String oldServer)
originalHistory
- the queue's original owner historyoldServer
- the name of the server that used to own the queueprotected List<String> getListOfReplicators()
protected List<String> getAllQueues(String serverName)
protected List<String> getLogsInQueue(String serverName, String queueId)
protected List<String> getLogsInQueue(byte[] rowKey)
protected List<String> readWALsFromResult(Result queue)
queue
- HBase query result containing the queueprotected ResultScanner getQueuesBelongingToServer(String server) throws IOException
server
- name of the serverIOException
protected Table getOrBlockOnReplicationTable() throws IOException
IOException
private Table getAndSetUpReplicationTable() throws IOException
IOException
private void createReplicationTableInBackground() throws IOException
IOException
- if the Replication Table takes too long to buildCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.