accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1332347 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Date Mon, 30 Apr 2012 19:24:29 GMT
Author: kturner
Date: Mon Apr 30 19:24:29 2012
New Revision: 1332347

URL: http://svn.apache.org/viewvc?rev=1332347&view=rev
Log:
ACCUMULO-561 update bytes scanned stats for batch scans

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1332347&r1=1332346&r2=1332347&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Mon Apr 30 19:24:29 2012
@@ -1601,6 +1601,7 @@ public class Tablet {
           results.add(kve);
           entriesAdded++;
           lookupResult.bytesAdded += kve.estimateMemoryUsed();
+          lookupResult.dataSize += kve.numBytes();
           
           exceededMemoryUsage = lookupResult.bytesAdded > maxResultsSize;
           
@@ -1669,6 +1670,7 @@ public class Tablet {
   class LookupResult {
     List<Range> unfinishedRanges = new ArrayList<Range>();
     long bytesAdded = 0;
+    long dataSize = 0;
     boolean closed = false;
   }
   
@@ -1691,9 +1693,12 @@ public class Tablet {
     
     ScanDataSource dataSource = new ScanDataSource(authorizations, this.defaultSecurityLabel,
columns, ssiList, ssio, interruptFlag);
     
+    LookupResult result = null;
+
     try {
       SortedKeyValueIterator<Key,Value> iter = new SourceSwitchingIterator(dataSource);
-      return lookup(iter, ranges, columns, results, maxResultSize);
+      result = lookup(iter, ranges, columns, results, maxResultSize);
+      return result;
     } catch (IOException ioe) {
       dataSource.close(true);
       throw ioe;
@@ -1704,6 +1709,8 @@ public class Tablet {
       
       synchronized (this) {
         queryCount += results.size();
+        if (result != null)
+          queryBytes += result.dataSize;
       }
     }
   }



Mime
View raw message