hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject git commit: HBASE-11561 deprecate ImmutableBytesWritable.getSize and replace with getLength
Date Tue, 22 Jul 2014 18:47:29 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 8995df459 -> 05f28d936


HBASE-11561 deprecate ImmutableBytesWritable.getSize and replace with getLength


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

Branch: refs/heads/0.98
Commit: 05f28d93657977e41fa80deab4fa350f271510d2
Parents: 8995df4
Author: Jonathan M Hsieh <jmhsieh@apache.org>
Authored: Mon Jul 21 18:50:32 2014 -0700
Committer: Jonathan M Hsieh <jon@cloudera.com>
Committed: Tue Jul 22 11:45:38 2014 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/io/ImmutableBytesWritable.java   | 8 ++++----
 .../apache/hadoop/hbase/MapFilePerformanceEvaluation.java    | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/05f28d93/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java
index 7a13392..eabc273 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ImmutableBytesWritable.java
@@ -33,7 +33,7 @@ import org.apache.hadoop.io.WritableComparator;
 /**
  * A byte sequence that is usable as a key or value.  Based on
  * {@link org.apache.hadoop.io.BytesWritable} only this class is NOT resizable
- * and DOES NOT distinguish between the size of the seqeunce and the current
+ * and DOES NOT distinguish between the size of the sequence and the current
  * capacity as {@link org.apache.hadoop.io.BytesWritable} does. Hence its
  * comparatively 'immutable'. When creating a new instance of this class,
  * the underlying byte [] is not copied, just referenced.  The backing
@@ -71,7 +71,7 @@ implements WritableComparable<ImmutableBytesWritable> {
    * @param ibw the value to set this ImmutableBytesWritable to.
    */
   public ImmutableBytesWritable(final ImmutableBytesWritable ibw) {
-    this(ibw.get(), ibw.getOffset(), ibw.getSize());
+    this(ibw.get(), ibw.getOffset(), ibw.getLength());
   }
 
   /**
@@ -119,7 +119,9 @@ implements WritableComparable<ImmutableBytesWritable> {
 
   /**
    * @return the number of valid bytes in the buffer
+   * @deprecated use {@link #getLength()} instead
    */
+  @Deprecated
   public int getSize() {
     if (this.bytes == null) {
       throw new IllegalStateException("Uninitialiized. Null constructor " +
@@ -131,8 +133,6 @@ implements WritableComparable<ImmutableBytesWritable> {
   /**
    * @return the number of valid bytes in the buffer
    */
-  //Should probably deprecate getSize() so that we keep the same calls for all
-  //byte []
   public int getLength() {
     if (this.bytes == null) {
       throw new IllegalStateException("Uninitialiized. Null constructor " +

http://git-wip-us.apache.org/repos/asf/hbase/blob/05f28d93/hbase-server/src/test/java/org/apache/hadoop/hbase/MapFilePerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MapFilePerformanceEvaluation.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/MapFilePerformanceEvaluation.java
index ec47318..e4ed1a8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MapFilePerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MapFilePerformanceEvaluation.java
@@ -252,7 +252,7 @@ public class MapFilePerformanceEvaluation {
       this.reader.next(key, value);
       PerformanceEvaluationCommons.assertKey(this.key.get(),
         format(i, this.verify).get());
-      PerformanceEvaluationCommons.assertValueSize(ROW_LENGTH, value.getSize());
+      PerformanceEvaluationCommons.assertValueSize(ROW_LENGTH, value.getLength());
     }
 
     @Override
@@ -275,7 +275,7 @@ public class MapFilePerformanceEvaluation {
     void doRow(int i) throws Exception {
       ImmutableBytesWritable k = getRandomRow();
       ImmutableBytesWritable r = (ImmutableBytesWritable)reader.get(k, value);
-      PerformanceEvaluationCommons.assertValueSize(r.getSize(), ROW_LENGTH);
+      PerformanceEvaluationCommons.assertValueSize(r.getLength(), ROW_LENGTH);
     }
 
     private ImmutableBytesWritable getRandomRow() {
@@ -304,7 +304,7 @@ public class MapFilePerformanceEvaluation {
       // TODO: Verify we're getting right values.
       for (int ii = 0; ii < 29; ii++) {
         this.reader.next(this.key, this.value);
-        PerformanceEvaluationCommons.assertValueSize(this.value.getSize(), ROW_LENGTH);
+        PerformanceEvaluationCommons.assertValueSize(this.value.getLength(), ROW_LENGTH);
       }
     }
 
@@ -325,7 +325,7 @@ public class MapFilePerformanceEvaluation {
     void doRow(int i) throws Exception {
       ImmutableBytesWritable k = getGaussianRandomRow();
       ImmutableBytesWritable r = (ImmutableBytesWritable)reader.get(k, value);
-      PerformanceEvaluationCommons.assertValueSize(r.getSize(), ROW_LENGTH);
+      PerformanceEvaluationCommons.assertValueSize(r.getLength(), ROW_LENGTH);
     }
 
     private ImmutableBytesWritable getGaussianRandomRow() {


Mime
View raw message