hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject hbase git commit: HBASE-13943 Get rid of KeyValue#heapSizeWithoutTags.
Date Tue, 30 Jun 2015 17:39:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 7e7fbdb84 -> 42d5ef017


HBASE-13943 Get rid of KeyValue#heapSizeWithoutTags.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/42d5ef01
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/42d5ef01
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/42d5ef01

Branch: refs/heads/master
Commit: 42d5ef017d3d629e6ca9ee93e15ac4f0f9e00ce1
Parents: 7e7fbdb
Author: anoopsjohn <anoopsamjohn@gmail.com>
Authored: Tue Jun 30 23:09:09 2015 +0530
Committer: anoopsjohn <anoopsamjohn@gmail.com>
Committed: Tue Jun 30 23:09:09 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/CellUtil.java  | 15 --------------
 .../java/org/apache/hadoop/hbase/KeyValue.java  | 21 --------------------
 .../apache/hadoop/hbase/SizeCachedKeyValue.java |  5 -----
 .../hadoop/hbase/SizeCachedNoTagsKeyValue.java  |  5 -----
 .../hadoop/hbase/regionserver/HRegion.java      |  2 +-
 .../hbase/regionserver/RSRpcServices.java       |  2 +-
 .../hadoop/hbase/regionserver/StoreScanner.java |  2 +-
 7 files changed, 3 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
index b6ae948..f84bef7 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
@@ -589,21 +589,6 @@ public final class CellUtil {
     return estimatedSerializedSizeOf(cell);
   }
 
-  /**
-   * This is a hack that should be removed once we don't care about matching
-   * up client- and server-side estimations of cell size. It needed to be
-   * backwards compatible with estimations done by older clients. We need to
-   * pretend that tags never exist and cells aren't serialized with tag
-   * length included. See HBASE-13262 and HBASE-13303
-   */
-  @Deprecated
-  public static long estimatedHeapSizeOfWithoutTags(final Cell cell) {
-    if (cell instanceof KeyValue) {
-      return ((KeyValue)cell).heapSizeWithoutTags();
-    }
-    return getSumOfCellKeyElementLengths(cell) + cell.getValueLength();
-  }
-
   /********************* tags *************************************/
   /**
    * Util method to iterate through the tags

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
index b9b60f8..2fc7975 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
@@ -2670,27 +2670,6 @@ public class KeyValue implements Cell, HeapSize, Cloneable, SettableSequenceId,
   }
 
   /**
-   * This is a hack that should be removed once we don't care about matching
-   * up client- and server-side estimations of cell size. It needed to be
-   * backwards compatible with estimations done by older clients. We need to
-   * pretend that tags never exist and KeyValues aren't serialized with tag
-   * length included. See HBASE-13262 and HBASE-13303
-   */
-  @Deprecated
-  public long heapSizeWithoutTags() {
-    int sum = 0;
-    sum += ClassSize.OBJECT;// the KeyValue object itself
-    sum += ClassSize.REFERENCE;// pointer to "bytes"
-    sum += ClassSize.align(ClassSize.ARRAY);// "bytes"
-    sum += KeyValue.KEYVALUE_INFRASTRUCTURE_SIZE;
-    sum += getKeyLength();
-    sum += getValueLength();
-    sum += 2 * Bytes.SIZEOF_INT;// offset, length
-    sum += Bytes.SIZEOF_LONG;// memstoreTS
-    return ClassSize.align(sum);
-  }
-
-  /**
    * A simple form of KeyValue that creates a keyvalue with only the key part of the byte[]
    * Mainly used in places where we need to compare two cells.  Avoids copying of bytes
    * In places like block index keys, we need to compare the key byte[] with a cell.

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedKeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedKeyValue.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedKeyValue.java
index 8a25dcd..3ed2fc9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedKeyValue.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedKeyValue.java
@@ -59,9 +59,4 @@ public class SizeCachedKeyValue extends KeyValue {
   public long heapSize() {
     return super.heapSize() + HEAP_SIZE_OVERHEAD;
   }
-
-  @Override
-  public long heapSizeWithoutTags() {
-    return super.heapSizeWithoutTags() + HEAP_SIZE_OVERHEAD;
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
index 619196d..386d997 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/SizeCachedNoTagsKeyValue.java
@@ -43,11 +43,6 @@ public class SizeCachedNoTagsKeyValue extends SizeCachedKeyValue {
   }
 
   @Override
-  public long heapSizeWithoutTags() {
-    return super.heapSize();
-  }
-
-  @Override
   public int write(OutputStream out, boolean withTags) throws IOException {
     writeInt(out, this.length);
     out.write(this.bytes, this.offset, this.length);

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 7a69e32..c139296 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -5627,7 +5627,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver,
Regi
             scannerContext.setTimeProgress(timeProgress);
             scannerContext.incrementBatchProgress(results.size());
             for (Cell cell : results) {
-              scannerContext.incrementSizeProgress(CellUtil.estimatedHeapSizeOfWithoutTags(cell));
+              scannerContext.incrementSizeProgress(CellUtil.estimatedHeapSizeOf(cell));
             }
           }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 254e447..7bcf8e7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -2336,7 +2336,7 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
               for (Result r : results) {
                 for (Cell cell : r.rawCells()) {
                   totalCellSize += CellUtil.estimatedSerializedSizeOf(cell);
-                  currentScanResultSize += CellUtil.estimatedHeapSizeOfWithoutTags(cell);
+                  currentScanResultSize += CellUtil.estimatedHeapSizeOf(cell);
                 }
               }
             }

http://git-wip-us.apache.org/repos/asf/hbase/blob/42d5ef01/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
index d60087b..701cf8a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
@@ -590,7 +590,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner
             totalBytesRead += CellUtil.estimatedSerializedSizeOf(cell);
 
             // Update the progress of the scanner context
-            scannerContext.incrementSizeProgress(CellUtil.estimatedHeapSizeOfWithoutTags(cell));
+            scannerContext.incrementSizeProgress(CellUtil.estimatedHeapSizeOf(cell));
             scannerContext.incrementBatchProgress(1);
 
             if (totalBytesRead > maxRowSize) {


Mime
View raw message