You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by hu...@apache.org on 2022/03/12 23:22:27 UTC

[helix] branch master updated: Use ZooKeeper 3.5.9 in zookeeper-api instead (#1977)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new cbf35ba  Use ZooKeeper 3.5.9 in zookeeper-api instead (#1977)
cbf35ba is described below

commit cbf35baa22a90a75470921726eb2e0417a6e0123
Author: Hunter Lee <na...@gmail.com>
AuthorDate: Sat Mar 12 18:22:21 2022 -0500

    Use ZooKeeper 3.5.9 in zookeeper-api instead (#1977)
    
    With the upgrade of apache zookeeper version, snappy-java was missing in the dependency. This commit adds snappy-java and removes unused imports in osgi declaration. Also, using ZooKeeper 3.5.9 in zookeeper-api instead because 3.6.0+ causes some tests to fail in zookeeper-api.
---
 .../apache/helix/tools/commandtools/ZKLogFormatter.java   |  8 ++++----
 zookeeper-api/pom.xml                                     | 15 ++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/helix-core/src/main/java/org/apache/helix/tools/commandtools/ZKLogFormatter.java b/helix-core/src/main/java/org/apache/helix/tools/commandtools/ZKLogFormatter.java
index c4618c1..3e06271 100644
--- a/helix-core/src/main/java/org/apache/helix/tools/commandtools/ZKLogFormatter.java
+++ b/helix-core/src/main/java/org/apache/helix/tools/commandtools/ZKLogFormatter.java
@@ -49,7 +49,6 @@ import org.apache.zookeeper.server.persistence.FileSnap;
 import org.apache.zookeeper.server.persistence.FileTxnLog;
 import org.apache.zookeeper.server.util.SerializeUtils;
 import org.apache.zookeeper.txn.TxnHeader;
-import org.apache.zookeeper.server.TxnLogEntry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -249,12 +248,13 @@ public class ZKLogFormatter {
       if (crcValue != crc.getValue()) {
         throw new IOException("CRC doesn't match " + crcValue + " vs " + crc.getValue());
       }
-      TxnLogEntry txnLogEntry =  SerializeUtils.deserializeTxn(bytes);
+      TxnHeader hdr = new TxnHeader();
+      Record txn = SerializeUtils.deserializeTxn(bytes, hdr);
       if (bw != null) {
-        bw.write(formatTransaction(txnLogEntry.getHeader(), txnLogEntry.getTxn()));
+        bw.write(formatTransaction(hdr, txn));
         bw.newLine();
       } else {
-        System.out.println(formatTransaction(txnLogEntry.getHeader(), txnLogEntry.getTxn()));
+        System.out.println(formatTransaction(hdr, txn));
       }
 
       if (logStream.readByte("EOR") != 'B') {
diff --git a/zookeeper-api/pom.xml b/zookeeper-api/pom.xml
index d8d1930..cca12a2 100644
--- a/zookeeper-api/pom.xml
+++ b/zookeeper-api/pom.xml
@@ -32,12 +32,7 @@
   <properties>
     <osgi.import>
       org.slf4j*;version="[1.7,2)",
-      org.apache.logging.log4j*;version="[2.17,3)",
-      org.apache.logging.slf4j*;version="[2.17,3)",
-      org.apache.zookeeper.server.persistence*;resolution:=optional,
-      org.apache.zookeeper.server.util*;resolution:=optional,
-      org.apache.zookeeper.txn*;resolution:=optional,
-      org.apache.zookeeper*;version="[3.6,3)",
+      org.apache.zookeeper*;version="[3.5,9)",
       *
     </osgi.import>
     <osgi.export>org.apache.helix.zookeeper*;version="${project.version};-noimport:=true</osgi.export>
@@ -56,7 +51,7 @@
     <dependency>
       <groupId>org.apache.zookeeper</groupId>
       <artifactId>zookeeper</artifactId>
-      <version>3.6.3</version>
+      <version>3.5.9</version>
       <exclusions>
         <exclusion>
           <groupId>junit</groupId>
@@ -108,6 +103,12 @@
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.xerial.snappy</groupId>
+      <artifactId>snappy-java</artifactId>
+      <version>1.1.7</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <build>
     <resources>