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 2016/02/18 00:59:27 UTC
hbase git commit: HBASE-15283 Revert to IOException in TimeRange
constructor to maintain API compat in 1.x line
Repository: hbase
Updated Branches:
refs/heads/branch-1 455e09c32 -> 2e1a3ef64
HBASE-15283 Revert to IOException in TimeRange constructor to maintain API compat in 1.x line
[branch-1 and branch-1.2 only] HBASE-14355 changed the type of exception thrown if an invalid TimeRange is specified. This reverts to 1.1.x semantics.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2e1a3ef6
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2e1a3ef6
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2e1a3ef6
Branch: refs/heads/branch-1
Commit: 2e1a3ef644be31fd35d10769722c7b1ea8be443f
Parents: 455e09c
Author: Jonathan M Hsieh <jm...@apache.org>
Authored: Wed Feb 17 11:20:23 2016 -0800
Committer: Jonathan M Hsieh <jm...@apache.org>
Committed: Wed Feb 17 15:57:54 2016 -0800
----------------------------------------------------------------------
.../java/org/apache/hadoop/hbase/client/Query.java | 9 +++++++--
.../java/org/apache/hadoop/hbase/io/TimeRange.java | 17 ++++++++++++++---
2 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/2e1a3ef6/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java
index 268d81a..53e680d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java
@@ -17,6 +17,7 @@
*/
package org.apache.hadoop.hbase.client;
+import java.io.IOException;
import java.util.Map;
import com.google.common.collect.Maps;
@@ -192,8 +193,12 @@ public abstract class Query extends OperationWithAttributes {
*/
public Query setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) {
- colFamTimeRangeMap.put(cf, new TimeRange(minStamp, maxStamp));
- return this;
+ try {
+ colFamTimeRangeMap.put(cf, new TimeRange(minStamp, maxStamp));
+ return this;
+ } catch (IOException ioe) {
+ throw new IllegalArgumentException(ioe);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/hbase/blob/2e1a3ef6/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
index a300c21..672cc9d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
@@ -43,7 +43,9 @@ public class TimeRange {
/**
* Default constructor.
* Represents interval [0, Long.MAX_VALUE) (allTime)
+ * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above
*/
+ @Deprecated
public TimeRange() {
allTime = true;
}
@@ -51,7 +53,9 @@ public class TimeRange {
/**
* Represents interval [minStamp, Long.MAX_VALUE)
* @param minStamp the minimum timestamp value, inclusive
+ * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above
*/
+ @Deprecated
public TimeRange(long minStamp) {
this.minStamp = minStamp;
}
@@ -59,7 +63,9 @@ public class TimeRange {
/**
* Represents interval [minStamp, Long.MAX_VALUE)
* @param minStamp the minimum timestamp value, inclusive
+ * @deprecated This is removed in the 2.0 line and above
*/
+ @Deprecated
public TimeRange(byte [] minStamp) {
this.minStamp = Bytes.toLong(minStamp);
}
@@ -68,15 +74,18 @@ public class TimeRange {
* Represents interval [minStamp, maxStamp)
* @param minStamp the minimum timestamp, inclusive
* @param maxStamp the maximum timestamp, exclusive
- * @throws IllegalArgumentException
+ * @throws IllegalArgumentException if either <0,
+ * @throws IOException if max smaller than min.
+ * @deprecated This is made @InterfaceAudience.Private in the 2.0 line and above
*/
- public TimeRange(long minStamp, long maxStamp) {
+ @Deprecated
+ public TimeRange(long minStamp, long maxStamp) throws IOException {
if (minStamp < 0 || maxStamp < 0) {
throw new IllegalArgumentException("Timestamp cannot be negative. minStamp:" + minStamp
+ ", maxStamp:" + maxStamp);
}
if(maxStamp < minStamp) {
- throw new IllegalArgumentException("maxStamp is smaller than minStamp");
+ throw new IOException("maxStamp is smaller than minStamp");
}
this.minStamp = minStamp;
this.maxStamp = maxStamp;
@@ -87,7 +96,9 @@ public class TimeRange {
* @param minStamp the minimum timestamp, inclusive
* @param maxStamp the maximum timestamp, exclusive
* @throws IOException
+ * @deprecated This is removed in the 2.0 line and above
*/
+ @Deprecated
public TimeRange(byte [] minStamp, byte [] maxStamp)
throws IOException {
this(Bytes.toLong(minStamp), Bytes.toLong(maxStamp));