gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject gora git commit: GORA-461 Ineffective null check in HBaseStore#getPartitions
Date Wed, 27 Jan 2016 05:05:23 GMT
Repository: gora
Updated Branches:
  refs/heads/master 9e1467198 -> 01437e1ae


GORA-461 Ineffective null check in HBaseStore#getPartitions


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/01437e1a
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/01437e1a
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/01437e1a

Branch: refs/heads/master
Commit: 01437e1aea6098e6a31f001d139246199ce48066
Parents: 9e14671
Author: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Authored: Tue Jan 26 21:08:24 2016 -0800
Committer: Lewis John McGibbney <lewis.j.mcgibbney@jpl.nasa.gov>
Committed: Tue Jan 26 21:08:24 2016 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/gora/hbase/store/HBaseStore.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/01437e1a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
----------------------------------------------------------------------
diff --git a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
index c294691..bb83ff2 100644
--- a/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
+++ b/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
@@ -391,15 +391,17 @@ implements Configurable {
   public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query)
       throws IOException {
 
+    if (table == null) {
+      throw new IOException("No table was provided.");
+    }
+
     // taken from o.a.h.hbase.mapreduce.TableInputFormatBase
     Pair<byte[][], byte[][]> keys = table.getStartEndKeys();
     if (keys == null || keys.getFirst() == null ||
         keys.getFirst().length == 0) {
       throw new IOException("Expecting at least one region.");
     }
-    if (table == null) {
-      throw new IOException("No table was provided.");
-    }
+
     List<PartitionQuery<K,T>> partitions = new ArrayList<>(keys.getFirst().length);
     for (int i = 0; i < keys.getFirst().length; i++) {
       String regionLocation = table.getRegionLocation(keys.getFirst()[i]).getHostname();


Mime
View raw message