hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1511408 - /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Date Wed, 07 Aug 2013 17:12:49 GMT
Author: jdcryans
Date: Wed Aug  7 17:12:48 2013
New Revision: 1511408

URL: http://svn.apache.org/r1511408
Log:
HBASE-7183 print WARN message if hbase.replication.sizeOfLogQueue is too big (Michael Webster
via JD)

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1511408&r1=1511407&r2=1511408&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Wed Aug  7 17:12:48 2013
@@ -131,6 +131,8 @@ public class ReplicationSource extends T
   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 T
     // 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



Mime
View raw message