From b6baa9a6b8f1365918c8896bb7b66952d928760d Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Wed, 4 Sep 2024 22:38:50 +0800 Subject: [PATCH] HBASE-28580 Revert the deprecation for methods in WALObserver --- .../hadoop/hbase/coprocessor/WALObserver.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/WALObserver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/WALObserver.java index bc57dbc735a4..768cc3955e56 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/WALObserver.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/WALObserver.java @@ -56,25 +56,31 @@ @InterfaceStability.Evolving public interface WALObserver { /** - * Called before a {@link WALEdit} is writen to WAL. Do not amend the WALKey. It is - * InterfaceAudience.Private. Changing the WALKey will cause damage. - * @deprecated Since hbase-2.0.0. To be replaced with an alternative that does not expose - * InterfaceAudience classes such as WALKey and WALEdit. Will be removed in - * hbase-3.0.0. + * Called before a {@link WALEdit} is writen to WAL. + *

+ * The method is marked as deprecated in 2.0.0, but later we abstracted the WALKey interface for + * coprocessors, now it is OK to expose this to coprocessor users, so we revert the deprecation. + * But you still need to be careful while changing {@link WALEdit}, as when reaching here, if you + * add some cells to WALEdit, it will only be written to WAL but no in memstore, but when + * replaying you will get these cells and there are CP hooks to intercept these cells. + *

+ * See HBASE-28580. */ - @Deprecated default void preWALWrite(ObserverContext ctx, RegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException { } /** - * Called after a {@link WALEdit} is writen to WAL. Do not amend the WALKey. It is - * InterfaceAudience.Private. Changing the WALKey will cause damage. - * @deprecated Since hbase-2.0.0. To be replaced with an alternative that does not expose - * InterfaceAudience classes such as WALKey and WALEdit. Will be removed in - * hbase-3.0.0. + * Called after a {@link WALEdit} is writen to WAL. + *

+ * The method is marked as deprecated in 2.0.0, but later we abstracted the WALKey interface for + * coprocessors, now it is OK to expose this to coprocessor users, so we revert the deprecation. + * But you still need to be careful while changing {@link WALEdit}, as when reaching here, if you + * add some cells to WALEdit, it will only be written to WAL but no in memstore, but when + * replaying you will get these cells and there are CP hooks to intercept these cells. + *

+ * See HBASE-28580. */ - @Deprecated default void postWALWrite(ObserverContext ctx, RegionInfo info, WALKey logKey, WALEdit logEdit) throws IOException { }