hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1181551 - in /hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase: ipc/HRegionInterface.java regionserver/HRegionServer.java
Date Tue, 11 Oct 2011 02:19:06 GMT
Author: nspiegelberg
Date: Tue Oct 11 02:19:05 2011
New Revision: 1181551

URL: http://svn.apache.org/viewvc?rev=1181551&view=rev
Log:
Handle null pointer in getStoreFileList

Summary:
getStoreFileList API does not take care of an invalid regionName
being passed in. This has been handled in this diff.

Test Plan:
Build it.

Reviewed By: kannan
Reviewers: kannan, aaiyer
CC: kannan
Revert Plan:
Tags:

- begin *PUBLIC* platform impact section -
Bugzilla: #
- end platform impact -

Differential Revision: 263487

Modified:
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java?rev=1181551&r1=1181550&r2=1181551&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java Tue
Oct 11 02:19:05 2011
@@ -73,7 +73,8 @@ public interface HRegionInterface extend
    */
   public HRegion [] getOnlineRegionsAsArray();
 
-  public List<String> getStoreFileList(byte[] regionName, byte[] columnFamily);
+  public List<String> getStoreFileList(byte[] regionName, byte[] columnFamily)
+    throws IllegalArgumentException;
 
   /**
    * Perform Get operation.

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1181551&r1=1181550&r2=1181551&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Tue Oct 11 02:19:05 2011
@@ -2174,8 +2174,18 @@ public class HRegionServer implements HR
     return getOnlineRegions().toArray(new HRegion[0]);
   }
 
-  public List<String> getStoreFileList(byte[] regionName, byte[] columnFamily) {
+  public List<String> getStoreFileList(byte[] regionName, byte[] columnFamily)
+    throws IllegalArgumentException {
 	  HRegion region = getOnlineRegion(regionName);
+    if (region == null) {
+      throw new IllegalArgumentException("No region : " + new String(regionName)
+          + " available");
+    }
+    Store store = region.getStore(columnFamily);
+    if (store == null) {
+      throw new IllegalArgumentException("No column family : " +
+          new String(columnFamily) + " available");
+    }
 	  List<StoreFile> storeFiles = region.getStore(columnFamily).getStorefiles();
 	  List<String> storeFileNames = new ArrayList<String>(storeFiles.size());
 	  for (StoreFile storeFile: storeFiles) {



Mime
View raw message