Apache9 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_r311968129
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
 ##########
 @@ -1104,4 +1104,16 @@ 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 the environment provided by the region server
+   * @param key the WALKey associated with a particular append to a WAL
+   */
+  default void preWALAppend(ObserverContext<RegionCoprocessorEnvironment> ctx, 
WALKey key,
 
 Review comment:
   Phoenix already uses lots of deprecated methods in HBase, and I believe you 
can not find alternate solutions, for example, this one
   
   ```
     /**
      * Called before creation of Reader for a store file.
      * Calling {@link 
org.apache.hadoop.hbase.coprocessor.ObserverContext#bypass()} has no
      * effect in this hook.
      *
      * @param ctx the environment provided by the region server
      * @param fs fileystem to read from
      * @param p path to the file
      * @param in {@link FSDataInputStreamWrapper}
      * @param size Full size of the file
      * @param cacheConf
      * @param r original reference file. This will be not null only when 
reading a split file.
      * @param reader the base reader, if not {@code null}, from previous 
RegionObserver in the chain
      * @return a Reader instance to use instead of the base reader if 
overriding
      * default behavior, null otherwise
      * @deprecated For Phoenix only, StoreFileReader is not a stable interface.
      */
     @Deprecated
     // Passing InterfaceAudience.Private args FSDataInputStreamWrapper, 
CacheConfig and Reference.
     // This is fine as the hook is deprecated any way.
     default StoreFileReader 
preStoreFileReaderOpen(ObserverContext<RegionCoprocessorEnvironment> ctx,
         FileSystem fs, Path p, FSDataInputStreamWrapper in, long size, 
CacheConfig cacheConf,
         Reference r, StoreFileReader reader) throws IOException {
       return reader;
     }
   ```
   
   You can add javadoc to say that now it is only supposed to be used in 
Phoenix, but I still think we should mark it as deprecated, otherwise it will 
be confusing that why in WALObserver, we say that WALEdit is private and should 
not be used, but then in RegionObserver, we allow users to use 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