hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HBASE-5827) [Coprocessors] Observer notifications on exceptions
Date Wed, 27 Jun 2012 00:37:43 GMT

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

Andrew Purtell edited comment on HBASE-5827 at 6/27/12 12:36 AM:
-----------------------------------------------------------------

bq. Maybe some sort of tiered thing where the default calls the original

Yes.

So if the CP overrides this, it's done there.

If not, the base Observer class that CPs are supposed to be extending will call the original.


Edit: And the aim is source level compatibility only.
                
      was (Author: apurtell):
    bq. Maybe some sort of tiered thing where the default calls the original

Yes.

So if the CP overrides this, it's done there.

If not, the base Observer class that CPs are supposed to be extending will call the original.

                  
> [Coprocessors] Observer notifications on exceptions
> ---------------------------------------------------
>
>                 Key: HBASE-5827
>                 URL: https://issues.apache.org/jira/browse/HBASE-5827
>             Project: HBase
>          Issue Type: Improvement
>          Components: coprocessors
>            Reporter: Andrew Purtell
>            Assignee: Andrew Purtell
>
> Benjamin Busjaeger wrote on dev@:
> {quote}
> Is there a reason that RegionObservers are not notified when a get/put/delete fails?
Suppose I maintain some (transient) state in my Coprocessor that is created during preGet
and discarded during postGet. If the get fails, postGet is not invoked, so I cannot remove
the state.
> If there is a good reason, is there any other way to achieve the same thing? If not,
would  it be possible to add something the snippet below to the code base?
> {code}
>     // pre-get CP hook
>     if (withCoprocessor && (coprocessorHost != null)) {
>       if (coprocessorHost.preGet(get, results)) {
>         return results;
>       }
>     }
> +    try{
>     ...
> +    } catch (Throwable t) {
> +        // failed-get CP hook
> +        if (withCoprocessor && (coprocessorHost != null)) {
> +          coprocessorHost.failedGet(get, results);
> +        }
> +        rethrow t;
> +    }
>     // post-get CP hook
>     if (withCoprocessor && (coprocessorHost != null)) {
>       coprocessorHost.postGet(get, results);
>     }
> {code}
> {quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message