@InterfaceAudience.Private @InterfaceStability.Evolving public class ReplicationSourceLogQueue extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private static org.slf4j.Logger |
LOG |
private int |
logQueueWarnThreshold |
private MetricsSource |
metrics |
private Map<String,PriorityBlockingQueue<org.apache.hadoop.fs.Path>> |
queues |
private int |
queueSizePerGroup |
private ReplicationSource |
source |
Constructor and Description |
---|
ReplicationSourceLogQueue(org.apache.hadoop.conf.Configuration conf,
MetricsSource metrics,
ReplicationSource source) |
Modifier and Type | Method and Description |
---|---|
void |
clear(String walGroupId)
Remove all the elements from the queue corresponding to walGroupId
|
boolean |
enqueueLog(org.apache.hadoop.fs.Path wal,
String walGroupId)
Enqueue the wal
|
MetricsSource |
getMetrics() |
int |
getNumQueues()
Returns number of queues.
|
(package private) long |
getOldestWalAge() |
private long |
getOldestWalTimestamp() |
PriorityBlockingQueue<org.apache.hadoop.fs.Path> |
getQueue(String walGroupId)
Return queue for the given walGroupId Please don't add or remove elements from the returned
queue.
|
Map<String,PriorityBlockingQueue<org.apache.hadoop.fs.Path>> |
getQueues() |
int |
getQueueSize(String walGroupId)
Get the queue size for the given walGroupId.
|
void |
remove(String walGroupId)
Remove head from the queue corresponding to given walGroupId.
|
private static final org.slf4j.Logger LOG
private Map<String,PriorityBlockingQueue<org.apache.hadoop.fs.Path>> queues
private MetricsSource metrics
private org.apache.hadoop.conf.Configuration conf
private int queueSizePerGroup
private int logQueueWarnThreshold
private ReplicationSource source
public ReplicationSourceLogQueue(org.apache.hadoop.conf.Configuration conf, MetricsSource metrics, ReplicationSource source)
public boolean enqueueLog(org.apache.hadoop.fs.Path wal, String walGroupId)
wal
- wal to be enqueuedwalGroupId
- Key for the wal in @queues mappublic int getQueueSize(String walGroupId)
walGroupId
- walGroupIdpublic int getNumQueues()
public Map<String,PriorityBlockingQueue<org.apache.hadoop.fs.Path>> getQueues()
public PriorityBlockingQueue<org.apache.hadoop.fs.Path> getQueue(String walGroupId)
walGroupId
- walGroupIdpublic void remove(String walGroupId)
walGroupId
- walGroupIdpublic void clear(String walGroupId)
walGroupId
- walGroupIdlong getOldestWalAge()
private long getOldestWalTimestamp()
public MetricsSource getMetrics()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.