Skip to content
Commits on Source (6)
@echo off
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements. See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
setlocal
call "%~dp0zkEnv.cmd"
set ZOOMAIN=org.apache.zookeeper.server.persistence.TxnLogToolkit
call %JAVA% -cp "%CLASSPATH%" %ZOOMAIN% %*
endlocal
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# If this scripted is run out of /usr/bin or some other system bin directory
# it should be linked to and not copied. Things like java jar files are found
# relative to the canonical path of this script.
#
# use POSIX interface, symlink is followed automatically
ZOOBIN="${BASH_SOURCE-$0}"
ZOOBIN="$(dirname "${ZOOBIN}")"
ZOOBINDIR="$(cd "${ZOOBIN}"; pwd)"
if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then
. "$ZOOBINDIR"/../libexec/zkEnv.sh
else
. "$ZOOBINDIR"/zkEnv.sh
fi
"$JAVA" -cp "$CLASSPATH" $JVMFLAGS \
org.apache.zookeeper.server.persistence.TxnLogToolkit "$@"
......@@ -23,6 +23,48 @@ xmlns:artifact="antlib:org.apache.maven.artifact.ant"
xmlns:maven="antlib:org.apache.maven.artifact.ant"
xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<!-- ====================================================== -->
<!-- Dependency versions -->
<!-- ====================================================== -->
<property name="slf4j.version" value="1.7.25"/>
<property name="wagon-http.version" value="2.4"/>
<property name="maven-ant-tasks.version" value="2.1.3"/>
<property name="log4j.version" value="1.2.17"/>
<property name="jline.version" value="0.9.94"/>
<property name="jdeb.version" value="0.8"/>
<property name="audience-annotations.version" value="0.5.0" />
<property name="netty.version" value="3.10.6.Final"/>
<property name="junit.version" value="4.12"/>
<property name="mockito.version" value="1.8.5"/>
<property name="checkstyle.version" value="6.1.1"/>
<property name="commons-collections.version" value="3.2.2"/>
<property name="commons-io.version" value="2.4"/>
<property name="apache-directory-server.version" value="2.0.0-M15"/>
<property name="apache-directory-api.version" value="1.0.0-M20"/>
<property name="jdiff.version" value="1.0.9"/>
<property name="xerces.version" value="1.4.4"/>
<property name="apache-rat-tasks.version" value="0.6"/>
<property name="commons-lang.version" value="2.4"/>
<property name="dependency-check-ant.version" value="3.2.1"/>
<property name="hamcrest.version" value="1.3"/>
<property name="clover.version" value="4.2.1" />
<!-- ====================================================== -->
<!-- Project properties -->
<!-- ====================================================== -->
<!-- read build.properties from the basedir if any -->
<property file="${basedir}/build.properties" />
......@@ -31,7 +73,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property environment="env"/>
<property name="version" value="3.4.12" />
<property name="version" value="3.4.13" />
<property name="final.name" value="${name}-${version}"/>
<property name="revision.dir" value="${basedir}/.revision" />
<property name="revision.properties" value="revision.properties" />
......@@ -99,12 +141,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property name="dist.dir" value="${build.dir}/${final.name}"/>
<property name="dist.maven.dir" value="${dist.dir}/dist-maven"/>
<property name="clover.home" location="${env.CLOVER_HOME}"/>
<property name="clover.jar" location="${clover.home}/lib/clover.jar" />
<property name="clover.db.dir" location="${test.java.build.dir}/clover/db"/>
<property name="clover.report.dir"
location="${test.java.build.dir}/clover/reports"/>
<property name="contrib.dir" value="${src.dir}/contrib"/>
<property name="recipes.dir" value="${src.dir}/recipes"/>
......@@ -118,6 +154,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property name="ivy.jdiff.lib" value="${build.dir}/jdiff/lib"/>
<property name="ivy.releaseaudit.lib" value="${build.dir}/releaseaudit/lib"/>
<property name="ivy.owasp.lib" value="${build.dir}/owasp/lib"/>
<property name="ivy.clover.lib" value="${build.dir}/clover/lib"/>
<property name="ivysettings.xml" value="${basedir}/ivysettings.xml"/>
<property name="mvnrepo" value="https://repo1.maven.org/maven2"/>
......@@ -127,21 +164,16 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
value="${mvnrepo}${tsk.org}${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
<property name="ant_task.jar" location="${ivy.lib}/maven-ant-tasks-${ant-task.version}.jar"/>
<available property="clover.present"
classname="com.cenqua.clover.CloverInstr"
classpath="${clover.home}/lib/clover.jar"/>
<!-- clover property set -->
<property name="clover.home" location="${build.dir}/clover"/>
<property name="clover.jar" location="${clover.home}/lib/clover-${clover.version}.jar"/>
<property name="clover.dest" location="${build.dir}/clover"/>
<property name="clover.db.dir" location="${clover.dest}/db"/>
<property name="clover.report.dir" location="${clover.dest}/reports"/>
<property name="clover.db" location="${clover.db.dir}/zookeeper-coverage.db"/>
<available file="${c.src.dir}/Makefile" property="Makefile.present"/>
<!-- check if clover reports should be generated -->
<condition property="clover.enabled">
<and>
<isset property="run.clover"/>
<isset property="clover.present"/>
</and>
</condition>
<property name="test.cobertura.output.format" value="html" />
<property name="coveragereport.dir" value="${build.dir}/cobertura" />
......@@ -204,39 +236,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property name="sources-jar" value="${dist.maven.dir}/${final.name}-sources.jar"/>
<property name="javadoc-jar" value="${dist.maven.dir}/${final.name}-javadoc.jar"/>
<!-- ====================================================== -->
<!-- Dependency versions -->
<!-- ====================================================== -->
<property name="slf4j.version" value="1.7.25"/>
<property name="wagon-http.version" value="2.4"/>
<property name="maven-ant-tasks.version" value="2.1.3"/>
<property name="log4j.version" value="1.2.17"/>
<property name="jline.version" value="0.9.94"/>
<property name="jdeb.version" value="0.8"/>
<property name="audience-annotations.version" value="0.5.0" />
<property name="netty.version" value="3.10.6.Final"/>
<property name="junit.version" value="4.8.1"/>
<property name="mockito.version" value="1.8.5"/>
<property name="checkstyle.version" value="6.1.1"/>
<property name="commons-collections.version" value="3.2.2"/>
<property name="commons-io.version" value="2.4"/>
<property name="apache-directory-server.version" value="2.0.0-M15"/>
<property name="apache-directory-api.version" value="1.0.0-M20"/>
<property name="jdiff.version" value="1.0.9"/>
<property name="xerces.version" value="1.4.4"/>
<property name="apache-rat-tasks.version" value="0.6"/>
<property name="commons-lang.version" value="2.4"/>
<property name="dependency-check-ant.version" value="2.1.0"/>
<!-- ====================================================== -->
<!-- Macro definitions -->
<!-- ====================================================== -->
......@@ -265,7 +264,9 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<fileset dir="${ant.home}/lib">
<include name="ant.jar" />
</fileset>
<pathelement path="${clover.jar}" />
<fileset dir="${clover.home}/lib" erroronmissingdir="false">
<include name="**/*.jar" if="run.clover" />
</fileset>
</path>
<!-- the normal classpath -->
......@@ -435,6 +436,12 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<ivy:cachepath pathid="owasp-classpath" conf="owasp"/>
</target>
<target name="ivy-retrieve-clover" if="run.clover" depends="init,ivy-init">
<ivy:retrieve settingsRef="${ant.project.name}" conf="clover"
pattern="${ivy.clover.lib}/[artifact]-[revision].[ext]"/>
<ivy:cachepath pathid="clover-classpath" conf="clover"/>
</target>
<target name="ivy-retrieve-mvn-ant-task" depends="init,ivy-init">
<ivy:retrieve settingsRef="${ant.project.name}" conf="mvn-ant-task"
pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
......@@ -474,11 +481,15 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<env key="ACLOCAL" value="aclocal -I ${cppunit.m4}"/>
</exec>
<mkdir dir="${build.dir}/c" />
<condition property="enable.gcov.arg" value="--enable-gcov" else="">
<equals arg1="${enable.gcov}" arg2="true"/>
</condition>
<exec executable="${c.src.dir}/configure" dir="${build.dir}/c"
failonerror="yes">
<env key="base_dir" value="${basedir}"/>
<env key="CALLER" value="ANT"/>
<arg value="--prefix=${build.dir}/c/build/${package.prefix}"/>
<arg line="${enable.gcov.arg}"/>
</exec>
<property name="c.build" value="${build.dir}/c/build"/>
<exec dir="${build.dir}/c" executable="make" failonerror="true">
......@@ -1391,7 +1402,29 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
</condition>
</target>
<target name="check-cppunit-makefile" depends="init" >
<target name="verify-cppunit-makefile-gcov">
<fileset id="fileset.makefile.gcov.enabled" dir="${test.cppunit.dir}" erroronmissingdir="false">
<include name="Makefile"/>
<containsregexp expression="^[^#]+-ftest-coverage.*$"/>
</fileset>
<condition property="makefile.gcov.enabled">
<resourcecount when="greater" count="0" refid="fileset.makefile.gcov.enabled"/>
</condition>
<echo message="makefile.gcov.enabled = ${makefile.gcov.enabled}"/>
<condition property="delete.cppunit.makefile">
<and>
<isset property="makefile.gcov.enabled"/>
<not><equals arg1="${enable.gcov}" arg2="true"/></not>
</and>
</condition>
<echo message="delete.cppunit.makefile = ${delete.cppunit.makefile}"/>
</target>
<target name="delete-cppunit-makefile" if="delete.cppunit.makefile">
<delete file="${test.cppunit.dir}/Makefile"/>
</target>
<target name="check-cppunit-makefile" depends="init,verify-cppunit-makefile-gcov,delete-cppunit-makefile" >
<condition property="need.cppunit.makefile">
<not> <available file="${test.cppunit.dir}/Makefile"/> </not>
</condition>
......@@ -1421,11 +1454,15 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<param name="cppunit" value="true"/>
</antcall>
<mkdir dir="${test.cppunit.dir}"/>
<condition property="enable.gcov.arg" value="--enable-gcov" else="">
<equals arg1="${enable.gcov}" arg2="true"/>
</condition>
<exec executable="${c.src.dir}/configure" dir="${test.cppunit.dir}"
failonerror="yes">
<env key="base_dir" value="${basedir}"/>
<env key="CALLER" value="ANT"/>
<arg value="--prefix=${test.cppunit.dir}"/>
<arg line="${enable.gcov.arg}"/>
</exec>
</target>
......@@ -1489,52 +1526,84 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<!-- Run optional third-party tool targets -->
<!-- ====================================================== -->
<!-- clover code coverage -->
<target name="clover" depends="clover.setup, clover.info"
description="Instrument the Unit tests using Clover. Requires a Clover license and CLOVER_HOME environment variable set appropriately. To use, specify -Drun.clover=true on the command line."/>
<target name="clover.setup" if="clover.enabled">
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
<mkdir dir="${clover.db.dir}"/>
<clover-setup initString="${clover.db.dir}/zookeeper_coverage.db">
<fileset dir="${java.src.dir}"
includes="org/apache/zookeeper/**/*"
excludes="org/apache/zookeeper/version/**/*"/>
</clover-setup>
<!-- Clover code coverage -->
<target name="test-coverage-clover-java"
description="Runs Java tests with Clover and generates coverage report in HTML and XML.">
<antcall target="test-core-java">
<param name="run.clover" value="true"/>
</antcall>
<antcall target="clover-report"/>
</target>
<target name="clover.info" if="run.clover" unless="clover.present">
<echo>
Clover not found. Code coverage reports disabled.
</echo>
</target>
<target name="clover" if="run.clover" depends="ivy-retrieve-clover,clover.check,clover.setup"
description="Used in compile target to add source code instrumentation for Clover and sets up the Clover database."/>
<target name="clover.check">
<fail unless="clover.present">
##################################################################
<available property="clover.present"
classname="com.atlassian.clover.CloverInstr"
classpath="${clover.home}/lib/clover-${clover.version}.jar"/>
<fail if="run.clover" unless="clover.present">
Clover not found.
Please make sure clover.jar is in ANT_HOME/lib, or made available
Please make sure clover-${clover.version}.jar is in ${clover.home}/lib, or made available
to Ant using other mechanisms like -lib or CLASSPATH.
##################################################################
</fail>
</target>
<target name="generate-clover-reports" depends="clover.check, clover">
<mkdir dir="${clover.report.dir}"/>
<target name="clover.setup" if="run.clover">
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
<mkdir dir="${clover.db.dir}"/>
<clover-setup initString="${clover.db}">
<fileset dir="${java.src.dir}"
includes="org/apache/zookeeper/**/*"
excludes="org/apache/zookeeper/version/**/*">
</fileset>
<testsources dir="${test.src.dir}">
<testclass package="org.apache.zookeeper.*" name=".*Test">
<testmethod annotation="Test"/>
</testclass>
</testsources>
</clover-setup>
</target>
<clover-report initString="${clover.db.dir}/zookeeper_coverage.db">
<target name="clover-report" depends="ivy-retrieve-clover"
description="Generates coverage report in HTML and XML. Run the tests first with 'ant -Drun.clover=true test-core-java' to generate coverage data.">
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
<mkdir dir="${clover.report.dir}"/>
<clover-report initString="${clover.db}">
<current outfile="${clover.report.dir}" title="${final.name}">
<format type="html"/>
</current>
</clover-report>
<clover-report initString="${clover.db.dir}/zookeeper_coverage.db">
<clover-report initString="${clover.db}">
<current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
<format type="xml"/>
</current>
</clover-report>
</target>
<target name="c_coverage_report" description="Runs coverage report for ZK C client code.">
<!-- delete configure and make files so that they get regenerated with coverage enabled -->
<delete file="${c.src.dir}/configure"/>
<delete file="${test.cppunit.dir}/Makefile"/>
<subant target="test-core-cppunit" failonerror="false">
<property name="enable.gcov" value="true"/>
<fileset dir="." file="build.xml"/>
</subant>
<mkdir dir="${build.dir}/c_coverage" />
<copy todir="${build.dir}/c" verbose="true" overwrite="true" failonerror="true">
<fileset dir="${build.dir}/test/test-cppunit/.libs">
<include name="*.gcno"/>
<include name="*.gcda"/>
</fileset>
</copy>
<exec dir="${build.dir}/c" executable="lcov">
<arg line="-t testname -o ZK_C_client.info -c -d ."/>
</exec>
<exec dir="${build.dir}/c_coverage" executable="genhtml">
<arg line="-o report ${build.dir}/c/ZK_C_client.info"/>
</exec>
</target>
<!-- Run with 'ant -Dfindbugs.home="path to Findbugs directory" findbugs -->
<property name="findbugs.home" value="" />
<target name="findbugs" depends="check-for-findbugs, jar" if="findbugs.present">
......
zookeeper (3.4.13-1) unstable; urgency=medium
* New upstream version 3.4.13
* Update version in debian-provided pom file
* Bump Standards-Version to 4.2.1
-- tony mancill <tmancill@debian.org> Thu, 18 Oct 2018 20:19:42 -0700
zookeeper (3.4.12-2) unstable; urgency=medium
* Team upload.
......
......@@ -35,7 +35,7 @@ Build-Depends:
pkg-config,
procps,
python-all-dev (>= 2.6.6-3~)
Standards-Version: 4.2.0
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/java-team/zookeeper.git
Vcs-Browser: https://salsa.debian.org/java-team/zookeeper
Homepage: https://zookeeper.apache.org
......
......@@ -11,7 +11,7 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<packaging>pom</packaging>
<version>3.4.9</version>
<version>3.4.13</version>
<licenses>
<license>
......
......@@ -107,6 +107,7 @@ override_dh_clean:
libzookeeper-st-dev libzookeeper-mt-dev; do \
[ ! -f debian/$$install.install ] || rm debian/$$install.install; \
done
rm -rf debian/*debhelper.log
# the original build.xml deletes too much
override_dh_auto_clean:
......
......@@ -34,6 +34,7 @@
<conf name="jdiff" visibility="private"/>
<conf name="releaseaudit" visibility="private" description="Artifacts required for releaseaudit target"/>
<conf name="owasp" visibility="private" description="Artifacts required for owasp target"/>
<conf name="clover" visibility="private" description="Artifacts required for clover target"/>
</configurations>
<publications>
......@@ -143,6 +144,10 @@
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.hamcrest" name="hamcrest-all" rev="${hamcrest.version}" conf="test->default" />
<dependency org="org.openclover" name="clover" rev="${clover.version}" conf="clover->default"/>
<conflict manager="strict"/>
</dependencies>
......
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<!-- on Mon Mar 26 21:32:45 PDT 2018 -->
<!-- on Fri Jun 29 17:05:06 UTC 2018 -->
<api
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='api.xsd'
name="zookeeper 3.4.12"
name="zookeeper 3.4.13"
jdversion="1.0.9">
<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /home/abe/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/abe/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -classpath /home/abe/zookeeper/build/classes:/home/abe/zookeeper/src/java/lib/ivy-2.4.0.jar:/home/abe/zookeeper/build/lib/audience-annotations-0.5.0.jar:/home/abe/zookeeper/build/lib/jline-0.9.94.jar:/home/abe/zookeeper/build/lib/log4j-1.2.17.jar:/home/abe/zookeeper/build/lib/netty-3.10.6.Final.jar:/home/abe/zookeeper/build/lib/slf4j-api-1.7.25.jar:/home/abe/zookeeper/build/lib/slf4j-log4j12-1.7.25.jar -sourcepath /home/abe/zookeeper/src/java/main -doclet jdiff.JDiff -docletpath /home/abe/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/abe/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -apidir /home/abe/zookeeper/src/java/lib/jdiff -apiname zookeeper 3.4.12 -->
<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /home/ubuntu/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/ubuntu/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -classpath /home/ubuntu/zookeeper/build/classes:/home/ubuntu/zookeeper/src/java/lib/ivy-2.4.0.jar:/home/ubuntu/zookeeper/build/lib/audience-annotations-0.5.0.jar:/home/ubuntu/zookeeper/build/lib/jline-0.9.94.jar:/home/ubuntu/zookeeper/build/lib/log4j-1.2.17.jar:/home/ubuntu/zookeeper/build/lib/netty-3.10.6.Final.jar:/home/ubuntu/zookeeper/build/lib/slf4j-api-1.7.25.jar:/home/ubuntu/zookeeper/build/lib/slf4j-log4j12-1.7.25.jar -sourcepath /home/ubuntu/zookeeper/src/java/main -doclet jdiff.JDiff -docletpath /home/ubuntu/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/ubuntu/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -apidir /home/ubuntu/zookeeper/src/java/lib/jdiff -apiname zookeeper 3.4.13 -->
<package name="org.apache.zookeeper">
<!-- start interface org.apache.zookeeper.AsyncCallback -->
<interface name="AsyncCallback" abstract="true"
......@@ -2804,6 +2804,23 @@
</doc>
</class>
<!-- end class org.apache.zookeeper.StatsTrack -->
<!-- start interface org.apache.zookeeper.Testable -->
<interface name="Testable" abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<method name="injectSessionExpiration"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Cause the ZooKeeper instance to behave as if the session expired]]>
</doc>
</method>
<doc>
<![CDATA[Abstraction that exposes various methods useful for testing ZooKeeper]]>
</doc>
</interface>
<!-- end interface org.apache.zookeeper.Testable -->
<!-- start class org.apache.zookeeper.Transaction -->
<class name="Transaction" extends="java.lang.Object"
abstract="false"
......@@ -3700,6 +3717,11 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
<method name="getTestable" return="org.apache.zookeeper.Testable"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
<method name="getSessionId" return="long"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
......
......@@ -16,7 +16,7 @@
cmake_minimum_required(VERSION 3.6)
project(zookeeper VERSION 3.4.12)
project(zookeeper VERSION 3.4.13)
set(email user@zookeeper.apache.org)
set(description "zookeeper C client")
......
......@@ -9,6 +9,12 @@ AM_CPPFLAGS = -I${srcdir}/include -I${srcdir}/tests -I${srcdir}/generated $(SOLA
AM_CFLAGS = -Wall -Werror
AM_CXXFLAGS = -Wall $(USEIPV6)
# Additional flags for coverage testing (if enabled)
if ENABLEGCOV
AM_CFLAGS += -fprofile-arcs -ftest-coverage
AM_LDFLAGS = -lgcov
endif
LIB_LDFLAGS = -no-undefined -version-info 2 $(SOLARIS_LIB_LDFLAGS)
pkginclude_HEADERS = include/zookeeper.h include/zookeeper_version.h include/zookeeper_log.h include/proto.h include/recordio.h generated/zookeeper.jute.h
......
......@@ -3,7 +3,7 @@
AC_PREREQ(2.59)
AC_INIT([zookeeper C client],3.4.12,[user@zookeeper.apache.org],[zookeeper])
AC_INIT([zookeeper C client],3.4.13,[user@zookeeper.apache.org],[zookeeper])
AC_CONFIG_SRCDIR([src/zookeeper.c])
# Save initial CFLAGS and CXXFLAGS values before AC_PROG_CC and AC_PROG_CXX
......@@ -86,6 +86,12 @@ else
fi
fi
# Check whether to enable gcov (coverage test)
AC_ARG_ENABLE(gcov, [AS_HELP_STRING([--enable-gcov],[enable coverage test])])
AC_MSG_CHECKING([whether to enable gcov])
AS_IF([test "x${enable_gcov}" = "xyes"],AC_MSG_RESULT([yes]),AC_MSG_RESULT([no]))
AM_CONDITIONAL([ENABLEGCOV],[test "x${enable_gcov}" = "xyes"])
AC_ARG_WITH([syncapi],
[AS_HELP_STRING([--with-syncapi],[build with support for SyncAPI [default=yes]])],
[],[with_syncapi=yes])
......
......@@ -34,6 +34,7 @@ zk_ephemerals_count 0
zk_approximate_data_size 41
zk_open_file_descriptor_count 20
zk_max_file_descriptor_count 1024
zk_fsync_threshold_exceed_count 0
Python 2.6 (maybe it works on previous version but it's not tested yet).
......
......@@ -256,6 +256,31 @@ def _parse_stat(self, data):
result['zk_znode_count'] = int(m.group(1))
continue
m = re.match('Watch count: (\d+)', line)
if m is not None:
result['zk_watch_count'] = int(m.group(1))
continue
m = re.match('Ephemerals count: (\d+)', line)
if m is not None:
result['zk_ephemerals_count'] = int(m.group(1))
continue
m = re.match('Approximate data size: (\d+)', line)
if m is not None:
result['zk_approximate_data_size'] = int(m.group(1))
continue
m = re.match('Open file descriptor count: (\d+)', line)
if m is not None:
result['zk_open_file_descriptor_count'] = int(m.group(1))
continue
m = re.match('Max file descriptor count: (\d+)', line)
if m is not None:
result['zk_max_file_descriptor_count'] = int(m.group(1))
continue
m = re.match('Zxid: (0x[0-9a-fA-F]+)', line)
if m is not None:
result['zk_zxid'] = m.group(1)
......
......@@ -45,5 +45,6 @@ collection_group {
metric { name = "zk_followers" }
metric { name = "zk_synced_followers" }
metric { name = "zk_pending_syncs" }
metric { name = "zk_fsync_threshold_exceed_count" }
}
......@@ -178,7 +178,8 @@ def metric_init(params=None):
'zk_max_file_descriptor_count': {'units': 'descriptors'},
'zk_followers': {'units': 'nodes'},
'zk_synced_followers': {'units': 'nodes'},
'zk_pending_syncs': {'units': 'syncs'}
'zk_pending_syncs': {'units': 'syncs'},
'zk_fsync_threshold_exceed_count': {'units': 'fsyncexceed'}
}
metric_handler.descriptors = {}
for name, updates in metrics.iteritems():
......
......@@ -1578,6 +1578,7 @@ zk_synced_followers 4 - only exposed by the Leader
zk_pending_syncs 0 - only exposed by the Leader
zk_open_file_descriptor_count 23 - only available on Unix platforms
zk_max_file_descriptor_count 1024 - only available on Unix platforms
zk_fsync_threshold_exceed_count 0
</programlisting>
<para>The output is compatible with java properties format and the content
......@@ -1702,6 +1703,76 @@ imok
individual settings in which it is being deployed. </para>
</note>
</section>
<section>
<title>Recovery - TxnLogToolkit</title>
<para>TxnLogToolkit is a command line tool shipped with ZooKeeper which
is capable of recovering transaction log entries with broken CRC.</para>
<para>Running it without any command line parameters or with the "-h,--help"
argument, it outputs the following help page:</para>
<programlisting>
$ bin/zkTxnLogToolkit.sh
usage: TxnLogToolkit [-dhrv] txn_log_file_name
-d,--dump Dump mode. Dump all entries of the log file. (this is the default)
-h,--help Print help message
-r,--recover Recovery mode. Re-calculate CRC for broken entries.
-v,--verbose Be verbose in recovery mode: print all entries, not just fixed ones.
-y,--yes Non-interactive mode: repair all CRC errors without asking
</programlisting>
<para>The default behaviour is safe: it dumps the entries of the given
transaction log file to the screen: (same as using '-d,--dump' parameter)</para>
<programlisting>
$ bin/zkTxnLogToolkit.sh log.100000001
ZooKeeper Transactional Log File with dbid 0 txnlog format version 2
4/5/18 2:15:58 PM CEST session 0x16295bafcc40000 cxid 0x0 zxid 0x100000001 createSession 30000
<emphasis role="bold">CRC ERROR - 4/5/18 2:16:05 PM CEST session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null</emphasis>
4/5/18 2:16:05 PM CEST session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null
4/5/18 2:16:12 PM CEST session 0x26295bafcc90000 cxid 0x0 zxid 0x100000003 createSession 30000
4/5/18 2:17:34 PM CEST session 0x26295bafcc90000 cxid 0x0 zxid 0x200000001 closeSession null
4/5/18 2:17:34 PM CEST session 0x16295bd23720000 cxid 0x0 zxid 0x200000002 createSession 30000
4/5/18 2:18:02 PM CEST session 0x16295bd23720000 cxid 0x2 zxid 0x200000003 create '/andor,#626262,v{s{31,s{'world,'anyone}}},F,1
EOF reached after 6 txns.
</programlisting>
<para>There's a CRC error in the 2nd entry of the above transaction log file. In <emphasis role="bold">dump</emphasis>
mode, the toolkit only prints this information to the screen without touching the original file. In
<emphasis role="bold">recovery</emphasis> mode (-r,--recover flag) the original file still remains
untouched and all transactions will be copied over to a new txn log file with ".fixed" suffix. It recalculates
CRC values and copies the calculated value, if it doesn't match the original txn entry.
By default, the tool works interactively: it asks for confirmation whenever CRC error encountered.</para>
<programlisting>
$ bin/zkTxnLogToolkit.sh -r log.100000001
ZooKeeper Transactional Log File with dbid 0 txnlog format version 2
CRC ERROR - 4/5/18 2:16:05 PM CEST session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null
Would you like to fix it (Yes/No/Abort) ?
</programlisting>
<para>Answering <emphasis role="bold">Yes</emphasis> means the newly calculated CRC value will be outputted
to the new file. <emphasis role="bold">No</emphasis> means that the original CRC value will be copied over.
<emphasis role="bold">Abort</emphasis> will abort the entire operation and exits.
(In this case the ".fixed" will not be deleted and left in a half-complete state: contains only entries which
have already been processed or only the header if the operation was aborted at the first entry.)</para>
<programlisting>
$ bin/zkTxnLogToolkit.sh -r log.100000001
ZooKeeper Transactional Log File with dbid 0 txnlog format version 2
CRC ERROR - 4/5/18 2:16:05 PM CEST session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null
Would you like to fix it (Yes/No/Abort) ? y
EOF reached after 6 txns.
Recovery file log.100000001.fixed has been written with 1 fixed CRC error(s)
</programlisting>
<para>The default behaviour of recovery is to be silent: only entries with CRC error get printed to the screen.
One can turn on verbose mode with the -v,--verbose parameter to see all records.
Interactive mode can be turned off with the -y,--yes parameter. In this case all CRC errors will be fixed
in the new transaction file.</para>
</section>
</section>
<section id="sc_commonProblems">
......
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<!-- on Mon Mar 26 21:32:45 PDT 2018 -->
<!-- on Fri Jun 29 17:05:06 UTC 2018 -->
<api
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='api.xsd'
name="zookeeper 3.4.12"
name="zookeeper 3.4.13"
jdversion="1.0.9">
<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /home/abe/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/abe/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -classpath /home/abe/zookeeper/build/classes:/home/abe/zookeeper/src/java/lib/ivy-2.4.0.jar:/home/abe/zookeeper/build/lib/audience-annotations-0.5.0.jar:/home/abe/zookeeper/build/lib/jline-0.9.94.jar:/home/abe/zookeeper/build/lib/log4j-1.2.17.jar:/home/abe/zookeeper/build/lib/netty-3.10.6.Final.jar:/home/abe/zookeeper/build/lib/slf4j-api-1.7.25.jar:/home/abe/zookeeper/build/lib/slf4j-log4j12-1.7.25.jar -sourcepath /home/abe/zookeeper/src/java/main -doclet jdiff.JDiff -docletpath /home/abe/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/abe/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -apidir /home/abe/zookeeper/src/java/lib/jdiff -apiname zookeeper 3.4.12 -->
<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /home/ubuntu/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/ubuntu/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -classpath /home/ubuntu/zookeeper/build/classes:/home/ubuntu/zookeeper/src/java/lib/ivy-2.4.0.jar:/home/ubuntu/zookeeper/build/lib/audience-annotations-0.5.0.jar:/home/ubuntu/zookeeper/build/lib/jline-0.9.94.jar:/home/ubuntu/zookeeper/build/lib/log4j-1.2.17.jar:/home/ubuntu/zookeeper/build/lib/netty-3.10.6.Final.jar:/home/ubuntu/zookeeper/build/lib/slf4j-api-1.7.25.jar:/home/ubuntu/zookeeper/build/lib/slf4j-log4j12-1.7.25.jar -sourcepath /home/ubuntu/zookeeper/src/java/main -doclet jdiff.JDiff -docletpath /home/ubuntu/zookeeper/build/jdiff/lib/jdiff-1.0.9.jar:/home/ubuntu/zookeeper/build/jdiff/lib/xerces-1.4.4.jar -apidir /home/ubuntu/zookeeper/src/java/lib/jdiff -apiname zookeeper 3.4.13 -->
<package name="org.apache.zookeeper">
<!-- start interface org.apache.zookeeper.AsyncCallback -->
<interface name="AsyncCallback" abstract="true"
......@@ -2804,6 +2804,23 @@
</doc>
</class>
<!-- end class org.apache.zookeeper.StatsTrack -->
<!-- start interface org.apache.zookeeper.Testable -->
<interface name="Testable" abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<method name="injectSessionExpiration"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Cause the ZooKeeper instance to behave as if the session expired]]>
</doc>
</method>
<doc>
<![CDATA[Abstraction that exposes various methods useful for testing ZooKeeper]]>
</doc>
</interface>
<!-- end interface org.apache.zookeeper.Testable -->
<!-- start class org.apache.zookeeper.Transaction -->
<class name="Transaction" extends="java.lang.Object"
abstract="false"
......@@ -3700,6 +3717,11 @@
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
<method name="getTestable" return="org.apache.zookeeper.Testable"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
</method>
<method name="getSessionId" return="long"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="public"
......
......@@ -28,6 +28,7 @@
import java.net.Socket;
import java.net.SocketAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
......@@ -1193,7 +1194,7 @@ public void run() {
+ Long.toHexString(getSessionId()));
}
private void pingRwServer() throws RWServerFoundException {
private void pingRwServer() throws RWServerFoundException, UnknownHostException {
String result = null;
InetSocketAddress addr = hostProvider.next(0);
LOG.info("Checking server " + addr + " for being r/w." +
......@@ -1388,7 +1389,8 @@ public void close() throws IOException {
private int xid = 1;
private volatile States state = States.NOT_CONNECTED;
// @VisibleForTesting
volatile States state = States.NOT_CONNECTED;
/*
* getXid() is called externally by ClientCnxnNIO::doIO() when packets are sent from the outgoingQueue to
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zookeeper;
/**
* Abstraction that exposes various methods useful for testing ZooKeeper
*/
public interface Testable {
/**
* Cause the ZooKeeper instance to behave as if the session expired
*/
void injectSessionExpiration();
}