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_r312105437
##########
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:
The goal isn't to create a Phoenix-specific hack, but a general-purpose
HBase API which Phoenix can use. You're both complaining about Phoenix's
previous and existing use of unapproved hooks while resisting efforts to create
approved APIs the right way.
preStoreFileReaderOpen wasn't _created_ deprecated -- it's still alive and
well in branch-1 -- but was deprecated in HBASE-18793, which you know because
you were the one who deprecated it.
Given that I'm backporting this new hook to branch-1, if I create it
deprecated that presumably means that as soon as 1.5 releases, the new hook is
eligible for cleanup in master via semver rules before it's even been released!
The comments are confusing, not because of this patch, but because the
position that created those comments is _already_ self-contradictory in
existing code. WALEdit must never be exposed to coprocessors...except the 6
times it already is in RegionObserver and the 4 times it is in WALObserver.
When a policy leads to increasingly strange and nonsensical results -- and
creating an already deprecated method is nonsensical -- it's time to rethink
the policy.
----------------------------------------------------------------
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