hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HBASE-18770) Remove bypass method in ObserverContext and implement the 'bypass' logic case by case
Date Wed, 25 Oct 2017 21:23:00 GMT

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

stack edited comment on HBASE-18770 at 10/25/17 9:22 PM:
---------------------------------------------------------

After Andrew comment up on RB made me think, and indeed we can do bypass simply and the same
pattern for all methods; i.e. return true if you want to bypass, false otherwise.

List of methods that return bypass or not from (RegionObserver):
{code}
    default boolean preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
      List<Cell> bypassResult) throws IOException

  default boolean preExists(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
      MutableBoolean bypassResult) throws IOException

  default boolean prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit
edit,
      Durability durability) throws IOException

  default boolean preDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete
delete,
      WALEdit edit, Durability durability) throws IOException

  @Deprecated
  default boolean prePrepareTimeStampForDeleteVersion(ObserverContext<RegionCoprocessorEnvironment>
c,
      Mutation mutation, Cell cell, byte[] byteNow, Get get) throws IOException 

  default boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
      ByteArrayComparable comparator, Put put, MutableBoolean bypassResult) throws IOException

  default void preCheckAndDelete(ObserverContext<RegionCoprocessorEnvironment> c,
      byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
      ByteArrayComparable comparator, Delete delete, boolean result) throws IOException

  default boolean preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      Append append, Result bypassResult) throws IOException

  default boolean preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      Increment increment, Result bypassResult) throws IOException

{code}

... and I was going to try and fix... 

  default boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner
s,
      List<Result> result, int limit, boolean hasNext) throws IOException 

  default boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment>
c,
      InternalScanner s, Cell curRowCell, boolean hasMore) throws IOException

These seem to be doing bypass but doesn't say so in javadoc, only in client-code when it calls.


was (Author: stack):
After Andrew comment up on RB made me think, and indeed we can do bypass simply and the same
pattern for all methods; i.e. return true if you want to bypass, false otherwise.

List of methods that return bypass or not from (RegionObserver):
{code}
    default boolean preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
      List<Cell> bypassResult) throws IOException

  default boolean preExists(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
      MutableBoolean bypassResult) throws IOException

  default boolean prePut(ObserverContext<RegionCoprocessorEnvironment> c, Put put, WALEdit
edit,
      Durability durability) throws IOException

  default boolean preDelete(ObserverContext<RegionCoprocessorEnvironment> c, Delete
delete,
      WALEdit edit, Durability durability) throws IOException

  @Deprecated
  default boolean prePrepareTimeStampForDeleteVersion(ObserverContext<RegionCoprocessorEnvironment>
c,
      Mutation mutation, Cell cell, byte[] byteNow, Get get) throws IOException 

  default boolean preCheckAndPutAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
      ByteArrayComparable comparator, Put put, MutableBoolean bypassResult) throws IOException

  default Optional<Boolean> preCheckAndDeleteAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
      ByteArrayComparable comparator, Delete delete, MutableBoolean bypassResult) throws IOException

  default boolean preAppendAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      Append append, Result bypassResult) throws IOException

  default boolean preIncrementAfterRowLock(ObserverContext<RegionCoprocessorEnvironment>
c,
      Increment increment, Result bypassResult) throws IOException

{code}

... and I was going to try and fix... 

  default boolean preScannerNext(ObserverContext<RegionCoprocessorEnvironment> c, InternalScanner
s,
      List<Result> result, int limit, boolean hasNext) throws IOException 

  default boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment>
c,
      InternalScanner s, Cell curRowCell, boolean hasMore) throws IOException

These seem to be doing bypass but doesn't say so in javadoc, only in client-code when it calls.

> Remove bypass method in ObserverContext and implement the 'bypass' logic case by case
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-18770
>                 URL: https://issues.apache.org/jira/browse/HBASE-18770
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>            Reporter: Duo Zhang
>            Assignee: stack
>            Priority: Critical
>             Fix For: 2.0.0-alpha-4
>
>         Attachments: HBASE-18770.master.001.patch
>
>
> http://search-hadoop.com/m/HBase/YGbbXd0RDCIHSC1



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message