[
https://issues.apache.org/jira/browse/HBASE-7105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269020#comment-14269020
]
Cosmin Lehene commented on HBASE-7105:
--------------------------------------
{{majorCompaction}} is still only initialized in open and will throw in
{{isMajorCompaction}}
{code}
public boolean isMajorCompaction() {
if (this.majorCompaction == null) {
throw new NullPointerException("This has not been set yet");
}
return this.majorCompaction.get();
}
{code}
Since we only initialize in {{open()}} (called only from {{createReader()}})
and we're (re)setting it to the correct value we should initialize this to
false rather than null indeed.
> RS throws NPE on forcing compaction from HBase shell on a single bulk
> imported file.
> ------------------------------------------------------------------------------------
>
> Key: HBASE-7105
> URL: https://issues.apache.org/jira/browse/HBASE-7105
> Project: HBase
> Issue Type: Bug
> Components: regionserver
> Reporter: Karthik Ranganathan
> Assignee: Karthik Ranganathan
> Fix For: 1.0.0, 2.0.0
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)