You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Elliott Clark (JIRA)" <ji...@apache.org> on 2014/11/25 00:11:13 UTC

[jira] [Commented] (HBASE-12566) HRegion should have an InterfaceAudience of LimitedPrivate(PHOENIX)

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

Elliott Clark commented on HBASE-12566:
---------------------------------------

If HRegion isn't private I don't really see anything being private.
This is a pretty slippery slope to allow other code to reach so far in. Creating splits is something that requires coordination with other parts of the system and can cause severe corruption if not handled correctly.
HBase is on the hook for making sure that things are stored correctly. We shouldn't expose anything that can cause us to lose data.

Additionally code that ignore the annotations telling who can access what do so at their own risk; not with the knowledge that we'll open everything up at the first asking. That's a sure road to making everything public and making it so nothing can be changed.

> HRegion should have an InterfaceAudience of LimitedPrivate(PHOENIX)
> -------------------------------------------------------------------
>
>                 Key: HBASE-12566
>                 URL: https://issues.apache.org/jira/browse/HBASE-12566
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Andrew Purtell
>             Fix For: 2.0.0, 0.98.9, 0.99.2
>
>
> I've discovered after HBASE-12550 that Phoenix has a class that was broken by a change to a package scoped method in HRegion:
> {code}
> diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/reg
> index 39a9fdc..3377e6b 100644
> --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
> +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
> @@ -4628,11 +4628,12 @@ public class HRegion implements HeapSize { // , Writable{
>    /**
>     * Create a daughter region from given a temp directory with the region data.
>     * @param hri Spec. for daughter region to open.
> +   * @param expectedReferenceFileCount
>     * @throws IOException
>     */
> -  HRegion createDaughterRegionFromSplits(final HRegionInfo hri) throws IOException {
> +  HRegion createDaughterRegionFromSplits(final HRegionInfo hri, int expectedReferenceFileCount) throws IOException {
>      // Move the files from the temporary .splits to the final /table/region directory
> -    fs.commitDaughterRegion(hri);
> +    fs.commitDaughterRegion(hri, expectedReferenceFileCount);
> {code}
> We should change the HRegion InterfaceAudience to LimitedPrivate(COPROC, PHOENIX).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)