This is an automated email from the ASF dual-hosted git repository.

kezhuw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new b4443e82c ZOOKEEPER-842: [ADDENDUM] Keep `DataTree::copyStat` for 
compatibility with Apache Curator
b4443e82c is described below

commit b4443e82c61f98356079eb9b53ff85f62fbd30a1
Author: Kezhu Wang <[email protected]>
AuthorDate: Wed Aug 27 11:46:16 2025 +0800

    ZOOKEEPER-842: [ADDENDUM] Keep `DataTree::copyStat` for compatibility with 
Apache Curator
    
    ZOOKEEPER-842: [ADDENDUM] Keep `DataTree::copyStat` for compatibility with 
Apache Curator
    `DataTree` is apparently internal to zookeeper. But we don't export
    public alternatives to `copyStat` and `copyStatPersisted` until now.
    So, let's keep them for some releases to let downstream libraries to
    migrate to `Stat::copyFrom`.
    Refs: ZOOKEEPER-842, #2305.
    Reviewers: tisonkun
    Author: kezhuw
    Closes #2310 from 
kezhuw/ZOOKEEPER-842-addendum-keep-DataTree_copyStat-for-compatibility
---
 .../java/org/apache/zookeeper/server/DataTree.java   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git 
a/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
index b682ec64f..a9c69b486 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
@@ -342,6 +342,26 @@ boolean isSpecialPath(String path) {
                || configZookeeper.equals(path);
     }
 
+    /**
+     * Use {@link StatPersisted#copyFrom(StatPersisted)} instead.
+     *
+     * <p>Apache Curator uses it, let's keep it for now to let them and their 
clients to react.
+     */
+    @Deprecated
+    public static void copyStatPersisted(StatPersisted from, StatPersisted to) 
{
+        to.copyFrom(from);
+    }
+
+    /**
+     * Use {@link Stat#copyFrom(Stat)} instead.
+     *
+     * <p> Apache Curator uses it, let's keep it for now to let them and their 
clients to react.
+     */
+    @Deprecated
+    public static void copyStat(Stat from, Stat to) {
+        to.copyFrom(from);
+    }
+
     /**
      * update the count/bytes of this stat data node
      *

Reply via email to