HBASE-7183 print WARN message if hbase.replication.sizeOfLogQueue is too big (Sho Shimauchi via JD)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1511406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
93ea2059d5
commit
8f2c6dc140
@ -131,6 +131,8 @@ public class ReplicationSource extends Thread
|
||||
private ReplicationHLogReaderManager repLogReader;
|
||||
// Handles connecting to peer region servers
|
||||
private ReplicationSinkManager replicationSinkMgr;
|
||||
//WARN threshold for the number of queued logs, defaults to 2
|
||||
private int logQueueWarnThreshold;
|
||||
|
||||
/**
|
||||
* Instantiation method used by region servers
|
||||
@ -182,13 +184,20 @@ public class ReplicationSource extends Thread
|
||||
// ReplicationQueueInfo parses the peerId out of the znode for us
|
||||
this.peerId = this.replicationQueueInfo.getPeerId();
|
||||
this.replicationSinkMgr = new ReplicationSinkManager(conn, peerId, replicationPeers, conf);
|
||||
this.logQueueWarnThreshold = this.conf.getInt("replication.source.log.queue.warn", 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void enqueueLog(Path log) {
|
||||
this.queue.put(log);
|
||||
this.metrics.setSizeOfLogQueue(queue.size());
|
||||
int queueSize = queue.size();
|
||||
this.metrics.setSizeOfLogQueue(queueSize);
|
||||
// This will log a warning for each new log that gets created above the warn threshold
|
||||
if (queueSize > this.logQueueWarnThreshold) {
|
||||
LOG.warn("Queue size: " + queueSize +
|
||||
" exceeds value of replication.source.log.queue.warn: " + logQueueWarnThreshold);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user