gjacoby126 commented on a change in pull request #390: HBASE-22623 - Add 
RegionObserver coprocessor hook for preWALAppend
URL: https://github.com/apache/hbase/pull/390#discussion_r305577407
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
 ##########
 @@ -1104,4 +1105,18 @@ default DeleteTracker postInstantiateDeleteTracker(
       throws IOException {
     return delTracker;
   }
+
+  /**
+   * Called just before the WAL Entry is appended to the WAL. Implementing 
this hook allows
+   * coprocessors to add extended attributes to the WALKey that then get 
persisted to the
+   * WAL, and are available to replication endpoints to use in processing WAL 
Entries.
+   * @param ctx
+   * @param key
+   * @return
+   * @throws IOException
+   */
+  default WALKeyImpl 
preWALAppend(ObserverContext<RegionCoprocessorEnvironment> ctx, WALKeyImpl key)
 
 Review comment:
   @apurtell - the header comments for WALEdit state that the class is meant to 
be read-only for coprocs. There are coprocessor hooks that take a WALEdit 
parameter, but unless I missed one, they all seem to be _after_ the WAL has 
been appended so that mutating the edit has no function. 
   
   I don't understand the reason for the restriction -- we trust coprocessor 
implementers to do sane things already everywhere else -- but since the code 
had an explicit policy I tried to honor it. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to