You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2012/11/07 21:15:20 UTC

svn commit: r1406786 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java

Author: liyin
Date: Wed Nov  7 20:15:20 2012
New Revision: 1406786

URL: http://svn.apache.org/viewvc?rev=1406786&view=rev
Log:
[HBASE-7105] RS throws NPE on forcing compaction from HBase shell on a single bulk imported file.

Author: kranganathan

Summary:
In StoreFile, we have:
private AtomicBoolean majorCompaction = null;

In StoreFile.open(), we do:
b = metadataMap.get(MAJOR_COMPACTION_KEY);
if (b != null) { // init majorCompaction variable }

Because the file was bulk imported, this is never initialized. Any subsequent call to isMajorCompaction() NPE's. Fix is to initialize it to false.

Test Plan: Ran unit tests, re-ran the test case that broke it.

Reviewers: kannan

Reviewed By: kannan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D622348

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1406786&r1=1406785&r2=1406786&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java Wed Nov  7 20:15:20 2012
@@ -175,7 +175,7 @@ public class StoreFile extends SchemaCon
 
   // If true, this file was product of a major compaction.  Its then set
   // whenever you get a Reader.
-  private AtomicBoolean majorCompaction = null;
+  private AtomicBoolean majorCompaction = new AtomicBoolean(false);
 
   /** Meta key set when store file is a result of a bulk load */
   public static final byte[] BULKLOAD_TASK_KEY =