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

Geoffrey Jacoby edited comment on HBASE-22623 at 7/8/19 10:08 PM:
------------------------------------------------------------------

As an alternative to adding yet-another-new-coprocessor hook, or changing the 
behavior of an old one, how about this? Complete HBASE-18127, which adds a 
notion of OperationContext to the ObserverContext for the mutation pipeline. 
Then add a new field to the OperationContext, WALAttributeMap, which would then 
allow for _any_ coprocessor hook (before WAL committal) to annotate the WALKey. 
Then the WAL writing code would just read from the OperationContext's 
WALAttributeMap and annotate the WALKey appropriately. 

No publicly overridable code would ever get anywhere near a protobuf, and the 
only interface that would change would be the HBASE-18127 OperationContext one 
that has never been released. (This would leave as future work the more general 
cases of HBASE-18127, such as passing information from a RegionObserver to a 
WALObserver, which prevents use of thread local storage.) 

[~apurtell] [~anoop.hbase][~abhishek.chouhan][~stack]


was (Author: gjacoby):
As an alternative to adding yet-another-new-coprocessor hook, or changing the 
behavior of an old one, how about this? Complete HBASE-18127, which adds a 
notion of OperationContext to the ObserverContext for the mutation pipeline. 
Then add a new field to the OperationContext, WALAttributeMap, which would then 
allow for _any_ coprocessor hook (before WAL committal) to annotate the WALKey. 
Then the WAL writing code would just read from the OperationContext and 
annotate the WALKey appropriately. 

No publicly overridable code would ever get anywhere near a protobuf, and the 
only interface that would change would be the HBASE-18127 OperationContext one 
that has never been released. (This would leave as future work the more general 
cases of HBASE-18127, such as passing information from a RegionObserver to a 
WALObserver, which prevents use of thread local storage.) 

[~apurtell] [~anoop.hbase][~abhishek.chouhan][~stack]

> Add RegionObserver coprocessor hook for preWALAppend
> ----------------------------------------------------
>
>                 Key: HBASE-22623
>                 URL: https://issues.apache.org/jira/browse/HBASE-22623
>             Project: HBase
>          Issue Type: New Feature
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>            Priority: Major
>
> While many coprocessor hooks expose the WALEdit to implementing coprocs, 
> there aren't any that expose the WALKey before it's created and added to the 
> WALEntry. 
> It's sometimes useful for coprocessors to be able to edit the WALKey, for 
> example to add extended attributes using the fields to be added in 
> HBASE-22622. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to