You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jm...@apache.org on 2014/07/22 20:44:10 UTC
git commit: HBASE-11561 deprecate ImmutableBytesWritable.getSize and
replace with getLength
Repository: hbase
Updated Branches:
refs/heads/master 549a8ee21 -> 226672c55
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/226672c5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/226672c5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/226672c5
Branch: refs/heads/master
Commit: 226672c55f99ee7854a174e50063e816a2af2337
Parents: 549a8ee
Author: Jonathan M Hsieh <jm...@apache.org>
Authored: Mon Jul 21 18:50:32 2014 -0700
Committer: Jonathan M Hsieh <jm...@apache.org>
Committed: Tue Jul 22 11:41:43 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/226672c5/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/226672c5/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() {