hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16145 MultiRowRangeFilter constructor shouldn't throw IOException (Konstantin Ryakhovskiy)
Date Mon, 17 Oct 2016 23:06:16 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 0c304a049 -> 10840a51e


HBASE-16145 MultiRowRangeFilter constructor shouldn't throw IOException (Konstantin Ryakhovskiy)


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

Branch: refs/heads/master
Commit: 10840a51e851d3ea50749a9527310142a967dab3
Parents: 0c304a0
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Oct 17 16:06:10 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Mon Oct 17 16:06:10 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/filter/MultiRowRangeFilter.java | 12 ++----------
 .../apache/hadoop/hbase/rest/model/ScannerModel.java    |  6 +-----
 .../org/apache/hadoop/hbase/mapreduce/RowCounter.java   |  7 +------
 3 files changed, 4 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/10840a51/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
index 328498d..66556b0 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.hbase.filter;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -64,11 +63,8 @@ public class MultiRowRangeFilter extends FilterBase {
 
   /**
    * @param list A list of <code>RowRange</code>
-   * @throws java.io.IOException
-   *           throw an exception if the range list is not in an natural order or any
-   *           <code>RowRange</code> is invalid
    */
-  public MultiRowRangeFilter(List<RowRange> list) throws IOException {
+  public MultiRowRangeFilter(List<RowRange> list) {
     this.rangeList = sortAndMerge(list);
   }
 
@@ -184,11 +180,7 @@ public class MultiRowRangeFilter extends FilterBase {
               rangeProto.getStopRow().toByteArray() : null, rangeProto.getStopRowInclusive());
       rangeList.add(range);
     }
-    try {
-      return new MultiRowRangeFilter(rangeList);
-    } catch (IOException e) {
-      throw new DeserializationException("Fail to instantiate the MultiRowRangeFilter", e);
-    }
+    return new MultiRowRangeFilter(rangeList);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/10840a51/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
index a1d852e..024fec8 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
@@ -407,11 +407,7 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable
{
         filter = new MultipleColumnPrefixFilter(values);
       } break;
       case MultiRowRangeFilter: {
-        try {
-          filter = new MultiRowRangeFilter(ranges);
-        } catch (IOException e) {
-          throw new RuntimeException(e);
-        }
+        filter = new MultiRowRangeFilter(ranges);
       } break;
       case PageFilter:
         filter = new PageFilter(Long.parseLong(value));

http://git-wip-us.apache.org/repos/asf/hbase/blob/10840a51/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
index aca84fd..47651af 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
@@ -207,12 +207,7 @@ public class RowCounter extends Configured implements Tool {
       scan.setStartRow(range.getStartRow()); //inclusive
       scan.setStopRow(range.getStopRow());   //exclusive
     } else if (size > 1) {
-      try {
-        scan.setFilter(new MultiRowRangeFilter(rowRangeList));
-      } catch (IOException e) {
-        //the IOException should never be thrown. see HBASE-16145
-        throw new RuntimeException("Cannot instantiate MultiRowRangeFilter");
-      }
+      scan.setFilter(new MultiRowRangeFilter(rowRangeList));
     }
   }
 


Mime
View raw message