[ 
https://issues.apache.org/jira/browse/HBASE-7863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582115#comment-13582115
 ] 

Matteo Bertozzi commented on HBASE-7863:
----------------------------------------

Why you've moved out from the constructor the initialization of HRegion and 
HStore?
probably if I'll write a test in 2 weeks I'll create a CompactionRequest() 
without calling initialize() and everything will crash.

Are HRegion/HStore really needed in CompactionRequest? region seems to be used 
just to send notification back. Can we have an interface or something just to 
been able to test the compaction without having to create a full 
HRegion/HStore? (My guess is that we should be able to compact just having a 
list of files. you can play with the CompactionTool to find what's the best way 
to remove the HRegion/HStore dependency.

{code}
public CompactionRequest(HRegion region, HStore store,
-        CompactSelection files, boolean isMajor, int priority) {

+        // Set common compactionrequest properties.
+        compactionRequest.initialize(this.region, this);
+        compactionRequest.setIsMajor(
+            compactionRequest.getFiles().size() == this.getStorefilesCount());
+        compactionRequest.setPriority(getCompactPriority(priority));
{code}
                
> make compactionpolicy return compactionrequest
> ----------------------------------------------
>
>                 Key: HBASE-7863
>                 URL: https://issues.apache.org/jira/browse/HBASE-7863
>             Project: HBase
>          Issue Type: Improvement
>          Components: Compaction
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>         Attachments: HBASE-7863-v0.patch, HBASE-7863-v1.patch
>
>
> See HBASE-7843, I figured the patch could be split for easier review.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to