hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Appy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-17312) [JDK8] Use default method for Observer Coprocessors
Date Fri, 17 Feb 2017 01:59:41 GMT

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

Appy commented on HBASE-17312:
------------------------------

So answering [~stack]'s question above:
Right now we have
{noformat}
public interface Foo {
  void getBar1();
  void getBar2();
}

public class BaseFoo {
  void getBar1() { }
  void getBar2() { }
}
-------

class ThirdParty extends BaseFoo {
    void getBar1() { // override }
}
{noformat}

That's changes to:
{noformat}
public interface Foo {
  void getBar1() {}
  void getBar2() {}
}
------
class ThirdParty implement Foo {   // Only one line fix
    void getBar1() { // override }
}
{noformat}

One weird case which i saw in tests was, overrides calling base class' functions. It doesn't
make sense because our base classes have no functionality. They are there to just prevent
redundant empty implementations (or returning default values when hooks have non-void return
type).

> [JDK8] Use default method for Observer Coprocessors
> ---------------------------------------------------
>
>                 Key: HBASE-17312
>                 URL: https://issues.apache.org/jira/browse/HBASE-17312
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>    Affects Versions: 2.0.0
>            Reporter: Guanghao Zhang
>            Assignee: Guanghao Zhang
>         Attachments: HBASE-17312.master.001.patch, HBASE-17312.master.001.patch
>
>
> Use default method in MasterObserver, RegionObserver, RegionServerObserver and WALObserver.
And mark the BaseRegionObserver, BaseMasterAndRegionObserver, BaseRegionServerObserver and
BaseWALObserver. User can implement the interface directly and will not break compatibility
when add new default methods.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message