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

Mike Drob commented on HBASE-20567:
-----------------------------------

Hmm, I'm concerned about changing the CP API here, do we think there is a way 
to do the same thing by adding a new method and having default implementation 
of that call the old?

So we end up with something like:
{code}
   default void preModifyTable(final 
ObserverContext<MasterCoprocessorEnvironment> ctx,
      final TableName tableName, TableDescriptor newDescriptor) throws 
IOException {}

   default void preModifyTable(final 
ObserverContext<MasterCoprocessorEnvironment> ctx,
      final TableName tableName, TableDescriptor currentDescriptor, 
TableDescriptor newDescriptor)
    throws IOException {
      preModifyTable(ctx, tableName, newDescriptor);
    }
{code}

This way folks that are currently implementing preModifyTable don't break and 
folks that need the new method can use that. Would have to doc that If you 
override both, then only the first will get called.

> Pass both old and new descriptors to pre/post hooks of modify operations for 
> table and namespace
> ------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-20567
>                 URL: https://issues.apache.org/jira/browse/HBASE-20567
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Appy
>            Assignee: Appy
>            Priority: Major
>         Attachments: HBASE-20567.master.001.patch
>
>
> In postModify* hooks like {{postModifyX(..., Descriptor newDesc)}}, there's 
> no way of getting the old descriptor which was there before modification 
> happened.
> Having both old and new descriptors will make the hooks more useful.
> We felt the need when we wanted to audit certain events but there was no way 
> of deducing them by just seeing 'after-state' of modification.
> To keep the method signatures consistent, i have modified both pre and post 
> hooks with new arguments which are well named and commented.



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

Reply via email to