You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2013/08/30 20:10:48 UTC

svn commit: r1519040 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java

Author: jdcryans
Date: Fri Aug 30 18:10:47 2013
New Revision: 1519040

URL: http://svn.apache.org/r1519040
Log:
HBASE-9394 [replication] size accounting is completely off in the source

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

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1519040&r1=1519039&r2=1519040&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Fri Aug 30 18:10:47 2013
@@ -403,7 +403,7 @@ public class ReplicationSource extends T
           logKey.addClusterId(clusterId);
           currentNbOperations += countDistinctRowKeys(edit);
           currentNbEntries++;
-          currentSize += entry.getEdit().size();
+          currentSize += entry.getEdit().heapSize();
         } else {
           this.metrics.incrLogEditsFiltered();
         }
@@ -567,7 +567,9 @@ public class ReplicationSource extends T
    */
   protected boolean sleepForRetries(String msg, int sleepMultiplier) {
     try {
-      LOG.debug(msg + ", sleeping " + sleepForRetries + " times " + sleepMultiplier);
+      if (LOG.isTraceEnabled()) {
+        LOG.trace(msg + ", sleeping " + sleepForRetries + " times " + sleepMultiplier);
+      }
       Thread.sleep(this.sleepForRetries * sleepMultiplier);
     } catch (InterruptedException e) {
       LOG.debug("Interrupted while sleeping between retries");
@@ -633,7 +635,8 @@ public class ReplicationSource extends T
         sinkPeer = replicationSinkMgr.getReplicationSink();
         BlockingInterface rrs = sinkPeer.getRegionServer();
         if (LOG.isTraceEnabled()) {
-          LOG.trace("Replicating " + this.currentNbEntries + " entries");
+          LOG.trace("Replicating " + this.currentNbEntries +
+              " entries of total size " + currentSize);
         }
         ReplicationProtbufUtil.replicateWALEntry(rrs,
             Arrays.copyOf(this.entriesArray, currentNbEntries));