You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org> on 2011/09/01 04:37:12 UTC

[jira] [Commented] (HBASE-3842) Refactor Coprocessor Compaction API

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

jiraposter@reviews.apache.org commented on HBASE-3842:
------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1686/
-----------------------------------------------------------

Review request for hbase.


Summary
-------

This patch adds two new hooks to wrap the selection process for store files to compact:

  void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Store store, final List<StoreFile> candidates);

  void postCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Store store, final ImmutableList<StoreFile> selected);

In addition, the existing preCompact and postCompact methods have been refactored as described in JIRA:

  InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> c,
    final Store store, final InternalScanner scanner);

  void postCompact(final ObserverContext<RegionCoprocessorEnvironment> c,
    final Store store, StoreFile resultFile);

Coprocessors that wish to override compaction behavior can wrap the provided InternalScanner in preCompact and return their own implementation.  They can then apply custom policy on the fly before returning KeyValues from the scanner.  Alternately, the coprocessor could set the "bypass" flag in preCompact, which will skip the normal process of writing out a new store file.  In this case, the coprocessor is indicating that it will handle the store file writing itself.  Once the coprocessor has written a new store file, it will need to explicitly tell the Store instance to load it using bulkLoadHFile().


This addresses bug HBASE-3842.
    https://issues.apache.org/jira/browse/HBASE-3842


Diffs
-----

  src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java d473ba7 
  src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java 008d027 
  src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 30c9d69 
  src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java 53645ce 
  src/main/java/org/apache/hadoop/hbase/regionserver/Store.java 655db7d 
  src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java c0b7267 
  src/test/java/org/apache/hadoop/hbase/coprocessor/TestClassLoading.java c2af6a1 
  src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java a8edb42 
  src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java b370ff0 

Diff: https://reviews.apache.org/r/1686/diff


Testing
-------

Added a new test case -- TestRegionObserverInterface#testCompactionOverride -- to verify custom compaction handling using an InternalScanner implementation.

All additional coprocessor related tests pass.


Thanks,

Gary



> Refactor Coprocessor Compaction API
> -----------------------------------
>
>                 Key: HBASE-3842
>                 URL: https://issues.apache.org/jira/browse/HBASE-3842
>             Project: HBase
>          Issue Type: Improvement
>          Components: coprocessors, regionserver
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Gary Helmling
>            Priority: Critical
>              Labels: compaction
>             Fix For: 0.92.0
>
>
> After HBASE-3797, the compaction logic flow has been significantly altered.  Because of this, the current compaction coprocessor API is insufficient for gaining full insight into compaction requests/results.  Refactor coprocessor API after HBASE-3797 is committed to be more extensible and increase visibility.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira