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.
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.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 @@
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>