Просмотр исходного кода

ZOOKEEPER-3155: Remove Forrest XMLs and their build process from the …

…project

In this commit I've removed the forrest XML files and their result from the repository.
I've also removed the process to generate HTML and PDF files from the forrest files, since it's not needed anymore.

It also effects the test-github-pr.sh and test-patch.sh, since we do have less parameters for them (FORREST_HOME).

Change-Id: I30ecdb181f19eed05d86838b12c75e0c03e33710

Author: Tamas Penzes <tamaas@cloudera.com>

Reviewers: andor@apache.org

Closes #671 from tamaashu/ZOOKEEPER-3155
Tamas Penzes 6 лет назад
Родитель
Сommit
e5fc122810
100 измененных файлов с 4 добавлено и 15062 удалено
  1. 4 25
      build.xml
  2. 0 384
      docs/bookkeeperConfig.html
  3. BIN
      docs/bookkeeperConfig.pdf
  4. 0 694
      docs/bookkeeperOverview.html
  5. BIN
      docs/bookkeeperOverview.pdf
  6. 0 1083
      docs/bookkeeperProgrammer.html
  7. BIN
      docs/bookkeeperProgrammer.pdf
  8. 0 448
      docs/bookkeeperStarted.html
  9. BIN
      docs/bookkeeperStarted.pdf
  10. 0 612
      docs/bookkeeperStream.html
  11. BIN
      docs/bookkeeperStream.pdf
  12. 0 2
      docs/broken-links.xml
  13. BIN
      docs/images/2pc.jpg
  14. BIN
      docs/images/bk-overview.jpg
  15. BIN
      docs/images/built-with-forrest-button.png
  16. BIN
      docs/images/favicon.ico
  17. BIN
      docs/images/hadoop-logo.jpg
  18. BIN
      docs/images/instruction_arrow.png
  19. BIN
      docs/images/state_dia.jpg
  20. BIN
      docs/images/zkcomponents.jpg
  21. BIN
      docs/images/zknamespace.jpg
  22. BIN
      docs/images/zkperfRW-3.2.jpg
  23. BIN
      docs/images/zkperfRW.jpg
  24. BIN
      docs/images/zkperfreliability.jpg
  25. BIN
      docs/images/zkservice.jpg
  26. BIN
      docs/images/zookeeper_small.gif
  27. 0 352
      docs/index.html
  28. BIN
      docs/index.pdf
  29. 0 900
      docs/javaExample.html
  30. BIN
      docs/javaExample.pdf
  31. 0 394
      docs/linkmap.html
  32. BIN
      docs/linkmap.pdf
  33. 0 1024
      docs/recipes.html
  34. BIN
      docs/recipes.pdf
  35. 0 1900
      docs/releasenotes.html
  36. BIN
      docs/releasenotes.pdf
  37. 0 23
      docs/skin/CommonMessages_de.xml
  38. 0 23
      docs/skin/CommonMessages_en_US.xml
  39. 0 23
      docs/skin/CommonMessages_es.xml
  40. 0 23
      docs/skin/CommonMessages_fr.xml
  41. 0 167
      docs/skin/basic.css
  42. 0 90
      docs/skin/breadcrumbs-optimized.js
  43. 0 237
      docs/skin/breadcrumbs.js
  44. 0 166
      docs/skin/fontsize.js
  45. 0 40
      docs/skin/getBlank.js
  46. 0 45
      docs/skin/getMenu.js
  47. 0 1
      docs/skin/images/README.txt
  48. BIN
      docs/skin/images/add.jpg
  49. BIN
      docs/skin/images/apache-thanks.png
  50. BIN
      docs/skin/images/built-with-cocoon.gif
  51. BIN
      docs/skin/images/built-with-forrest-button.png
  52. BIN
      docs/skin/images/chapter.gif
  53. BIN
      docs/skin/images/chapter_open.gif
  54. BIN
      docs/skin/images/current.gif
  55. BIN
      docs/skin/images/error.png
  56. BIN
      docs/skin/images/external-link.gif
  57. BIN
      docs/skin/images/fix.jpg
  58. BIN
      docs/skin/images/forrest-credit-logo.png
  59. BIN
      docs/skin/images/hack.jpg
  60. BIN
      docs/skin/images/header_white_line.gif
  61. BIN
      docs/skin/images/info.png
  62. BIN
      docs/skin/images/instruction_arrow.png
  63. BIN
      docs/skin/images/label.gif
  64. BIN
      docs/skin/images/page.gif
  65. BIN
      docs/skin/images/pdfdoc.gif
  66. BIN
      docs/skin/images/poddoc.png
  67. BIN
      docs/skin/images/printer.gif
  68. BIN
      docs/skin/images/rc-b-l-15-1body-2menu-3menu.png
  69. BIN
      docs/skin/images/rc-b-r-15-1body-2menu-3menu.png
  70. BIN
      docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png
  71. BIN
      docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png
  72. BIN
      docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png
  73. BIN
      docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png
  74. BIN
      docs/skin/images/rc-t-r-15-1body-2menu-3menu.png
  75. BIN
      docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png
  76. BIN
      docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png
  77. BIN
      docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png
  78. BIN
      docs/skin/images/remove.jpg
  79. BIN
      docs/skin/images/rss.png
  80. BIN
      docs/skin/images/spacer.gif
  81. BIN
      docs/skin/images/success.png
  82. BIN
      docs/skin/images/txtdoc.png
  83. BIN
      docs/skin/images/update.jpg
  84. BIN
      docs/skin/images/valid-html401.png
  85. BIN
      docs/skin/images/vcss.png
  86. BIN
      docs/skin/images/warning.png
  87. BIN
      docs/skin/images/xmldoc.gif
  88. 0 48
      docs/skin/menu.js
  89. 0 50
      docs/skin/note.txt
  90. 0 54
      docs/skin/print.css
  91. 0 168
      docs/skin/profile.css
  92. 0 1257
      docs/skin/prototype.js
  93. 0 587
      docs/skin/screen.css
  94. 0 2718
      docs/zookeeperAdmin.html
  95. BIN
      docs/zookeeperAdmin.pdf
  96. 0 264
      docs/zookeeperHierarchicalQuorums.html
  97. BIN
      docs/zookeeperHierarchicalQuorums.pdf
  98. 0 793
      docs/zookeeperInternals.html
  99. BIN
      docs/zookeeperInternals.pdf
  100. 0 467
      docs/zookeeperJMX.html

+ 4 - 25
build.xml

@@ -556,24 +556,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
     <!-- ====================================================== -->
     <!-- Documentation                                          -->
     <!-- ====================================================== -->
-    <target name="docs" depends="forrest.check" description="Generate forrest-based documentation. To use, specify -Dforrest.home=&lt;base of Apache Forrest installation&gt; on the command line." if="forrest.home">
-      <condition property="forrest.exec" value="forrest.bat" else="forrest">
-      	<os family="windows"/>
-      </condition>
-      <exec dir="${docs.src}" executable="${forrest.home}/bin/${forrest.exec}"
-            failonerror="true">
-      </exec>
-      <copy todir="${docs.dir}">
-        <fileset dir="${docs.src}/build/site/" />
-      </copy>
-      <style basedir="${conf.dir}" destdir="${docs.dir}"
-             includes="zookeeper-default.xml" style="conf/configuration.xsl"/>
-    </target>
-
-    <target name="forrest.check" unless="forrest.home">
-      <fail message="'forrest.home' is not defined. Please pass -Dforrest.home=&lt;base of Apache Forrest installation&gt; to Ant on the command-line." />
-    </target>
-
     <!-- Javadoc -->
     <target name="javadoc-dev" depends="jar"
             description="Generate javadoc for zookeeper developers">
@@ -1818,7 +1800,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
 		to Ant on the command-line." />
     </target>
 
-    <target name="test-patch" depends="patch.check,findbugs.check,forrest.check">
+    <target name="test-patch" depends="patch.check,findbugs.check">
   	<exec executable="bash" failonerror="true">
     		<arg value="${test_patch_sh}"/>
     		<arg value="DEVELOPER"/>
@@ -1828,13 +1810,12 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
     		<arg value="${grep.cmd}"/>
     		<arg value="${patch.cmd}"/>
     		<arg value="${findbugs.home}"/>
-    		<arg value="${forrest.home}"/>
     		<arg value="${basedir}"/>
     		<arg value="${java5.home}"/>
   	</exec>
     </target>
 
-    <target name="hudson-test-patch" depends="findbugs.check,forrest.check">
+    <target name="hudson-test-patch" depends="findbugs.check">
   	<exec executable="bash" failonerror="true">
     		<arg value="${test_patch_sh}"/>
     		<arg value="HUDSON"/>
@@ -1846,7 +1827,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
     		<arg value="${grep.cmd}"/>
     		<arg value="${patch.cmd}"/>
     		<arg value="${findbugs.home}"/>
-    		<arg value="${forrest.home}"/>
     		<arg value="${basedir}"/>
     		<arg value="${jira.passwd}"/>
     		<arg value="${java5.home}"/>
@@ -1855,7 +1835,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
     	</exec>
      </target>
 
-     <target name="qa-test-pullrequest" depends="findbugs.check,forrest.check">
+     <target name="qa-test-pullrequest" depends="findbugs.check">
         <exec executable="bash" failonerror="true">
                 <arg value="${test_pullrequest_sh}"/>
                 <arg value="QABUILD"/>
@@ -1867,7 +1847,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
                 <arg value="${grep.cmd}"/>
                 <arg value="${patch.cmd}"/>
                 <arg value="${findbugs.home}"/>
-                <arg value="${forrest.home}"/>
                 <arg value="${basedir}"/>
                 <arg value="${jira.passwd}"/>
                 <arg value="${java5.home}"/>
@@ -1876,7 +1855,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
      </target>
 
      <!-- this target runs the hudson trunk build -->
-     <target name="hudson-test-trunk" depends="docs,tar,findbugs"/>
+     <target name="hudson-test-trunk" depends="tar,findbugs"/>
 
      <target name="api-xml" depends="ivy-retrieve-jdiff, javadoc, write-null">
        <javadoc>

+ 0 - 384
docs/bookkeeperConfig.html

@@ -1,384 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>BookKeeper Administrator's Guide</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">BookKeeper</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="bookkeeperStarted.html">Getting started</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperOverview.html">Overview</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Setup guide</div>
-</div>
-<div class="menuitem">
-<a href="bookkeeperProgrammer.html">Programmer's guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Contributor</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.6', 'skin/')" id="menu_1.6Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.6" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="bookkeeperConfig.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>BookKeeper Administrator's Guide</h1>
-<h3>Setup Guide</h3>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#bk_deployment">Deployment</a>
-<ul class="minitoc">
-<li>
-<a href="#bk_sysReq">System requirements</a>
-</li>
-<li>
-<a href="#bk_runningBookies">Running bookies</a>
-</li>
-<li>
-<a href="#bk_zkMetadata">ZooKeeper Metadata</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-
-  
-<a name="bk_deployment"></a>
-<h2 class="h3">Deployment</h2>
-<div class="section">
-<p>This section contains information about deploying BookKeeper and
-    covers these topics:</p>
-<ul>
-      
-<li>
-        
-<p>
-<a href="#bk_sysReq">System requirements</a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#bk_runningBookies">Running bookies</a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#bk_zkMetadata">ZooKeeper Metadata</a>
-</p>
-      
-</li>
-    
-</ul>
-<p> The first section tells you how many machines you need. The second explains how to bootstrap bookies
-     (BookKeeper storage servers). The third section explains how we use ZooKeeper and our requirements with
-     respect to ZooKeeper.
-    </p>
-<a name="bk_sysReq"></a>
-<h3 class="h4">System requirements</h3>
-<p> A typical BookKeeper installation comprises a set of bookies and a set of ZooKeeper replicas. The exact number of bookies
- 	   depends on the quorum mode, desired throughput, and number of clients using this installation simultaneously. The minimum number of
- 	   bookies is three for self-verifying (stores a message authentication code along with each entry) and four for generic (does not
- 	   store a message authentication codewith each entry), and there is no upper limit on the number of bookies. Increasing the number of 
- 	   bookies, in fact, enables higher throughput.
- 	   </p>
-<p> For performance, we require each server to have at least two disks. It is possible to run a bookie with a single disk, but 
- 	   performance will be significantly lower in this case. Of course, it works with one disk, but performance is significantly lower. 
- 	   </p>
-<p> For ZooKeeper, there is no constraint with respect to the number of replicas. Having a single machine running ZooKeeper
- 	   in standalone mode is sufficient for BookKeeper. For resilience purposes, it might be a good idea to run ZooKeeper in quorum 
- 	   mode with multiple servers. Please refer to the ZooKeeper documentation for detail on how to configure ZooKeeper with multiple
- 	   replicas
- 	   </p>
-<a name="bk_runningBookies"></a>
-<h3 class="h4">Running bookies</h3>
-<p>
- 	   To run a bookie, we execute the following command:
- 	   </p>
-<p>
-<span class="codefrag computeroutput">
-		java -cp .:./zookeeper-&lt;version&gt;-bookkeeper.jar:./zookeeper-&lt;version&gt;.jar\
-		:../log4j/apache-log4j-1.2.15/log4j-1.2.15.jar -Dlog4j.configuration=log4j.properties\ 
-		org.apache.bookkeeper.proto.BookieServer 3181 127.0.0.1:2181 /path_to_log_device/\
-		/path_to_ledger_device/
-	   </span>
-</p>
-<p>
- 	   The parameters are:
- 	   </p>
-<ul>
- 	   	
-<li>
- 	   	
-<p>
- 	   		Port number that the bookie listens on;
- 	   	</p>
- 	   	
-</li>
- 	   	
- 	   	
-<li>
- 	   	
-<p>
- 	   		Comma separated list of ZooKeeper servers with a hostname:port format;
- 	   	</p>
- 	   	
-</li>
- 	   	
- 	   	
-<li>
- 	   	
-<p>
- 	   		Path for Log Device (stores bookie write-ahead log);
- 	   	</p>
- 	   	
-</li>
- 	   	
- 	   	
-<li>
- 	   	
-<p>
- 	   		Path for Ledger Device (stores ledger entries);
- 	   	</p>
- 	   	
-</li>
- 	   
-</ul>
-<p>
- 	   Ideally, <span class="codefrag computeroutput">/path_to_log_device/ </span> and <span class="codefrag computeroutput">/path_to_ledger_device/ </span> are each
- 	   in a different device. 
- 	   </p>
-<a name="bk_zkMetadata"></a>
-<h3 class="h4">ZooKeeper Metadata</h3>
-<p>
- 	   For BookKeeper, we require a ZooKeeper installation to store metadata, and to pass the list
- 	   of ZooKeeper servers as parameter to the constructor of the BookKeeper class (<span class="codefrag computeroutput">
- 	   org.apache.bookkeeper.client,BookKeeper</span>).
- 	   To setup ZooKeeper, please check the <a href="index.html">
-          ZooKeeper documentation</a>.
- 	   </p>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/bookkeeperConfig.pdf


+ 0 - 694
docs/bookkeeperOverview.html

@@ -1,694 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>BookKeeper overview</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">BookKeeper</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="bookkeeperStarted.html">Getting started</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Overview</div>
-</div>
-<div class="menuitem">
-<a href="bookkeeperConfig.html">Setup guide</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperProgrammer.html">Programmer's guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Contributor</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.6', 'skin/')" id="menu_1.6Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.6" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="bookkeeperOverview.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>BookKeeper overview</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#bk_Overview">BookKeeper overview</a>
-<ul class="minitoc">
-<li>
-<a href="#bk_Intro">BookKeeper introduction</a>
-</li>
-<li>
-<a href="#bk_moreDetail">In slightly more detail...</a>
-</li>
-<li>
-<a href="#bk_basicComponents">Bookkeeper elements and concepts</a>
-</li>
-<li>
-<a href="#bk_initialDesign">Bookkeeper initial design</a>
-</li>
-<li>
-<a href="#bk_metadata">Bookkeeper metadata management</a>
-</li>
-<li>
-<a href="#bk_closingOut">Closing out ledgers</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-  
-<a name="bk_Overview"></a>
-<h2 class="h3">BookKeeper overview</h2>
-<div class="section">
-<a name="bk_Intro"></a>
-<h3 class="h4">BookKeeper introduction</h3>
-<p>
-	BookKeeper is a replicated service to reliably log streams of records. In BookKeeper, 
-	servers are "bookies", log streams are "ledgers", and each unit of a log (aka record) is a 
-	"ledger entry". BookKeeper is designed to be reliable; bookies, the servers that store 
-	ledgers, can crash, corrupt data, discard data, but as long as there are enough bookies 
-	behaving correctly the service as a whole behaves correctly.
-	</p>
-<p>
-    The initial motivation for BookKeeper comes from the namenode of HDFS. Namenodes have to 
-    log operations in a reliable fashion so that recovery is possible in the case of crashes. 
-    We have found the applications for BookKeeper extend far beyond HDFS, however. Essentially, 
-    any application that requires an append storage can replace their implementations with
-    BookKeeper. BookKeeper has the advantage of scaling throughput with the number of servers. 
-    </p>
-<p>
-    At a high level, a bookkeeper client receives entries from a client application and stores it to
-    sets of bookies, and there are a few advantages in having such a service:
-	</p>
-<ul>
-    
-<li>
-    
-<p>
-    	We can use hardware that is optimized for such a service. We currently believe that such a
-      	system has to be optimized only for disk I/O;
-    </p>
-    
-</li>
-    
-    
-<li>
-    
-<p>
-    	We can have a pool of servers implementing such a log system, and shared among a number of servers;
-    </p>
-    
-</li>
-    
-    
-<li>
-    
-<p>
-    	We can have a higher degree of replication with such a pool, which makes sense if the hardware necessary for it is cheaper compared to the one the application uses. 
-	</p>
-	
-</li>
-	
-</ul>
-<a name="bk_moreDetail"></a>
-<h3 class="h4">In slightly more detail...</h3>
-<p> BookKeeper implements highly available logs, and it has been designed with write-ahead logging in mind. Besides high availability
-    due to the replicated nature of the service, it provides high throughput due to striping. As we write entries in a subset of bookies of an
-    ensemble and rotate writes across available quorums, we are able to increase throughput with the number of servers for both reads and writes. 
-    Scalability is a property that is possible to achieve in this case due to the use of quorums. Other replication techniques, such as 
-    state-machine replication, do not enable such a property. 
-    </p>
-<p> An application first creates a ledger before writing to bookies through a local BookKeeper client instance.   
-  	Upon creating a ledger, a BookKeeper client writes metadata about the ledger to ZooKeeper. Each ledger currently 
-  	has a single writer. This writer has to execute a close ledger operation before any other client can read from it. 
-  	If the writer of a ledger does not close a ledger properly because, for example, it has crashed before having the 
-  	opportunity of closing the ledger, then the next client that tries to open a ledger executes a procedure to recover
-  	it. As closing a ledger consists essentially of writing the last entry written to a ledger to ZooKeeper, the recovery
-  	procedure simply finds the last entry written correctly and writes it to ZooKeeper.	
-	</p>
-<p>
-	Note that currently this recovery procedure is executed automatically upon trying to open a ledger and no explicit action is necessary. 
-	Although two clients may try to recover a ledger concurrently, only one will succeed, the first one that is able to create the close znode
-	for the ledger.
-	</p>
-<a name="bk_basicComponents"></a>
-<h3 class="h4">Bookkeeper elements and concepts</h3>
-<p> 
-	BookKeeper uses four basic elements:
-	</p>
-<ul>
-      
-<li>
-      
-<p> 
-		
-<strong>Ledger</strong>: A ledger is a sequence of entries, and each entry is a sequence of bytes. Entries are
-		written sequentially to a ledger and at most once. Consequently, ledgers have an append-only semantics;
-	  </p>
-	  
-</li>
-	
-	  
-<li>
-	  
-<p> 
-		
-<strong>BookKeeper client</strong>: A client runs along with a BookKeeper application, and it enables applications
-		to execute operations on ledgers, such as creating a ledger and writing to it; 
-	  </p>
-	  
-</li> 
-	
-	  
-<li>
-	  
-<p>
-		
-<strong>Bookie</strong>: A bookie is a BookKeeper storage server. Bookies store the content of ledgers. For any given
-		ledger L, we call an <em>ensemble</em> the group of bookies storing the content of L. For performance, we store on
-		each bookie of an ensemble only a fragment of a ledger. That is, we stripe when writing entries to a ledger such that
-		each entry is written to sub-group of bookies of the ensemble.
-	  </p>
-	  
-</li>
-
-	  
-<li>
-	  
-<p> 	
-		
-<strong>Metadata storage service</strong>: BookKeeper requires a metadata storage service to store information related 
-		to ledgers and available bookies. We currently use ZooKeeper for such a task.     
-   	  </p>
-   	  
-</li>
-    
-</ul>
-<a name="bk_initialDesign"></a>
-<h3 class="h4">Bookkeeper initial design</h3>
-<p>
-    A set of bookies implements BookKeeper, and we use a quorum-based protocol to replicate data across the bookies. 
-    There are basically two operations to an existing ledger: read and append. Here is the complete API list 
-    (mode detail <a href="bookkeeperProgrammer.html">
-    	      here</a>):
-	</p>
-<ul>
-	
-<li>
-	
-<p>
-    	Create ledger: creates a new empty ledger; 
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    	Open ledger: opens an existing ledger for reading;
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    	Add entry: adds a record to a ledger either synchronously or asynchronously;
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    Read entries: reads a sequence of entries from a ledger either synchronously or asynchronously 
-	</p>
-    
-</li>
-	
-</ul>
-<p>
-	There is only a single client that can write to a ledger. Once that ledger is closed or the client fails, 
-	no more entries can be added. (We take advantage of this behavior to provide our strong guarantees.) 
-	There will not be gaps in the ledger. Fingers get broken, people get roughed up or end up in prison when
-	books are manipulated, so there is no deleting or changing of entries.
-	</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<tr>
-<td>BookKeeper Overview</td>
-</tr>
-<tr>
-<td>
-        
-            <img alt="" src="images/bk-overview.jpg">
-        
-        </td>
-</tr>
-</table>
-<p>
-    A simple use of BooKeeper is to implement a write-ahead transaction log. A server maintains an in-memory data structure
-    (with periodic snapshots for example) and logs changes to that structure before it applies the change. The application 
-    server creates a ledger at startup and store the ledger id and password in a well known place (ZooKeeper maybe). When 
-    it needs to make a change, the server adds an entry with the change information to a ledger and apply the change when 
-    BookKeeper adds the entry successfully. The server can even use asyncAddEntry to queue up many changes for high change
-    throughput. BooKeeper meticulously logs the changes in order and call the completion functions in order.
-	</p>
-<p>
-    When the application server dies, a backup server will come online, get the last snapshot and then it will open the 
-    ledger of the old server and read all the entries from the time the snapshot was taken. (Since it doesn't know the 
-    last entry number it will use MAX_INTEGER). Once all the entries have been processed, it will close the ledger and 
-    start a new one for its use. 
-	</p>
-<p>
-	A client library takes care of communicating with bookies and managing entry numbers. An entry has the following fields:
-	</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>Entry fields</caption>
-<title>Entry fields</title>
-	
-	
-<tr>
-  	
-<th>Field</th>
-  	<th>Type</th>
-  	<th>Description</th>
-	
-</tr>
-	
-	
-<tr>
-  	
-<td>Ledger number</td>
-  	<td>long</td>
-  	<td>The id of the ledger of this entry</td>
-	
-</tr>
-	
-<tr>
-  	
-<td>Entry number</td>
-  	<td>long</td>
-  	<td>The id of this entry</td>
-	
-</tr>
-	
-	
-<tr>
-  	
-<td>last confirmed (<em>LC</em>)</td>
-  	<td>long</td>
-  	<td>id of the last recorded entry</td>
-	
-</tr>
-	
-<tr>
-  	
-<td>data</td>
-  	<td>byte[]</td>
-  	<td>the entry data (supplied by application)</td>
-	
-</tr>
-	
-<tr>
-  	
-<td>authentication code</td>
-  	<td>byte[]</td>
-  	<td>Message authentication code that includes all other fields of the entry</td>
-	
-</tr>
-	
-	
-	
-</table>
-<p>
-	The client library generates a ledger entry. None of the fields are modified by the bookies and only the first three 
-	fields are interpreted by the bookies.
-	</p>
-<p>
-	To add to a ledger, the client generates the entry above using the ledger number. The entry number will be one more 
-	than the last entry generated. The <em>LC</em> field contains the last entry that has been successfully recorded by BookKeeper. 
-	If the client writes entries one at a time, <em>LC</em> is the last entry id. But, if the client is using asyncAddEntry, there 
-	may be many entries in flight. An entry is considered recorded when both of the following conditions are met:
-	</p>
-<ul>
-	
-<li>
-    
-<p>
-    	the entry has been accepted by a quorum of bookies
-    </p>
-    
-</li>
-    
-    
-<li>
-    
-<p>
-    	all entries with a lower entry id have been accepted by a quorum of bookies 
-	</p>
-	
-</li>
-    
-</ul>
-<p>
-	
-<em>LC</em> seems mysterious right now, but it is too early to explain how we use it; just smile and move on.
-	</p>
-<p>
-	Once all the other fields have been field in, the client generates an authentication code with all of the previous fields. 
-	The entry is then sent to a quorum of bookies to be recorded. Any failures will result in the entry being sent to a new
-	quorum of bookies.
-	</p>
-<p>
-	To read, the client library initially contacts a bookie and starts requesting entries. If an entry is missing or 
-	invalid (a bad MAC for example), the client will make a request to a different bookie. By using quorum writes, 
-	as long as enough bookies are up we are guaranteed to eventually be able to read an entry.
-	</p>
-<a name="bk_metadata"></a>
-<h3 class="h4">Bookkeeper metadata management</h3>
-<p>
-	There are some meta data that needs to be made available to BookKeeper clients:
-	</p>
-<ul>
-	
-<li>
-	
-<p>
-		The available bookies;
-	</p>
-	
-</li>
-	
-	
-<li>
-	
-<p>
-    	The list of ledgers;
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    	The list of bookies that have been used for a given ledger;
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    	The last entry of a ledger; 
-	</p>
-	
-</li>
-	
-</ul>
-<p>
-	We maintain this information in ZooKeeper. Bookies use ephemeral nodes to indicate their availability. Clients 
-	use znodes to track ledger creation and deletion and also to know the end of the ledger and the bookies that 
-	were used to store the ledger. Bookies also watch the ledger list so that they can cleanup ledgers that get deleted.
-	</p>
-<a name="bk_closingOut"></a>
-<h3 class="h4">Closing out ledgers</h3>
-<p>
-	The process of closing out the ledger and finding the last ledger is difficult due to the durability guarantees of BookKeeper:
-	</p>
-<ul>
-	
-<li>
-	
-<p>
-    	If an entry has been successfully recorded, it must be readable.
-    </p>
-    
-</li>
-    
-    
-<li>
-	
-<p>
-    	If an entry is read once, it must always be available to be read. 
-	</p>
-	
-</li>
-	
-</ul>
-<p>
-	If the ledger was closed gracefully, ZooKeeper will have the last entry and everything will work well. But, if the 
-	BookKeeper client that was writing the ledger dies, there is some recovery that needs to take place.
-	</p>
-<p>
-	The problematic entries are the ones at the end of the ledger. There can be entries in flight when a BookKeeper client 
-	dies. If the entry only gets to one bookie, the entry should not be readable since the entry will disappear if that bookie
-	fails. If the entry is only on one bookie, that doesn't mean that the entry has not been recorded successfully; the other
-	bookies that recorded the entry might have failed.
-	</p>
-<p>
-	The trick to making everything work is to have a correct idea of a last entry. We do it in roughly three steps:
-	</p>
-<ol>
-	
-<li>
-	
-<p>
-		Find the entry with the highest last recorded entry, <em>LC</em>;
-	</p>
-	
-</li>
-	
-	
-<li>
-	
-<p>
-		Find the highest consecutively recorded entry, <em>LR</em>;
-	</p>
-	
-</li>
-	
-	
-<li>
-	
-<p>
-		Make sure that all entries between <em>LC</em> and <em>LR</em> are on a quorum of bookies; 
-	</p>
-	
-</li>
-	
-	
-</ol>
-</div>  
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/bookkeeperOverview.pdf


+ 0 - 1083
docs/bookkeeperProgrammer.html

@@ -1,1083 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>BookKeeper Getting Started Guide</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">BookKeeper</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="bookkeeperStarted.html">Getting started</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperOverview.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperConfig.html">Setup guide</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Programmer's guide</div>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Contributor</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.6', 'skin/')" id="menu_1.6Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.6" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="bookkeeperProgrammer.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>BookKeeper Getting Started Guide</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#bk_GettingStarted">Programming with BookKeeper</a>
-<ul class="minitoc">
-<li>
-<a href="#bk_instance"> Instantiating BookKeeper.</a>
-</li>
-<li>
-<a href="#bk_createLedger"> Creating a ledger. </a>
-</li>
-<li>
-<a href="#bk_writeLedger"> Adding entries to a ledger. </a>
-</li>
-<li>
-<a href="#bk_closeLedger"> Closing a ledger. </a>
-</li>
-<li>
-<a href="#bk_openLedger"> Opening a ledger. </a>
-</li>
-<li>
-<a href="#bk_readLedger"> Reading from ledger </a>
-</li>
-<li>
-<a href="#bk_deleteLedger"> Deleting a ledger </a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-  
-<a name="bk_GettingStarted"></a>
-<h2 class="h3">Programming with BookKeeper</h2>
-<div class="section">
-<ul>
-      
-<li>
-        
-<p>
-<a href="#bk_instance"> Instantiating BookKeeper.</a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#bk_createLedger"> Creating a ledger. </a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#bk_writeLedger"> Adding entries to a ledger. </a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#bk_closeLedger"> Closing a ledger. </a>
-</p>
-      
-</li>
-      
-	  
-<li>
-        
-<p>
-<a href="#bk_openLedger"> Opening a ledger. </a>
-</p>
-      
-</li>
-      
-      
-<li>
-        
-<p>
-<a href="#bk_readLedger"> Reading from ledger </a>
-</p>
-      
-</li>
-      
-      
-<li>
-        
-<p>
-<a href="#bk_deleteLedger"> Deleting a ledger </a>
-</p>
-      
-</li>
-      
-    
-</ul>
-<a name="bk_instance"></a>
-<h3 class="h4"> Instantiating BookKeeper.</h3>
-<p>
-    The first step to use BookKeeper is to instantiate a BookKeeper object:
-    </p>
-<p>
-    
-<span class="codefrag computeroutput">
-    org.apache.bookkeeper.BookKeeper
-    </span>
-    
-</p>
-<p>
-    There are three BookKeeper constructors:
-    </p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public BookKeeper(String servers) 
-    	throws KeeperException, IOException    
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">servers</span> is a comma-separated list of ZooKeeper servers.
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public BookKeeper(ZooKeeper zk) 
-    	throws InterruptedException, KeeperException    
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">zk</span> is a ZooKeeper object. This constructor is useful when
-        the application also using ZooKeeper and wants to have a single instance of ZooKeeper.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public BookKeeper(ZooKeeper zk, ClientSocketChannelFactory channelFactory) 
-    	throws InterruptedException, KeeperException    
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">zk</span> is a ZooKeeper object. This constructor is useful when
-        the application also using ZooKeeper and wants to have a single instance of ZooKeeper.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">channelFactory</span> is a netty channel object 
-        (<span class="codefrag computeroutput">org.jboss.netty.channel.socket</span>).  
-    	</p>
-    	
-</li>
-    
-</ul>
-<a name="bk_createLedger"></a>
-<h3 class="h4"> Creating a ledger. </h3>
-<p> Before writing entries to BookKeeper, it is necessary to create a ledger. 
-    With the current BookKeeper API, it is possible to create a ledger both synchronously
-    or asynchronously. The following methods belong
-    to <span class="codefrag computeroutput">org.apache.bookkeeper.client.BookKeeper</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous call:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-    public LedgerHandle createLedger(int ensSize, int qSize, DigestType type,  byte passwd[])
-        throws KeeperException, InterruptedException, 
-        IOException, BKException
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-    	
-<span class="codefrag computeroutput">ensSize</span> is the number of bookies (ensemble size);
-    	</p>
-    	
-</li>
-    
-    	
-<li> 
-    	
-<p>
-    	
-<span class="codefrag computeroutput">qSize</span> is the write quorum size;
-    	</p>
-    	
-</li>
-    
-    	
-<li> 
-    	
-<p>
-    	
-<span class="codefrag computeroutput">type</span> is the type of digest used with entries: either MAC or CRC32.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p>
-    	
-<span class="codefrag computeroutput">passwd</span> is a password that authorizes the client to write to the
-    	ledger being created.
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    All further operations on a ledger are invoked through the <span class="codefrag computeroutput">LedgerHandle</span>
-    object returned.
-    </p>
-<p>
-    As a convenience, we provide a <span class="codefrag computeroutput">createLedger</span> with default parameters (3,2,VERIFIABLE), 
-    and the only two input parameters it requires are a digest type and a password.
-    </p>
-<p>
-   	
-<strong>Asynchronous call:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-    public void asyncCreateLedger(int ensSize, 
-            int qSize, 
-            DigestType type,  
-            byte passwd[],
-            CreateCallback cb,
-            Object ctx
-            )
-    </span>
-	
-</p>
-<p>
-	The parameters are the same of the synchronous version, with the
-	exception of <span class="codefrag computeroutput">cb</span> and <span class="codefrag computeroutput">ctx</span>. <span class="codefrag computeroutput">CreateCallback</span>
-	is an interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">createComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	void createComplete(int rc, LedgerHandle lh, Object ctx);
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKException</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">lh</span> is a <span class="codefrag computeroutput">LedgerHandle</span> object to manipulate a ledger;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is a control object for accountability purposes. It can be essentially any object the application is happy with.
-		</p>
-		
-</li>
-	
-</ul>
-<p>
-	The <span class="codefrag computeroutput">ctx</span> object passed as a parameter to the call to create a ledger
-	is the one same returned in the callback.
-    </p>
-<a name="bk_writeLedger"></a>
-<h3 class="h4"> Adding entries to a ledger. </h3>
-<p>
-    Once we have a ledger handle <span class="codefrag computeroutput">lh</span> obtained through a call to create a ledger, we
-    can start writing entries. As with creating ledgers, we can write both synchronously and 
-    asynchronously. The following methods belong
-    to <span class="codefrag computeroutput">org.apache.bookkeeper.client.LedgerHandle</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous call:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public long addEntry(byte[] data)
-    	throws InterruptedException
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-    	
-<span class="codefrag computeroutput">data</span> is a byte array;
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-	A call to <span class="codefrag computeroutput">addEntry</span> returns the status of the operation (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-    </p>
-<p>
-   	
-<strong>Asynchronous call:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void asyncAddEntry(byte[] data, AddCallback cb, Object ctx)
-    </span>
-	
-</p>
-<p>
-    It also takes a byte array as the sequence of bytes to be stored as an entry. Additionaly, it takes
-    a callback object <span class="codefrag computeroutput">cb</span> and a control object <span class="codefrag computeroutput">ctx</span>. The callback object must implement
-    the <span class="codefrag computeroutput">AddCallback</span> interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">addComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	void addComplete(int rc, LedgerHandle lh, long entryId, Object ctx);
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">lh</span> is a <span class="codefrag computeroutput">LedgerHandle</span> object to manipulate a ledger;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">entryId</span> is the identifier of entry associated with this request;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is control object used for accountability purposes. It can be any object the application is happy with.
-		</p>
-		
-</li>
-	
-</ul>
-<a name="bk_closeLedger"></a>
-<h3 class="h4"> Closing a ledger. </h3>
-<p>
-    Once a client is done writing, it closes the ledger. The following methods belong
-    to <span class="codefrag computeroutput">org.apache.bookkeeper.client.LedgerHandle</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous close:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void close() 
-    throws InterruptedException
-    </span>
-	
-</p>
-<p>
-    It takes no input parameters.
-    </p>
-<p>
-   	
-<strong>Asynchronous close:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void asyncClose(CloseCallback cb, Object ctx)
-    throws InterruptedException
-    </span>
-	
-</p>
-<p>
-    It takes a callback object <span class="codefrag computeroutput">cb</span> and a control object <span class="codefrag computeroutput">ctx</span>. The callback object must implement
-    the <span class="codefrag computeroutput">CloseCallback</span> interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">closeComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	void closeComplete(int rc, LedgerHandle lh, Object ctx)
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">lh</span> is a <span class="codefrag computeroutput">LedgerHandle</span> object to manipulate a ledger;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is control object used for accountability purposes. 
-		</p>
-		
-</li>
-	
-</ul>
-<a name="bk_openLedger"></a>
-<h3 class="h4"> Opening a ledger. </h3>
-<p>
-    To read from a ledger, a client must open it first. The following methods belong
-    to <span class="codefrag computeroutput">org.apache.bookkeeper.client.BookKeeper</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous open:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public LedgerHandle openLedger(long lId, DigestType type, byte passwd[])
-    throws InterruptedException, BKException
-    </span>
-	
-</p>
-<ul>
-	
-<li>
-	
-<p>
-	
-<span class="codefrag computeroutput">ledgerId</span> is the ledger identifier;
-	</p>
-	
-</li>
-	
-	
-<li> 
-    
-<p>
-    
-<span class="codefrag computeroutput">type</span> is the type of digest used with entries: either MAC or CRC32.  
-    </p>
-    
-</li>
-	
-	
-<li>
-	
-<p>
-	
-<span class="codefrag computeroutput">passwd</span> is a password to access the ledger (used only in the case of <span class="codefrag computeroutput">VERIFIABLE</span> ledgers);
-	</p>
-	
-</li>
-	
-</ul>
-<p>
-   	
-<strong>Asynchronous open:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void asyncOpenLedger(long lId, DigestType type, byte passwd[], OpenCallback cb, Object ctx)
-    </span>
-	
-</p>
-<p>
-    It also takes a a ledger identifier and a password. Additionaly, it takes a callback object 
-    <span class="codefrag computeroutput">cb</span> and a control object <span class="codefrag computeroutput">ctx</span>. The callback object must implement
-    the <span class="codefrag computeroutput">OpenCallback</span> interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">openComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	public void openComplete(int rc, LedgerHandle lh, Object ctx)
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">lh</span> is a <span class="codefrag computeroutput">LedgerHandle</span> object to manipulate a ledger;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is control object used for accountability purposes. 
-		</p>
-		
-</li>
-	
-</ul>
-<a name="bk_readLedger"></a>
-<h3 class="h4"> Reading from ledger </h3>
-<p>
-    Read calls may request one or more consecutive entries. The following methods belong
-    to <span class="codefrag computeroutput">org.apache.bookkeeper.client.LedgerHandle</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous read:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public Enumeration&lt;LedgerEntry&gt; readEntries(long firstEntry, long lastEntry) 
-    throws InterruptedException, BKException
-    </span>
-	
-</p>
-<ul>
-	
-<li>
-	
-<p>
-	
-<span class="codefrag computeroutput">firstEntry</span> is the identifier of the first entry in the sequence of entries to read;
-	</p>
-	
-</li>
-	
-	
-<li>
-	
-<p>
-	
-<span class="codefrag computeroutput">lastEntry</span> is the identifier of the last entry in the sequence of entries to read.
-	</p>
-	
-</li>
-	
-</ul>
-<p>
-   	
-<strong>Asynchronous read:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void asyncReadEntries(long firstEntry, 
-            long lastEntry, ReadCallback cb, Object ctx)
-    throws BKException, InterruptedException
-    </span>
-	
-</p>
-<p>
-    It also takes a first and a last entry identifiers. Additionaly, it takes a callback object 
-    <span class="codefrag computeroutput">cb</span> and a control object <span class="codefrag computeroutput">ctx</span>. The callback object must implement
-    the <span class="codefrag computeroutput">ReadCallback</span> interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">readComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	void readComplete(int rc, LedgerHandle lh, Enumeration&lt;LedgerEntry&gt; seq, Object ctx)
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">lh</span> is a <span class="codefrag computeroutput">LedgerHandle</span> object to manipulate a ledger;
-		</p>
-		
-</li>
-		
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">seq</span> is a <span class="codefrag computeroutput">Enumeration&lt;LedgerEntry&gt; </span> object to containing the list of entries requested;
-		</p>
-		
-</li>
-
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is control object used for accountability purposes. 
-		</p>
-		
-</li>
-	
-</ul>
-<a name="bk_deleteLedger"></a>
-<h3 class="h4"> Deleting a ledger </h3>
-<p>
-    Once a client is done with a ledger and is sure that nobody will ever need to read from it again, they can delete the ledger.
-    The following methods belong to <span class="codefrag computeroutput">org.apache.bookkeeper.client.BookKeeper</span>.
-    </p>
-<p>
-   	
-<strong>Synchronous delete:</strong>
-   	
-</p>
-<p>
-    
-<span class="codefrag computeroutput">
-        public void deleteLedger(long lId) throws InterruptedException, BKException
-    </span>
-    
-</p>
-<ul>
-	
-<li>
-	
-<p>
-	
-<span class="codefrag computeroutput">lId</span> is the ledger identifier;
-	</p>
-	
-</li>
-	
-</ul>
-<p>
-   	
-<strong>Asynchronous delete:</strong>
-    
-</p>
-<p>
-      
-<span class="codefrag computeroutput">
-	 public void asyncDeleteLedger(long lId, DeleteCallback cb, Object ctx) 
-      </span>
-    
-</p>
-<p>
-    It takes a ledger identifier. Additionally, it takes a callback object 
-    <span class="codefrag computeroutput">cb</span> and a control object <span class="codefrag computeroutput">ctx</span>. The callback object must implement
-    the <span class="codefrag computeroutput">DeleteCallback</span> interface in <span class="codefrag computeroutput">org.apache.bookkeeper.client.AsyncCallback</span>, and
-	a class implementing it has to implement a method called <span class="codefrag computeroutput">deleteComplete</span>
-	that has the following signature: 
-    </p>
-<p>
-	
-<span class="codefrag computeroutput">
-	void deleteComplete(int rc, Object ctx)
-	</span>    
-	
-</p>
-<p>
-	where:
-	</p>
-<ul>
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">rc</span> is a return code (please refer to <span class="codefrag computeroutput">org.apache.bookeeper.client.BKDefs</span> for a list);
-		</p>
-		
-</li>
-	
-		
-<li>
-		
-<p>
-		
-<span class="codefrag computeroutput">ctx</span> is control object used for accountability purposes. 
-		</p>
-		
-</li>
-	
-</ul>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/bookkeeperProgrammer.pdf


+ 0 - 448
docs/bookkeeperStarted.html

@@ -1,448 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>BookKeeper Getting Started Guide</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">BookKeeper</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menupage">
-<div class="menupagetitle">Getting started</div>
-</div>
-<div class="menuitem">
-<a href="bookkeeperOverview.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperConfig.html">Setup guide</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperProgrammer.html">Programmer's guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Contributor</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.6', 'skin/')" id="menu_1.6Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.6" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="bookkeeperStarted.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>BookKeeper Getting Started Guide</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#bk_GettingStarted">Getting Started: Setting up BookKeeper to write logs.</a>
-<ul class="minitoc">
-<li>
-<a href="#bk_Prerequisites">Pre-requisites</a>
-</li>
-<li>
-<a href="#bk_Download">Download</a>
-</li>
-<li>
-<a href="#bk_localBK">LocalBookKeeper</a>
-</li>
-<li>
-<a href="#bk_setupBookies">Setting up bookies</a>
-</li>
-<li>
-<a href="#bk_setupZK">Setting up ZooKeeper</a>
-</li>
-<li>
-<a href="#bk_example">Example</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-  
-<a name="bk_GettingStarted"></a>
-<h2 class="h3">Getting Started: Setting up BookKeeper to write logs.</h2>
-<div class="section">
-<p>This document contains information to get you started quickly with
-    BookKeeper. It is aimed primarily at developers willing to try it out, and
-    contains simple installation instructions for a simple BookKeeper installation
-    and a simple programming example. For further programming detail, please refer to 
-    <a href="bookkeeperProgrammer.html">BookKeeper Programmer's Guide</a>.
-    </p>
-<a name="bk_Prerequisites"></a>
-<h3 class="h4">Pre-requisites</h3>
-<p>See <a href="bookkeeperConfig.html#bk_sysReq">
-    	      System Requirements</a> in the Admin guide.</p>
-<a name="bk_Download"></a>
-<h3 class="h4">Download</h3>
-<p> BookKeeper is distributed along with ZooKeeper. To get a ZooKeeper distribution, 
-			   download a recent
-    	    <a href="http://zookeeper.apache.org/releases.html">
-        	  stable</a> release from one of the Apache Download
-       	 Mirrors.</p>
-<a name="bk_localBK"></a>
-<h3 class="h4">LocalBookKeeper</h3>
-<p> Under org.apache.bookkeeper.util, you'll find a java program
-		called LocalBookKeeper.java that sets you up to run BookKeeper on a 
-		single machine. This is far from ideal from a performance perspective,
-		but the program is useful for both test and educational purposes.
-		</p>
-<a name="bk_setupBookies"></a>
-<h3 class="h4">Setting up bookies</h3>
-<p> If you're bold and you want more than just running things locally, then
-		you'll need to run bookies in different servers. You'll need at least three bookies
-		to start with.  
-		</p>
-<p>
-		For each bookie, we need to execute a command like the following:
-		</p>
-<p>
-<span class="codefrag computeroutput">
-		java -cp .:./zookeeper-&lt;version&gt;-bookkeeper.jar:./zookeeper-&lt;version&gt;.jar\
-		:lib/slf4j-api-1.6.1.jar:lib/slf4j-log4j12-1.6.1.jar:lib/log4j-1.2.15.jar -Dlog4j.configuration=log4j.properties\ 
-		org.apache.bookkeeper.proto.BookieServer 3181 127.0.0.1:2181 /path_to_log_device/\
-		/path_to_ledger_device/
-		</span>
-</p>
-<p> "/path_to_log_device/" and "/path_to_ledger_device/" are different paths. Also, port 3181
-		is the port that a bookie listens on for connection requests from clients. 127.0.0.1:2181 is the hostname:port 
-		for the ZooKeeper server. In this example, the standalone ZooKeeper server is running locally on port 2181.
-		If we had multiple ZooKeeper servers, this parameter would be a comma separated list of all the hostname:port
-		values corresponding to them.
-		</p>
-<a name="bk_setupZK"></a>
-<h3 class="h4">Setting up ZooKeeper</h3>
-<p> ZooKeeper stores metadata on behalf of BookKeeper clients and bookies. To get a minimal 
-	  	ZooKeeper installation to work with BookKeeper, we can set up one server running in
-	  	standalone mode. Once we have the server running, we need to create a few znodes:
-	  	</p>
-<ol>
-	  	
-<li>
-	  	
-<p>
-<span class="codefrag computeroutput">
-	  	/ledgers	
-	  	</span>
-</p>
-	  	
-</li>
-	  	
-	  	
-<li>
-	  	
-<p>
-<span class="codefrag computeroutput">
-	  	/ledgers/available
-	  	</span>
-</p>
-	  	
-</li>
-	  	
-	  	
-<li>
-	  	
-<p> For each bookie, we add one znode such that the name of the znode is the
-	  	concatenation of the machine name and the port number that the bookie is 
-	  	listening on. For example, if a bookie is running on bookie.foo.com an is listening 
-	  	on port 3181, we add a znode 
-	  	<span class="codefrag computeroutput">/ledgers/available/bookie.foo.com:3181</span>.  
-	  	</p>
-	  	
-</li>
-	  	
-</ol>
-<a name="bk_example"></a>
-<h3 class="h4">Example</h3>
-<p>
-	    In the following excerpt of code, we:
-	    </p>
-<ol>
-	    	
-<li>
-	    	
-<p>
-	    	Create a ledger;
-	    	</p>
-	    	
-</li>
-	    	
-	    	
-<li>
-	    	
-<p>
-	    	Write to the ledger;
-	    	</p>
-	    	
-</li>
-	    	
-	    	
-<li>
-	    	
-<p>
-	    	Close the ledger;
-	    	</p>
-	    	
-</li>
-	    	
-	    	
-<li>
-	    	
-<p>
-	    	Open the same ledger for reading;
-	    	</p>
-	    	
-</li>
-	    	
-	    	
-<li>
-	    	
-<p>
-	    	Read from the ledger;
-	    	</p>
-	    	
-</li>
-	    	
-	    	
-<li>
-	    	
-<p>
-	    	Close the ledger again;
-	    	</p>
-	    	
-</li>
-	    
-</ol>
-<pre class="code">
-LedgerHandle lh = bkc.createLedger(ledgerPassword);
-ledgerId = lh.getId();
-ByteBuffer entry = ByteBuffer.allocate(4);
-
-for(int i = 0; i &lt; 10; i++){
-	entry.putInt(i);
-	entry.position(0);
-	entries.add(entry.array());				
-	lh.addEntry(entry.array());
-}
-lh.close();
-lh = bkc.openLedger(ledgerId, ledgerPassword);		
-			
-Enumeration&lt;LedgerEntry&gt; ls = lh.readEntries(0, 9);
-int i = 0;
-while(ls.hasMoreElements()){
-	ByteBuffer origbb = ByteBuffer.wrap(
-				entries.get(i++));
-	Integer origEntry = origbb.getInt();
-	ByteBuffer result = ByteBuffer.wrap(
-				ls.nextElement().getEntry());
-
-	Integer retrEntry = result.getInt();
-}
-lh.close();
-	    </pre>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/bookkeeperStarted.pdf


+ 0 - 612
docs/bookkeeperStream.html

@@ -1,612 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>Streaming with BookKeeper</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">BookKeeper</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="bookkeeperStarted.html">Getting started</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperOverview.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperConfig.html">Setup guide</a>
-</div>
-<div class="menuitem">
-<a href="bookkeeperProgrammer.html">Programmer's guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Contributor</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.6', 'skin/')" id="menu_1.6Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.6" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="bookkeeperStream.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>Streaming with BookKeeper</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#bk_StreamSummary">Summary</a>
-</li>
-<li>
-<a href="#bk_LedgerOutputStream">Writing a stream of bytes</a>
-</li>
-<li>
-<a href="#bk_LedgerInputStream">Reading a stream of bytes</a>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-	
-<a name="bk_StreamSummary"></a>
-<h2 class="h3">Summary</h2>
-<div class="section">
-<p>
-    When using the BookKeeper API, an application has to split the data to write into entries, each
-    entry being a byte array. This is natural for many applications. For example, when using BookKeeper
-    for write-ahead logging, an application typically wants to write the modifications corresponding
-    to a command or a transaction. Some other applications, however, might not have a natural boundary
-    for entries, and may prefer to write and read streams of bytes. This is exactly the purpose of the
-    stream API we have implemented on top of BookKeeper.
-    </p>
-<p>
-    The stream API is implemented in the package <span class="codefrag computeroutput">Streaming</span>, and it contains two main classes: <span class="codefrag computeroutput">LedgerOutputStream</span> and 
-    <span class="codefrag computeroutput">LedgerInputStream</span>. The class names are indicative of what they do.
-    </p>
-</div>
-    
-    
-<a name="bk_LedgerOutputStream"></a>
-<h2 class="h3">Writing a stream of bytes</h2>
-<div class="section">
-<p>
-    Class <span class="codefrag computeroutput">LedgerOutputStream</span> implements two constructors and five public methods:
-    </p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public LedgerOutputStream(LedgerHandle lh) 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">lh</span> is a ledger handle for a previously created and open ledger.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public LedgerOutputStream(LedgerHandle lh, int size) 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">lh</span> is a ledger handle for a previously created and open ledger.  
-    	</p>
-    	
-</li>
-
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">size</span> is the size of the byte buffer to store written bytes before flushing.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-   	
-<strong>Closing a stream.</strong> This call closes the stream by flushing the write buffer.
-   	</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void close() 
-    </span>
-	
-</p>
-<p>
-    which has no parameters.
-    </p>
-<p>
-   	
-<strong>Flushing a stream.</strong> This call essentially flushes the write buffer.
-   	</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized void flush() 
-    </span>
-	
-</p>
-<p>
-    which has no parameters.
-    </p>
-<p>
-   	
-<strong>Writing bytes.</strong> There are three calls for writing bytes to a stream.
-   	</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized void write(byte[] b) 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">b</span> is an array of bytes to write.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized void write(byte[] b, int off, int len) 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">b</span> is an array of bytes to write.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">off</span> is a buffer offset.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">len</span> is the length to write.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized void write(int b) 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">b</span> contains a byte to write. The method writes the least significant byte of the integer four bytes.    
-    	</p>
-    	
-</li>
-    
-</ul>
-</div>
-    
-    
-<a name="bk_LedgerInputStream"></a>
-<h2 class="h3">Reading a stream of bytes</h2>
-<div class="section">
-<p>
-    Class <span class="codefrag computeroutput">LedgerOutputStream</span> implements two constructors and four public methods:
-    </p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public LedgerInputStream(LedgerHandle lh)
-	throws BKException, InterruptedException 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">lh</span> is a ledger handle for a previously created and open ledger.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public LedgerInputStream(LedgerHandle lh, int size) 
-    throws BKException, InterruptedException
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">lh</span> is a ledger handle for a previously created and open ledger.  
-    	</p>
-    	
-</li>
-
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">size</span> is the size of the byte buffer to store bytes that the application
-        will eventually read.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-   	
-<strong>Closing.</strong> There is one call to close an input stream, but the call
-   	is currently empty and the application is responsible for closing the ledger handle. 
-   	</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public void close()
-    </span>
-	
-</p>
-<p>
-    which has no parameters.
-    </p>
-<p>
-   	
-<strong>Reading.</strong> There are three calls to read from the stream.
-   	</p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized int read()
-	throws IOException 
-    </span>
-	
-</p>
-<p>
-    which has no parameters.
-    </p>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized int read(byte[] b)
-	throws IOException 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">b</span> is a byte array to write to.  
-    	</p>
-    	
-</li>
-    
-</ul>
-<p>
-    
-<span class="codefrag computeroutput">
-	public synchronized int read(byte[] b, int off, int len)
-	throws IOException 
-    </span>
-	
-</p>
-<p>
-    where:
-    </p>
-<ul>
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">b</span> is a byte array to write to.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">off</span> is an offset for byte array <span class="codefrag computeroutput">b</span>.  
-    	</p>
-    	
-</li>
-    	
-    	
-<li>
-    	
-<p> 
-        
-<span class="codefrag computeroutput">len</span> is the length in bytes to write to <span class="codefrag computeroutput">b</span>.  
-    	</p>
-    	
-</li>
-    
-</ul>
-</div>
-  
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/bookkeeperStream.pdf


+ 0 - 2
docs/broken-links.xml

@@ -1,2 +0,0 @@
-<broken-links>
-</broken-links>

BIN
docs/images/2pc.jpg


BIN
docs/images/bk-overview.jpg


BIN
docs/images/built-with-forrest-button.png


BIN
docs/images/favicon.ico


BIN
docs/images/hadoop-logo.jpg


BIN
docs/images/instruction_arrow.png


BIN
docs/images/state_dia.jpg


BIN
docs/images/zkcomponents.jpg


BIN
docs/images/zknamespace.jpg


BIN
docs/images/zkperfRW-3.2.jpg


BIN
docs/images/zkperfRW.jpg


BIN
docs/images/zkperfreliability.jpg


BIN
docs/images/zkservice.jpg


BIN
docs/images/zookeeper_small.gif


+ 0 - 352
docs/index.html

@@ -1,352 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper: Because Coordinating Distributed Systems is a Zoo</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Overview</div>
-<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
-<div class="menupage">
-<div class="menupagetitle">Welcome</div>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit">
-<hr>
-<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
-</div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="index.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper: Because Coordinating Distributed Systems is a Zoo</h1>
-<div id="front-matter"></div>
-    
-<p>ZooKeeper is a high-performance coordination service for
-      distributed applications.  It exposes common services - such as
-      naming, configuration management, synchronization, and group
-      services - in a simple interface so you don't have to write them
-      from scratch.  You can use it off-the-shelf to implement
-      consensus, group management, leader election, and presence
-      protocols. And you can build on it for your own, specific needs.
-    </p>
-
-    
-<p>
-      The following documents describe concepts and procedures to get
-      you started using ZooKeeper. If you have more questions, please
-      ask the <a href="http://zookeeper.apache.org/mailing_lists.html">mailing list</a> or browse the
-      archives.
-    </p>
-    
-<ul>
-
-      
-<li>
-<strong>ZooKeeper Overview</strong>
-<p>Technical Overview Documents for Client Developers, Adminstrators, and Contributors</p>
-      
-<ul>
-<li>
-<a href="zookeeperOver.html">Overview</a> - a bird's eye view of ZooKeeper, including design concepts and architecture</li>
-      
-<li>
-<a href="zookeeperStarted.html">Getting Started</a> - a tutorial-style guide for developers to install, run, and program to ZooKeeper</li>
-      
-<li>
-<a href="releasenotes.html">Release Notes</a> - new developer and user facing features, improvements, and incompatibilities</li>
-      
-</ul>
-      
-</li>
-      
-      
-<li>
-<strong>Developers</strong>
-<p> Documents for Developers using the ZooKeeper Client API</p>
-      
-<ul>
-            
-<li>
-<a href="api/index.html">API Docs</a> - the technical reference to ZooKeeper Client APIs</li>
-      
-<li>
-<a href="zookeeperProgrammers.html">Programmer's Guide</a> - a client application developer's guide to ZooKeeper</li>
-      
-<li>
-<a href="javaExample.html">ZooKeeper Java Example</a> - a simple Zookeeper client appplication, written in Java</li>
-      
-<li>
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a> - sample implementations of barriers and queues</li>  
-      
-<li>
-<a href="recipes.html">ZooKeeper Recipes</a> - higher level solutions to common problems in distributed applications</li>
-      
-</ul>
-      
-</li>
-      
-      
-<li>
-<strong>Administrators &amp; Operators</strong> 
-<p> Documents for Administrators and Operations Engineers of ZooKeeper Deployments</p>
-      
-<ul>
-      
-<li>
-<a href="zookeeperAdmin.html">Administrator's Guide</a> - a guide for system administrators and anyone else who might deploy ZooKeeper</li>
-      
-<li>
-<a href="zookeeperQuotas.html">Quota Guide</a> - a guide for system administrators on Quotas in ZooKeeper. </li>
-      
-<li>
-<a href="zookeeperJMX.html">JMX</a> - how to enable JMX in ZooKeeper</li>
-      
-<li>
-<a href="zookeeperHierarchicalQuorums.html">Hierarchical quorums</a>
-</li>
-      
-<li>
-<a href="zookeeperObservers.html">Observers</a> - non-voting ensemble members that easily improve ZooKeeper's scalability</li>
-      
-<li>
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a> - a guide on how to use dynamic reconfiguration in ZooKeeper</li>
-      
-</ul>
-      
-</li>
-      
-      
-<li>
-<strong>Contributors</strong>
-<p> Documents for Developers Contributing to the ZooKeeper Open Source Project</p>
-      
-<ul>
-      
-<li>
-<a href="zookeeperInternals.html">ZooKeeper Internals</a> - assorted topics on the inner workings of ZooKeeper</li>
-      
-</ul>
-      
-</li>
-      
-      
-<li>
-<strong>Miscellaneous ZooKeeper Documentation</strong>
-      
-<ul>
-      
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</li>
-      
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</li>    
-      
-</ul>
-      
-</li>
-    
-</ul>
-  
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<div id="logos"></div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/index.pdf


+ 0 - 900
docs/javaExample.html

@@ -1,900 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper Java Example</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.2', 'skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Developer</div>
-<div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Java Example</div>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="javaExample.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper Java Example</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#ch_Introduction">A Simple Watch Client</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_requirements">Requirements</a>
-</li>
-<li>
-<a href="#sc_design">Program Design</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_executor">The Executor Class</a>
-</li>
-<li>
-<a href="#sc_DataMonitor">The DataMonitor Class</a>
-</li>
-<li>
-<a href="#sc_completeSourceCode">Complete Source Listings</a>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-<a name="ch_Introduction"></a>
-<h2 class="h3">A Simple Watch Client</h2>
-<div class="section">
-<p>To introduce you to the ZooKeeper Java API, we develop here a very simple 
-    watch client. This ZooKeeper client watches a ZooKeeper node for changes 
-    and responds to by starting or stopping a program.</p>
-<a name="sc_requirements"></a>
-<h3 class="h4">Requirements</h3>
-<p>The client has four requirements:</p>
-<ul>
-<li>
-<p>It takes as parameters:</p>
-        
-<ul>
-        
-<li>
-<p>the address of the ZooKeeper service</p>
-</li>
-        
-<li>
-<p>the name of a znode - the one to be watched</p>
-</li>
-        
-<li>
-<p>the name of a file to write the output to</p>
-</li>
-        
-<li>
-<p>an executable with arguments.</p>
-</li>
-</ul>
-</li>
-    
-<li>
-<p>It fetches the data associated with the znode and starts the executable.</p>
-</li>
-    
-<li>
-<p>If the znode changes, the client refetches the contents and restarts the executable.</p>
-</li>
-    
-<li>
-<p>If the znode disappears, the client kills the executable.</p>
-</li>
-</ul>
-<a name="sc_design"></a>
-<h3 class="h4">Program Design</h3>
-<p>Conventionally, ZooKeeper applications are broken into two units, one which maintains the connection, 
-   and the other which monitors data.  In this application, the class called the <strong>Executor</strong> 
-   maintains the ZooKeeper connection, and the class called the  <strong>DataMonitor</strong> monitors the data
-   in the ZooKeeper tree. Also, Executor contains the main thread and contains the execution logic.
-   It is responsible for what little user interaction there is, as well as interaction with the exectuable program you
-   pass in as an argument and which the sample (per the requirements) shuts down and restarts, according to the 
-   state of the znode.</p>
-</div>
-
-   
-<a name="sc_executor"></a>
-<h2 class="h3">The Executor Class</h2>
-<div class="section">
-<p>The Executor object is the primary container of the sample application. It contains 
-    both the <strong>ZooKeeper</strong> object, <strong>DataMonitor</strong>, as described above in 
-    <a href="#sc_design">Program Design</a>.  </p>
-<pre class="code">
-    // from the Executor class...
-    
-    public static void main(String[] args) {
-        if (args.length &lt; 4) {
-            System.err
-                    .println("USAGE: Executor hostPort znode filename program [args ...]");
-            System.exit(2);
-        }
-        String hostPort = args[0];
-        String znode = args[1];
-        String filename = args[2];
-        String exec[] = new String[args.length - 3];
-        System.arraycopy(args, 3, exec, 0, exec.length);
-        try {
-            new Executor(hostPort, znode, filename, exec).run();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public Executor(String hostPort, String znode, String filename,
-            String exec[]) throws KeeperException, IOException {
-        this.filename = filename;
-        this.exec = exec;
-        zk = new ZooKeeper(hostPort, 3000, this);
-        dm = new DataMonitor(zk, znode, null, this);
-    }
-
-    public void run() {
-        try {
-            synchronized (this) {
-                while (!dm.dead) {
-                    wait();
-                }
-            }
-        } catch (InterruptedException e) {
-        }
-    }
-</pre>
-<p>
-    Recall that the Executor's job is to start and stop the executable whose name you pass in on the command line. 
-    It does this in response to events fired by the ZooKeeper object. As you can see in the code above, the Executor passes
-    a reference to itself as the Watcher argument in the ZooKeeper constructor. It also passes a reference to itself
-    as DataMonitorListener argument to the DataMonitor constructor. Per the Executor's definition, it implements both these
-    interfaces:
-    </p>
-<pre class="code">
-public class Executor implements Watcher, Runnable, DataMonitor.DataMonitorListener {
-...</pre>
-<p>The <strong>Watcher</strong> interface is defined by the ZooKeeper Java API.
-    ZooKeeper uses it to communicate back to its container. It supports only one method, <span class="codefrag command">process()</span>, and ZooKeeper uses 
-    it to communciates generic events that the main thread would be intersted in, such as the state of the ZooKeeper connection or the ZooKeeper session.The Executor 
-    in this example simply forwards those events down to the DataMonitor to decide what to do with them. It does this simply to illustrate
-    the point that, by convention, the Executor or some Executor-like object "owns" the ZooKeeper connection, but it is free to delegate the events to other
-    events to other objects. It also uses this as the default channel on which to fire watch events. (More on this later.)</p>
-<pre class="code">
-    public void process(WatchedEvent event) {
-        dm.process(event);
-    }
-</pre>
-<p>The <strong>DataMonitorListener</strong> 
-    interface, on the other hand, is not part of the the ZooKeeper API. It is a completely custom interface, 
-    designed for this sample application. The DataMonitor object uses it to communicate back to its container, which
-    is also the the Executor object.The DataMonitorListener interface looks like this:</p>
-<pre class="code">
-public interface DataMonitorListener {
-    /**
-    * The existence status of the node has changed.
-    */
-    void exists(byte data[]);
-
-    /**
-    * The ZooKeeper session is no longer valid.
-    * 
-    * @param rc
-    * the ZooKeeper reason code
-    */
-    void closing(int rc);
-}
-</pre>
-<p>This interface is defined in the DataMonitor class and implemented in the Executor class. 
-    When <span class="codefrag command">Executor.exists()</span> is invoked,
-    the Executor decides whether to start up or shut down per the requirements. Recall that the requires say to kill the executable when the 
-    znode ceases to <em>exist</em>. </p>
-<p>When <span class="codefrag command">Executor.closing()</span>
-    is invoked, the Executor decides whether or not to shut itself down in response to the ZooKeeper connection permanently disappearing.</p>
-<p>As you might have guessed, DataMonitor is the object that invokes 
-    these methods, in response to changes in ZooKeeper's state.</p>
-<p>Here are Executor's implementation of 
-    <span class="codefrag command">DataMonitorListener.exists()</span> and <span class="codefrag command">DataMonitorListener.closing</span>:
-    </p>
-<pre class="code">
-public void exists( byte[] data ) {
-    if (data == null) {
-        if (child != null) {
-            System.out.println("Killing process");
-            child.destroy();
-            try {
-                child.waitFor();
-            } catch (InterruptedException e) {
-            }
-        }
-        child = null;
-    } else {
-        if (child != null) {
-            System.out.println("Stopping child");
-            child.destroy();
-            try {
-               child.waitFor();
-            } catch (InterruptedException e) {
-            e.printStackTrace();
-            }
-        }
-        try {
-            FileOutputStream fos = new FileOutputStream(filename);
-            fos.write(data);
-            fos.close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        try {
-            System.out.println("Starting child");
-            child = Runtime.getRuntime().exec(exec);
-            new StreamWriter(child.getInputStream(), System.out);
-            new StreamWriter(child.getErrorStream(), System.err);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-}
-
-public void closing(int rc) {
-    synchronized (this) {
-        notifyAll();
-    }
-}
-</pre>
-</div>
-
-<a name="sc_DataMonitor"></a>
-<h2 class="h3">The DataMonitor Class</h2>
-<div class="section">
-<p>
-The DataMonitor class has the meat of the ZooKeeper logic. It is mostly 
-asynchronous and event driven. DataMonitor kicks things off in the constructor with:</p>
-<pre class="code">
-public DataMonitor(ZooKeeper zk, String znode, Watcher chainedWatcher,
-        DataMonitorListener listener) {
-    this.zk = zk;
-    this.znode = znode;
-    this.chainedWatcher = chainedWatcher;
-    this.listener = listener;
-    
-    // Get things started by checking if the node exists. We are going
-    // to be completely event driven
-    <strong>zk.exists(znode, true, this, null);</strong>
-}
-</pre>
-<p>The call to <span class="codefrag command">ZooKeeper.exists()</span> checks for the existence of the znode, 
-sets a watch, and passes a reference to itself (<span class="codefrag command">this</span>)
-as the completion callback object. In this sense, it kicks things off, since the
-real processing happens when the watch is triggered.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-
-<p>Don't confuse the completion callback with the watch callback. The <span class="codefrag command">ZooKeeper.exists()</span> 
-completion callback, which happens to be the method <span class="codefrag command">StatCallback.processResult()</span> implemented 
-in the DataMonitor object, is invoked when the asynchronous <em>setting of the watch</em> operation 
-(by <span class="codefrag command">ZooKeeper.exists()</span>) completes on the server. </p>
-
-<p>
-The triggering of the watch, on the other hand, sends an event to the <em>Executor</em> object, since
-the Executor registered as the Watcher of the ZooKeeper object.</p>
-
-
-<p>As an aside, you might note that the DataMonitor could also register itself as the Watcher
-for this particular watch event. This is new to ZooKeeper 3.0.0 (the support of multiple Watchers). In this
-example, however, DataMonitor does not register as the Watcher.</p>
-
-</div>
-</div>
-<p>When the <span class="codefrag command">ZooKeeper.exists()</span> operation completes on the server, the ZooKeeper API invokes this completion callback on 
-the client:</p>
-<pre class="code">
-public void processResult(int rc, String path, Object ctx, Stat stat) {
-    boolean exists;
-    switch (rc) {
-    case Code.Ok:
-        exists = true;
-        break;
-    case Code.NoNode:
-        exists = false;
-        break;
-    case Code.SessionExpired:
-    case Code.NoAuth:
-        dead = true;
-        listener.closing(rc);
-        return;
-    default:
-        // Retry errors
-        zk.exists(znode, true, this, null);
-        return;
-    }
- 
-    byte b[] = null;
-    if (exists) {
-        try {
-            <strong>b = zk.getData(znode, false, null);</strong>
-        } catch (KeeperException e) {
-            // We don't need to worry about recovering now. The watch
-            // callbacks will kick off any exception handling
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            return;
-        }
-    }     
-    if ((b == null &amp;&amp; b != prevData)
-            || (b != null &amp;&amp; !Arrays.equals(prevData, b))) {
-        <strong>listener.exists(b);</strong>
-        prevData = b;
-    }
-}
-</pre>
-<p>
-The code first checks the error codes for znode existence, fatal errors, and 
-recoverable errors. If the file (or znode) exists, it gets the data from the znode, and 
-then invoke the exists() callback of Executor if the state has changed. Note, 
-it doesn't have to do any Exception processing for the getData call because it 
-has watches pending for anything that could cause an error: if the node is deleted 
-before it calls <span class="codefrag command">ZooKeeper.getData()</span>, the watch event set by 
-the <span class="codefrag command">ZooKeeper.exists()</span> triggers a callback; 
-if there is a communication error, a connection watch event fires when 
-the connection comes back up.
-</p>
-<p>Finally, notice how DataMonitor processes watch events: </p>
-<pre class="code">
-    public void process(WatchedEvent event) {
-        String path = event.getPath();
-        if (event.getType() == Event.EventType.None) {
-            // We are are being told that the state of the
-            // connection has changed
-            switch (event.getState()) {
-            case SyncConnected:
-                // In this particular example we don't need to do anything
-                // here - watches are automatically re-registered with 
-                // server and any watches triggered while the client was 
-                // disconnected will be delivered (in order of course)
-                break;
-            case Expired:
-                // It's all over
-                dead = true;
-                listener.closing(KeeperException.Code.SessionExpired);
-                break;
-            }
-        } else {
-            if (path != null &amp;&amp; path.equals(znode)) {
-                // Something has changed on the node, let's find out
-                zk.exists(znode, true, this, null);
-            }
-        }
-        if (chainedWatcher != null) {
-            chainedWatcher.process(event);
-        }
-    }
-</pre>
-<p>
-If the client-side ZooKeeper libraries can re-establish the
-communication channel (SyncConnected event) to ZooKeeper before
-session expiration (Expired event) all of the session's watches will
-automatically be re-established with the server (auto-reset of watches
-is new in ZooKeeper 3.0.0). See <a href="zookeeperProgrammers.html#ch_zkWatches">ZooKeeper Watches</a>
-in the programmer guide for more on this. A bit lower down in this
-function, when DataMonitor gets an event for a znode, it calls
-<span class="codefrag command">ZooKeeper.exists()</span> to find out what has changed.
-</p>
-</div>
-
-
-<a name="sc_completeSourceCode"></a>
-<h2 class="h3">Complete Source Listings</h2>
-<div class="section">
-<div class="note example">
-<div class="label">Executor.java</div>
-<div class="content">
-<title>Executor.java</title>
-<pre class="code">
-/**
- * A simple example program to use DataMonitor to start and
- * stop executables based on a znode. The program watches the
- * specified znode and saves the data that corresponds to the
- * znode in the filesystem. It also starts the specified program
- * with the specified arguments when the znode exists and kills
- * the program if the znode goes away.
- */
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooKeeper;
-
-public class Executor
-    implements Watcher, Runnable, DataMonitor.DataMonitorListener
-{
-    String znode;
-
-    DataMonitor dm;
-
-    ZooKeeper zk;
-
-    String filename;
-
-    String exec[];
-
-    Process child;
-
-    public Executor(String hostPort, String znode, String filename,
-            String exec[]) throws KeeperException, IOException {
-        this.filename = filename;
-        this.exec = exec;
-        zk = new ZooKeeper(hostPort, 3000, this);
-        dm = new DataMonitor(zk, znode, null, this);
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        if (args.length &lt; 4) {
-            System.err
-                    .println("USAGE: Executor hostPort znode filename program [args ...]");
-            System.exit(2);
-        }
-        String hostPort = args[0];
-        String znode = args[1];
-        String filename = args[2];
-        String exec[] = new String[args.length - 3];
-        System.arraycopy(args, 3, exec, 0, exec.length);
-        try {
-            new Executor(hostPort, znode, filename, exec).run();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /***************************************************************************
-     * We do process any events ourselves, we just need to forward them on.
-     *
-     * @see org.apache.zookeeper.Watcher#process(org.apache.zookeeper.proto.WatcherEvent)
-     */
-    public void process(WatchedEvent event) {
-        dm.process(event);
-    }
-
-    public void run() {
-        try {
-            synchronized (this) {
-                while (!dm.dead) {
-                    wait();
-                }
-            }
-        } catch (InterruptedException e) {
-        }
-    }
-
-    public void closing(int rc) {
-        synchronized (this) {
-            notifyAll();
-        }
-    }
-
-    static class StreamWriter extends Thread {
-        OutputStream os;
-
-        InputStream is;
-
-        StreamWriter(InputStream is, OutputStream os) {
-            this.is = is;
-            this.os = os;
-            start();
-        }
-
-        public void run() {
-            byte b[] = new byte[80];
-            int rc;
-            try {
-                while ((rc = is.read(b)) &gt; 0) {
-                    os.write(b, 0, rc);
-                }
-            } catch (IOException e) {
-            }
-
-        }
-    }
-
-    public void exists(byte[] data) {
-        if (data == null) {
-            if (child != null) {
-                System.out.println("Killing process");
-                child.destroy();
-                try {
-                    child.waitFor();
-                } catch (InterruptedException e) {
-                }
-            }
-            child = null;
-        } else {
-            if (child != null) {
-                System.out.println("Stopping child");
-                child.destroy();
-                try {
-                    child.waitFor();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-            }
-            try {
-                FileOutputStream fos = new FileOutputStream(filename);
-                fos.write(data);
-                fos.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            try {
-                System.out.println("Starting child");
-                child = Runtime.getRuntime().exec(exec);
-                new StreamWriter(child.getInputStream(), System.out);
-                new StreamWriter(child.getErrorStream(), System.err);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-}
-</pre>
-	
-
-</div>
-</div>
-<div class="note example">
-<div class="label">DataMonitor.java</div>
-<div class="content">
-	
-<title>DataMonitor.java</title>
-	
-<pre class="code">
-/**
- * A simple class that monitors the data and existence of a ZooKeeper
- * node. It uses asynchronous ZooKeeper APIs.
- */
-import java.util.Arrays;
-
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.AsyncCallback.StatCallback;
-import org.apache.zookeeper.KeeperException.Code;
-import org.apache.zookeeper.data.Stat;
-
-public class DataMonitor implements Watcher, StatCallback {
-
-    ZooKeeper zk;
-
-    String znode;
-
-    Watcher chainedWatcher;
-
-    boolean dead;
-
-    DataMonitorListener listener;
-
-    byte prevData[];
-
-    public DataMonitor(ZooKeeper zk, String znode, Watcher chainedWatcher,
-            DataMonitorListener listener) {
-        this.zk = zk;
-        this.znode = znode;
-        this.chainedWatcher = chainedWatcher;
-        this.listener = listener;
-        // Get things started by checking if the node exists. We are going
-        // to be completely event driven
-        zk.exists(znode, true, this, null);
-    }
-
-    /**
-     * Other classes use the DataMonitor by implementing this method
-     */
-    public interface DataMonitorListener {
-        /**
-         * The existence status of the node has changed.
-         */
-        void exists(byte data[]);
-
-        /**
-         * The ZooKeeper session is no longer valid.
-         *
-         * @param rc
-         *                the ZooKeeper reason code
-         */
-        void closing(int rc);
-    }
-
-    public void process(WatchedEvent event) {
-        String path = event.getPath();
-        if (event.getType() == Event.EventType.None) {
-            // We are are being told that the state of the
-            // connection has changed
-            switch (event.getState()) {
-            case SyncConnected:
-                // In this particular example we don't need to do anything
-                // here - watches are automatically re-registered with 
-                // server and any watches triggered while the client was 
-                // disconnected will be delivered (in order of course)
-                break;
-            case Expired:
-                // It's all over
-                dead = true;
-                listener.closing(KeeperException.Code.SessionExpired);
-                break;
-            }
-        } else {
-            if (path != null &amp;&amp; path.equals(znode)) {
-                // Something has changed on the node, let's find out
-                zk.exists(znode, true, this, null);
-            }
-        }
-        if (chainedWatcher != null) {
-            chainedWatcher.process(event);
-        }
-    }
-
-    public void processResult(int rc, String path, Object ctx, Stat stat) {
-        boolean exists;
-        switch (rc) {
-        case Code.Ok:
-            exists = true;
-            break;
-        case Code.NoNode:
-            exists = false;
-            break;
-        case Code.SessionExpired:
-        case Code.NoAuth:
-            dead = true;
-            listener.closing(rc);
-            return;
-        default:
-            // Retry errors
-            zk.exists(znode, true, this, null);
-            return;
-        }
-
-        byte b[] = null;
-        if (exists) {
-            try {
-                b = zk.getData(znode, false, null);
-            } catch (KeeperException e) {
-                // We don't need to worry about recovering now. The watch
-                // callbacks will kick off any exception handling
-                e.printStackTrace();
-            } catch (InterruptedException e) {
-                return;
-            }
-        }
-        if ((b == null &amp;&amp; b != prevData)
-                || (b != null &amp;&amp; !Arrays.equals(prevData, b))) {
-            listener.exists(b);
-            prevData = b;
-        }
-    }
-}
-</pre>
-
-</div>
-</div>
-</div>
-
-
-
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/javaExample.pdf


+ 0 - 394
docs/linkmap.html

@@ -1,394 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>Site Linkmap Table of Contents</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="linkmap.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>Site Linkmap Table of Contents</h1>
-<div id="front-matter"></div>
-<p>
-          This is a map of the complete site and its structure.
-        </p>
-<ul>
-<li>
-<a>ZooKeeper</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>site</em>
-</li>
-<ul>
-
-  
-<ul>
-<li>
-<a>Overview</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>docs</em>
-</li>
-<ul> 
-    
-<ul>
-<li>
-<a href="index.html">Welcome</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>welcome</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="zookeeperOver.html">Overview</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>overview</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="zookeeperStarted.html">Getting Started</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>started</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="releasenotes.html">Release Notes</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>relnotes</em>
-</li>
-</ul>
-  
-</ul>
-</ul>
-  
-  
-<ul>
-<li>
-<a>Developer</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>docs</em>
-</li>
-<ul>
-    
-<ul>
-<li>
-<a href="api/index.html">API Docs</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>api</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>program</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="javaExample.html">Java Example</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>javaEx</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>barTutor</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="recipes.html">Recipes</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>recipes</em>
-</li>
-</ul>
-  
-</ul>
-</ul>
-  
-  
-<ul>
-<li>
-<a>Admin &amp; Ops</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>docs</em>
-</li>
-<ul>
-      
-<ul>
-<li>
-<a href="zookeeperAdmin.html">Administrator's Guide</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>admin</em>
-</li>
-</ul>
-      
-<ul>
-<li>
-<a href="zookeeperQuotas.html">Quota Guide</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>quota</em>
-</li>
-</ul>
-      
-<ul>
-<li>
-<a href="zookeeperJMX.html">JMX</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>jmx</em>
-</li>
-</ul>
-      
-<ul>
-<li>
-<a href="zookeeperObservers.html">Observers Guide</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>observers</em>
-</li>
-</ul>
-      
-<ul>
-<li>
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>reconfig</em>
-</li>
-</ul>
-  
-</ul>
-</ul>
-  
-  
-<ul>
-<li>
-<a>Contributor</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>docs</em>
-</li>
-<ul>
-      
-<ul>
-<li>
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>internals</em>
-</li>
-</ul>
-  
-</ul>
-</ul>
-  
-  
-<ul>
-<li>
-<a>Miscellaneous</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>docs</em>
-</li>
-<ul>
-    
-<ul>
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>wiki</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>faq</em>
-</li>
-</ul>
-    
-<ul>
-<li>
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>&nbsp;&nbsp;___________________&nbsp;&nbsp;<em>lists</em>
-</li>
-</ul>
-    
-  
-</ul>
-</ul>
-  
-  
-
-  
- 
-
-</ul>
-</ul>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/linkmap.pdf


+ 0 - 1024
docs/recipes.html

@@ -1,1024 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper Recipes and Solutions</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.2', 'skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Developer</div>
-<div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Recipes</div>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="recipes.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper Recipes and Solutions</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#ch_recipes">A Guide to Creating Higher-level Constructs with ZooKeeper</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_recipes_errorHandlingNote">Important Note About Error Handling</a>
-</li>
-<li>
-<a href="#sc_outOfTheBox">Out of the Box Applications: Name Service, Configuration, Group
-    Membership</a>
-</li>
-<li>
-<a href="#sc_recipes_eventHandles">Barriers</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_doubleBarriers">Double Barriers</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_recipes_Queues">Queues</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_recipes_priorityQueues">Priority Queues</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_recipes_Locks">Locks</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_recipes_GuidNote">Recoverable Errors and the GUID</a>
-</li>
-<li>
-<a href="#Shared+Locks">Shared Locks</a>
-</li>
-<li>
-<a href="#sc_revocableSharedLocks">Revocable Shared Locks</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_recipes_twoPhasedCommit">Two-phased Commit</a>
-</li>
-<li>
-<a href="#sc_leaderElection">Leader Election</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-<a name="ch_recipes"></a>
-<h2 class="h3">A Guide to Creating Higher-level Constructs with ZooKeeper</h2>
-<div class="section">
-<p>In this article, you'll find guidelines for using
-    ZooKeeper to implement higher order functions. All of them are conventions
-    implemented at the client and do not require special support from
-    ZooKeeper. Hopfully the community will capture these conventions in client-side libraries 
-    to ease their use and to encourage standardization.</p>
-<p>One of the most interesting things about ZooKeeper is that even
-    though ZooKeeper uses <em>asynchronous</em> notifications, you
-    can use it to build <em>synchronous</em> consistency
-    primitives, such as queues and locks. As you will see, this is possible
-    because ZooKeeper imposes an overall order on updates, and has mechanisms
-    to expose this ordering.</p>
-<p>Note that the recipes below attempt to employ best practices. In
-    particular, they avoid polling, timers or anything else that would result
-    in a "herd effect", causing bursts of traffic and limiting
-    scalability.</p>
-<p>There are many useful functions that can be imagined that aren't
-    included here - revocable read-write priority locks, as just one example.
-    And some of the constructs mentioned here - locks, in particular -
-    illustrate certain points, even though you may find other constructs, such
-    as event handles or queues, a more practical means of performing the same
-    function. In general, the examples in this section are designed to
-    stimulate thought.</p>
-<a name="sc_recipes_errorHandlingNote"></a>
-<h3 class="h4">Important Note About Error Handling</h3>
-<p>When implementing the recipes you must handle recoverable exceptions 
-        (see the <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>). In 
-	particular, several of the recipes employ sequential ephemeral 
-	nodes. When creating a sequential ephemeral node there is an error case in 
-	which the create() succeeds on the server but the server crashes before 
-	returning the name of the node to the client. When the client reconnects its 
-	session is still valid and, thus, the node is not removed. The implication is 
-	that it is difficult for the client to know if its node was created or not. The 
-	recipes below include measures to handle this.</p>
-<a name="sc_outOfTheBox"></a>
-<h3 class="h4">Out of the Box Applications: Name Service, Configuration, Group
-    Membership</h3>
-<p>Name service and configuration are two of the primary applications
-    of ZooKeeper. These two functions are provided directly by the ZooKeeper
-    API.</p>
-<p>Another function directly provided by ZooKeeper is <em>group
-    membership</em>. The group is represented by a node. Members of the
-    group create ephemeral nodes under the group node. Nodes of the members
-    that fail abnormally will be removed automatically when ZooKeeper detects
-    the failure.</p>
-<a name="sc_recipes_eventHandles"></a>
-<h3 class="h4">Barriers</h3>
-<p>Distributed systems use <em>barriers</em>
-      to block processing of a set of nodes until a condition is met
-      at which time all the nodes are allowed to proceed. Barriers are
-      implemented in ZooKeeper by designating a barrier node. The
-      barrier is in place if the barrier node exists. Here's the
-      pseudo code:</p>
-<ol>
-      
-<li>
-        
-<p>Client calls the ZooKeeper API's <strong>exists()</strong> function on the barrier node, with
-        <em>watch</em> set to true.</p>
-      
-</li>
-
-      
-<li>
-        
-<p>If <strong>exists()</strong> returns false, the
-        barrier is gone and the client proceeds</p>
-      
-</li>
-
-      
-<li>
-        
-<p>Else, if <strong>exists()</strong> returns true,
-        the clients wait for a watch event from ZooKeeper for the barrier
-        node.</p>
-      
-</li>
-
-      
-<li>
-        
-<p>When the watch event is triggered, the client reissues the
-        <strong>exists( )</strong> call, again waiting until
-        the barrier node is removed.</p>
-      
-</li>
-    
-</ol>
-<a name="sc_doubleBarriers"></a>
-<h4>Double Barriers</h4>
-<p>Double barriers enable clients to synchronize the beginning and
-      the end of a computation. When enough processes have joined the barrier,
-      processes start their computation and leave the barrier once they have
-      finished. This recipe shows how to use a ZooKeeper node as a
-      barrier.</p>
-<p>The pseudo code in this recipe represents the barrier node as
-      <em>b</em>. Every client process <em>p</em>
-      registers with the barrier node on entry and unregisters when it is
-      ready to leave. A node registers with the barrier node via the <strong>Enter</strong> procedure below, it waits until
-      <em>x</em> client process register before proceeding with
-      the computation. (The <em>x</em> here is up to you to
-      determine for your system.)</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-        
-            
-<tr>
-              
-<td><strong>Enter</strong></td>
-
-              <td><strong>Leave</strong></td>
-            
-</tr>
-
-            
-<tr>
-              
-<td>
-<ol>
-                  
-<li>
-                    
-<p>Create a name <em><em>n</em> =
-                        <em>b</em>+&ldquo;/&rdquo;+<em>p</em></em>
-</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Set watch: <strong>exists(<em>b</em> + &lsquo;&lsquo;/ready&rsquo;&rsquo;,
-                        true)</strong>
-</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Create child: <strong>create(
-                        <em>n</em>, EPHEMERAL)</strong>
-</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>
-<strong>L = getChildren(b,
-                        false)</strong>
-</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>if fewer children in L than<em>
-                        x</em>, wait for watch event</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>else <strong>create(b + &lsquo;&lsquo;/ready&rsquo;&rsquo;,
-                        REGULAR)</strong>
-</p>
-                  
-</li>
-                
-</ol>
-</td>
-
-              <td>
-<ol>
-                  
-<li>
-                    
-<p>
-<strong>L = getChildren(b,
-                        false)</strong>
-</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>if no children, exit</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>if <em>p</em> is only process node in
-                      L, delete(n) and exit</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>if <em>p</em> is the lowest process
-                      node in L, wait on highest process node in L</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>else <strong>delete(<em>n</em>) </strong>if
-                      still exists and wait on lowest process node in L</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>goto 1</p>
-                  
-</li>
-                
-</ol>
-</td>
-            
-</tr>
-          
-      
-</table>
-<p>On entering, all processes watch on a ready node and
-        create an ephemeral node as a child of the barrier node. Each process
-        but the last enters the barrier and waits for the ready node to appear
-        at line 5. The process that creates the xth node, the last process, will
-        see x nodes in the list of children and create the ready node, waking up
-        the other processes. Note that waiting processes wake up only when it is
-        time to exit, so waiting is efficient.
-      </p>
-<p>On exit, you can't use a flag such as <em>ready</em>
-      because you are watching for process nodes to go away. By using
-      ephemeral nodes, processes that fail after the barrier has been entered
-      do not prevent correct processes from finishing. When processes are
-      ready to leave, they need to delete their process nodes and wait for all
-      other processes to do the same.</p>
-<p>Processes exit when there are no process nodes left as children of
-      <em>b</em>. However, as an efficiency, you can use the
-      lowest process node as the ready flag. All other processes that are
-      ready to exit watch for the lowest existing process node to go away, and
-      the owner of the lowest process watches for any other process node
-      (picking the highest for simplicity) to go away. This means that only a
-      single process wakes up on each node deletion except for the last node,
-      which wakes up everyone when it is removed.</p>
-<a name="sc_recipes_Queues"></a>
-<h3 class="h4">Queues</h3>
-<p>Distributed queues are a common data structure. To implement a
-    distributed queue in ZooKeeper, first designate a znode to hold the queue,
-    the queue node. The distributed clients put something into the queue by
-    calling create() with a pathname ending in "queue-", with the
-    <em>sequence</em> and <em>ephemeral</em> flags in
-    the create() call set to true. Because the <em>sequence</em>
-    flag is set, the new pathnames will have the form
-    _path-to-queue-node_/queue-X, where X is a monotonic increasing number. A
-    client that wants to be removed from the queue calls ZooKeeper's <strong>getChildren( )</strong> function, with
-    <em>watch</em> set to true on the queue node, and begins
-    processing nodes with the lowest number. The client does not need to issue
-    another <strong>getChildren( )</strong> until it exhausts
-    the list obtained from the first <strong>getChildren(
-    )</strong> call. If there are are no children in the queue node, the
-    reader waits for a watch notification to check the queue again.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-      
-<p>There now exists a Queue implementation in ZooKeeper
-      recipes directory. This is distributed with the release --
-      src/recipes/queue directory of the release artifact.
-      </p>
-    
-</div>
-</div>
-<a name="sc_recipes_priorityQueues"></a>
-<h4>Priority Queues</h4>
-<p>To implement a priority queue, you need only make two simple
-      changes to the generic <a href="#sc_recipes_Queues">queue
-      recipe</a> . First, to add to a queue, the pathname ends with
-      "queue-YY" where YY is the priority of the element with lower numbers
-      representing higher priority (just like UNIX). Second, when removing
-      from the queue, a client uses an up-to-date children list meaning that
-      the client will invalidate previously obtained children lists if a watch
-      notification triggers for the queue node.</p>
-<a name="sc_recipes_Locks"></a>
-<h3 class="h4">Locks</h3>
-<p>Fully distributed locks that are globally synchronous, meaning at
-    any snapshot in time no two clients think they hold the same lock. These
-    can be implemented using ZooKeeeper. As with priority queues, first define
-    a lock node.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-      
-<p>There now exists a Lock implementation in ZooKeeper
-      recipes directory. This is distributed with the release --
-      src/recipes/lock directory of the release artifact.
-      </p>
-    
-</div>
-</div>
-<p>Clients wishing to obtain a lock do the following:</p>
-<ol>
-      
-<li>
-        
-<p>Call <strong>create( )</strong> with a pathname
-        of "_locknode_/guid-lock-" and the <em>sequence</em> and
-        <em>ephemeral</em> flags set. The <em>guid</em> 
-		is needed in case the create() result is missed. See the note below.</p>
-      
-</li>
-
-      
-<li>
-        
-<p>Call <strong>getChildren( )</strong> on the lock
-        node <em>without</em> setting the watch flag (this is
-        important to avoid the herd effect).</p>
-      
-</li>
-
-      
-<li>
-        
-<p>If the pathname created in step <strong>1</strong> has the lowest sequence number suffix, the
-        client has the lock and the client exits the protocol.</p>
-      
-</li>
-
-      
-<li>
-        
-<p>The client calls <strong>exists( )</strong> with
-        the watch flag set on the path in the lock directory with the next
-        lowest sequence number.</p>
-      
-</li>
-
-      
-<li>
-        
-<p>if <strong>exists( )</strong> returns false, go
-        to step <strong>2</strong>. Otherwise, wait for a
-        notification for the pathname from the previous step before going to
-        step <strong>2</strong>.</p>
-      
-</li>
-    
-</ol>
-<p>The unlock protocol is very simple: clients wishing to release a
-    lock simply delete the node they created in step 1.</p>
-<p>Here are a few things to notice:</p>
-<ul>
-      
-<li>
-        
-<p>The removal of a node will only cause one client to wake up
-        since each node is watched by exactly one client. In this way, you
-        avoid the herd effect.</p>
-      
-</li>
-    
-</ul>
-<ul>
-      
-<li>
-        
-<p>There is no polling or timeouts.</p>
-      
-</li>
-    
-</ul>
-<ul>
-      
-<li>
-        
-<p>Because of the way you implement locking, it is easy to see the
-        amount of lock contention, break locks, debug locking problems,
-        etc.</p>
-      
-</li>
-    
-</ul>
-<a name="sc_recipes_GuidNote"></a>
-<h4>Recoverable Errors and the GUID</h4>
-<ul>
-      
-<li>
-        
-<p>If a recoverable error occurs calling <strong>create()</strong> the 
-		client should call <strong>getChildren()</strong> and check for a node 
-		containing the <em>guid</em> used in the path name. 
-		This handles the case (noted <a href="#sc_recipes_errorHandlingNote">above</a>) of 
-		the create() succeeding on the server but the server crashing before returning the name 
-		of the new node.</p>
-      
-</li>
-    
-</ul>
-<a name="Shared+Locks"></a>
-<h4>Shared Locks</h4>
-<p>You can implement shared locks by with a few changes to the lock
-      protocol:</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-        
-            
-<tr>
-              
-<td><strong>Obtaining a read
-              lock:</strong></td>
-
-              <td><strong>Obtaining a write
-              lock:</strong></td>
-            
-</tr>
-
-            
-<tr>
-              
-<td>
-<ol>
-                  
-<li>
-                    
-<p>Call <strong>create( )</strong> to
-                    create a node with pathname
-                    "<span class="codefrag filename">guid-/read-</span>". This is the
-                    lock node use later in the protocol. Make sure to set both
-                    the <em>sequence</em> and
-                    <em>ephemeral</em> flags.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Call <strong>getChildren( )</strong>
-                    on the lock node <em>without</em> setting the
-                    <em>watch</em> flag - this is important, as it
-                    avoids the herd effect.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>If there are no children with a pathname starting
-                    with "<span class="codefrag filename">write-</span>" and having a lower
-                    sequence number than the node created in step <strong>1</strong>, the client has the lock and can
-                    exit the protocol. </p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Otherwise, call <strong>exists(
-                    )</strong>, with <em>watch</em> flag, set on
-                    the node in lock directory with pathname staring with
-                    "<span class="codefrag filename">write-</span>" having the next lowest
-                    sequence number.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>If <strong>exists( )</strong>
-                    returns <em>false</em>, goto step <strong>2</strong>.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Otherwise, wait for a notification for the pathname
-                    from the previous step before going to step <strong>2</strong>
-</p>
-                  
-</li>
-                
-</ol>
-</td>
-
-              <td>
-<ol>
-                  
-<li>
-                    
-<p>Call <strong>create( )</strong> to
-                    create a node with pathname
-                    "<span class="codefrag filename">guid-/write-</span>". This is the
-                    lock node spoken of later in the protocol. Make sure to
-                    set both <em>sequence</em> and
-                    <em>ephemeral</em> flags.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Call <strong>getChildren( )
-                    </strong> on the lock node <em>without</em>
-                    setting the <em>watch</em> flag - this is
-                    important, as it avoids the herd effect.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>If there are no children with a lower sequence
-                    number than the node created in step <strong>1</strong>, the client has the lock and the
-                    client exits the protocol.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>Call <strong>exists( ),</strong>
-                    with <em>watch</em> flag set, on the node with
-                    the pathname that has the next lowest sequence
-                    number.</p>
-                  
-</li>
-
-                  
-<li>
-                    
-<p>If <strong>exists( )</strong>
-                    returns <em>false</em>, goto step <strong>2</strong>. Otherwise, wait for a
-                    notification for the pathname from the previous step
-                    before going to step <strong>2</strong>.</p>
-                  
-</li>
-                
-</ol>
-</td>
-            
-</tr>
-          
-      
-</table>
-<p>Notes:</p>
-<ul>
-      
-<li>
-        
-<p>It might appear that this recipe creates a herd effect:
-          when there is a large group of clients waiting for a read
-          lock, and all getting notified more or less simultaneously
-          when the "<span class="codefrag filename">write-</span>" node with the lowest
-          sequence number is deleted. In fact. that's valid behavior:
-          as all those waiting reader clients should be released since
-          they have the lock. The herd effect refers to releasing a
-          "herd" when in fact only a single or a small number of
-          machines can proceed.</p>
-      
-</li>
-    
-</ul>
-<ul>
-      
-<li>
-        
-<p>See the <a href="#sc_recipes_GuidNote">note for Locks</a> on how to use the guid in the node.</p>
-      
-</li>
-    
-</ul>
-<a name="sc_revocableSharedLocks"></a>
-<h4>Revocable Shared Locks</h4>
-<p>With minor modifications to the Shared Lock protocol, you make
-      shared locks revocable by modifying the shared lock protocol:</p>
-<p>In step <strong>1</strong>, of both obtain reader
-      and writer lock protocols, call <strong>getData(
-      )</strong> with <em>watch</em> set, immediately after the
-      call to <strong>create( )</strong>. If the client
-      subsequently receives notification for the node it created in step
-      <strong>1</strong>, it does another <strong>getData( )</strong> on that node, with
-      <em>watch</em> set and looks for the string "unlock", which
-      signals to the client that it must release the lock. This is because,
-      according to this shared lock protocol, you can request the client with
-      the lock give up the lock by calling <strong>setData()
-      </strong> on the lock node, writing "unlock" to that node.</p>
-<p>Note that this protocol requires the lock holder to consent to
-      releasing the lock. Such consent is important, especially if the lock
-      holder needs to do some processing before releasing the lock. Of course
-      you can always implement <em>Revocable Shared Locks with Freaking
-      Laser Beams</em> by stipulating in your protocol that the revoker
-      is allowed to delete the lock node if after some length of time the lock
-      isn't deleted by the lock holder.</p>
-<a name="sc_recipes_twoPhasedCommit"></a>
-<h3 class="h4">Two-phased Commit</h3>
-<p>A two-phase commit protocol is an algorithm that lets all clients in
-    a distributed system agree either to commit a transaction or abort.</p>
-<p>In ZooKeeper, you can implement a two-phased commit by having a
-    coordinator create a transaction node, say "/app/Tx", and one child node
-    per participating site, say "/app/Tx/s_i". When coordinator creates the
-    child node, it leaves the content undefined. Once each site involved in
-    the transaction receives the transaction from the coordinator, the site
-    reads each child node and sets a watch. Each site then processes the query
-    and votes "commit" or "abort" by writing to its respective node. Once the
-    write completes, the other sites are notified, and as soon as all sites
-    have all votes, they can decide either "abort" or "commit". Note that a
-    node can decide "abort" earlier if some site votes for "abort".</p>
-<p>An interesting aspect of this implementation is that the only role
-    of the coordinator is to decide upon the group of sites, to create the
-    ZooKeeper nodes, and to propagate the transaction to the corresponding
-    sites. In fact, even propagating the transaction can be done through
-    ZooKeeper by writing it in the transaction node.</p>
-<p>There are two important drawbacks of the approach described above.
-    One is the message complexity, which is O(n&sup2;). The second is the
-    impossibility of detecting failures of sites through ephemeral nodes. To
-    detect the failure of a site using ephemeral nodes, it is necessary that
-    the site create the node.</p>
-<p>To solve the first problem, you can have only the coordinator
-    notified of changes to the transaction nodes, and then notify the sites
-    once coordinator reaches a decision. Note that this approach is scalable,
-    but it's is slower too, as it requires all communication to go through the
-    coordinator.</p>
-<p>To address the second problem, you can have the coordinator
-    propagate the transaction to the sites, and have each site creating its
-    own ephemeral node.</p>
-<a name="sc_leaderElection"></a>
-<h3 class="h4">Leader Election</h3>
-<p>A simple way of doing leader election with ZooKeeper is to use the
-    <strong>SEQUENCE|EPHEMERAL</strong> flags when creating
-    znodes that represent "proposals" of clients. The idea is to have a znode,
-    say "/election", such that each znode creates a child znode "/election/guid-n_"
-    with both flags SEQUENCE|EPHEMERAL. With the sequence flag, ZooKeeper
-    automatically appends a sequence number that is greater than any one
-    previously appended to a child of "/election". The process that created
-    the znode with the smallest appended sequence number is the leader.
-    </p>
-<p>That's not all, though. It is important to watch for failures of the
-    leader, so that a new client arises as the new leader in the case the
-    current leader fails. A trivial solution is to have all application
-    processes watching upon the current smallest znode, and checking if they
-    are the new leader when the smallest znode goes away (note that the
-    smallest znode will go away if the leader fails because the node is
-    ephemeral). But this causes a herd effect: upon a failure of the current
-    leader, all other processes receive a notification, and execute
-    getChildren on "/election" to obtain the current list of children of
-    "/election". If the number of clients is large, it causes a spike on the
-    number of operations that ZooKeeper servers have to process. To avoid the
-    herd effect, it is sufficient to watch for the next znode down on the
-    sequence of znodes. If a client receives a notification that the znode it
-    is watching is gone, then it becomes the new leader in the case that there
-    is no smaller znode. Note that this avoids the herd effect by not having
-    all clients watching the same znode. </p>
-<p>Here's the pseudo code:</p>
-<p>Let ELECTION be a path of choice of the application. To volunteer to
-    be a leader: </p>
-<ol>
-      
-<li>
-        
-<p>Create znode z with path "ELECTION/guid-n_" with both SEQUENCE and
-        EPHEMERAL flags;</p>
-      
-</li>
-
-      
-<li>
-        
-<p>Let C be the children of "ELECTION", and i be the sequence
-        number of z;</p>
-      
-</li>
-
-      
-<li>
-        
-<p>Watch for changes on "ELECTION/guid-n_j", where j is the largest
-        sequence number such that j &lt; i and n_j is a znode in C;</p>
-      
-</li>
-    
-</ol>
-<p>Upon receiving a notification of znode deletion: </p>
-<ol>
-      
-<li>
-        
-<p>Let C be the new set of children of ELECTION; </p>
-      
-</li>
-
-      
-<li>
-        
-<p>If z is the smallest node in C, then execute leader
-        procedure;</p>
-      
-</li>
-
-      
-<li>
-        
-<p>Otherwise, watch for changes on "ELECTION/guid-n_j", where j is the
-        largest sequence number such that j &lt; i and n_j is a znode in C;
-        </p>
-      
-</li>
-    
-</ol>
-<p>Notes:</p>
-<ul>
-      
-<li>
-	    
-<p>Note that the znode having no preceding znode on the list of
-	    children does not imply that the creator of this znode is aware that it is
-	    the current leader. Applications may consider creating a separate znode
-	    to acknowledge that the leader has executed the leader procedure. </p>
-      
-</li>
-    
-</ul>
-<ul>
-      
-<li>
-        
-<p>See the <a href="#sc_recipes_GuidNote">note for Locks</a> on how to use the guid in the node.</p>
-      
-</li>
-    
-</ul>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/recipes.pdf


+ 0 - 1900
docs/releasenotes.html

@@ -1,1900 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper 3.0.0 Release Notes</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.4 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Overview</div>
-<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">Release Notes</div>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="releasenotes.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper 3.0.0 Release Notes</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#migration">Migration Instructions when Upgrading to 3.0.0</a>
-<ul class="minitoc">
-<li>
-<a href="#migration_code">Migrating Client Code</a>
-<ul class="minitoc">
-<li>
-<a href="#Watch+Management">Watch Management</a>
-</li>
-<li>
-<a href="#Java+API">Java API</a>
-</li>
-<li>
-<a href="#C+API">C API</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#migration_data">Migrating Server Data</a>
-</li>
-<li>
-<a href="#migration_config">Migrating Server Configuration</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#changes">Changes Since ZooKeeper 2.2.1</a>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-
-<p>
-These release notes include new developer and user facing incompatibilities, features, and major improvements.
-</p>
-
-
-<ul>
-  
-<li>
-<p>
-<a href="#migration">Migration Instructions</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="#changes">Changes</a>
-</p>
-</li>
-
-</ul>
-
-
-<a name="migration"></a>
-<h2 class="h3">Migration Instructions when Upgrading to 3.0.0</h2>
-<div class="section">
-<p>
-
-<em>You should only have to read this section if you are upgrading from a previous version of ZooKeeper to version 3.0.0, otw skip down to <a href="#changes">changes</a></em>
-
-</p>
-<p>
-A small number of changes in this release have resulted in non-backward compatible Zookeeper client user code and server instance data. The following instructions provide details on how to migrate code and date from version 2.2.1 to version 3.0.0.
-</p>
-<p>
-Note: ZooKeeper increments the major version number (major.minor.fix) when backward incompatible changes are made to the source base. As part of the migration from SourceForge we changed the package structure (com.yahoo.zookeeper.* to org.apache.zookeeper.*) and felt it was a good time to incorporate some changes that we had been withholding. As a result the following will be required when migrating from 2.2.1 to 3.0.0 version of ZooKeeper.
-</p>
-<ul>
-  
-<li>
-<p>
-<a href="#migration_code">Migrating Client Code</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="#migration_data">Migrating Server Data</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="#migration_config">Migrating Server Configuration</a>
-</p>
-</li>
-
-</ul>
-<a name="migration_code"></a>
-<h3 class="h4">Migrating Client Code</h3>
-<p>
-  The underlying client-server protocol has changed in version 3.0.0
-  of ZooKeeper. As a result clients must be upgraded along with
-  serving clusters to ensure proper operation of the system (old
-  pre-3.0.0 clients are not guaranteed to operate against upgraded
-  3.0.0 servers and vice-versa).
-</p>
-<a name="Watch+Management"></a>
-<h4>Watch Management</h4>
-<p>
-In previous releases of ZooKeeper any watches registered by clients were lost if the client lost a connection to a ZooKeeper server.
-This meant that developers had to track watches they were interested in and reregister them if a session disconnect event was received.
-In this release the client library tracks watches that a client has registered and reregisters the watches when a connection is made to a new server.
-Applications that still manually reregister interest should continue working properly as long as they are able to handle unsolicited watches.
-For example, an old application may register a watch for /foo and /goo, lose the connection, and reregister only /goo.
-As long as the application is able to receive a notification for /foo, (probably ignoring it) it does not need to be changed.
-One caveat to the watch management: it is possible to miss an event for the creation and deletion of a znode if watching for creation and both the create and delete happens while the client is disconnected from ZooKeeper.
-</p>
-<p>
-This release also allows clients to specify call specific watch functions.
-This gives the developer the ability to modularize logic in different watch functions rather than cramming everything in the watch function attached to the ZooKeeper handle.
-Call specific watch functions receive all session events for as long as they are active, but will only receive the watch callbacks for which they are registered.
-</p>
-<a name="Java+API"></a>
-<h4>Java API</h4>
-<ol>
-  
-<li>
-<p>The java package structure has changed from <strong>com.yahoo.zookeeper*</strong> to <strong>org.apache.zookeeper*</strong>. This will probably effect all of your java code which makes use of ZooKeeper APIs (typically import statements)</p>
-</li>
-  
-<li>
-<p>A number of constants used in the client ZooKeeper API were re-specified using enums (rather than ints). See <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-7">ZOOKEEPER-7</a>, <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-132">ZOOKEEPER-132</a> and <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-139">ZOOKEEPER-139</a> for full details</p>
-</li>
-  
-<li>
-<p>
-<a href="https://issues.apache.org/jira/browse/ZOOKEEPER-18">ZOOKEEPER-18</a> removed KeeperStateChanged, use KeeperStateDisconnected instead</p>
-</li>
-
-</ol>
-<p>
-Also see <a href="http://zookeeper.apache.org/docs/current/api/index.html">the current java API</a>
-
-</p>
-<a name="C+API"></a>
-<h4>C API</h4>
-<ol>
-  
-<li>
-<p>A number of constants used in the client ZooKeeper API were renamed in order to reduce namespace collision, see <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-6">ZOOKEEPER-6</a> for full details</p>
-</li>
-
-</ol>
-<a name="migration_data"></a>
-<h3 class="h4">Migrating Server Data</h3>
-<p>
-The following issues resulted in changes to the on-disk data format (the snapshot and transaction log files contained within the ZK data directory) and require a migration utility to be run. 
-</p>
-<ul>
-  
-<li>
-<p>
-<a href="https://issues.apache.org/jira/browse/ZOOKEEPER-27">ZOOKEEPER-27 Unique DB identifiers for servers and clients</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="https://issues.apache.org/jira/browse/ZOOKEEPER-32">ZOOKEEPER-32 CRCs for ZooKeeper data</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="https://issues.apache.org/jira/browse/ZOOKEEPER-33">ZOOKEEPER-33 Better ACL management</a>
-</p>
-</li>
-  
-<li>
-<p>
-<a href="https://issues.apache.org/jira/browse/ZOOKEEPER-38">ZOOKEEPER-38 headers (version+) in log/snap files</a>
-</p>
-</li>
-
-</ul>
-<p>
-  
-<strong>The following must be run once, and only once, when upgrading the ZooKeeper server instances to version 3.0.0.</strong>
-
-</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-  
-<p>
-    The &lt;dataLogDir&gt; and &lt;dataDir&gt; directories referenced
-    below are specified by the <em>dataLogDir</em>
-    and <em>dataDir</em> specification in your
-    ZooKeeper config file
-    respectively. <em>dataLogDir</em> defaults to the
-    value of <em>dataDir</em> if not specified explicitly
-    in the ZooKeeper server config file (in which case provide the
-    same directory for both parameters to the upgrade utility).
-  </p>
-
-</div>
-</div>
-<ol>
-  
-<li>
-<p>Shutdown the ZooKeeper server cluster.</p>
-</li>
-  
-<li>
-<p>Backup your &lt;dataLogDir&gt; and &lt;dataDir&gt; directories</p>
-</li>
-  
-<li>
-<p>Run upgrade using</p>
-    
-<ul>
-      
-<li>
-<p>
-<span class="codefrag computeroutput">bin/zkServer.sh upgrade &lt;dataLogDir&gt; &lt;dataDir&gt;</span>
-</p>
-</li>
-    
-</ul>
-    
-<p>or</p>
-    
-<ul>
-      
-<li>
-<p>
-<span class="codefrag computeroutput">java -classpath pathtolog4j:pathtozookeeper.jar UpgradeMain &lt;dataLogDir&gt; &lt;dataDir&gt;</span>
-</p>
-</li>
-    
-</ul>
-    
-<p>where &lt;dataLogDir&gt; is the directory where all transaction logs (log.*) are stored. &lt;dataDir&gt; is the directory where all the snapshots (snapshot.*) are stored.</p>
-  
-</li>
-  
-<li>
-<p>Restart the cluster. </p>
-</li>
- 
-</ol>
-<p>
- If you have any failure during the upgrade procedure keep reading to sanitize your database. 
- </p>
-<p>This is how upgrade works in ZooKeeper. This will help you troubleshoot in case you have problems while upgrading</p>
-<ol>
-
-<li>
-<p>Upgrade moves files from &lt;dataLogDir&gt; and &lt;dataDir&gt; to &lt;dataLogDir&gt;/version-1/ and &lt;dataDir&gt;/version-1 respectively (version-1 sub-directory is created by the upgrade utility). </p>
-</li>
- 
-<li>
-<p>Upgrade creates a new version sub-directory &lt;dataDir&gt;/version-2 and &lt;dataLogDir&gt;/version-2</p>
-</li>
- 
-<li>
-<p>Upgrade reads the old database from &lt;dataDir&gt;/version-1 and &lt;dataLogDir&gt;/version-1 into the memory and creates a new upgraded snapshot. </p>
-</li>
- 
-<li>
-<p>Upgrade writes the new database in &lt;dataDir&gt;/version-2.  </p>
-</li>
- 
-</ol>
-<p>Troubleshooting.</p>
-<ol>
- 
-<li>
-<p>In case you start ZooKeeper 3.0 without upgrading from 2.0 on a 2.0 database - the servers will start up with an empty database.
- This is because the servers assume that &lt;dataDir&gt;/version-2 and &lt;dataLogDir&gt;/version-2 will have the database to start with. Since this will be empty
- in case of no upgrade, the servers will start with an empty database. In such a case, shutdown the ZooKeeper servers, remove the version-2 directory (remember
- this will lead to loss of updates after you started 3.0.)
- and then start the upgrade procedure.</p>
-</li>
- 
-<li>
-<p>If the upgrade fails while trying to rename files into the version-1 directory, you should try and move all the files under &lt;dataDir&gt;/version-1
- and &lt;dataLogDir&gt;/version-1 to &lt;dataDir&gt; and &lt;dataLogDir&gt; respectively. Then try upgrade again.
- </p>
- 
-</li>
- 
-<li>
-<p> If you do not wish to run with ZooKeeper 3.0 and prefer to run with ZooKeeper 2.0 and have already upgraded - you can run ZooKeeper 2 with 
- the &lt;dataDir&gt; and &lt;dataLogDir&gt; directories changed to &lt;dataDir&gt;/version-1 and &lt;dataLogDir&gt;/version-1. Remember that you will lose all the updates that you made after the upgrade.
-</p>
-</li> 
- 
-</ol>
-<a name="migration_config"></a>
-<h3 class="h4">Migrating Server Configuration</h3>
-<p>
-There is a significant change to the ZooKeeper server configuration file.
-</p>
-<p>The default election algorithm, specified by
-  the <em>electionAlg</em> configuration attribute, has
-  changed from a default of <em>0</em> to a default
-  of <em>3</em>. See
-  <a href="zookeeperAdmin.html#sc_clusterOptions">Cluster
-  Options</a> section of the administrators guide, specifically
-  the <em>electionAlg</em>
-  and <em>server.X</em> properties.
-</p>
-<p>
-  You will either need to explicitly
-  set <em>electionAlg</em> to it's previous default value
-  of <em>0</em> or change
-  your <em>server.X</em> options to include the leader
-  election port.
-</p>
-</div>
-
-
-<a name="changes"></a>
-<h2 class="h3">Changes Since ZooKeeper 2.2.1</h2>
-<div class="section">
-<p>
-Version 2.2.1 code, documentation, binaries, etc... are still accessible on <a href="http://sourceforge.net/projects/zookeeper">SourceForge</a>
-
-</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>Changes Since ZooKeeper 2.2.1</caption>
-
-<title>Changes Since ZooKeeper 2.2.1</title>
-
-
-<tr>
-  
-<th>Issue</th>
-  <th>Notes</th>
-
-</tr>
-
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-43">
-      ZOOKEEPER-43</a>
-  </td>
-  <td>
-    Server side of auto reset watches.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-132">
-      ZOOKEEPER-132</a>
-  </td>
-  <td>
-    Create Enum to replace CreateFlag in ZooKepper.create method 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-139">
-      ZOOKEEPER-139</a>
-  </td>
-  <td>
-    Create Enums for WatcherEvent's KeeperState and EventType
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-18">
-      ZOOKEEPER-18</a>
-  </td>
-  <td>
-    keeper state inconsistency 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-38">
-      ZOOKEEPER-38</a>
-  </td>
-  <td>
-    headers  in log/snap files
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-8">
-      ZOOKEEPER-8</a>
-  </td>
-  <td>
-    Stat enchaned to include num of children and size
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-6">
-      ZOOKEEPER-6</a>
-  </td>
-  <td>
-    List of problem identifiers in zookeeper.h
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-7">
-      ZOOKEEPER-7</a>
-  </td>
-  <td>
-    Use enums rather than ints for types and state
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-27">
-      ZOOKEEPER-27</a>
-  </td>
-  <td>
-    Unique DB identifiers for servers and clients
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-32">
-      ZOOKEEPER-32</a>
-  </td>
-  <td>
-    CRCs for ZooKeeper data
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-33">
-      ZOOKEEPER-33</a>
-  </td>
-  <td>
-    Better ACL management
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-203">
-      ZOOKEEPER-203</a>
-  </td>
-  <td>
-    fix datadir typo in releasenotes
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-145">
-      ZOOKEEPER-145</a>
-  </td>
-  <td>
-    write detailed release notes for users migrating from 2.x to 3.0
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-23">
-      ZOOKEEPER-23</a>
-  </td>
-  <td>
-    Auto reset of watches on reconnect
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-191">
-      ZOOKEEPER-191</a>
-  </td>
-  <td>
-    forrest docs for upgrade.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-201">
-      ZOOKEEPER-201</a>
-  </td>
-  <td>
-    validate magic number when reading snapshot and transaction logs 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-200">
-      ZOOKEEPER-200</a>
-  </td>
-  <td>
-    the magic number for snapshot and log must be different
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-199">
-      ZOOKEEPER-199</a>
-  </td>
-  <td>
-    fix log messages in persistence code 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-197">
-      ZOOKEEPER-197</a>
-  </td>
-  <td>
-    create checksums for snapshots 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-198">
-      ZOOKEEPER-198</a>
-  </td>
-  <td>
-    apache license header missing from FollowerSyncRequest.java
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-5">
-      ZOOKEEPER-5</a>
-  </td>
-  <td>
-    Upgrade Feature in Zookeeper server. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-194">
-      ZOOKEEPER-194</a>
-  </td>
-  <td>
-    Fix terminology in zookeeperAdmin.xml
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-151">
-      ZOOKEEPER-151</a>
-  </td>
-  <td>
-    Document change to server configuration
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-193">
-      ZOOKEEPER-193</a>
-  </td>
-  <td>
-    update java example doc to compile with latest zookeeper
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-187">
-      ZOOKEEPER-187</a>
-  </td>
-  <td>
-    CreateMode api docs missing 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-186">
-      ZOOKEEPER-186</a>
-  </td>
-  <td>
-    add new "releasenotes.xml" to forrest documentation
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-190">
-      ZOOKEEPER-190</a>
-  </td>
-  <td>
-    Reorg links to docs and navs to docs into related sections
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-189">
-      ZOOKEEPER-189</a>
-  </td>
-  <td>
-    forrest build not validated xml of input documents
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-188">
-      ZOOKEEPER-188</a>
-  </td>
-  <td>
-    Check that election port is present for all servers
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-185">
-      ZOOKEEPER-185</a>
-  </td>
-  <td>
-    Improved version of FLETest 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-184">
-      ZOOKEEPER-184</a>
-  </td>
-  <td>
-    tests: An explicit include derective is needed for the usage of memcpy functions
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-183">
-      ZOOKEEPER-183</a>
-  </td>
-  <td>
-    Array subscript is above array bounds in od_completion, src/cli.c. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-182">
-      ZOOKEEPER-182</a>
-  </td>
-  <td>
-     zookeeper_init accepts empty host-port string and returns valid pointer to zhandle_t. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-17">
-      ZOOKEEPER-17</a>
-  </td>
-  <td>
-    zookeeper_init doc needs clarification 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-181">
-      ZOOKEEPER-181</a>
-  </td>
-  <td>
-    Some Source Forge Documents did not get moved over: javaExample, zookeeperTutorial, zookeeperInternals 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-180">
-      ZOOKEEPER-180</a>
-  </td>
-  <td>
-    Placeholder sections needed in document for new topics that the umbrella jira discusses 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-179">
-      ZOOKEEPER-179</a>
-  </td>
-  <td>
-    Programmer's Guide "Basic Operations" section is missing content 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-178">
-      ZOOKEEPER-178</a>
-  </td>
-  <td>
-    FLE test. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-159">
-      ZOOKEEPER-159</a>
-  </td>
-  <td>
-    Cover two corner cases of leader election
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-156">
-      ZOOKEEPER-156</a>
-  </td>
-  <td>
-    update programmer guide with acl details from old wiki page
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-154">
-      ZOOKEEPER-154</a>
-  </td>
-  <td>
-    reliability graph diagram in overview doc needs context
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-157">
-      ZOOKEEPER-157</a>
-  </td>
-  <td>
-    Peer can't find existing leader 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-155">
-      ZOOKEEPER-155</a>
-  </td>
-  <td>
-    improve "the zookeeper project" section of overview doc
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-140">
-      ZOOKEEPER-140</a>
-  </td>
-  <td>
-    Deadlock in QuorumCnxManager 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-147">
-      ZOOKEEPER-147</a>
-  </td>
-  <td>
-    This is version of the documents with most of the [tbd...] scrubbed out 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-150">
-      ZOOKEEPER-150</a>
-  </td>
-  <td>
-    zookeeper build broken 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-136">
-      ZOOKEEPER-136</a>
-  </td>
-  <td>
-    sync causes hang in all followers of quorum. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-134">
-      ZOOKEEPER-134</a>
-  </td>
-  <td>
-    findbugs cleanup 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-133">
-      ZOOKEEPER-133</a>
-  </td>
-  <td>
-    hudson tests failing intermittently 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-144">
-      ZOOKEEPER-144</a>
-  </td>
-  <td>
-    add tostring support for watcher event, and enums for event type/state 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-21">
-      ZOOKEEPER-21</a>
-  </td>
-  <td>
-    Improve zk ctor/watcher 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-142">
-      ZOOKEEPER-142</a>
-  </td>
-  <td>
-    Provide Javadoc as to the maximum size of the data byte array that may be stored within a znode 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-93">
-      ZOOKEEPER-93</a>
-  </td>
-  <td>
-    Create Documentation for Zookeeper 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-117">
-      ZOOKEEPER-117</a>
-  </td>
-  <td>
-    threading issues in Leader election 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-137">
-      ZOOKEEPER-137</a>
-  </td>
-  <td>
-    client watcher objects can lose events 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-131">
-      ZOOKEEPER-131</a>
-  </td>
-  <td>
-    Old leader election can elect a dead leader over and over again 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-130">
-      ZOOKEEPER-130</a>
-  </td>
-  <td>
-    update build.xml to support apache release process
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-118">
-      ZOOKEEPER-118</a>
-  </td>
-  <td>
-    findbugs flagged switch statement in followerrequestprocessor.run
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-115">
-      ZOOKEEPER-115</a>
-  </td>
-  <td>
-    Potential NPE in QuorumCnxManager
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-114">
-      ZOOKEEPER-114</a>
-  </td>
-  <td>
-    cleanup ugly event messages in zookeeper client 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-112">
-      ZOOKEEPER-112</a>
-  </td>
-  <td>
-    src/java/main ZooKeeper.java has test code embedded into it.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-39">
-      ZOOKEEPER-39</a>
-  </td>
-  <td>
-    Use Watcher objects rather than boolean on read operations.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-97">
-      ZOOKEEPER-97</a>
-  </td>
-  <td>
-    supports optional output directory in code generator.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-101">
-      ZOOKEEPER-101</a>
-  </td>
-  <td>
-    Integrate ZooKeeper with "violations" feature on hudson
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-105">
-      ZOOKEEPER-105</a>
-  </td>
-  <td>
-    Catch Zookeeper exceptions and print on the stderr. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-42">
-      ZOOKEEPER-42</a>
-  </td>
-  <td>
-    Change Leader Election to fast tcp.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-48">
-      ZOOKEEPER-48</a>
-  </td>
-  <td>
-    auth_id now handled correctly when no auth ids present
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-44">
-      ZOOKEEPER-44</a>
-  </td>
-  <td>
-    Create sequence flag children with prefixes of 0's so that they can be lexicographically sorted. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-108">
-      ZOOKEEPER-108</a>
-  </td>
-  <td>
-    Fix sync operation reordering on a Quorum. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-25">
-      ZOOKEEPER-25</a>
-  </td>
-  <td>
-    Fuse module for Zookeeper.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-58">
-      ZOOKEEPER-58</a>
-  </td>
-  <td>
-    Race condition on ClientCnxn.java 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-56">
-      ZOOKEEPER-56</a>
-  </td>
-  <td>
-    Add clover support to build.xml. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-75">
-      ZOOKEEPER-75</a>
-  </td>
-  <td>
-    register the ZooKeeper mailing lists with nabble.com 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-54">
-      ZOOKEEPER-54</a>
-  </td>
-  <td>
-    remove sleeps in the tests. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-55">
-      ZOOKEEPER-55</a>
-  </td>
-  <td>
-    build.xml failes to retrieve a release number from SVN and the ant target "dist" fails 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-89">
-      ZOOKEEPER-89</a>
-  </td>
-  <td>
-    invoke WhenOwnerListener.whenNotOwner when the ZK connection fails 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-90">
-      ZOOKEEPER-90</a>
-  </td>
-  <td>
-    invoke WhenOwnerListener.whenNotOwner when the ZK session expires and the znode is the leader 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-82">
-      ZOOKEEPER-82</a>
-  </td>
-  <td>
-    Make the ZooKeeperServer more DI friendly.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-110">
-      ZOOKEEPER-110</a>
-  </td>
-  <td>
-    Build script relies on svnant, which is not compatible with subversion 1.5 working copies 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-111">
-      ZOOKEEPER-111</a>
-  </td>
-  <td>
-    Significant cleanup of existing tests.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-122">
-      ZOOKEEPER-122</a>
-  </td>
-  <td>
-    Fix  NPE in jute's Utils.toCSVString.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-123">
-      ZOOKEEPER-123</a>
-  </td>
-  <td>
-    Fix  the wrong class is specified for the logger.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-2">
-      ZOOKEEPER-2</a>
-  </td>
-  <td>
-    Fix synchronization issues in QuorumPeer and FastLeader election. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-125">
-      ZOOKEEPER-125</a>
-  </td>
-  <td>
-    Remove unwanted class declaration in FastLeaderElection. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-61">
-      ZOOKEEPER-61</a>
-  </td>
-  <td>
-    Address  in client/server test cases.
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-75">
-      ZOOKEEPER-75</a>
-  </td>
-  <td>
-    cleanup the library directory 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-109">
-      ZOOKEEPER-109</a>
-  </td>
-  <td>
-    cleanup of NPE and Resource issue nits found by static analysis 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-76">
-      ZOOKEEPER-76</a>
-  </td>
-  <td>
-    Commit 677109 removed the cobertura library, but not the build targets. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-63">
-      ZOOKEEPER-63</a>
-  </td>
-  <td>
-    Race condition in client close
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-70">
-      ZOOKEEPER-70</a>
-  </td>
-  <td>
-    Add skeleton forrest doc structure for ZooKeeper 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-79">
-      ZOOKEEPER-79</a>
-  </td>
-  <td>
-    Document jacob's leader election on the wiki recipes page 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-73">
-      ZOOKEEPER-73</a>
-  </td>
-  <td>
-    Move ZK wiki from SourceForge to Apache 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-72">
-      ZOOKEEPER-72</a>
-  </td>
-  <td>
-    Initial creation/setup of ZooKeeper ASF site. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-71">
-      ZOOKEEPER-71</a>
-  </td>
-  <td>
-    Determine what to do re ZooKeeper Changelog
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-68">
-      ZOOKEEPER-68</a>
-  </td>
-  <td>
-    parseACLs in ZooKeeper.java fails to parse elements of ACL, should be lastIndexOf rather than IndexOf 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-130">
-      ZOOKEEPER-130</a>
-  </td>
-  <td>
-    update build.xml to support apache release process. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-131">
-      ZOOKEEPER-131</a>
-  </td>
-  <td>
-    Fix Old leader election can elect a dead leader over and over again. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-137">
-      ZOOKEEPER-137</a>
-  </td>
-  <td>
-    client watcher objects can lose events 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-117">
-      ZOOKEEPER-117</a>
-  </td>
-  <td>
-    threading issues in Leader election
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-128">
-      ZOOKEEPER-128</a>
-  </td>
-  <td>
-    test coverage on async client operations needs to be improved
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-127">
-      ZOOKEEPER-127</a>
-  </td>
-  <td>
-     Use of non-standard election ports in config breaks services
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-53">
-      ZOOKEEPER-53</a>
-  </td>
-  <td>
-    tests failing on solaris. 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-172">
-      ZOOKEEPER-172</a>
-  </td>
-  <td>
-    FLE Test 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-41">
-      ZOOKEEPER-41</a>
-  </td>
-  <td>
-    Sample startup script 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-33">
-      ZOOKEEPER-33</a>
-  </td>
-  <td>
-    Better ACL management 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-49">
-      ZOOKEEPER-49</a>
-  </td>
-  <td>
-    SetACL does not work 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-20">
-      ZOOKEEPER-20</a>
-  </td>
-  <td>
-    Child watches are not triggered when the node is deleted
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-15">
-      ZOOKEEPER-15</a>
-  </td>
-  <td>
-    handle failure better in build.xml:test 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-11">
-      ZOOKEEPER-11</a>
-  </td>
-  <td>
-    ArrayList is used instead of List 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-45">
-      ZOOKEEPER-45</a>
-  </td>
-  <td>
-    Restructure the SVN repository after initial import 
-  </td>
-
-</tr>
-
-<tr>
-  
-<td>
-    <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-1">
-      ZOOKEEPER-1</a>
-  </td>
-  <td>
-    Initial ZooKeeper code contribution from Yahoo!
-  </td>
-
-</tr>
-
-
-</table>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-         2008-2013 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/releasenotes.pdf


+ 0 - 23
docs/skin/CommonMessages_de.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<catalogue>
-  <message key="Font size:">Schriftgrösse:</message>
-  <message key="Last Published:">Zuletzt veröffentlicht:</message>
-  <message key="Search">Suche:</message>
-  <message key="Search the site with">Suche auf der Seite mit</message>
-</catalogue>

+ 0 - 23
docs/skin/CommonMessages_en_US.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<catalogue>
-  <message  key="Font size:">Font size:</message>
-  <message key="Last Published:">Last Published:</message>
-  <message key="Search">Search</message>
-  <message key="Search the site with">Search site with</message>
-</catalogue>

+ 0 - 23
docs/skin/CommonMessages_es.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<catalogue>
-  <message key="Font size:">Tamaño del texto:</message>
-  <message key="Last Published:">Fecha de publicación:</message>
-  <message key="Search">Buscar</message>
-  <message key="Search the site with">Buscar en</message>
-</catalogue>

+ 0 - 23
docs/skin/CommonMessages_fr.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<catalogue>
-  <message key="Font size:">Taille :</message>
-  <message key="Last Published:">Dernière publication :</message>
-  <message key="Search">Rechercher</message>
-  <message key="Search the site with">Rechercher sur le site avec</message>
-</catalogue>

+ 0 - 167
docs/skin/basic.css

@@ -1,167 +0,0 @@
-/*
-* 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.
-*/
-/**
- * General
- */
-
-img { border: 0; }
-
-#content table {
-  border: 0;
-  width: 100%;
-}
-/*Hack to get IE to render the table at 100%*/
-* html #content table { margin-left: -3px; }
-
-#content th,
-#content td {
-  margin: 0;
-  padding: 0;
-  vertical-align: top;
-}
-
-.clearboth {
-  clear: both;
-}
-
-.note, .warning, .fixme {
-  clear:right;
-  border: solid black 1px;
-  margin: 1em 3em;
-}
-
-.note .label {
-  background: #369;
-  color: white;
-  font-weight: bold;
-  padding: 5px 10px;
-}
-.note .content {
-  background: #F0F0FF;
-  color: black;
-  line-height: 120%;
-  font-size: 90%;
-  padding: 5px 10px;
-}
-.warning .label {
-  background: #C00;
-  color: white;
-  font-weight: bold;
-  padding: 5px 10px;
-}
-.warning .content {
-  background: #FFF0F0;
-  color: black;
-  line-height: 120%;
-  font-size: 90%;
-  padding: 5px 10px;
-}
-.fixme .label {
-  background: #C6C600;
-  color: black;
-  font-weight: bold;
-  padding: 5px 10px;
-}
-.fixme .content {
-  padding: 5px 10px;
-}
-
-/**
- * Typography
- */
-
-body {
-  font-family: verdana, "Trebuchet MS", arial, helvetica, sans-serif;
-  font-size: 100%;
-}
-
-#content {
-  font-family: Georgia, Palatino, Times, serif;
-  font-size: 95%;
-}
-#tabs {
-  font-size: 70%;
-}
-#menu {
-  font-size: 80%;
-}
-#footer {
-  font-size: 70%;
-}
-
-h1, h2, h3, h4, h5, h6 {
-  font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif;
-  font-weight: bold;
-  margin-top: 1em;
-  margin-bottom: .5em;
-}
-
-h1 {
-    margin-top: 0;
-    margin-bottom: 1em;
-  font-size: 1.4em;
-}
-#content h1 {
-  font-size: 160%;
-  margin-bottom: .5em;
-}
-#menu h1 {
-  margin: 0;
-  padding: 10px;
-  background: #336699;
-  color: white;
-}
-h2 { font-size: 120%; }
-h3 { font-size: 100%; }
-h4 { font-size: 90%; }
-h5 { font-size: 80%; }
-h6 { font-size: 75%; }
-
-p {
-  line-height: 120%;
-  text-align: left;
-  margin-top: .5em;
-  margin-bottom: 1em;
-}
-
-#content li,
-#content th,
-#content td,
-#content li ul,
-#content li ol{
-  margin-top: .5em;
-  margin-bottom: .5em;
-}
-
-
-#content li li,
-#minitoc-area li{
-  margin-top: 0em;
-  margin-bottom: 0em;
-}
-
-#content .attribution {
-  text-align: right;
-  font-style: italic;
-  font-size: 85%;
-  margin-top: 1em;
-}
-
-.codefrag {
-  font-family: "Courier New", Courier, monospace;
-  font-size: 110%;
-}

+ 0 - 90
docs/skin/breadcrumbs-optimized.js

@@ -1,90 +0,0 @@
-/*
-* 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.
-*/
-var PREPREND_CRUMBS=new Array();
-var link1="@skinconfig.trail.link1.name@";
-var link2="@skinconfig.trail.link2.name@";
-var link3="@skinconfig.trail.link3.name@";
-if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
-  PREPREND_CRUMBS.push( new Array( link1, @skinconfig.trail.link1.href@ ) ); }
-if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
-  PREPREND_CRUMBS.push( new Array( link2, @skinconfig.trail.link2.href@ ) ); }
-if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
-  PREPREND_CRUMBS.push( new Array( link3, @skinconfig.trail.link3.href@ ) ); }
-var DISPLAY_SEPARATOR=" &gt; ";
-var DISPLAY_PREPREND=" &gt; ";
-var DISPLAY_POSTPREND=":";
-var CSS_CLASS_CRUMB="breadcrumb";
-var CSS_CLASS_TRAIL="breadcrumbTrail";
-var CSS_CLASS_SEPARATOR="crumbSeparator";
-var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
-var PATH_SEPARATOR="/";
-
-function sc(s) {
-	var l=s.toLowerCase();
-	return l.substr(0,1).toUpperCase()+l.substr(1);
-}
-function getdirs() {
-	var t=document.location.pathname.split(PATH_SEPARATOR);
-	var lc=t[t.length-1];
-	for(var i=0;i < FILE_EXTENSIONS.length;i++)
-	{
-		if(lc.indexOf(FILE_EXTENSIONS[i]))
-			return t.slice(1,t.length-1); }
-	return t.slice(1,t.length);
-}
-function getcrumbs( d )
-{
-	var pre = "/";
-	var post = "/";
-	var c = new Array();
-	if( d != null )
-	{
-		for(var i=0;i < d.length;i++) {
-			pre+=d[i]+postfix;
-			c.push(new Array(d[i],pre)); }
-	}
-	if(PREPREND_CRUMBS.length > 0 )
-		return PREPREND_CRUMBS.concat( c );
-	return c;
-}
-function gettrail( c )
-{
-	var h=DISPLAY_PREPREND;
-	for(var i=0;i < c.length;i++)
-	{
-		h+='<a href="'+c[i][1]+'" >'+sc(c[i][0])+'</a>';
-		if(i!=(c.length-1))
-			h+=DISPLAY_SEPARATOR; }
-	return h+DISPLAY_POSTPREND;
-}
-
-function gettrailXHTML( c )
-{
-	var h='<span class="'+CSS_CLASS_TRAIL+'">'+DISPLAY_PREPREND;
-	for(var i=0;i < c.length;i++)
-	{
-		h+='<a href="'+c[i][1]+'" class="'+CSS_CLASS_CRUMB+'">'+sc(c[i][0])+'</a>';
-		if(i!=(c.length-1))
-			h+='<span class="'+CSS_CLASS_SEPARATOR+'">'+DISPLAY_SEPARATOR+'</span>'; }
-	return h+DISPLAY_POSTPREND+'</span>';
-}
-
-if(document.location.href.toLowerCase().indexOf("http://")==-1)
-	document.write(gettrail(getcrumbs()));
-else
-	document.write(gettrail(getcrumbs(getdirs())));
-

+ 0 - 237
docs/skin/breadcrumbs.js

@@ -1,237 +0,0 @@
-/*
-* 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.
-*/
-/**
- * This script, when included in a html file, builds a neat breadcrumb trail
- * based on its url. That is, if it doesn't contains bugs (I'm relatively
- * sure it does).
- *
- * Typical usage:
- * <script type="text/javascript" language="JavaScript" src="breadcrumbs.js"></script>
- */
-
-/**
- * IE 5 on Mac doesn't know Array.push.
- *
- * Implement it - courtesy to fritz.
- */
-var abc	= new Array();
-if (!abc.push) {
-  Array.prototype.push	= function(what){this[this.length]=what}
-}
-
-/* ========================================================================
-	CONSTANTS
-   ======================================================================== */
-
-/**
- * Two-dimensional array containing extra crumbs to place at the front of
- * the trail. Specify first the name of the crumb, then the URI that belongs
- * to it. You'll need to modify this for every domain or subdomain where
- * you use this script (you can leave it as an empty array if you wish)
- */
-var PREPREND_CRUMBS = new Array();
-
-var link1 = "@skinconfig.trail.link1.name@";
-var link2 = "@skinconfig.trail.link2.name@";
-var link3 = "@skinconfig.trail.link3.name@";
-
-var href1 = "@skinconfig.trail.link1.href@";
-var href2 = "@skinconfig.trail.link2.href@";
-var href3 = "@skinconfig.trail.link3.href@";
-
-   if(!(link1=="")&&!link1.indexOf( "@" ) == 0){
-     PREPREND_CRUMBS.push( new Array( link1, href1 ) );
-   }
-   if(!(link2=="")&&!link2.indexOf( "@" ) == 0){
-     PREPREND_CRUMBS.push( new Array( link2, href2 ) );
-   }
-   if(!(link3=="")&&!link3.indexOf( "@" ) == 0){
-     PREPREND_CRUMBS.push( new Array( link3, href3 ) );
-   }
-
-/**
- * String to include between crumbs:
- */
-var DISPLAY_SEPARATOR = " &gt; ";
-/**
- * String to include at the beginning of the trail
- */
-var DISPLAY_PREPREND = " &gt; ";
-/**
- * String to include at the end of the trail
- */
-var DISPLAY_POSTPREND = "";
-
-/**
- * CSS Class to use for a single crumb:
- */
-var CSS_CLASS_CRUMB = "breadcrumb";
-
-/**
- * CSS Class to use for the complete trail:
- */
-var CSS_CLASS_TRAIL = "breadcrumbTrail";
-
-/**
- * CSS Class to use for crumb separator:
- */
-var CSS_CLASS_SEPARATOR = "crumbSeparator";
-
-/**
- * Array of strings containing common file extensions. We use this to
- * determine what part of the url to ignore (if it contains one of the
- * string specified here, we ignore it).
- */
-var FILE_EXTENSIONS = new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" );
-
-/**
- * String that separates parts of the breadcrumb trail from each other.
- * When this is no longer a slash, I'm sure I'll be old and grey.
- */
-var PATH_SEPARATOR = "/";
-
-/* ========================================================================
-	UTILITY FUNCTIONS
-   ======================================================================== */
-/**
- * Capitalize first letter of the provided string and return the modified
- * string.
- */
-function sentenceCase( string )
-{        return string;
-	//var lower = string.toLowerCase();
-	//return lower.substr(0,1).toUpperCase() + lower.substr(1);
-}
-
-/**
- * Returns an array containing the names of all the directories in the
- * current document URL
- */
-function getDirectoriesInURL()
-{
-	var trail = document.location.pathname.split( PATH_SEPARATOR );
-
-	// check whether last section is a file or a directory
-	var lastcrumb = trail[trail.length-1];
-	for( var i = 0; i < FILE_EXTENSIONS.length; i++ )
-	{
-		if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) )
-		{
-			// it is, remove it and send results
-			return trail.slice( 1, trail.length-1 );
-		}
-	}
-
-	// it's not; send the trail unmodified
-	return trail.slice( 1, trail.length );
-}
-
-/* ========================================================================
-	BREADCRUMB FUNCTIONALITY
-   ======================================================================== */
-/**
- * Return a two-dimensional array describing the breadcrumbs based on the
- * array of directories passed in.
- */
-function getBreadcrumbs( dirs )
-{
-	var prefix = "/";
-	var postfix = "/";
-
-	// the array we will return
-	var crumbs = new Array();
-
-	if( dirs != null )
-	{
-		for( var i = 0; i < dirs.length; i++ )
-		{
-			prefix += dirs[i] + postfix;
-			crumbs.push( new Array( dirs[i], prefix ) );
-		}
-	}
-
-	// preprend the PREPREND_CRUMBS
-	if(PREPREND_CRUMBS.length > 0 )
-	{
-		return PREPREND_CRUMBS.concat( crumbs );
-	}
-
-	return crumbs;
-}
-
-/**
- * Return a string containing a simple text breadcrumb trail based on the
- * two-dimensional array passed in.
- */
-function getCrumbTrail( crumbs )
-{
-	var xhtml = DISPLAY_PREPREND;
-
-	for( var i = 0; i < crumbs.length; i++ )
-	{
-		xhtml += '<a href="' + crumbs[i][1] + '" >';
-		xhtml += unescape( crumbs[i][0] ) + '</a>';
-		if( i != (crumbs.length-1) )
-		{
-			xhtml += DISPLAY_SEPARATOR;
-		}
-	}
-
-	xhtml += DISPLAY_POSTPREND;
-
-	return xhtml;
-}
-
-/**
- * Return a string containing an XHTML breadcrumb trail based on the
- * two-dimensional array passed in.
- */
-function getCrumbTrailXHTML( crumbs )
-{
-	var xhtml = '<span class="' + CSS_CLASS_TRAIL  + '">';
-	xhtml += DISPLAY_PREPREND;
-
-	for( var i = 0; i < crumbs.length; i++ )
-	{
-		xhtml += '<a href="' + crumbs[i][1] + '" class="' + CSS_CLASS_CRUMB + '">';
-		xhtml += unescape( crumbs[i][0] ) + '</a>';
-		if( i != (crumbs.length-1) )
-		{
-			xhtml += '<span class="' + CSS_CLASS_SEPARATOR + '">' + DISPLAY_SEPARATOR + '</span>';
-		}
-	}
-
-	xhtml += DISPLAY_POSTPREND;
-	xhtml += '</span>';
-
-	return xhtml;
-}
-
-/* ========================================================================
-	PRINT BREADCRUMB TRAIL
-   ======================================================================== */
-
-// check if we're local; if so, only print the PREPREND_CRUMBS
-if( document.location.href.toLowerCase().indexOf( "http://" ) == -1 )
-{
-	document.write( getCrumbTrail( getBreadcrumbs() ) );
-}
-else
-{
-	document.write( getCrumbTrail( getBreadcrumbs( getDirectoriesInURL() ) ) );
-}
-

+ 0 - 166
docs/skin/fontsize.js

@@ -1,166 +0,0 @@
-/*
-* 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.
-*/
-function init() 
-{ //embedded in the doc
-  //ndeSetTextSize();
-}
-
-function checkBrowser(){
-  if (!document.getElementsByTagName){
-    return true;
-  }
-  else{
-    return false;
-  }
-}
-
-
-function ndeSetTextSize(chgsize,rs) 
-{
-  var startSize;
-  var newSize;
-
-  if (!checkBrowser)
-  {
-    return;
-  }
-
-  startSize = parseInt(ndeGetDocTextSize());
-
-  if (!startSize)
-  {
-    startSize = 16;
-  }
-
-  switch (chgsize)
-  {
-  case 'incr':
-    newSize = startSize + 2;
-    break;
-
-  case 'decr':
-    newSize = startSize - 2;
-    break;
-
-  case 'reset':
-    if (rs) {newSize = rs;} else {newSize = 16;}
-    break;
-
-  default:
-    try{
-      newSize = parseInt(ndeReadCookie("nde-textsize"));
-    }
-    catch(e){
-      alert(e);
-    }
-    
-    if (!newSize || newSize == 'NaN')
-    {
-      newSize = startSize;
-    }
-    break;
-
-  }
-
-  if (newSize < 10) 
-  {
-    newSize = 10;
-  }
-
-  newSize += 'px';
-
-  document.getElementsByTagName('html')[0].style.fontSize = newSize;
-  document.getElementsByTagName('body')[0].style.fontSize = newSize;
-
-  ndeCreateCookie("nde-textsize", newSize, 365);
-}
-
-function ndeGetDocTextSize() 
-{
-  if (!checkBrowser)
-  {
-    return 0;
-  }
-
-  var size = 0;
-  var body = document.getElementsByTagName('body')[0];
-
-  if (body.style && body.style.fontSize)
-  {
-    size = body.style.fontSize;
-  }
-  else if (typeof(getComputedStyle) != 'undefined')
-  {
-    size = getComputedStyle(body,'').getPropertyValue('font-size');
-  }
-  else if (body.currentStyle)
-  {
-   size = body.currentStyle.fontSize;
-  }
-
-  //fix IE bug
-  if( isNaN(size)){
-    if(size.substring(size.length-1)=="%"){
-      return
-    }
-
-  }
-
-  return size;
-
-}
-
-
-
-function ndeCreateCookie(name,value,days) 
-{
-  var cookie = name + "=" + value + ";";
-
-  if (days) 
-  {
-    var date = new Date();
-    date.setTime(date.getTime()+(days*24*60*60*1000));
-    cookie += " expires=" + date.toGMTString() + ";";
-  }
-  cookie += " path=/";
-
-  document.cookie = cookie;
-
-}
-
-function ndeReadCookie(name) 
-{
-  var nameEQ = name + "=";
-  var ca = document.cookie.split(';');
-
- 
-  for(var i = 0; i < ca.length; i++) 
-  {
-    var c = ca[i];
-    while (c.charAt(0) == ' ') 
-    {
-      c = c.substring(1, c.length);
-    }
-
-    ctest = c.substring(0,name.length);
- 
-    if(ctest == name){
-      return c.substring(nameEQ.length,c.length);
-    }
-  }
-  return null;
-}

+ 0 - 40
docs/skin/getBlank.js

@@ -1,40 +0,0 @@
-/*
-* 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.
-*/
-/**
- * getBlank script - when included in a html file and called from a form text field, will set the value of this field to ""
- * if the text value is still the standard value.
- * getPrompt script - when included in a html file and called from a form text field, will set the value of this field to the prompt
- * if the text value is empty.
- *
- * Typical usage:
- * <script type="text/javascript" language="JavaScript" src="getBlank.js"></script>
- * <input type="text" id="query" value="Search the site:" onFocus="getBlank (this, 'Search the site:');" onBlur="getBlank (this, 'Search the site:');"/>
- */
-<!--
-function getBlank (form, stdValue){
-if (form.value == stdValue){
-	form.value = '';
-	}
-return true;
-}
-function getPrompt (form, stdValue){
-if (form.value == ''){
-	form.value = stdValue;
-	}
-return true;
-}
-//-->

+ 0 - 45
docs/skin/getMenu.js

@@ -1,45 +0,0 @@
-/*
-* 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.
-*/
-/**
- * This script, when included in a html file, can be used to make collapsible menus
- *
- * Typical usage:
- * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
- */
-
-if (document.getElementById){ 
-  document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
-}
-
-
-function SwitchMenu(obj, thePath)
-{
-var open = 'url("'+thePath + 'images/chapter_open.gif")';
-var close = 'url("'+thePath + 'images/chapter.gif")';
-  if(document.getElementById)  {
-    var el = document.getElementById(obj);
-    var title = document.getElementById(obj+'Title');
-
-    if(el.style.display != "block"){ 
-      title.style.backgroundImage = open;
-      el.style.display = "block";
-    }else{
-      title.style.backgroundImage = close;
-      el.style.display = "none";
-    }
-  }// end -  if(document.getElementById) 
-}//end - function SwitchMenu(obj)

+ 0 - 1
docs/skin/images/README.txt

@@ -1 +0,0 @@
-The images in this directory are used if the current skin lacks them.

BIN
docs/skin/images/add.jpg


BIN
docs/skin/images/apache-thanks.png


BIN
docs/skin/images/built-with-cocoon.gif


BIN
docs/skin/images/built-with-forrest-button.png


BIN
docs/skin/images/chapter.gif


BIN
docs/skin/images/chapter_open.gif


BIN
docs/skin/images/current.gif


BIN
docs/skin/images/error.png


BIN
docs/skin/images/external-link.gif


BIN
docs/skin/images/fix.jpg


BIN
docs/skin/images/forrest-credit-logo.png


BIN
docs/skin/images/hack.jpg


BIN
docs/skin/images/header_white_line.gif


BIN
docs/skin/images/info.png


BIN
docs/skin/images/instruction_arrow.png


BIN
docs/skin/images/label.gif


BIN
docs/skin/images/page.gif


BIN
docs/skin/images/pdfdoc.gif


BIN
docs/skin/images/poddoc.png


BIN
docs/skin/images/printer.gif


BIN
docs/skin/images/rc-b-l-15-1body-2menu-3menu.png


BIN
docs/skin/images/rc-b-r-15-1body-2menu-3menu.png


BIN
docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png


BIN
docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png


BIN
docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png


BIN
docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png


BIN
docs/skin/images/rc-t-r-15-1body-2menu-3menu.png


BIN
docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png


BIN
docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png


BIN
docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png


BIN
docs/skin/images/remove.jpg


BIN
docs/skin/images/rss.png


BIN
docs/skin/images/spacer.gif


BIN
docs/skin/images/success.png


BIN
docs/skin/images/txtdoc.png


BIN
docs/skin/images/update.jpg


BIN
docs/skin/images/valid-html401.png


BIN
docs/skin/images/vcss.png


BIN
docs/skin/images/warning.png


BIN
docs/skin/images/xmldoc.gif


+ 0 - 48
docs/skin/menu.js

@@ -1,48 +0,0 @@
-/*
-* 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.
-*/
-/**
- * This script, when included in a html file, can be used to make collapsible menus
- *
- * Typical usage:
- * <script type="text/javascript" language="JavaScript" src="menu.js"></script>
- */
-
-if (document.getElementById){ 
-  document.write('<style type="text/css">.menuitemgroup{display: none;}</style>')
-}
-
-function SwitchMenu(obj)
-{
-  if(document.getElementById)  {
-    var el = document.getElementById(obj);
-    var title = document.getElementById(obj+'Title');
-
-    if(obj.indexOf("_selected_")==0&&el.style.display == ""){
-      el.style.display = "block";
-      title.className = "pagegroupselected";
-    }
-
-    if(el.style.display != "block"){
-      el.style.display = "block";
-      title.className = "pagegroupopen";
-    }
-    else{
-      el.style.display = "none";
-      title.className = "pagegroup";
-    }
-  }// end -  if(document.getElementById) 
-}//end - function SwitchMenu(obj)

+ 0 - 50
docs/skin/note.txt

@@ -1,50 +0,0 @@
-Notes for developer:
-
---Legend-------------------
-TODO -> blocker
-DONE -> blocker
-ToDo -> enhancement bug
-done -> enhancement bug
-
---Issues-------------------
-- the corner images should be rendered through svg with the header color.
--> DONE 
--> ToDo: get rid of the images and use only divs!
-
-- the menu points should be displayed "better". 
--> DONE
--- Use the krysalis-site menu approach for the overall menu display.
--> DONE
--- Use the old lenya innermenu approch to further enhance the menu .
--> DONE
-
-- the content area needs some attention.
--> DONE
--- introduce the heading scheme from krysalis (<headings type="clean|box|underlined"/>)
--> DONE 
--> ToDo: make box with round corners
--> done: make underlined with variable border height
--> ToDo: make underline with bottom round corner
--- introduce the toc for each html-page
--> DONE
--- introduce the external-link-images.
--> DONE
-
-- the publish note should be where now only a border is. 
-Like <div id="published"/>
--> DONE
-, but make it configurable.
--> DONE
-- footer needs some attention
--> DONE
--- the footer do not have the color profile! Enable it!
--> DONE
--- the footer should as well contain a feedback link. 
-See http://issues.apache.org/eyebrowse/ReadMsg?listName=forrest-user@xml.apache.org&msgNo=71
--> DONE
-
-- introduce credits alternativ location
--> DONE
-
-- border for published / breadtrail / menu /tab divs 
--> ToDo

+ 0 - 54
docs/skin/print.css

@@ -1,54 +0,0 @@
-/*
-* 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.
-*/
-body {
-  font-family: Georgia, Palatino, serif;
-  font-size: 12pt;
-  background: white;
-}
-
-#tabs,
-#menu,
-#content .toc {
-  display: none;
-}
-
-#content {
-  width: auto;
-  padding: 0;
-  float: none !important;
-  color: black;
-  background: inherit;
-}
-
-a:link, a:visited {
-  color: #336699;
-  background: inherit;
-  text-decoration: underline;
-}
-
-#top .logo {
-  padding: 0;
-  margin: 0 0 2em 0;
-}
-
-#footer {
-  margin-top: 4em;
-}
-
-acronym {
-  border: 0;
-}

+ 0 - 168
docs/skin/profile.css

@@ -1,168 +0,0 @@
-
-
-/* ==================== aural ============================ */
-
-@media aural {
-  h1, h2, h3, h4, h5, h6 { voice-family: paul, male; stress: 20; richness: 90 }
-  h1 { pitch: x-low; pitch-range: 90 }
-  h2 { pitch: x-low; pitch-range: 80 }
-  h3 { pitch: low; pitch-range: 70 }
-  h4 { pitch: medium; pitch-range: 60 }
-  h5 { pitch: medium; pitch-range: 50 }
-  h6 { pitch: medium; pitch-range: 40 }
-  li, dt, dd { pitch: medium; richness: 60 }
-  dt { stress: 80 }
-  pre, code, tt { pitch: medium; pitch-range: 0; stress: 0; richness: 80 }
-  em { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
-  strong { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
-  dfn { pitch: high; pitch-range: 60; stress: 60 }
-  s, strike { richness: 0 }
-  i { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
-  b { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
-  u { richness: 0 }
-  
-  :link { voice-family: harry, male }
-  :visited { voice-family: betty, female }
-  :active { voice-family: betty, female; pitch-range: 80; pitch: x-high }
-}
-  
-a.external  {
-  padding: 0 20px 0px 0px;
-	display:inline;
-  background-repeat: no-repeat;
-	background-position: center right;
-	background-image: url(images/external-link.gif);
-}
-  
-#top          { background-color: #FFFFFF;}  
- 
-#top .header .current { background-color: #4C6C8F;} 
-#top .header .current a:link {  color: #ffffff;  }
-#top .header .current a:visited { color: #ffffff; }
-#top .header .current a:hover { color: #ffffff; }
- 
-#tabs li      { background-color: #E5E4D9 ;} 
-#tabs li a:link {  color: #000000;  }
-#tabs li a:visited { color: #000000; }
-#tabs li a:hover { color: #000000; }
-
-#level2tabs a.selected      { background-color: #4C6C8F ;} 
-#level2tabs a:link {  color: #ffffff;  }
-#level2tabs a:visited { color: #ffffff; }
-#level2tabs a:hover { color: #ffffff; }
-
-#level2tabs { background-color: #E5E4D9;}
-#level2tabs a.unselected:link {  color: #000000;  }
-#level2tabs a.unselected:visited { color: #000000; }
-#level2tabs a.unselected:hover { color: #000000; }
-
-.heading { background-color: #E5E4D9;} 
-
-.boxed { background-color: #E5E4D9;} 
-.underlined_5 	{border-bottom: solid 5px #E5E4D9;}
-.underlined_10 	{border-bottom: solid 10px #E5E4D9;}
-table caption { 
-background-color: #E5E4D9; 
-color: #000000;
-}
-    
-#feedback {
-color: #FFFFFF;
-background: #4C6C8F;
-text-align: center;
-}
-#feedback #feedbackto {
-color: #FFFFFF;
-}   
-
-#publishedStrip { 
-color: #FFFFFF;
-background: #4C6C8F; 
-}
-
-#publishedStrip { 
-color: #000000;
-background: #E5E4D9; 
-}
-
-#menu .menupagetitle  { background-color: #CFDCED;
-  color: #000000;}
-
-#menu           { border-color: #999999;}
-#menu .menupagetitle  { border-color: #999999;}
-#menu .menupageitemgroup  { border-color: #999999;}
-
-#menu      { background-color: #4C6C8F;} 
-#menu  {  color: #ffffff;} 
-#menu a:link {  color: #ffffff;} 
-#menu a:visited {  color: #ffffff;} 
-#menu a:hover {  
-background-color: #4C6C8F;
-color: #ffffff;} 
-
-#menu h1 {
-color: #000000;
-background-color: #cfdced;
-}   
- 
-#top .searchbox { 
-background-color: #E5E4D9 ;
-color: #000000; 
-} 
- 
-#menu .menupageitemgroup     { 
-background-color: #E5E4D9;
-}
-#menu .menupageitem {
-color: #000000;
-} 
-#menu .menupageitem a:link {  color: #000000;} 
-#menu .menupageitem a:visited {  color: #000000;} 
-#menu .menupageitem a:hover {  
-background-color: #E5E4D9;
-color: #000000;
-}
-
-body{ 
-background-color: #ffffff;
-color: #000000;
-} 
-a:link { color:#0000ff} 
-a:visited { color:#009999} 
-a:hover { color:#6587ff} 
-
- 
-.ForrestTable      { background-color: #ccc;} 
- 
-.ForrestTable td   { background-color: #ffffff;} 
- 
-.highlight        { background-color: #ffff00;} 
- 
-.fixme        { border-color: #c60;} 
- 
-.note         { border-color: #069;} 
- 
-.warning         { border-color: #900;} 
- 
-.code         { border-color: #a5b6c6;} 
- 
-#footer       { background-color: #E5E4D9;} 
-/* extra-css */
-    
-    p.quote {
-      margin-left: 2em;
-      padding: .5em;
-      background-color: #f0f0f0;
-      font-family: monospace;
-    }
-
-    pre.code {
-      margin-left: 0em;
-      padding: 0.5em;
-      background-color: #f0f0f0;
-      font-family: monospace;
-    }
-
-
-
-  

+ 0 - 1257
docs/skin/prototype.js

@@ -1,1257 +0,0 @@
-/*  Prototype JavaScript framework, version 1.4.0_pre4
- *  (c) 2005 Sam Stephenson <sam@conio.net>
- *
- *  THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
- *  against the source tree, available from the Prototype darcs repository. 
- *
- *  Prototype is freely distributable under the terms of an MIT-style license.
- *
- *  For details, see the Prototype web site: http://prototype.conio.net/
- *
-/*--------------------------------------------------------------------------*/
-
-var Prototype = {
-  Version: '1.4.0_pre4',
-  
-  emptyFunction: function() {},
-  K: function(x) {return x}
-}
-
-var Class = {
-  create: function() {
-    return function() { 
-      this.initialize.apply(this, arguments);
-    }
-  }
-}
-
-var Abstract = new Object();
-
-Object.extend = function(destination, source) {
-  for (property in source) {
-    destination[property] = source[property];
-  }
-  return destination;
-}
-
-Function.prototype.bind = function(object) {
-  var __method = this;
-  return function() {
-    return __method.apply(object, arguments);
-  }
-}
-
-Function.prototype.bindAsEventListener = function(object) {
-  var __method = this;
-  return function(event) {
-    return __method.call(object, event || window.event);
-  }
-}
-
-Number.prototype.toColorPart = function() {
-  var digits = this.toString(16);
-  if (this < 16) return '0' + digits;
-  return digits;
-}
-
-var Try = {
-  these: function() {
-    var returnValue;
-
-    for (var i = 0; i < arguments.length; i++) {
-      var lambda = arguments[i];
-      try {
-        returnValue = lambda();
-        break;
-      } catch (e) {}
-    }
-
-    return returnValue;
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var PeriodicalExecuter = Class.create();
-PeriodicalExecuter.prototype = {
-  initialize: function(callback, frequency) {
-    this.callback = callback;
-    this.frequency = frequency;
-    this.currentlyExecuting = false;
-
-    this.registerCallback();
-  },
-
-  registerCallback: function() {
-    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
-  },
-
-  onTimerEvent: function() {
-    if (!this.currentlyExecuting) {
-      try { 
-        this.currentlyExecuting = true;
-        this.callback(); 
-      } finally { 
-        this.currentlyExecuting = false;
-      }
-    }
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-function $() {
-  var elements = new Array();
-
-  for (var i = 0; i < arguments.length; i++) {
-    var element = arguments[i];
-    if (typeof element == 'string')
-      element = document.getElementById(element);
-
-    if (arguments.length == 1) 
-      return element;
-
-    elements.push(element);
-  }
-
-  return elements;
-}
-
-if (!Array.prototype.push) {
-  Array.prototype.push = function() {
-		var startLength = this.length;
-		for (var i = 0; i < arguments.length; i++)
-      this[startLength + i] = arguments[i];
-	  return this.length;
-  }
-}
-
-if (!Function.prototype.apply) {
-  // Based on code from http://www.youngpup.net/
-  Function.prototype.apply = function(object, parameters) {
-    var parameterStrings = new Array();
-    if (!object)     object = window;
-    if (!parameters) parameters = new Array();
-    
-    for (var i = 0; i < parameters.length; i++)
-      parameterStrings[i] = 'parameters[' + i + ']';
-    
-    object.__apply__ = this;
-    var result = eval('object.__apply__(' + 
-      parameterStrings.join(', ') + ')');
-    object.__apply__ = null;
-    
-    return result;
-  }
-}
-
-Object.extend(String.prototype, {
-  stripTags: function() {
-    return this.replace(/<\/?[^>]+>/gi, '');
-  },
-
-  escapeHTML: function() {
-    var div = document.createElement('div');
-    var text = document.createTextNode(this);
-    div.appendChild(text);
-    return div.innerHTML;
-  },
-
-  unescapeHTML: function() {
-    var div = document.createElement('div');
-    div.innerHTML = this.stripTags();
-    return div.childNodes[0].nodeValue;
-  },
-  
-  parseQuery: function() {
-    var str = this;
-    if (str.substring(0,1) == '?') {
-      str = this.substring(1);
-    }
-    var result = {};
-    var pairs = str.split('&');
-    for (var i = 0; i < pairs.length; i++) {
-      var pair = pairs[i].split('=');
-      result[pair[0]] = pair[1];
-    }
-    return result;
-  }
-});
-
-
-var _break    = new Object();
-var _continue = new Object();
-
-var Enumerable = {
-  each: function(iterator) {
-    var index = 0;
-    try {
-      this._each(function(value) {
-        try {
-          iterator(value, index++);
-        } catch (e) {
-          if (e != _continue) throw e;
-        }
-      });
-    } catch (e) {
-      if (e != _break) throw e;
-    }
-  },
-  
-  all: function(iterator) {
-    var result = true;
-    this.each(function(value, index) {
-      if (!(result &= (iterator || Prototype.K)(value, index))) 
-        throw _break;
-    });
-    return result;
-  },
-  
-  any: function(iterator) {
-    var result = true;
-    this.each(function(value, index) {
-      if (result &= (iterator || Prototype.K)(value, index)) 
-        throw _break;
-    });
-    return result;
-  },
-  
-  collect: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      results.push(iterator(value, index));
-    });
-    return results;
-  },
-  
-  detect: function (iterator) {
-    var result;
-    this.each(function(value, index) {
-      if (iterator(value, index)) {
-        result = value;
-        throw _break;
-      }
-    });
-    return result;
-  },
-  
-  findAll: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      if (iterator(value, index))
-        results.push(value);
-    });
-    return results;
-  },
-  
-  grep: function(pattern, iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      var stringValue = value.toString();
-      if (stringValue.match(pattern))
-        results.push((iterator || Prototype.K)(value, index));
-    })
-    return results;
-  },
-  
-  include: function(object) {
-    var found = false;
-    this.each(function(value) {
-      if (value == object) {
-        found = true;
-        throw _break;
-      }
-    });
-    return found;
-  },
-  
-  inject: function(memo, iterator) {
-    this.each(function(value, index) {
-      memo = iterator(memo, value, index);
-    });
-    return memo;
-  },
-  
-  invoke: function(method) {
-    var args = $A(arguments).slice(1);
-    return this.collect(function(value) {
-      return value[method].apply(value, args);
-    });
-  },
-  
-  max: function(iterator) {
-    var result;
-    this.each(function(value, index) {
-      value = (iterator || Prototype.K)(value, index);
-      if (value >= (result || value))
-        result = value;
-    });
-    return result;
-  },
-  
-  min: function(iterator) {
-    var result;
-    this.each(function(value, index) {
-      value = (iterator || Prototype.K)(value, index);
-      if (value <= (result || value))
-        result = value;
-    });
-    return result;
-  },
-  
-  partition: function(iterator) {
-    var trues = [], falses = [];
-    this.each(function(value, index) {
-      ((iterator || Prototype.K)(value, index) ? 
-        trues : falses).push(value);
-    });
-    return [trues, falses];
-  },
-  
-  pluck: function(property) {
-    var results = [];
-    this.each(function(value, index) {
-      results.push(value[property]);
-    });
-    return results;
-  },
-  
-  reject: function(iterator) {
-    var results = [];
-    this.each(function(value, index) {
-      if (!iterator(value, index))
-        results.push(value);
-    });
-    return results;
-  },
-  
-  sortBy: function(iterator) {
-    return this.collect(function(value, index) {
-      return {value: value, criteria: iterator(value, index)};
-    }).sort(function(left, right) {
-      var a = left.criteria, b = right.criteria;
-      return a < b ? -1 : a > b ? 1 : 0;
-    }).pluck('value');
-  },
-  
-  toArray: function() {
-    return this.collect(Prototype.K);
-  },
-  
-  zip: function() {
-    var iterator = Prototype.K, args = $A(arguments);
-    if (typeof args.last() == 'function')
-      iterator = args.pop();
-
-    var collections = [this].concat(args).map($A);
-    return this.map(function(value, index) {
-      iterator(value = collections.pluck(index));
-      return value;
-    });
-  }
-}
-
-Object.extend(Enumerable, {
-  map:     Enumerable.collect,
-  find:    Enumerable.detect,
-  select:  Enumerable.findAll,
-  member:  Enumerable.include,
-  entries: Enumerable.toArray
-});
-
-$A = Array.from = function(iterable) {
-  var results = [];
-  for (var i = 0; i < iterable.length; i++)
-    results.push(iterable[i]);
-  return results;
-}
-
-Object.extend(Array.prototype, {
-  _each: function(iterator) {
-    for (var i = 0; i < this.length; i++)
-      iterator(this[i]);
-  },
-  
-  first: function() {
-    return this[0];
-  },
-  
-  last: function() {
-    return this[this.length - 1];
-  }
-});
-
-Object.extend(Array.prototype, Enumerable);
-
-
-var Ajax = {
-  getTransport: function() {
-    return Try.these(
-      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
-      function() {return new ActiveXObject('Microsoft.XMLHTTP')},
-      function() {return new XMLHttpRequest()}
-    ) || false;
-  }
-}
-
-Ajax.Base = function() {};
-Ajax.Base.prototype = {
-  setOptions: function(options) {
-    this.options = {
-      method:       'post',
-      asynchronous: true,
-      parameters:   ''
-    }
-    Object.extend(this.options, options || {});
-  },
-
-  responseIsSuccess: function() {
-    return this.transport.status == undefined
-        || this.transport.status == 0 
-        || (this.transport.status >= 200 && this.transport.status < 300);
-  },
-
-  responseIsFailure: function() {
-    return !this.responseIsSuccess();
-  }
-}
-
-Ajax.Request = Class.create();
-Ajax.Request.Events = 
-  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
-
-Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
-  initialize: function(url, options) {
-    this.transport = Ajax.getTransport();
-    this.setOptions(options);
-    this.request(url);
-  },
-
-  request: function(url) {
-    var parameters = this.options.parameters || '';
-    if (parameters.length > 0) parameters += '&_=';
-
-    try {
-      if (this.options.method == 'get')
-        url += '?' + parameters;
-
-      this.transport.open(this.options.method, url,
-        this.options.asynchronous);
-
-      if (this.options.asynchronous) {
-        this.transport.onreadystatechange = this.onStateChange.bind(this);
-        setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
-      }
-
-      this.setRequestHeaders();
-
-      var body = this.options.postBody ? this.options.postBody : parameters;
-      this.transport.send(this.options.method == 'post' ? body : null);
-
-    } catch (e) {
-    }
-  },
-
-  setRequestHeaders: function() {
-    var requestHeaders = 
-      ['X-Requested-With', 'XMLHttpRequest',
-       'X-Prototype-Version', Prototype.Version];
-
-    if (this.options.method == 'post') {
-      requestHeaders.push('Content-type', 
-        'application/x-www-form-urlencoded');
-
-      /* Force "Connection: close" for Mozilla browsers to work around
-       * a bug where XMLHttpReqeuest sends an incorrect Content-length
-       * header. See Mozilla Bugzilla #246651. 
-       */
-      if (this.transport.overrideMimeType)
-        requestHeaders.push('Connection', 'close');
-    }
-
-    if (this.options.requestHeaders)
-      requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
-
-    for (var i = 0; i < requestHeaders.length; i += 2)
-      this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
-  },
-
-  onStateChange: function() {
-    var readyState = this.transport.readyState;
-    if (readyState != 1)
-      this.respondToReadyState(this.transport.readyState);
-  },
-
-  respondToReadyState: function(readyState) {
-    var event = Ajax.Request.Events[readyState];
-
-    if (event == 'Complete')
-      (this.options['on' + this.transport.status]
-       || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
-       || Prototype.emptyFunction)(this.transport);
-
-    (this.options['on' + event] || Prototype.emptyFunction)(this.transport);
-
-    /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
-    if (event == 'Complete')
-      this.transport.onreadystatechange = Prototype.emptyFunction;
-  }
-});
-
-Ajax.Updater = Class.create();
-Ajax.Updater.ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:<\/script>)';
-
-Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
-  initialize: function(container, url, options) {
-    this.containers = {
-      success: container.success ? $(container.success) : $(container),
-      failure: container.failure ? $(container.failure) :
-        (container.success ? null : $(container))
-    }
-
-    this.transport = Ajax.getTransport();
-    this.setOptions(options);
-
-    var onComplete = this.options.onComplete || Prototype.emptyFunction;
-    this.options.onComplete = (function() {
-      this.updateContent();
-      onComplete(this.transport);
-    }).bind(this);
-
-    this.request(url);
-  },
-
-  updateContent: function() {
-    var receiver = this.responseIsSuccess() ?
-      this.containers.success : this.containers.failure;
-
-    var match    = new RegExp(Ajax.Updater.ScriptFragment, 'img');
-    var response = this.transport.responseText.replace(match, '');
-    var scripts  = this.transport.responseText.match(match);
-
-    if (receiver) {
-      if (this.options.insertion) {
-        new this.options.insertion(receiver, response);
-      } else {
-        receiver.innerHTML = response;
-      }
-    }
-
-    if (this.responseIsSuccess()) {
-      if (this.onComplete)
-        setTimeout((function() {this.onComplete(
-          this.transport)}).bind(this), 10);
-    }
-
-    if (this.options.evalScripts && scripts) {
-      match = new RegExp(Ajax.Updater.ScriptFragment, 'im');
-      setTimeout((function() {
-        for (var i = 0; i < scripts.length; i++)
-          eval(scripts[i].match(match)[1]);
-      }).bind(this), 10);
-    }
-  }
-});
-
-Ajax.PeriodicalUpdater = Class.create();
-Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
-  initialize: function(container, url, options) {
-    this.setOptions(options);
-    this.onComplete = this.options.onComplete;
-
-    this.frequency = (this.options.frequency || 2);
-    this.decay = 1;
-
-    this.updater = {};
-    this.container = container;
-    this.url = url;
-
-    this.start();
-  },
-
-  start: function() {
-    this.options.onComplete = this.updateComplete.bind(this);
-    this.onTimerEvent();
-  },
-
-  stop: function() {
-    this.updater.onComplete = undefined;
-    clearTimeout(this.timer);
-    (this.onComplete || Ajax.emptyFunction).apply(this, arguments);
-  },
-
-  updateComplete: function(request) {
-    if (this.options.decay) {
-      this.decay = (request.responseText == this.lastText ? 
-        this.decay * this.options.decay : 1);
-
-      this.lastText = request.responseText;
-    }
-    this.timer = setTimeout(this.onTimerEvent.bind(this), 
-      this.decay * this.frequency * 1000);
-  },
-
-  onTimerEvent: function() {
-    this.updater = new Ajax.Updater(this.container, this.url, this.options);
-  }
-});
-
-document.getElementsByClassName = function(className) {
-  var children = document.getElementsByTagName('*') || document.all;
-  var elements = new Array();
-  
-  for (var i = 0; i < children.length; i++) {
-    var child = children[i];
-    var classNames = child.className.split(' ');
-    for (var j = 0; j < classNames.length; j++) {
-      if (classNames[j] == className) {
-        elements.push(child);
-        break;
-      }
-    }
-  }
-  
-  return elements;
-}
-
-/*--------------------------------------------------------------------------*/
-
-if (!window.Element) {
-  var Element = new Object();
-}
-
-Object.extend(Element, {
-  toggle: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $(arguments[i]);
-      element.style.display = 
-        (element.style.display == 'none' ? '' : 'none');
-    }
-  },
-
-  hide: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $(arguments[i]);
-      element.style.display = 'none';
-    }
-  },
-
-  show: function() {
-    for (var i = 0; i < arguments.length; i++) {
-      var element = $(arguments[i]);
-      element.style.display = '';
-    }
-  },
-
-  remove: function(element) {
-    element = $(element);
-    element.parentNode.removeChild(element);
-  },
-   
-  getHeight: function(element) {
-    element = $(element);
-    return element.offsetHeight; 
-  },
-
-  hasClassName: function(element, className) {
-    element = $(element);
-    if (!element)
-      return;
-    var a = element.className.split(' ');
-    for (var i = 0; i < a.length; i++) {
-      if (a[i] == className)
-        return true;
-    }
-    return false;
-  },
-
-  addClassName: function(element, className) {
-    element = $(element);
-    Element.removeClassName(element, className);
-    element.className += ' ' + className;
-  },
-
-  removeClassName: function(element, className) {
-    element = $(element);
-    if (!element)
-      return;
-    var newClassName = '';
-    var a = element.className.split(' ');
-    for (var i = 0; i < a.length; i++) {
-      if (a[i] != className) {
-        if (i > 0)
-          newClassName += ' ';
-        newClassName += a[i];
-      }
-    }
-    element.className = newClassName;
-  },
-  
-  // removes whitespace-only text node children
-  cleanWhitespace: function(element) {
-    var element = $(element);
-    for (var i = 0; i < element.childNodes.length; i++) {
-      var node = element.childNodes[i];
-      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
-        Element.remove(node);
-    }
-  }
-});
-
-var Toggle = new Object();
-Toggle.display = Element.toggle;
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.Insertion = function(adjacency) {
-  this.adjacency = adjacency;
-}
-
-Abstract.Insertion.prototype = {
-  initialize: function(element, content) {
-    this.element = $(element);
-    this.content = content;
-    
-    if (this.adjacency && this.element.insertAdjacentHTML) {
-      this.element.insertAdjacentHTML(this.adjacency, this.content);
-    } else {
-      this.range = this.element.ownerDocument.createRange();
-      if (this.initializeRange) this.initializeRange();
-      this.fragment = this.range.createContextualFragment(this.content);
-      this.insertContent();
-    }
-  }
-}
-
-var Insertion = new Object();
-
-Insertion.Before = Class.create();
-Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
-  initializeRange: function() {
-    this.range.setStartBefore(this.element);
-  },
-  
-  insertContent: function() {
-    this.element.parentNode.insertBefore(this.fragment, this.element);
-  }
-});
-
-Insertion.Top = Class.create();
-Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
-  initializeRange: function() {
-    this.range.selectNodeContents(this.element);
-    this.range.collapse(true);
-  },
-  
-  insertContent: function() {  
-    this.element.insertBefore(this.fragment, this.element.firstChild);
-  }
-});
-
-Insertion.Bottom = Class.create();
-Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
-  initializeRange: function() {
-    this.range.selectNodeContents(this.element);
-    this.range.collapse(this.element);
-  },
-  
-  insertContent: function() {
-    this.element.appendChild(this.fragment);
-  }
-});
-
-Insertion.After = Class.create();
-Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
-  initializeRange: function() {
-    this.range.setStartAfter(this.element);
-  },
-  
-  insertContent: function() {
-    this.element.parentNode.insertBefore(this.fragment, 
-      this.element.nextSibling);
-  }
-});
-
-var Field = {
-  clear: function() {
-    for (var i = 0; i < arguments.length; i++)
-      $(arguments[i]).value = '';
-  },
-
-  focus: function(element) {
-    $(element).focus();
-  },
-  
-  present: function() {
-    for (var i = 0; i < arguments.length; i++)
-      if ($(arguments[i]).value == '') return false;
-    return true;
-  },
-  
-  select: function(element) {
-    $(element).select();
-  },
-   
-  activate: function(element) {
-    $(element).focus();
-    $(element).select();
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var Form = {
-  serialize: function(form) {
-    var elements = Form.getElements($(form));
-    var queryComponents = new Array();
-    
-    for (var i = 0; i < elements.length; i++) {
-      var queryComponent = Form.Element.serialize(elements[i]);
-      if (queryComponent)
-        queryComponents.push(queryComponent);
-    }
-    
-    return queryComponents.join('&');
-  },
-  
-  getElements: function(form) {
-    var form = $(form);
-    var elements = new Array();
-
-    for (tagName in Form.Element.Serializers) {
-      var tagElements = form.getElementsByTagName(tagName);
-      for (var j = 0; j < tagElements.length; j++)
-        elements.push(tagElements[j]);
-    }
-    return elements;
-  },
-  
-  getInputs: function(form, typeName, name) {
-    var form = $(form);
-    var inputs = form.getElementsByTagName('input');
-    
-    if (!typeName && !name)
-      return inputs;
-      
-    var matchingInputs = new Array();
-    for (var i = 0; i < inputs.length; i++) {
-      var input = inputs[i];
-      if ((typeName && input.type != typeName) ||
-          (name && input.name != name)) 
-        continue;
-      matchingInputs.push(input);
-    }
-
-    return matchingInputs;
-  },
-
-  disable: function(form) {
-    var elements = Form.getElements(form);
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      element.blur();
-      element.disabled = 'true';
-    }
-  },
-
-  enable: function(form) {
-    var elements = Form.getElements(form);
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      element.disabled = '';
-    }
-  },
-
-  focusFirstElement: function(form) {
-    var form = $(form);
-    var elements = Form.getElements(form);
-    for (var i = 0; i < elements.length; i++) {
-      var element = elements[i];
-      if (element.type != 'hidden' && !element.disabled) {
-        Field.activate(element);
-        break;
-      }
-    }
-  },
-
-  reset: function(form) {
-    $(form).reset();
-  }
-}
-
-Form.Element = {
-  serialize: function(element) {
-    var element = $(element);
-    var method = element.tagName.toLowerCase();
-    var parameter = Form.Element.Serializers[method](element);
-    
-    if (parameter)
-      return encodeURIComponent(parameter[0]) + '=' + 
-        encodeURIComponent(parameter[1]);                   
-  },
-  
-  getValue: function(element) {
-    var element = $(element);
-    var method = element.tagName.toLowerCase();
-    var parameter = Form.Element.Serializers[method](element);
-    
-    if (parameter) 
-      return parameter[1];
-  }
-}
-
-Form.Element.Serializers = {
-  input: function(element) {
-    switch (element.type.toLowerCase()) {
-      case 'submit':
-      case 'hidden':
-      case 'password':
-      case 'text':
-        return Form.Element.Serializers.textarea(element);
-      case 'checkbox':  
-      case 'radio':
-        return Form.Element.Serializers.inputSelector(element);
-    }
-    return false;
-  },
-
-  inputSelector: function(element) {
-    if (element.checked)
-      return [element.name, element.value];
-  },
-
-  textarea: function(element) {
-    return [element.name, element.value];
-  },
-
-  select: function(element) {
-    var value = '';
-    if (element.type == 'select-one') {
-      var index = element.selectedIndex;
-      if (index >= 0)
-        value = element.options[index].value || element.options[index].text;
-    } else {
-      value = new Array();
-      for (var i = 0; i < element.length; i++) {
-        var opt = element.options[i];
-        if (opt.selected)
-          value.push(opt.value || opt.text);
-      }
-    }
-    return [element.name, value];
-  }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var $F = Form.Element.getValue;
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.TimedObserver = function() {}
-Abstract.TimedObserver.prototype = {
-  initialize: function(element, frequency, callback) {
-    this.frequency = frequency;
-    this.element   = $(element);
-    this.callback  = callback;
-    
-    this.lastValue = this.getValue();
-    this.registerCallback();
-  },
-  
-  registerCallback: function() {
-    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
-  },
-  
-  onTimerEvent: function() {
-    var value = this.getValue();
-    if (this.lastValue != value) {
-      this.callback(this.element, value);
-      this.lastValue = value;
-    }
-  }
-}
-
-Form.Element.Observer = Class.create();
-Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
-  getValue: function() {
-    return Form.Element.getValue(this.element);
-  }
-});
-
-Form.Observer = Class.create();
-Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
-  getValue: function() {
-    return Form.serialize(this.element);
-  }
-});
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.EventObserver = function() {}
-Abstract.EventObserver.prototype = {
-  initialize: function(element, callback) {
-    this.element  = $(element);
-    this.callback = callback;
-    
-    this.lastValue = this.getValue();
-    if (this.element.tagName.toLowerCase() == 'form')
-      this.registerFormCallbacks();
-    else
-      this.registerCallback(this.element);
-  },
-  
-  onElementEvent: function() {
-    var value = this.getValue();
-    if (this.lastValue != value) {
-      this.callback(this.element, value);
-      this.lastValue = value;
-    }
-  },
-  
-  registerFormCallbacks: function() {
-    var elements = Form.getElements(this.element);
-    for (var i = 0; i < elements.length; i++)
-      this.registerCallback(elements[i]);
-  },
-  
-  registerCallback: function(element) {
-    if (element.type) {
-      switch (element.type.toLowerCase()) {
-        case 'checkbox':  
-        case 'radio':
-          element.target = this;
-          element.prev_onclick = element.onclick || Prototype.emptyFunction;
-          element.onclick = function() {
-            this.prev_onclick(); 
-            this.target.onElementEvent();
-          }
-          break;
-        case 'password':
-        case 'text':
-        case 'textarea':
-        case 'select-one':
-        case 'select-multiple':
-          element.target = this;
-          element.prev_onchange = element.onchange || Prototype.emptyFunction;
-          element.onchange = function() {
-            this.prev_onchange(); 
-            this.target.onElementEvent();
-          }
-          break;
-      }
-    }    
-  }
-}
-
-Form.Element.EventObserver = Class.create();
-Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
-  getValue: function() {
-    return Form.Element.getValue(this.element);
-  }
-});
-
-Form.EventObserver = Class.create();
-Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
-  getValue: function() {
-    return Form.serialize(this.element);
-  }
-});
-
-
-if (!window.Event) {
-  var Event = new Object();
-}
-
-Object.extend(Event, {
-  KEY_BACKSPACE: 8,
-  KEY_TAB:       9,
-  KEY_RETURN:   13,
-  KEY_ESC:      27,
-  KEY_LEFT:     37,
-  KEY_UP:       38,
-  KEY_RIGHT:    39,
-  KEY_DOWN:     40,
-  KEY_DELETE:   46,
-
-  element: function(event) {
-    return event.target || event.srcElement;
-  },
-
-  isLeftClick: function(event) {
-    return (((event.which) && (event.which == 1)) ||
-            ((event.button) && (event.button == 1)));
-  },
-
-  pointerX: function(event) {
-    return event.pageX || (event.clientX + 
-      (document.documentElement.scrollLeft || document.body.scrollLeft));
-  },
-
-  pointerY: function(event) {
-    return event.pageY || (event.clientY + 
-      (document.documentElement.scrollTop || document.body.scrollTop));
-  },
-
-  stop: function(event) {
-    if (event.preventDefault) { 
-      event.preventDefault(); 
-      event.stopPropagation(); 
-    } else {
-      event.returnValue = false;
-    }
-  },
-
-  // find the first node with the given tagName, starting from the
-  // node the event was triggered on; traverses the DOM upwards
-  findElement: function(event, tagName) {
-    var element = Event.element(event);
-    while (element.parentNode && (!element.tagName ||
-        (element.tagName.toUpperCase() != tagName.toUpperCase())))
-      element = element.parentNode;
-    return element;
-  },
-
-  observers: false,
-  
-  _observeAndCache: function(element, name, observer, useCapture) {
-    if (!this.observers) this.observers = [];
-    if (element.addEventListener) {
-      this.observers.push([element, name, observer, useCapture]);
-      element.addEventListener(name, observer, useCapture);
-    } else if (element.attachEvent) {
-      this.observers.push([element, name, observer, useCapture]);
-      element.attachEvent('on' + name, observer);
-    }
-  },
-  
-  unloadCache: function() {
-    if (!Event.observers) return;
-    for (var i = 0; i < Event.observers.length; i++) {
-      Event.stopObserving.apply(this, Event.observers[i]);
-      Event.observers[i][0] = null;
-    }
-    Event.observers = false;
-  },
-
-  observe: function(element, name, observer, useCapture) {
-    var element = $(element);
-    useCapture = useCapture || false;
-    
-    if (name == 'keypress' &&
-        ((/Konqueror|Safari|KHTML/.test(navigator.userAgent)) 
-        || element.attachEvent))
-      name = 'keydown';
-    
-    this._observeAndCache(element, name, observer, useCapture);
-  },
-
-  stopObserving: function(element, name, observer, useCapture) {
-    var element = $(element);
-    useCapture = useCapture || false;
-    
-    if (name == 'keypress' &&
-        ((/Konqueror|Safari|KHTML/.test(navigator.userAgent)) 
-        || element.detachEvent))
-      name = 'keydown';
-    
-    if (element.removeEventListener) {
-      element.removeEventListener(name, observer, useCapture);
-    } else if (element.detachEvent) {
-      element.detachEvent('on' + name, observer);
-    }
-  }
-});
-
-/* prevent memory leaks in IE */
-Event.observe(window, 'unload', Event.unloadCache, false);
-
-var Position = {
-
-  // set to true if needed, warning: firefox performance problems
-  // NOT neeeded for page scrolling, only if draggable contained in
-  // scrollable elements
-  includeScrollOffsets: false, 
-
-  // must be called before calling withinIncludingScrolloffset, every time the
-  // page is scrolled
-  prepare: function() {
-    this.deltaX =  window.pageXOffset 
-                || document.documentElement.scrollLeft 
-                || document.body.scrollLeft 
-                || 0;
-    this.deltaY =  window.pageYOffset 
-                || document.documentElement.scrollTop 
-                || document.body.scrollTop 
-                || 0;
-  },
-
-  realOffset: function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.scrollTop  || 0;
-      valueL += element.scrollLeft || 0; 
-      element = element.parentNode;
-    } while (element);
-    return [valueL, valueT];
-  },
-
-  cumulativeOffset: function(element) {
-    var valueT = 0, valueL = 0;
-    do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-      element = element.offsetParent;
-    } while (element);
-    return [valueL, valueT];
-  },
-
-  // caches x/y coordinate pair to use with overlap
-  within: function(element, x, y) {
-    if (this.includeScrollOffsets)
-      return this.withinIncludingScrolloffsets(element, x, y);
-    this.xcomp = x;
-    this.ycomp = y;
-    this.offset = this.cumulativeOffset(element);
-
-    return (y >= this.offset[1] &&
-            y <  this.offset[1] + element.offsetHeight &&
-            x >= this.offset[0] && 
-            x <  this.offset[0] + element.offsetWidth);
-  },
-
-  withinIncludingScrolloffsets: function(element, x, y) {
-    var offsetcache = this.realOffset(element);
-
-    this.xcomp = x + offsetcache[0] - this.deltaX;
-    this.ycomp = y + offsetcache[1] - this.deltaY;
-    this.offset = this.cumulativeOffset(element);
-
-    return (this.ycomp >= this.offset[1] &&
-            this.ycomp <  this.offset[1] + element.offsetHeight &&
-            this.xcomp >= this.offset[0] && 
-            this.xcomp <  this.offset[0] + element.offsetWidth);
-  },
-
-  // within must be called directly before
-  overlap: function(mode, element) {  
-    if (!mode) return 0;  
-    if (mode == 'vertical') 
-      return ((this.offset[1] + element.offsetHeight) - this.ycomp) / 
-        element.offsetHeight;
-    if (mode == 'horizontal')
-      return ((this.offset[0] + element.offsetWidth) - this.xcomp) / 
-        element.offsetWidth;
-  },
-
-  clone: function(source, target) {
-    source = $(source);
-    target = $(target);
-    target.style.position = 'absolute';
-    var offsets = this.cumulativeOffset(source);
-    target.style.top    = offsets[1] + 'px';
-    target.style.left   = offsets[0] + 'px';
-    target.style.width  = source.offsetWidth + 'px';
-    target.style.height = source.offsetHeight + 'px';
-  }
-}

+ 0 - 587
docs/skin/screen.css

@@ -1,587 +0,0 @@
-/*
-* 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.
-*/
-body {  margin: 0px 0px 0px 0px; font-family: Verdana, Helvetica, sans-serif; }
-
-h1     { font-size : 160%; margin: 0px 0px 0px 0px;  padding: 0px; }
-h2     { font-size : 140%; margin: 1em 0px 0.8em 0px; padding: 0px; font-weight : bold;}
-h3     { font-size : 130%; margin: 0.8em 0px 0px 0px; padding: 0px; font-weight : bold; }
-.h3 { margin: 22px 0px 3px 0px; }
-h4     { font-size : 120%; margin: 0.7em 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; }
-.h4 { margin: 18px 0px 0px 0px; }
-h4.faq { font-size : 120%; margin: 18px 0px 0px 0px; padding: 0px; font-weight : bold;   text-align: left; }
-h5     { font-size : 100%; margin: 14px 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; }
-
-/**
-* table
-*/
-table .title { background-color: #000000; }
-.ForrestTable         {
-    color: #ffffff;
-    background-color: #7099C5;
-    width: 100%;
-    font-size : 100%;
-    empty-cells: show;
-}
-table caption {
-    padding-left: 5px;
-    color: white;
-    text-align: left;
-    font-weight: bold;
-    background-color: #000000;
-}
-.ForrestTable td {
-    color: black;
-    background-color: #f0f0ff;
-}
-.ForrestTable th { text-align: center; }
-/**
- * Page Header
- */
-
-#top {
-    position: relative;
-    float: left;
-    width: 100%;
-    background: #294563; /* if you want a background in the header, put it here */
-}
-
-#top .breadtrail {
-    background: #CFDCED;
-    color: black;
-    border-bottom: solid 1px white;
-    padding: 3px 10px;
-    font-size: 75%;
-}
-#top .breadtrail a { color: black; }
-
-#top .header {
-    float: left;
-    width: 100%;
-    background: url("images/header_white_line.gif") repeat-x bottom;
-}
-
-#top .grouplogo {
-    padding: 7px 0 10px 10px;
-    float: left;
-    text-align: left;
-}
-#top .projectlogo {
-    padding: 7px 0 10px 10px;
-    float: left;
-    width: 33%;
-    text-align: right;
-}
-#top .projectlogoA1 {
-    padding: 7px 0 10px 10px;
-    float: right;
-}
-html>body #top .searchbox {
-    bottom: 0px;
-}
-#top .searchbox {
-    position: absolute;
-    right: 10px;
-    height: 42px;
-    font-size: 70%;
-    white-space: nowrap;
-    text-align: right;
-    color: white;
-    background-color: #000000;
-    z-index:0;
-    background-image: url(images/rc-t-l-5-1header-2searchbox-3searchbox.png);
-    background-repeat: no-repeat;
-    background-position: top left;
-    bottom: -1px; /* compensate for IE rendering issue */
-}
-
-#top .searchbox form {
-    padding: 5px 10px;
-    margin: 0;
-}
-#top .searchbox p {
-    padding: 0 0 2px 0;
-    margin: 0;
-}
-#top .searchbox input {
-    font-size: 100%;
-}
-
-#tabs {
-    clear: both;
-    padding-left: 10px;
-    margin: 0;
-    list-style: none;
-}
-/*    background: #CFDCED url("images/tab-right.gif") no-repeat right top;*/
-#tabs li {
-    float: left;
-    background-image: url(images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-    background-color: #000000;
-    margin: 0 3px 0 0;
-    padding: 0;
-}
-
-/*background: url("images/tab-left.gif") no-repeat left top;*/
-#tabs li a {
-    float: left;
-    display: block;
-    font-family: verdana, arial, sans-serif;
-    text-decoration: none;
-    color: black;
-    white-space: nowrap;
-    background-image: url(images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png);
-    background-repeat: no-repeat;
-    background-position: top left;
-    padding: 5px 15px 4px;
-    width: .1em; /* IE/Win fix */
-}
-
-#tabs li a:hover {
-   
-    cursor: pointer;
-    text-decoration:underline;
-}
-
-#tabs > li a { width: auto; } /* Rest of IE/Win fix */
-
-/* Commented Backslash Hack hides rule from IE5-Mac \*/
-#tabs a { float: none; }
-/* End IE5-Mac hack */
-
-#top .header .current {
-    background-color: #4C6C8F;
-    background-image: url(images/rc-t-r-5-1header-2tab-selected-3tab-selected.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-}
-#top .header .current a {
-    font-weight: bold;
-    padding-bottom: 5px;
-    color: white;
-    background-image: url(images/rc-t-l-5-1header-2tab-selected-3tab-selected.png);
-    background-repeat: no-repeat;
-    background-position: top left;
-}
-#publishedStrip {
-    padding-right: 10px;
-    padding-left: 20px;
-    padding-top: 3px;
-    padding-bottom:3px;
-    color: #ffffff;
-    font-size : 60%;
-    font-weight: bold;
-    background-color: #4C6C8F;
-    text-align:right;
-}
-
-#level2tabs {
-margin: 0;
-float:left;
-position:relative;
-
-}
-
-
-
-#level2tabs  a:hover {
-   
-    cursor: pointer;
-    text-decoration:underline;
-    
-}
-
-#level2tabs  a{
-   
-    cursor: pointer;
-    text-decoration:none;
-    background-image: url('images/chapter.gif');
-    background-repeat: no-repeat;
-    background-position: center left;
-    padding-left: 6px;
-    margin-left: 6px;
-}
-
-/*
-*    border-top: solid #4C6C8F 15px;
-*/
-#main {
-    position: relative;
-    background: white;
-    clear:both;
-}
-#main .breadtrail {
-    clear:both;
-    position: relative;
-    background: #CFDCED;
-    color: black;
-    border-bottom: solid 1px black;
-    border-top: solid 1px black;
-    padding: 0px 180px;
-    font-size: 75%;
-    z-index:10;
-}
-/**
-* Round corner
-*/
-#roundtop {
-    background-image: url(images/rc-t-r-15-1body-2menu-3menu.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-}
-
-#roundbottom {
-    background-image: url(images/rc-b-r-15-1body-2menu-3menu.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-}
-
-img.corner {
-   width: 15px;
-   height: 15px;
-   border: none;
-   display: block !important;
-}
-
-.roundtopsmall {
-    background-image: url(images/rc-t-r-5-1header-2searchbox-3searchbox.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-}
-
-#roundbottomsmall {
-    background-image: url(images/rc-b-r-5-1header-2tab-selected-3tab-selected.png);
-    background-repeat: no-repeat;
-    background-position: top right;
-}
-
-img.cornersmall {
-   width: 5px;
-   height: 5px;
-   border: none;
-   display: block !important;
-}
-/**
- * Side menu
- */
-#menu a {  font-weight: normal; text-decoration: none;}
-#menu a:visited {  font-weight: normal; }
-#menu a:active {  font-weight: normal; }
-#menu a:hover {  font-weight: normal;  text-decoration:underline;}
-
-#menuarea { width:10em;}
-#menu {
-    position: relative;
-    float: left;
-    width: 160px;
-    padding-top: 0px;
-    top:-18px;
-    left:10px;
-    z-index: 20;
-    background-color: #f90;
-    font-size : 70%;
-    
-}
-
-.menutitle {
-        cursor:pointer;
-        padding: 3px 12px;
-        margin-left: 10px;
-        background-image: url('images/chapter.gif');
-        background-repeat: no-repeat;
-        background-position: center left;
-        font-weight : bold;
-
-        
-}
-
-.menutitle:hover{text-decoration:underline;cursor: pointer;}
-
-#menu .menuitemgroup {
-        margin: 0px 0px 6px 8px;
-        padding: 0px;
-        font-weight : bold; }
-
-#menu .selectedmenuitemgroup{
-        margin: 0px 0px 0px 8px;
-        padding: 0px;
-        font-weight : normal; 
-       
-        }
-
-#menu .menuitem {
-        padding: 2px 0px 1px 13px;
-        background-image: url('images/page.gif');
-        background-repeat: no-repeat;
-        background-position: center left;
-        font-weight : normal;
-        margin-left: 10px;
-}
-
-#menu .menupage {
-        margin: 2px 0px 1px 10px;
-        padding: 0px 3px 0px 12px;
-        background-image: url('images/page.gif');
-        background-repeat: no-repeat;
-        background-position: center left;
-        font-style : normal;
-}
-#menu .menupagetitle {
-        padding: 0px 0px 0px 1px;
-        font-style : normal;
-        border-style: solid;
-        border-width: 1px;
-        margin-right: 10px;
-         
-}
-#menu .menupageitemgroup {
-        padding: 3px 0px 4px 6px;
-        font-style : normal;
-        border-bottom: 1px solid ;
-        border-left: 1px solid ;
-        border-right: 1px solid ;
-        margin-right: 10px;
-}
-#menu .menupageitem {
-        font-style : normal;
-        font-weight : normal;
-        border-width: 0px;
-        font-size : 90%;
-}
-#menu #credit {
-    text-align: center;
-}
-#menu #credit2 {
-    text-align: center;
-    padding: 3px 3px 3px 3px;
-    background-color: #ffffff;
-}
-#menu .searchbox {
-    text-align: center;
-}
-#menu .searchbox form {
-    padding: 3px 3px;
-    margin: 0;
-}
-#menu .searchbox input {
-    font-size: 100%;
-}
-
-#content {
-    padding: 20px 20px 20px 180px;
-    margin: 0;
-    font : small Verdana, Helvetica, sans-serif;
-    font-size : 80%;
-}
-
-#content ul {
-    margin: 0;
-    padding: 0 25px;
-}
-#content li {
-    padding: 0 5px;
-}
-#feedback {
-    color: black;
-    background: #CFDCED;
-    text-align:center;
-    margin-top: 5px;
-}
-#feedback #feedbackto {
-    font-size: 90%;
-    color: black;
-}
-#footer {
-    clear: both;
-    position: relative; /* IE bugfix (http://www.dracos.co.uk/web/css/ie6floatbug/) */
-    width: 100%;
-    background: #CFDCED;
-    border-top: solid 1px #4C6C8F;
-    color: black;
-}
-#footer .copyright {
-    position: relative; /* IE bugfix cont'd */
-    padding: 5px;
-    margin: 0;
-    width: 60%;
-}
-#footer .lastmodified {
-    position: relative; /* IE bugfix cont'd */
-    float: right;
-    width: 30%;
-    padding: 5px;
-    margin: 0;
-    text-align: right;
-}
-#footer a { color: white; }
-
-#footer #logos {
-    text-align: left;
-}
-
-
-/**
- * Misc Styles
- */
-
-acronym { cursor: help; }
-.boxed      { background-color: #a5b6c6;}
-.underlined_5     {border-bottom: solid 5px #4C6C8F;}
-.underlined_10     {border-bottom: solid 10px #4C6C8F;}
-/* ==================== snail trail ============================ */
-
-.trail {
-  position: relative; /* IE bugfix cont'd */
-  font-size: 70%;
-  text-align: right;
-  float: right;
-  margin: -10px 5px 0px 5px;
-  padding: 0;
-}
-
-#motd-area {
-    position:relative;
-    float:right;
-    width: 35%;
-    background-color: #f0f0ff;
-    border: solid 1px #4C6C8F;
-    margin: 0px 0px 10px 10px;
-    padding: 5px;
-}
-
-#minitoc-area {
-    border-top: solid 1px #4C6C8F;
-    border-bottom: solid 1px #4C6C8F;
-    margin: 15px 10% 5px 15px;
-   /* margin-bottom: 15px;
-    margin-left: 15px;
-    margin-right: 10%;*/
-    padding-bottom: 7px;
-    padding-top: 5px;
-}
-.minitoc {
-    list-style-image: url('images/current.gif');
-    font-weight: normal;
-}
-
-.abstract{
-    text-align:justify;
-    }
-
-li p {
-    margin: 0;
-    padding: 0;
-}
-
-.pdflink {
-    position: relative; /* IE bugfix cont'd */
-    float: right;
-    margin: 0px 5px;
-    padding: 0;
-}
-.pdflink br {
-    margin-top: -10px;
-    padding-left: 1px;
-}
-.pdflink a {
-    display: block;
-    font-size: 70%;
-    text-align: center;
-    margin: 0;
-    padding: 0;
-}
-
-.pdflink img {
-    display: block;
-    height: 16px;
-    width: 16px;
-}
-.xmllink {
-    position: relative; /* IE bugfix cont'd */
-    float: right;
-    margin: 0px 5px;
-    padding: 0;
-}
-.xmllink br {
-    margin-top: -10px;
-    padding-left: 1px;
-}
-.xmllink a {
-    display: block;
-    font-size: 70%;
-    text-align: center;
-    margin: 0;
-    padding: 0;
-}
-
-.xmllink img {
-    display: block;
-    height: 16px;
-    width: 16px;
-}
-.podlink {
-    position: relative; /* IE bugfix cont'd */
-    float: right;
-    margin: 0px 5px;
-    padding: 0;
-}
-.podlink br {
-    margin-top: -10px;
-    padding-left: 1px;
-}
-.podlink a {
-    display: block;
-    font-size: 70%;
-    text-align: center;
-    margin: 0;
-    padding: 0;
-}
-
-.podlink img {
-    display: block;
-    height: 16px;
-    width: 16px;
-}
-
-.printlink {
-    position: relative; /* IE bugfix cont'd */
-    float: right;
-}
-.printlink br {
-    margin-top: -10px;
-    padding-left: 1px;
-}
-.printlink a {
-    display: block;
-    font-size: 70%;
-    text-align: center;
-    margin: 0;
-    padding: 0;
-}
-.printlink img {
-    display: block;
-    height: 16px;
-    width: 16px;
-}
-
-p.instruction {
-  display: list-item;
-  list-style-image: url('../images/instruction_arrow.png');
-  list-style-position: outside;
-  margin-left: 2em;
-} 

+ 0 - 2718
docs/zookeeperAdmin.html

@@ -1,2718 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper Administrator's Guide</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Admin &amp; Ops</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menupage">
-<div class="menupagetitle">Administrator's Guide</div>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="zookeeperAdmin.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper Administrator's Guide</h1>
-<h3>A Guide to Deployment and Administration</h3>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#ch_deployment">Deployment</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_systemReq">System Requirements</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_supportedPlatforms">Supported Platforms</a>
-</li>
-<li>
-<a href="#sc_requiredSoftware">Required Software </a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_zkMulitServerSetup">Clustered (Multi-Server) Setup</a>
-</li>
-<li>
-<a href="#sc_singleAndDevSetup">Single Server and Developer Setup</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#ch_administration">Administration</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_designing">Designing a ZooKeeper Deployment</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_CrossMachineRequirements">Cross Machine Requirements</a>
-</li>
-<li>
-<a href="#Single+Machine+Requirements">Single Machine Requirements</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_provisioning">Provisioning</a>
-</li>
-<li>
-<a href="#sc_strengthsAndLimitations">Things to Consider: ZooKeeper Strengths and Limitations</a>
-</li>
-<li>
-<a href="#sc_administering">Administering</a>
-</li>
-<li>
-<a href="#sc_maintenance">Maintenance</a>
-<ul class="minitoc">
-<li>
-<a href="#Ongoing+Data+Directory+Cleanup">Ongoing Data Directory Cleanup</a>
-</li>
-<li>
-<a href="#Debug+Log+Cleanup+%28log4j%29">Debug Log Cleanup (log4j)</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_supervision">Supervision</a>
-</li>
-<li>
-<a href="#sc_monitoring">Monitoring</a>
-</li>
-<li>
-<a href="#sc_logging">Logging</a>
-</li>
-<li>
-<a href="#sc_troubleshooting">Troubleshooting</a>
-</li>
-<li>
-<a href="#sc_configuration">Configuration Parameters</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_minimumConfiguration">Minimum Configuration</a>
-</li>
-<li>
-<a href="#sc_advancedConfiguration">Advanced Configuration</a>
-</li>
-<li>
-<a href="#sc_clusterOptions">Cluster Options</a>
-</li>
-<li>
-<a href="#sc_authOptions">Encryption, Authentication, Authorization Options</a>
-</li>
-<li>
-<a href="#Experimental+Options%2FFeatures">Experimental Options/Features</a>
-</li>
-<li>
-<a href="#Unsafe+Options">Unsafe Options</a>
-</li>
-<li>
-<a href="#Disabling+data+directory+autocreation">Disabling data directory autocreation</a>
-</li>
-<li>
-<a href="#sc_db_existence_validation">Enabling db existence validation</a>
-</li>
-<li>
-<a href="#sc_performance_options">Performance Tuning Options</a>
-</li>
-<li>
-<a href="#Communication+using+the+Netty+framework">Communication using the Netty framework</a>
-</li>
-<li>
-<a href="#sc_adminserver_config">AdminServer configuration</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_zkCommands">ZooKeeper Commands</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_4lw">The Four Letter Words</a>
-</li>
-<li>
-<a href="#sc_adminserver">The AdminServer</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_dataFileManagement">Data File Management</a>
-<ul class="minitoc">
-<li>
-<a href="#The+Data+Directory">The Data Directory</a>
-</li>
-<li>
-<a href="#The+Log+Directory">The Log Directory</a>
-</li>
-<li>
-<a href="#sc_filemanagement">File Management</a>
-</li>
-<li>
-<a href="#Recovery+-+TxnLogToolkit">Recovery - TxnLogToolkit</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_commonProblems">Things to Avoid</a>
-</li>
-<li>
-<a href="#sc_bestPractices">Best Practices</a>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-
-  
-<a name="ch_deployment"></a>
-<h2 class="h3">Deployment</h2>
-<div class="section">
-<p>This section contains information about deploying Zookeeper and
-    covers these topics:</p>
-<ul>
-      
-<li>
-        
-<p>
-<a href="#sc_systemReq">System Requirements</a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#sc_zkMulitServerSetup">Clustered (Multi-Server) Setup</a>
-</p>
-      
-</li>
-
-      
-<li>
-        
-<p>
-<a href="#sc_singleAndDevSetup">Single Server and Developer Setup</a>
-</p>
-      
-</li>
-    
-</ul>
-<p>The first two sections assume you are interested in installing
-    ZooKeeper in a production environment such as a datacenter. The final
-    section covers situations in which you are setting up ZooKeeper on a
-    limited basis - for evaluation, testing, or development - but not in a
-    production environment.</p>
-<a name="sc_systemReq"></a>
-<h3 class="h4">System Requirements</h3>
-<a name="sc_supportedPlatforms"></a>
-<h4>Supported Platforms</h4>
-<p>ZooKeeper consists of multiple components.  Some components are
-        supported broadly, and other components are supported only on a smaller
-        set of platforms.</p>
-<ul>
-          
-<li>
-            
-<p>
-<strong>Client</strong> is the Java client
-            library, used by applications to connect to a ZooKeeper ensemble.
-            </p>
-          
-</li>
-          
-<li>
-            
-<p>
-<strong>Server</strong> is the Java server
-            that runs on the ZooKeeper ensemble nodes.</p>
-          
-</li>
-          
-<li>
-            
-<p>
-<strong>Native Client</strong> is a client
-            implemented in C, similar to the Java client, used by applications
-            to connect to a ZooKeeper ensemble.</p>
-          
-</li>
-          
-<li>
-            
-<p>
-<strong>Contrib</strong> refers to multiple
-            optional add-on components.</p>
-          
-</li>
-        
-</ul>
-<p>The following matrix describes the level of support committed for
-        running each component on different operating system platforms.</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>Support Matrix</caption>
-          
-<title>Support Matrix</title>
-          
-              
-<tr>
-                
-<th>Operating System</th>
-                <th>Client</th>
-                <th>Server</th>
-                <th>Native Client</th>
-                <th>Contrib</th>
-              
-</tr>
-            
-              
-<tr>
-                
-<td>GNU/Linux</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-              
-</tr>
-              
-<tr>
-                
-<td>Solaris</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-                <td>Not Supported</td>
-                <td>Not Supported</td>
-              
-</tr>
-              
-<tr>
-                
-<td>FreeBSD</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-                <td>Not Supported</td>
-                <td>Not Supported</td>
-              
-</tr>
-              
-<tr>
-                
-<td>Windows</td>
-                <td>Development and Production</td>
-                <td>Development and Production</td>
-                <td>Not Supported</td>
-                <td>Not Supported</td>
-              
-</tr>
-              
-<tr>
-                
-<td>Mac OS X</td>
-                <td>Development Only</td>
-                <td>Development Only</td>
-                <td>Not Supported</td>
-                <td>Not Supported</td>
-              
-</tr>
-            
-        
-</table>
-<p>For any operating system not explicitly mentioned as supported in
-        the matrix, components may or may not work.  The ZooKeeper community
-        will fix obvious bugs that are reported for other platforms, but there
-        is no full support.</p>
-<a name="sc_requiredSoftware"></a>
-<h4>Required Software </h4>
-<p>ZooKeeper runs in Java, release 1.8 or greater (JDK 8 or
-        greater, FreeBSD support requires openjdk8).  It runs as an
-        <em>ensemble</em> of ZooKeeper servers. Three
-        ZooKeeper servers is the minimum recommended size for an
-        ensemble, and we also recommend that they run on separate
-        machines. At Yahoo!, ZooKeeper is usually deployed on
-        dedicated RHEL boxes, with dual-core processors, 2GB of RAM,
-        and 80GB IDE hard drives.</p>
-<a name="sc_zkMulitServerSetup"></a>
-<h3 class="h4">Clustered (Multi-Server) Setup</h3>
-<p>For reliable ZooKeeper service, you should deploy ZooKeeper in a
-      cluster known as an <em>ensemble</em>. As long as a majority
-      of the ensemble are up, the service will be available. Because Zookeeper
-      requires a majority, it is best to use an
-      odd number of machines. For example, with four machines ZooKeeper can
-      only handle the failure of a single machine; if two machines fail, the
-      remaining two machines do not constitute a majority. However, with five
-      machines ZooKeeper can handle the failure of two machines. </p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-         
-<p>
-            As mentioned in the
-            <a href="zookeeperStarted.html">ZooKeeper Getting Started Guide</a>
-            , a minimum of three servers are required for a fault tolerant
-            clustered setup, and it is strongly recommended that you have an
-            odd number of servers.
-         </p>
-         
-<p>Usually three servers is more than enough for a production
-            install, but for maximum reliability during maintenance, you may
-            wish to install five servers. With three servers, if you perform
-            maintenance on one of them, you are vulnerable to a failure on one
-            of the other two servers during that maintenance. If you have five
-            of them running, you can take one down for maintenance, and know
-            that you're still OK if one of the other four suddenly fails.
-         </p>
-         
-<p>Your redundancy considerations should include all aspects of
-            your environment. If you have three ZooKeeper servers, but their
-            network cables are all plugged into the same network switch, then
-            the failure of that switch will take down your entire ensemble.
-         </p>
-      
-</div>
-</div>
-<p>Here are the steps to setting a server that will be part of an
-      ensemble. These steps should be performed on every host in the
-      ensemble:</p>
-<ol>
-        
-<li>
-          
-<p>Install the Java JDK. You can use the native packaging system
-          for your system, or download the JDK from:</p>
-
-          
-<p>
-<a href="http://java.sun.com/javase/downloads/index.jsp">http://java.sun.com/javase/downloads/index.jsp</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>Set the Java heap size. This is very important to avoid
-          swapping, which will seriously degrade ZooKeeper performance. To
-          determine the correct value, use load tests, and make sure you are
-          well below the usage limit that would cause you to swap. Be
-          conservative - use a maximum heap size of 3GB for a 4GB
-          machine.</p>
-        
-</li>
-
-        
-<li>
-          
-<p>Install the ZooKeeper Server Package. It can be downloaded
-            from:
-          </p>
-          
-<p>
-            
-<a href="http://zookeeper.apache.org/releases.html">
-              http://zookeeper.apache.org/releases.html
-            </a>
-          
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>Create a configuration file. This file can be called anything.
-          Use the following settings as a starting point:</p>
-
-          
-<pre class="code">
-tickTime=2000
-dataDir=/var/lib/zookeeper/
-clientPort=2181
-initLimit=5
-syncLimit=2
-server.1=zoo1:2888:3888
-server.2=zoo2:2888:3888
-server.3=zoo3:2888:3888</pre>
-
-          
-<p>You can find the meanings of these and other configuration
-          settings in the section <a href="#sc_configuration">Configuration Parameters</a>. A word
-          though about a few here:</p>
-
-          
-<p>Every machine that is part of the ZooKeeper ensemble should know
-          about every other machine in the ensemble. You accomplish this with
-          the series of lines of the form <strong>server.id=host:port:port</strong>. The parameters <strong>host</strong> and <strong>port</strong> are straightforward. You attribute the
-          server id to each machine by creating a file named
-          <span class="codefrag filename">myid</span>, one for each server, which resides in
-          that server's data directory, as specified by the configuration file
-          parameter <strong>dataDir</strong>.</p>
-</li>
-
-          
-<li>
-<p>The myid file
-          consists of a single line containing only the text of that machine's
-          id. So <span class="codefrag filename">myid</span> of server 1 would contain the text
-          "1" and nothing else. The id must be unique within the
-          ensemble and should have a value between 1 and 255. <strong>IMPORTANT:</strong> if you
-          enable extended features such as TTL Nodes (see below) the id must be
-          between 1 and 254 due to internal limitations.</p>
-        
-</li>
-
-        
-<li>
-          
-<p>Create an initialization marker file <span class="codefrag filename">initialize</span>
-            in the same directory as <span class="codefrag filename">myid</span>. This file indicates
-            that an empty data directory is expected. When present, an empty data base
-            is created and the marker file deleted. When not present, an empty data
-            directory will mean this peer will not have voting rights and it will not
-            populate the data directory until it communicates with an active leader.
-            Intended use is to only create this file when bringing up a new
-            ensemble. </p>
-        
-</li>
-        
-<li>
-          
-<p>If your configuration file is set up, you can start a
-          ZooKeeper server:</p>
-
-          
-<p>
-<span class="codefrag computeroutput">$ java -cp zookeeper.jar:lib/slf4j-api-1.7.5.jar:lib/slf4j-log4j12-1.7.5.jar:lib/log4j-1.2.17.jar:conf \
-              org.apache.zookeeper.server.quorum.QuorumPeerMain zoo.cfg
-          </span>
-</p>
-          
-          
-<p>QuorumPeerMain starts a ZooKeeper server,
-            <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a>
-            management beans are also registered which allows
-            management through a JMX management console. 
-            The <a href="zookeeperJMX.html">ZooKeeper JMX
-            document</a> contains details on managing ZooKeeper with JMX.
-          </p>
-
-          
-<p>See the script <em>bin/zkServer.sh</em>,
-            which is included in the release, for an example
-            of starting server instances.</p>
-
-        
-</li>
-
-        
-<li>
-          
-<p>Test your deployment by connecting to the hosts:</p>
-
-          
-<p>In Java, you can run the following command to execute
-          simple operations:</p>
-
-          
-<p>
-<span class="codefrag computeroutput">$ bin/zkCli.sh -server 127.0.0.1:2181</span>
-</p>
-        
-</li>
-      
-</ol>
-<a name="sc_singleAndDevSetup"></a>
-<h3 class="h4">Single Server and Developer Setup</h3>
-<p>If you want to setup ZooKeeper for development purposes, you will
-      probably want to setup a single server instance of ZooKeeper, and then
-      install either the Java or C client-side libraries and bindings on your
-      development machine.</p>
-<p>The steps to setting up a single server instance are the similar
-      to the above, except the configuration file is simpler. You can find the
-      complete instructions in the <a href="zookeeperStarted.html#sc_InstallingSingleMode">Installing and
-      Running ZooKeeper in Single Server Mode</a> section of the <a href="zookeeperStarted.html">ZooKeeper Getting Started
-      Guide</a>.</p>
-<p>For information on installing the client side libraries, refer to
-      the <a href="zookeeperProgrammers.html#Bindings">Bindings</a>
-      section of the <a href="zookeeperProgrammers.html">ZooKeeper
-      Programmer's Guide</a>.</p>
-</div>
-
-  
-<a name="ch_administration"></a>
-<h2 class="h3">Administration</h2>
-<div class="section">
-<p>This section contains information about running and maintaining
-    ZooKeeper and covers these topics: </p>
-<ul>
-        
-<li>
-          
-<p>
-<a href="#sc_designing">Designing a ZooKeeper Deployment</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_provisioning">Provisioning</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_strengthsAndLimitations">Things to Consider: ZooKeeper Strengths and Limitations</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_administering">Administering</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_maintenance">Maintenance</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_supervision">Supervision</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_monitoring">Monitoring</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_logging">Logging</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_troubleshooting">Troubleshooting</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_configuration">Configuration Parameters</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_zkCommands">ZooKeeper Commands</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_dataFileManagement">Data File Management</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_commonProblems">Things to Avoid</a>
-</p>
-        
-</li>
-
-        
-<li>
-          
-<p>
-<a href="#sc_bestPractices">Best Practices</a>
-</p>
-        
-</li>
-      
-</ul>
-<a name="sc_designing"></a>
-<h3 class="h4">Designing a ZooKeeper Deployment</h3>
-<p>The reliability of ZooKeeper rests on two basic assumptions.</p>
-<ol>
-        
-<li>
-<p> Only a minority of servers in a deployment
-            will fail. <em>Failure</em> in this context
-            means a machine crash, or some error in the network that
-            partitions a server off from the majority.</p>
-        
-</li>
-        
-<li>
-<p> Deployed machines operate correctly. To
-            operate correctly means to execute code correctly, to have
-            clocks that work properly, and to have storage and network
-            components that perform consistently.</p>
-        
-</li>
-      
-</ol>
-<p>The sections below contain considerations for ZooKeeper
-      administrators to maximize the probability for these assumptions
-      to hold true. Some of these are cross-machines considerations,
-      and others are things you should consider for each and every
-      machine in your deployment.</p>
-<a name="sc_CrossMachineRequirements"></a>
-<h4>Cross Machine Requirements</h4>
-<p>For the ZooKeeper service to be active, there must be a
-        majority of non-failing machines that can communicate with
-        each other. To create a deployment that can tolerate the
-        failure of F machines, you should count on deploying 2xF+1
-        machines.  Thus, a deployment that consists of three machines
-        can handle one failure, and a deployment of five machines can
-        handle two failures. Note that a deployment of six machines
-        can only handle two failures since three machines is not a
-        majority.  For this reason, ZooKeeper deployments are usually
-        made up of an odd number of machines.</p>
-<p>To achieve the highest probability of tolerating a failure
-        you should try to make machine failures independent. For
-        example, if most of the machines share the same switch,
-        failure of that switch could cause a correlated failure and
-        bring down the service. The same holds true of shared power
-        circuits, cooling systems, etc.</p>
-<a name="Single+Machine+Requirements"></a>
-<h4>Single Machine Requirements</h4>
-<p>If ZooKeeper has to contend with other applications for
-        access to resources like storage media, CPU, network, or
-        memory, its performance will suffer markedly.  ZooKeeper has
-        strong durability guarantees, which means it uses storage
-        media to log changes before the operation responsible for the
-        change is allowed to complete. You should be aware of this
-        dependency then, and take great care if you want to ensure
-        that ZooKeeper operations aren&rsquo;t held up by your media. Here
-        are some things you can do to minimize that sort of
-        degradation:
-      </p>
-<ul>
-        
-<li>
-          
-<p>ZooKeeper's transaction log must be on a dedicated
-            device. (A dedicated partition is not enough.) ZooKeeper
-            writes the log sequentially, without seeking Sharing your
-            log device with other processes can cause seeks and
-            contention, which in turn can cause multi-second
-            delays.</p>
-        
-</li>
-
-        
-<li>
-          
-<p>Do not put ZooKeeper in a situation that can cause a
-            swap. In order for ZooKeeper to function with any sort of
-            timeliness, it simply cannot be allowed to swap.
-            Therefore, make certain that the maximum heap size given
-            to ZooKeeper is not bigger than the amount of real memory
-            available to ZooKeeper.  For more on this, see
-            <a href="#sc_commonProblems">Things to Avoid</a>
-            below. </p>
-        
-</li>
-      
-</ul>
-<a name="sc_provisioning"></a>
-<h3 class="h4">Provisioning</h3>
-<p></p>
-<a name="sc_strengthsAndLimitations"></a>
-<h3 class="h4">Things to Consider: ZooKeeper Strengths and Limitations</h3>
-<p></p>
-<a name="sc_administering"></a>
-<h3 class="h4">Administering</h3>
-<p></p>
-<a name="sc_maintenance"></a>
-<h3 class="h4">Maintenance</h3>
-<p>Little long term maintenance is required for a ZooKeeper
-        cluster however you must be aware of the following:</p>
-<a name="Ongoing+Data+Directory+Cleanup"></a>
-<h4>Ongoing Data Directory Cleanup</h4>
-<p>The ZooKeeper <a href="#var_datadir">Data
-          Directory</a> contains files which are a persistent copy
-          of the znodes stored by a particular serving ensemble. These
-          are the snapshot and transactional log files. As changes are
-          made to the znodes these changes are appended to a
-          transaction log. Occasionally, when a log grows large, a
-          snapshot of the current state of all znodes will be written
-          to the filesystem and a new transaction log file is created
-          for future transactions. During snapshotting, ZooKeeper may
-          continue appending incoming transactions to the old log file.
-          Therefore, some transactions which are newer than a snapshot
-          may be found in the last transaction log preceding the
-          snapshot.
-        </p>
-<p>A ZooKeeper server <strong>will not remove
-        old snapshots and log files</strong> when using the default
-        configuration (see autopurge below), this is the
-        responsibility of the operator. Every serving environment is
-        different and therefore the requirements of managing these
-        files may differ from install to install (backup for example).
-        </p>
-<p>The PurgeTxnLog utility implements a simple retention
-        policy that administrators can use. The <a href="api/index.html">API docs</a> contains details on
-        calling conventions (arguments, etc...).
-        </p>
-<p>In the following example the last count snapshots and
-        their corresponding logs are retained and the others are
-        deleted.  The value of &lt;count&gt; should typically be
-        greater than 3 (although not required, this provides 3 backups
-        in the unlikely event a recent log has become corrupted). This
-        can be run as a cron job on the ZooKeeper server machines to
-        clean up the logs daily.</p>
-<pre class="code"> java -cp zookeeper.jar:lib/slf4j-api-1.7.5.jar:lib/slf4j-log4j12-1.7.5.jar:lib/log4j-1.2.17.jar:conf org.apache.zookeeper.server.PurgeTxnLog &lt;dataDir&gt; &lt;snapDir&gt; -n &lt;count&gt;</pre>
-<p>Automatic purging of the snapshots and corresponding
-        transaction logs was introduced in version 3.4.0 and can be
-        enabled via the following configuration parameters <strong>autopurge.snapRetainCount</strong> and <strong>autopurge.purgeInterval</strong>. For more on
-        this, see <a href="#sc_advancedConfiguration">Advanced Configuration</a>
-        below.</p>
-<a name="Debug+Log+Cleanup+%28log4j%29"></a>
-<h4>Debug Log Cleanup (log4j)</h4>
-<p>See the section on <a href="#sc_logging">logging</a> in this document. It is
-        expected that you will setup a rolling file appender using the
-        in-built log4j feature. The sample configuration file in the
-        release tar's conf/log4j.properties provides an example of
-        this.
-        </p>
-<a name="sc_supervision"></a>
-<h3 class="h4">Supervision</h3>
-<p>You will want to have a supervisory process that manages
-      each of your ZooKeeper server processes (JVM). The ZK server is
-      designed to be "fail fast" meaning that it will shutdown
-      (process exit) if an error occurs that it cannot recover
-      from. As a ZooKeeper serving cluster is highly reliable, this
-      means that while the server may go down the cluster as a whole
-      is still active and serving requests. Additionally, as the
-      cluster is "self healing" the failed server once restarted will
-      automatically rejoin the ensemble w/o any manual
-      interaction.</p>
-<p>Having a supervisory process such as <a href="http://cr.yp.to/daemontools.html">daemontools</a> or
-      <a href="http://en.wikipedia.org/wiki/Service_Management_Facility">SMF</a>
-      (other options for supervisory process are also available, it's
-      up to you which one you would like to use, these are just two
-      examples) managing your ZooKeeper server ensures that if the
-      process does exit abnormally it will automatically be restarted
-      and will quickly rejoin the cluster.</p>
-<p>It is also recommended to configure the ZooKeeper server process to
-      terminate and dump its heap if an
-      <span class="codefrag computeroutput">OutOfMemoryError</span> occurs.  This is achieved
-      by launching the JVM with the following arguments on Linux and Windows
-      respectively.  The <span class="codefrag filename">zkServer.sh</span> and
-      <span class="codefrag filename">zkServer.cmd</span> scripts that ship with ZooKeeper set
-      these options.
-      </p>
-<pre class="code">-XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -9 %p'</pre>
-<pre class="code">"-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%%%p /t /f"</pre>
-<a name="sc_monitoring"></a>
-<h3 class="h4">Monitoring</h3>
-<p>The ZooKeeper service can be monitored in one of two
-      primary ways; 1) the command port through the use of <a href="#sc_zkCommands">4 letter words</a> and 2) <a href="zookeeperJMX.html">JMX</a>. See the appropriate section for
-      your environment/requirements.</p>
-<a name="sc_logging"></a>
-<h3 class="h4">Logging</h3>
-<p>
-        ZooKeeper uses <strong><a href="http://www.slf4j.org">SLF4J</a></strong>
-        version 1.7.5 as its logging infrastructure. For backward compatibility it is bound to
-        <strong>LOG4J</strong> but you can use
-        <strong><a href="http://logback.qos.ch/">LOGBack</a></strong>
-        or any other supported logging framework of your choice.
-    </p>
-<p>
-        The ZooKeeper default <span class="codefrag filename">log4j.properties</span>
-        file resides in the <span class="codefrag filename">conf</span> directory. Log4j requires that
-        <span class="codefrag filename">log4j.properties</span> either be in the working directory
-        (the directory from which ZooKeeper is run) or be accessible from the classpath.
-    </p>
-<p>For more information about SLF4J, see
-      <a href="http://www.slf4j.org/manual.html">its manual</a>.</p>
-<p>For more information about LOG4J, see
-      <a href="http://logging.apache.org/log4j/1.2/manual.html#defaultInit">Log4j Default Initialization Procedure</a> 
-      of the log4j manual.</p>
-<a name="sc_troubleshooting"></a>
-<h3 class="h4">Troubleshooting</h3>
-<dl>
-		
-<dt>
-<term> Server not coming up because of file corruption</term>
-</dt>
-<dd>
-<p>A server might not be able to read its database and fail to come up because of 
-		some file corruption in the transaction logs of the ZooKeeper server. You will
-		see some IOException on loading ZooKeeper database. In such a case,
-		make sure all the other servers in your ensemble are up and  working. Use "stat" 
-		command on the command port to see if they are in good health. After you have verified that
-		all the other servers of the ensemble are up, you can go ahead and clean the database
-		of the corrupt server. Delete all the files in datadir/version-2 and datalogdir/version-2/.
-		Restart the server.
-		</p>
-</dd>
-		
-</dl>
-<a name="sc_configuration"></a>
-<h3 class="h4">Configuration Parameters</h3>
-<p>ZooKeeper's behavior is governed by the ZooKeeper configuration
-      file. This file is designed so that the exact same file can be used by
-      all the servers that make up a ZooKeeper server assuming the disk
-      layouts are the same. If servers use different configuration files, care
-      must be taken to ensure that the list of servers in all of the different
-      configuration files match.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-        
-<p>In 3.5.0 and later, some of these parameters should be placed in
-         a dynamic configuration file. If they are placed in the static
-         configuration file, ZooKeeper will automatically move them over to the
-         dynamic configuration file. See <a href="zookeeperReconfig.html">
-         Dynamic Reconfiguration</a> for more information.</p>
-      
-</div>
-</div>
-<a name="sc_minimumConfiguration"></a>
-<h4>Minimum Configuration</h4>
-<p>Here are the minimum configuration keywords that must be defined
-        in the configuration file:</p>
-<dl>
-          
-<dt>
-<term>clientPort</term>
-</dt>
-<dd>
-<p>the port to listen for client connections; that is, the
-              port that clients attempt to connect to.</p>
-</dd>
-
-          
-<dt>
-<term>secureClientPort</term>
-</dt>
-<dd>
-<p>the port to listen on for secure client connections using SSL.
-
-              <strong>clientPort</strong> specifies
-                the port for plaintext connections while <strong>
-                  secureClientPort</strong> specifies the port for SSL
-                connections. Specifying both enables mixed-mode while omitting
-                either will disable that mode.</p>
-<p>Note that SSL feature will be enabled when user plugs-in
-                zookeeper.serverCnxnFactory, zookeeper.clientCnxnSocket as Netty.</p>
-</dd>
-
-          
-<dt>
-<term>dataDir</term>
-</dt>
-<dd>
-<p>the location where ZooKeeper will store the in-memory
-              database snapshots and, unless specified otherwise, the
-              transaction log of updates to the database.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-                
-<p>Be careful where you put the transaction log. A
-                dedicated transaction log device is key to consistent good
-                performance. Putting the log on a busy device will adversely
-                effect performance.</p>
-              
-</div>
-</div>
-</dd>
-
-          
-<dt>
-<term>tickTime</term>
-</dt>
-<dd>
-<p>the length of a single tick, which is the basic time unit
-              used by ZooKeeper, as measured in milliseconds. It is used to
-              regulate heartbeats, and timeouts. For example, the minimum
-              session timeout will be two ticks.</p>
-</dd>
-        
-</dl>
-<a name="sc_advancedConfiguration"></a>
-<h4>Advanced Configuration</h4>
-<p>The configuration settings in the section are optional. You can
-        use them to further fine tune the behaviour of your ZooKeeper servers.
-        Some can also be set using Java system properties, generally of the
-        form <em>zookeeper.keyword</em>. The exact system
-        property, when available, is noted below.</p>
-<dl>
-          
-<dt>
-<term>dataLogDir</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>This option will direct the machine to write the
-              transaction log to the <strong>dataLogDir</strong> rather than the <strong>dataDir</strong>. This allows a dedicated log
-              device to be used, and helps avoid competition between logging
-              and snapshots.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-                
-<p>Having a dedicated log device has a large impact on
-                throughput and stable latencies. It is highly recommended to
-                dedicate a log device and set <strong>dataLogDir</strong> to point to a directory on
-                that device, and then make sure to point <strong>dataDir</strong> to a directory
-                <em>not</em> residing on that device.</p>
-              
-</div>
-</div>
-</dd>
-
-          
-<dt>
-<term>globalOutstandingLimit</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.globalOutstandingLimit.</strong>)</p>
-<p>Clients can submit requests faster than ZooKeeper can
-              process them, especially if there are a lot of clients. To
-              prevent ZooKeeper from running out of memory due to queued
-              requests, ZooKeeper will throttle clients so that there is no
-              more than globalOutstandingLimit outstanding requests in the
-              system. The default limit is 1,000.</p>
-</dd>
-
-          
-<dt>
-<term>preAllocSize</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.preAllocSize</strong>)</p>
-<p>To avoid seeks ZooKeeper allocates space in the
-              transaction log file in blocks of preAllocSize kilobytes. The
-              default block size is 64M. One reason for changing the size of
-              the blocks is to reduce the block size if snapshots are taken
-              more often. (Also, see <strong>snapCount</strong>).</p>
-</dd>
-
-          
-<dt>
-<term>snapCount</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.snapCount</strong>)</p>
-<p>ZooKeeper records its transactions using snapshots and
-              a transaction log (think write-ahead log).The number of
-              transactions recorded in the transaction log before a snapshot
-              can be taken (and the transaction log rolled) is determined
-              by snapCount. In order to prevent all of the machines in the quorum
-              from taking a snapshot at the same time, each ZooKeeper server
-              will take a snapshot when the number of transactions in the transaction log
-              reaches a runtime generated random value in the [snapCount/2+1, snapCount] 
-              range.The default snapCount is 100,000.</p>
-</dd>
-
-          
-<dt>
-<term>maxClientCnxns</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Limits the number of concurrent connections (at the socket 
-              level) that a single client, identified by IP address, may make
-              to a single member of the ZooKeeper ensemble. This is used to 
-              prevent certain classes of DoS attacks, including file 
-              descriptor exhaustion. The default is 60. Setting this to 0
-              entirely removes the limit on concurrent connections.</p>
-</dd>
-
-           
-<dt>
-<term>clientPortAddress</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> the
-               address (ipv4, ipv6 or hostname) to listen for client
-               connections; that is, the address that clients attempt
-               to connect to. This is optional, by default we bind in
-               such a way that any connection to the <strong>clientPort</strong> for any
-               address/interface/nic on the server will be
-               accepted.</p>
-</dd>
-
-          
-<dt>
-<term>minSessionTimeout</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.3.0:</strong> the
-              minimum session timeout in milliseconds that the server
-              will allow the client to negotiate. Defaults to 2 times
-              the <strong>tickTime</strong>.</p>
-</dd>
-
-          
-<dt>
-<term>maxSessionTimeout</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.3.0:</strong> the
-              maximum session timeout in milliseconds that the server
-              will allow the client to negotiate. Defaults to 20 times
-              the <strong>tickTime</strong>.</p>
-</dd>
-           
-           
-<dt>
-<term>fsync.warningthresholdms</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.fsync.warningthresholdms</strong>)</p>
-<p>
-<strong>New in 3.3.4:</strong> A
-               warning message will be output to the log whenever an
-               fsync in the Transactional Log (WAL) takes longer than
-               this value. The values is specified in milliseconds and
-               defaults to 1000. This value can only be set as a
-               system property.</p>
-</dd>
-
-          
-<dt>
-<term>autopurge.snapRetainCount</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.4.0:</strong> 
-              When enabled, ZooKeeper auto purge feature retains
-              the <strong>autopurge.snapRetainCount</strong> most
-              recent snapshots and the corresponding transaction logs in the 
-              <strong>dataDir</strong> and <strong>dataLogDir</strong> respectively and deletes the rest.
-              Defaults to 3. Minimum value is 3.</p>
-</dd>
-          
-          
-<dt>
-<term>autopurge.purgeInterval</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.4.0:</strong> The
-              time interval in hours for which the purge task has to
-              be triggered. Set to a positive integer (1 and above)
-              to enable the auto purging. Defaults to 0.</p>
-</dd>
-
-          
-<dt>
-<term>syncEnabled</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.observer.syncEnabled</strong>)</p>
-<p>
-<strong>New in 3.4.6, 3.5.0:</strong>
-              The observers now log transaction and write snapshot to disk
-              by default like the participants. This reduces the recovery time
-              of the observers on restart. Set to "false" to disable this
-              feature. Default is "true"</p>
-</dd>
-
-          
-<dt>
-<term>zookeeper.extendedTypesEnabled</term>
-</dt>
-<dd>
-<p>(Java system property only: <strong>zookeeper.extendedTypesEnabled</strong>)</p>
-<p>
-<strong>New in 3.5.4, 3.6.0:</strong> Define to "true" to enable
-              extended features such as the creation of <a href="zookeeperProgrammers.html#TTL+Nodes">TTL Nodes</a>.
-              They are disabled by default. IMPORTANT: when enabled server IDs must
-              be less than 255 due to internal limitations.
-              </p>
-</dd>
-
-          
-<dt>
-<term>zookeeper.emulate353TTLNodes</term>
-</dt>
-<dd>
-<p>(Java system property only: <strong>zookeeper.emulate353TTLNodes</strong>)</p>
-<p>
-<strong>New in 3.5.4, 3.6.0:</strong> Due to
-                <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-2901">ZOOKEEPER-2901</a> TTL nodes
-                created in version 3.5.3 are not supported in 3.5.4/3.6.0. However, a workaround is provided via the
-                zookeeper.emulate353TTLNodes system property. If you used TTL nodes in ZooKeeper 3.5.3 and need to maintain
-                compatibility set <strong>zookeeper.emulate353TTLNodes</strong> to "true" in addition to
-                <strong>zookeeper.extendedTypesEnabled</strong>. NOTE: due to the bug, server IDs
-                must be 127 or less. Additionally, the maximum support TTL value is 1099511627775 which is smaller
-                than what was allowed in 3.5.3 (1152921504606846975)</p>
-</dd>
-
-        
-</dl>
-<a name="sc_clusterOptions"></a>
-<h4>Cluster Options</h4>
-<p>The options in this section are designed for use with an ensemble
-        of servers -- that is, when deploying clusters of servers.</p>
-<dl>
-          
-<dt>
-<term>electionAlg</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Election implementation to use. A value of "1" corresponds to the
-              non-authenticated UDP-based version of fast leader election, "2"
-              corresponds to the authenticated UDP-based version of fast
-              leader election, and "3" corresponds to TCP-based version of
-              fast leader election. Currently, algorithm 3 is the default.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-              
-<p> The implementations of leader election 1, and 2 are now
-              <strong> deprecated </strong>. We have the intention
-              of removing them in the next release, at which point only the 
-              FastLeaderElection will be available. 
-              </p>
-              
-</div>
-</div>
-</dd>
-
-          
-<dt>
-<term>initLimit</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Amount of time, in ticks (see <a href="#id_tickTime">tickTime</a>), to allow followers to
-              connect and sync to a leader. Increased this value as needed, if
-              the amount of data managed by ZooKeeper is large.</p>
-</dd>
-
-          
-<dt>
-<term>leaderServes</term>
-</dt>
-<dd>
-<p>(Java system property: zookeeper.<strong>leaderServes</strong>)</p>
-<p>Leader accepts client connections. Default value is "yes".
-              The leader machine coordinates updates. For higher update
-              throughput at the slight expense of read throughput the leader
-              can be configured to not accept clients and focus on
-              coordination. The default to this option is yes, which means
-              that a leader will accept client connections.</p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-                
-<p>Turning on leader selection is highly recommended when
-                you have more than three ZooKeeper servers in an ensemble.</p>
-              
-</div>
-</div>
-</dd>
-
-          
-<dt>
-<term>server.x=[hostname]:nnnnn[:nnnnn], etc</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>servers making up the ZooKeeper ensemble. When the server
-              starts up, it determines which server it is by looking for the
-              file <span class="codefrag filename">myid</span> in the data directory. That file
-              contains the server number, in ASCII, and it should match
-              <strong>x</strong> in <strong>server.x</strong> in the left hand side of this
-              setting.</p>
-<p>The list of servers that make up ZooKeeper servers that is
-              used by the clients must match the list of ZooKeeper servers
-              that each ZooKeeper server has.</p>
-<p>There are two port numbers <strong>nnnnn</strong>. 
-              The first followers use to connect to the leader, and the second is for 
-              leader election. If you want to test multiple servers on a single machine, then
-              different ports can be used for each server.</p>
-</dd>
-
-          
-<dt>
-<term>syncLimit</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Amount of time, in ticks (see <a href="#id_tickTime">tickTime</a>), to allow followers to sync
-              with ZooKeeper. If followers fall too far behind a leader, they
-              will be dropped.</p>
-</dd>
-
-          
-<dt>
-<term>group.x=nnnnn[:nnnnn]</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Enables a hierarchical quorum construction."x" is a group identifier
-              and the numbers following the "=" sign correspond to server identifiers. 
-              The left-hand side of the assignment is a colon-separated list of server
-              identifiers. Note that groups must be disjoint and the union of all groups
-              must be the ZooKeeper ensemble. </p>
-<p> You will find an example <a href="zookeeperHierarchicalQuorums.html">here</a>
-              
-</p>
-</dd>
-
-          
-<dt>
-<term>weight.x=nnnnn</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>Used along with "group", it assigns a weight to a server when
-              forming quorums. Such a value corresponds to the weight of a server
-              when voting. There are a few parts of ZooKeeper that require voting
-              such as leader election and the atomic broadcast protocol. By default
-              the weight of server is 1. If the configuration defines groups, but not
-              weights, then a value of 1 will be assigned to all servers.  
-              </p>
-<p> You will find an example <a href="zookeeperHierarchicalQuorums.html">here</a>
-              
-</p>
-</dd>
-          
-          
-<dt>
-<term>cnxTimeout</term>
-</dt>
-<dd>
-<p>(Java system property: zookeeper.<strong>cnxTimeout</strong>)</p>
-<p>Sets the timeout value for opening connections for leader election notifications. 
-              Only applicable if you are using electionAlg 3. 
-              </p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-                
-<p>Default value is 5 seconds.</p>
-              
-</div>
-</div>
-</dd>
-
-          
-<dt>
-<term>standaloneEnabled</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.5.0:</strong>
-              When set to false, a single server can be started in replicated
-              mode, a lone participant can run with observers, and a cluster
-              can reconfigure down to one node, and up from one node. The
-              default is true for backwards compatibility. It can be set
-              using QuorumPeerConfig's setStandaloneEnabled method or by
-              adding "standaloneEnabled=false" or "standaloneEnabled=true"
-              to a server's config file.
-              </p>
-</dd>
-
-          
-<dt>
-<term>reconfigEnabled</term>
-</dt>
-<dd>
-<p>(No Java system property)</p>
-<p>
-<strong>New in 3.5.3:</strong>
-                This controls the enabling or disabling of
-                <a href="zookeeperReconfig.html">
-                  Dynamic Reconfiguration</a> feature. When the feature
-                is enabled, users can perform reconfigure operations through
-                the ZooKeeper client API or through ZooKeeper command line tools
-                assuming users are authorized to perform such operations.
-                When the feature is disabled, no user, including the super user,
-                can perform a reconfiguration. Any attempt to reconfigure will return an error.
-                <strong>"reconfigEnabled"</strong> option can be set as
-                <strong>"reconfigEnabled=false"</strong> or
-                <strong>"reconfigEnabled=true"</strong>
-                to a server's config file, or using QuorumPeerConfig's
-                setReconfigEnabled method. The default value is false.
-
-                If present, the value should be consistent across every server in
-                the entire ensemble. Setting the value as true on some servers and false
-                on other servers will cause inconsistent behavior depending on which server
-                is elected as leader. If the leader has a setting of
-                <strong>"reconfigEnabled=true"</strong>, then the ensemble
-                will have reconfig feature enabled. If the leader has a setting of
-                <strong>"reconfigEnabled=false"</strong>, then the ensemble
-                will have reconfig feature disabled. It is thus recommended to have a consistent
-                value for <strong>"reconfigEnabled"</strong> across servers
-                in the ensemble.
-              </p>
-</dd>
-
-          
-<dt>
-<term>4lw.commands.whitelist</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.4lw.commands.whitelist</strong>)</p>
-<p>
-<strong>New in 3.5.3:</strong>
-                A list of comma separated <a href="#sc_4lw">Four Letter Words</a>
-                commands that user wants to use. A valid Four Letter Words
-                command must be put in this list else ZooKeeper server will
-                not enable the command.
-                By default the whitelist only contains "srvr" command
-                which zkServer.sh uses. The rest of four letter word commands are disabled
-                by default.
-              </p>
-<p>Here's an example of the configuration that enables stat, ruok, conf, and isro
-              command while disabling the rest of Four Letter Words command:</p>
-<pre class="code">
-                4lw.commands.whitelist=stat, ruok, conf, isro
-              </pre>
-<p>If you really need enable all four letter word commands by default, you can use
-                the asterisk option so you don't have to include every command one by one in the list.
-                As an example, this will enable all four letter word commands:
-              </p>
-<pre class="code">
-                4lw.commands.whitelist=*
-              </pre>
-</dd>
-
-          
-<dt>
-<term>tcpKeepAlive</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.tcpKeepAlive</strong>)</p>
-<p>
-<strong>New in 3.5.4:</strong>
-                Setting this to true sets the TCP keepAlive flag on the
-                sockets used by quorum members to perform elections.
-                This will allow for connections between quorum members to
-                remain up when there is network infrastructure that may
-                otherwise break them. Some NATs and firewalls may terminate
-                or lose state for long running or idle connections.</p>
-<p> Enabling this option relies on OS level settings to work
-                properly, check your operating system's options regarding TCP
-                keepalive for more information.  Defaults to
-                <strong>false</strong>.
-              </p>
-</dd>
-
-        
-</dl>
-<p></p>
-<a name="sc_authOptions"></a>
-<h4>Encryption, Authentication, Authorization Options</h4>
-<p>The options in this section allow control over
-        encryption/authentication/authorization performed by the service.</p>
-<dl>
-          
-<dt>
-<term>DigestAuthenticationProvider.superDigest</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.DigestAuthenticationProvider.superDigest</strong>)</p>
-<p>By default this feature is <strong>disabled</strong>
-</p>
-<p>
-<strong>New in 3.2:</strong>
-              Enables a ZooKeeper ensemble administrator to access the
-              znode hierarchy as a "super" user. In particular no ACL
-              checking occurs for a user authenticated as
-              super.</p>
-<p>org.apache.zookeeper.server.auth.DigestAuthenticationProvider
-              can be used to generate the superDigest, call it with
-              one parameter of "super:&lt;password&gt;". Provide the
-              generated "super:&lt;data&gt;" as the system property value
-              when starting each server of the ensemble.</p>
-<p>When authenticating to a ZooKeeper server (from a
-              ZooKeeper client) pass a scheme of "digest" and authdata
-              of "super:&lt;password&gt;". Note that digest auth passes
-              the authdata in plaintext to the server, it would be
-              prudent to use this authentication method only on
-              localhost (not over the network) or over an encrypted
-              connection.</p>
-</dd>
-
-          
-<dt>
-<term>X509AuthenticationProvider.superUser</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.X509AuthenticationProvider.superUser</strong>)</p>
-<p>The SSL-backed way to enable a ZooKeeper ensemble
-              administrator to access the znode hierarchy as a "super" user.
-              When this parameter is set to an X500 principal name, only an
-              authenticated client with that principal will be able to bypass
-              ACL checking and have full privileges to all znodes.</p>
-</dd>
-
-          
-<dt>
-<term>zookeeper.superUser</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.superUser</strong>)</p>
-<p>Similar to <strong>zookeeper.X509AuthenticationProvider.superUser</strong>
-              but is generic for SASL based logins. It stores the name of 
-              a user that can access the znode hierarchy as a "super" user.
-              </p>
-</dd>
-
-          
-<dt>
-<term>ssl.keyStore.location and ssl.keyStore.password</term>
-</dt>
-<dd>
-<p>(Java system properties: <strong>
-                zookeeper.ssl.keyStore.location</strong> and <strong>zookeeper.ssl.keyStore.password</strong>)</p>
-<p>Specifies the file path to a JKS containing the local
-                credentials to be used for SSL connections, and the
-                password to unlock the file.</p>
-</dd>
-
-          
-<dt>
-<term>ssl.trustStore.location and ssl.trustStore.password</term>
-</dt>
-<dd>
-<p>(Java system properties: <strong>
-                zookeeper.ssl.trustStore.location</strong> and <strong>zookeeper.ssl.trustStore.password</strong>)</p>
-<p>Specifies the file path to a JKS containing the remote
-                credentials to be used for SSL connections, and the
-                password to unlock the file.</p>
-</dd>
-
-          
-<dt>
-<term>ssl.authProvider</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.ssl.authProvider</strong>)</p>
-<p>Specifies a subclass of <strong>
-              org.apache.zookeeper.auth.X509AuthenticationProvider</strong>
-              to use for secure client authentication. This is useful in
-              certificate key infrastructures that do not use JKS. It may be
-              necessary to extend <strong>javax.net.ssl.X509KeyManager
-              </strong> and <strong>javax.net.ssl.X509TrustManager</strong>
-              to get the desired behavior from the SSL stack. To configure the
-              ZooKeeper server to use the custom provider for authentication,
-              choose a scheme name for the custom AuthenticationProvider and
-              set the property <strong>zookeeper.authProvider.[scheme]
-              </strong> to the fully-qualified class name of the custom
-              implementation. This will load the provider into the ProviderRegistry.
-              Then set this property <strong>
-              zookeeper.ssl.authProvider=[scheme]</strong> and that provider
-              will be used for secure authentication.</p>
-</dd>
-        
-</dl>
-<a name="Experimental+Options%2FFeatures"></a>
-<h4>Experimental Options/Features</h4>
-<p>New features that are currently considered experimental.</p>
-<dl>
-          
-<dt>
-<term>Read Only Mode Server</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>readonlymode.enabled</strong>)</p>
-<p>
-<strong>New in 3.4.0:</strong>
-              Setting this value to true enables Read Only Mode server
-              support (disabled by default). ROM allows clients
-              sessions which requested ROM support to connect to the
-              server even when the server might be partitioned from
-              the quorum. In this mode ROM clients can still read
-              values from the ZK service, but will be unable to write
-              values and see changes from other clients. See
-              ZOOKEEPER-784 for more details.
-              </p>
-</dd>
-
-        
-</dl>
-<a name="Unsafe+Options"></a>
-<h4>Unsafe Options</h4>
-<p>The following options can be useful, but be careful when you use
-        them. The risk of each is explained along with the explanation of what
-        the variable does.</p>
-<dl>
-          
-<dt>
-<term>forceSync</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.forceSync</strong>)</p>
-<p>Requires updates to be synced to media of the transaction
-              log before finishing processing the update. If this option is
-              set to no, ZooKeeper will not require updates to be synced to
-              the media.</p>
-</dd>
-
-          
-<dt>
-<term>jute.maxbuffer:</term>
-</dt>
-<dd>
-<p>(Java system property:<strong>
-              jute.maxbuffer</strong>)</p>
-<p>This option can only be set as a Java system property.
-              There is no zookeeper prefix on it. It specifies the maximum
-              size of the data that can be stored in a znode. The default is
-              0xfffff, or just under 1M. If this option is changed, the system
-              property must be set on all servers and clients otherwise
-              problems will arise. This is really a sanity check. ZooKeeper is
-              designed to store data on the order of kilobytes in size.</p>
-</dd>
-
-          
-<dt>
-<term>skipACL</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.skipACL</strong>)</p>
-<p>Skips ACL checks. This results in a boost in throughput,
-              but opens up full access to the data tree to everyone.</p>
-</dd>
-
-          
-<dt>
-<term>quorumListenOnAllIPs</term>
-</dt>
-<dd>
-<p>When set to true the ZooKeeper server will listen  
-              for connections from its peers on all available IP addresses,
-              and not only the address configured in the server list of the
-              configuration file. It affects the connections handling the 
-              ZAB protocol and the Fast Leader Election protocol. Default
-              value is <strong>false</strong>.</p>
-</dd>
-
-        
-</dl>
-<a name="Disabling+data+directory+autocreation"></a>
-<h4>Disabling data directory autocreation</h4>
-<p>
-<strong>New in 3.5:</strong> The default
-        behavior of a ZooKeeper server is to automatically create the
-        data directory (specified in the configuration file) when
-        started if that directory does not already exist. This can be
-        inconvenient and even dangerous in some cases. Take the case
-        where a configuration change is made to a running server,
-        wherein the <strong>dataDir</strong> parameter
-        is accidentally changed. When the ZooKeeper server is
-        restarted it will create this non-existent directory and begin
-        serving - with an empty znode namespace. This scenario can
-        result in an effective "split brain" situation (i.e. data in
-        both the new invalid directory and the original valid data
-        store). As such is would be good to have an option to turn off
-        this autocreate behavior. In general for production
-        environments this should be done, unfortunately however the
-        default legacy behavior cannot be changed at this point and
-        therefore this must be done on a case by case basis. This is
-        left to users and to packagers of ZooKeeper distributions.
-        </p>
-<p>When running <strong>zkServer.sh</strong> autocreate can be disabled
-        by setting the environment variable <strong>ZOO_DATADIR_AUTOCREATE_DISABLE</strong> to 1.
-        When running ZooKeeper servers directly from class files this
-        can be accomplished by setting <strong>zookeeper.datadir.autocreate=false</strong> on
-        the java command line, i.e. <strong>-Dzookeeper.datadir.autocreate=false</strong>
-        
-</p>
-<p>When this feature is disabled, and the ZooKeeper server
-        determines that the required directories do not exist it will
-        generate an error and refuse to start.
-        </p>
-<p>A new script <strong>zkServer-initialize.sh</strong> is provided to
-        support this new feature. If autocreate is disabled it is
-        necessary for the user to first install ZooKeeper, then create
-        the data directory (and potentially txnlog directory), and
-        then start the server. Otherwise as mentioned in the previous
-        paragraph the server will not start. Running <strong>zkServer-initialize.sh</strong> will create the
-        required directories, and optionally setup the myid file
-        (optional command line parameter). This script can be used
-        even if the autocreate feature itself is not used, and will
-        likely be of use to users as this (setup, including creation
-        of the myid file) has been an issue for users in the past.
-        Note that this script ensures the data directories exist only,
-        it does not create a config file, but rather requires a config
-        file to be available in order to execute.
-        </p>
-<a name="sc_db_existence_validation"></a>
-<h4>Enabling db existence validation</h4>
-<p>
-<strong>New in 3.6.0:</strong> The default
-          behavior of a ZooKeeper server on startup when no data tree
-          is found is to set zxid to zero and join the quorum as a
-          voting member. This can be dangerous if some event (e.g. a
-          rogue 'rm -rf') has removed the data directory while the
-          server was down since this server may help elect a leader
-          that is missing transactions. Enabling db existence validation
-          will change the behavior on startup when no data tree is
-          found: the server joins the ensemble as a non-voting participant
-          until it is able to sync with the leader and acquire an up-to-date
-          version of the ensemble data. To indicate an empty data tree is
-          expected (ensemble creation), the user should place a file
-          'initialize' in the same directory as 'myid'. This file will
-          be detected and deleted by the server on startup.
-        </p>
-<p> Initialization validation can be enabled when running
-          ZooKeeper servers directly from class files by setting
-          <strong>zookeeper.db.autocreate=false</strong>
-          on the java command line, i.e.
-          <strong>-Dzookeeper.db.autocreate=false</strong>.
-          Running <strong>zkServer-initialize.sh</strong>
-          will create the required initialization file.
-        </p>
-<a name="sc_performance_options"></a>
-<h4>Performance Tuning Options</h4>
-<p>
-<strong>New in 3.5.0:</strong> Several subsystems have been reworked
-        to improve read throughput. This includes multi-threading of the NIO communication subsystem and
-        request processing pipeline (Commit Processor). NIO is the default client/server communication
-        subsystem. Its threading model comprises 1 acceptor thread, 1-N selector threads and 0-M
-        socket I/O worker threads. In the request processing pipeline the system can be configured
-        to process multiple read request at once while maintaining the same consistency guarantee
-        (same-session read-after-write). The Commit Processor threading model comprises 1 main
-        thread and 0-N worker threads.
-        </p>
-<p>
-        The default values are aimed at maximizing read throughput on a dedicated ZooKeeper machine.
-        Both subsystems need to have sufficient amount of threads to achieve peak read throughput.
-        </p>
-<dl>
-
-          
-<dt>
-<term>zookeeper.nio.numSelectorThreads</term>
-</dt>
-<dd>
-<p>(Java system property only: <strong>zookeeper.nio.numSelectorThreads</strong>)
-              </p>
-<p>
-<strong>New in 3.5.0:</strong>
-              Number of NIO selector threads. At least 1 selector thread required.
-              It is recommended to use more than one selector for large numbers
-              of client connections. The default value is sqrt( number of cpu cores / 2 ).
-              </p>
-</dd>
-
-          
-<dt>
-<term>zookeeper.nio.numWorkerThreads</term>
-</dt>
-<dd>
-<p>(Java system property only: <strong>zookeeper.nio.numWorkerThreads</strong>)
-              </p>
-<p>
-<strong>New in 3.5.0:</strong>
-              Number of NIO worker threads. If configured with 0 worker threads, the selector threads
-              do the socket I/O directly. The default value is 2 times the number of cpu cores.
-              </p>
-</dd>
-
-          
-<dt>
-<term>zookeeper.commitProcessor.numWorkerThreads</term>
-</dt>
-<dd>
-<p>(Java system property only: <strong>zookeeper.commitProcessor.numWorkerThreads</strong>)
-              </p>
-<p>
-<strong>New in 3.5.0:</strong>
-              Number of Commit Processor worker threads. If configured with 0 worker threads, the main thread
-              will process the request directly. The default value is the number of cpu cores.
-              </p>
-</dd>
-
-          
-<dt>
-<term>znode.container.checkIntervalMs</term>
-</dt>
-<dd>
-<p>(Java system property only)</p>
-<p>
-<strong>New in 3.6.0:</strong> The
-                time interval in milliseconds for each check of candidate container
-                and ttl nodes. Default is "60000".</p>
-</dd>
-
-          
-<dt>
-<term>znode.container.maxPerMinute</term>
-</dt>
-<dd>
-<p>(Java system property only)</p>
-<p>
-<strong>New in 3.6.0:</strong> The
-                maximum number of container and ttl nodes that can be deleted per
-                minute. This prevents herding during container deletion.
-                Default is "10000".</p>
-</dd>
-        
-</dl>
-<a name="Communication+using+the+Netty+framework"></a>
-<h4>Communication using the Netty framework</h4>
-<p>
-<a href="http://netty.io">Netty</a>
-            is an NIO based client/server communication framework, it
-            simplifies (over NIO being used directly) many of the
-            complexities of network level communication for java
-            applications. Additionally the Netty framework has built
-            in support for encryption (SSL) and authentication
-            (certificates). These are optional features and can be
-            turned on or off individually.
-        </p>
-<p>In versions 3.5+, a ZooKeeper server can use Netty
-            instead of NIO (default option) by setting the environment
-            variable <strong>zookeeper.serverCnxnFactory</strong>
-            to <strong>org.apache.zookeeper.server.NettyServerCnxnFactory</strong>;
-            for the client, set <strong>zookeeper.clientCnxnSocket</strong>
-            to <strong>org.apache.zookeeper.ClientCnxnSocketNetty</strong>.
-        </p>
-<p>
-          TBD - tuning options for netty - currently there are none that are netty specific but we should add some. Esp around max bound on the number of reader worker threads netty creates.
-        </p>
-<p>
-          TBD - how to manage encryption
-        </p>
-<p>
-          TBD - how to manage certificates
-        </p>
-<a name="sc_adminserver_config"></a>
-<h4>AdminServer configuration</h4>
-<p>
-<strong>New in 3.5.0:</strong> The following
-        options are used to configure the <a href="#sc_adminserver">AdminServer</a>.</p>
-<dl>
-          
-<dt>
-<term>admin.enableServer</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.admin.enableServer</strong>)</p>
-<p>Set to "false" to disable the AdminServer.  By default the
-              AdminServer is enabled.</p>
-</dd>
-
-          
-<dt>
-<term>admin.serverAddress</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.admin.serverAddress</strong>)</p>
-<p>The address the embedded Jetty server listens on. Defaults to 0.0.0.0.</p>
-</dd>
-
-          
-<dt>
-<term>admin.serverPort</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.admin.serverPort</strong>)</p>
-<p>The port the embedded Jetty server listens on.  Defaults to 8080.</p>
-</dd>
-
-            
-<dt>
-<term>admin.idleTimeout</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.admin.idleTimeout</strong>)</p>
-<p>Set the maximum idle time in milliseconds that a connection can wait 
-                          before sending or receiving data. Defaults to 30000 ms.</p>
-</dd>
-
-
-          
-<dt>
-<term>admin.commandURL</term>
-</dt>
-<dd>
-<p>(Java system property: <strong>zookeeper.admin.commandURL</strong>)</p>
-<p>The URL for listing and issuing commands relative to the
-              root URL.  Defaults to "/commands".</p>
-</dd>
-        
-</dl>
-<a name="sc_zkCommands"></a>
-<h3 class="h4">ZooKeeper Commands</h3>
-<a name="sc_4lw"></a>
-<h4>The Four Letter Words</h4>
-<p>ZooKeeper responds to a small set of commands. Each command is
-        composed of four letters. You issue the commands to ZooKeeper via telnet
-        or nc, at the client port.</p>
-<p>Three of the more interesting commands: "stat" gives some
-        general information about the server and connected clients,
-        while "srvr" and "cons" give extended details on server and
-        connections respectively.</p>
-<p>
-<strong>New in 3.5.3:</strong>
-          Four Letter Words need to be explicitly white listed before using.
-          Please refer <strong>4lw.commands.whitelist</strong>
-           described in <a href="#sc_clusterOptions">
-            cluster configuration section</a> for details.
-          Moving forward, Four Letter Words will be deprecated, please use
-          <a href="#sc_adminserver">AdminServer</a> instead.
-        </p>
-<dl>
-          
-<dt>
-<term>conf</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Print
-              details about serving configuration.</p>
-</dd>
-
-          
-<dt>
-<term>cons</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> List
-              full connection/session details for all clients connected
-              to this server. Includes information on numbers of packets
-              received/sent, session id, operation latencies, last
-              operation performed, etc...</p>
-</dd>
-
-          
-<dt>
-<term>crst</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Reset
-              connection/session statistics for all connections.</p>
-</dd>
-
-          
-<dt>
-<term>dump</term>
-</dt>
-<dd>
-<p>Lists the outstanding sessions and ephemeral nodes. This
-              only works on the leader.</p>
-</dd>
-
-          
-<dt>
-<term>envi</term>
-</dt>
-<dd>
-<p>Print details about serving environment</p>
-</dd>
-
-          
-<dt>
-<term>ruok</term>
-</dt>
-<dd>
-<p>Tests if server is running in a non-error state. The server
-              will respond with imok if it is running. Otherwise it will not
-              respond at all.</p>
-<p>A response of "imok" does not necessarily indicate that the
-              server has joined the quorum, just that the server process is active
-              and bound to the specified client port. Use "stat" for details on
-              state wrt quorum and client connection information.</p>
-</dd>
-
-          
-<dt>
-<term>srst</term>
-</dt>
-<dd>
-<p>Reset server statistics.</p>
-</dd>
-
-          
-<dt>
-<term>srvr</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Lists
-              full details for the server.</p>
-</dd>
-
-          
-<dt>
-<term>stat</term>
-</dt>
-<dd>
-<p>Lists brief details for the server and connected
-              clients.</p>
-</dd>
-
-          
-<dt>
-<term>wchs</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Lists
-              brief information on watches for the server.</p>
-</dd>
-
-          
-<dt>
-<term>wchc</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Lists
-              detailed information on watches for the server, by
-              session.  This outputs a list of sessions(connections)
-              with associated watches (paths). Note, depending on the
-              number of watches this operation may be expensive (ie
-              impact server performance), use it carefully.</p>
-</dd>
-
-          
-<dt>
-<term>dirs</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.5.1:</strong>
-                Shows the total size of snapshot and log files in bytes
-              </p>
-</dd>
-
-          
-<dt>
-<term>wchp</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.3.0:</strong> Lists
-              detailed information on watches for the server, by path.
-              This outputs a list of paths (znodes) with associated
-              sessions. Note, depending on the number of watches this
-              operation may be expensive (ie impact server performance),
-              use it carefully.</p>
-</dd>
-
-
-          
-<dt>
-<term>mntr</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.4.0:</strong> Outputs a list 
-              of variables that could be used for monitoring the health of the cluster.</p>
-<pre class="code">$ echo mntr | nc localhost 2185
-
-              zk_version  3.4.0
-              zk_avg_latency  0
-              zk_max_latency  0
-              zk_min_latency  0
-              zk_packets_received 70
-              zk_packets_sent 69
-              zk_num_alive_connections	1
-              zk_outstanding_requests 0
-              zk_server_state leader
-              zk_znode_count   4
-              zk_watch_count  0
-              zk_ephemerals_count 0
-              zk_approximate_data_size    27
-              zk_followers    4                   - only exposed by the Leader
-              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_last_proposal_size 23
-              zk_min_proposal_size 23
-              zk_max_proposal_size 64
-              </pre>
-<p>The output is compatible with java properties format and the content 
-              may change over time (new keys added). Your scripts should expect changes.</p>
-<p>ATTENTION: Some of the keys are platform specific and some of the keys are only exported by the Leader. </p>
-<p>The output contains multiple lines with the following format:</p>
-<pre class="code">key \t value</pre>
-</dd>
-
-          
-<dt>
-<term>isro</term>
-</dt>
-<dd>
-<p>
-<strong>New in 3.4.0:</strong> Tests if
-              server is running in read-only mode.  The server will respond with
-              "ro" if in read-only mode or "rw" if not in read-only mode.</p>
-</dd>
-
-          
-<dt>
-<term>gtmk</term>
-</dt>
-<dd>
-<p>Gets the current trace mask as a 64-bit signed long value in
-              decimal format.  See <span class="codefrag command">stmk</span> for an explanation of
-              the possible values.</p>
-</dd>
-
-          
-<dt>
-<term>stmk</term>
-</dt>
-<dd>
-<p>Sets the current trace mask.  The trace mask is 64 bits,
-              where each bit enables or disables a specific category of trace
-              logging on the server.  Log4J must be configured to enable
-              <span class="codefrag command">TRACE</span> level first in order to see trace logging
-              messages.  The bits of the trace mask correspond to the following
-              trace logging categories.</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>Trace Mask Bit Values</caption>
-                
-<title>Trace Mask Bit Values</title>
-                
-                    
-<tr>
-                      
-<td>0b0000000000</td>
-                      <td>Unused, reserved for future use.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0000000010</td>
-                      <td>Logs client requests, excluding ping
-                      requests.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0000000100</td>
-                      <td>Unused, reserved for future use.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0000001000</td>
-                      <td>Logs client ping requests.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0000010000</td>
-                      <td>Logs packets received from the quorum peer that is
-                      the current leader, excluding ping requests.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0000100000</td>
-                      <td>Logs addition, removal and validation of client
-                      sessions.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0001000000</td>
-                      <td>Logs delivery of watch events to client
-                      sessions.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0010000000</td>
-                      <td>Logs ping packets received from the quorum peer
-                      that is the current leader.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b0100000000</td>
-                      <td>Unused, reserved for future use.</td>
-                    
-</tr>
-                    
-<tr>
-                      
-<td>0b1000000000</td>
-                      <td>Unused, reserved for future use.</td>
-                    
-</tr>
-                  
-              
-</table>
-<p>All remaining bits in the 64-bit value are unused and
-              reserved for future use.  Multiple trace logging categories are
-              specified by calculating the bitwise OR of the documented values.
-              The default trace mask is 0b0100110010.  Thus, by default, trace
-              logging includes client requests, packets received from the
-              leader and sessions.</p>
-<p>To set a different trace mask, send a request containing the
-              <span class="codefrag command">stmk</span> four-letter word followed by the trace
-              mask represented as a 64-bit signed long value.  This example uses
-              the Perl <span class="codefrag command">pack</span> function to construct a trace
-              mask that enables all trace logging categories described above and
-              convert it to a 64-bit signed long value with big-endian byte
-              order.  The result is appended to <span class="codefrag command">stmk</span> and sent
-              to the server using netcat.  The server responds with the new
-              trace mask in decimal format.</p>
-<pre class="code">$ perl -e "print 'stmk', pack('q&gt;', 0b0011111010)" | nc localhost 2181
-250
-              </pre>
-</dd>
-        
-</dl>
-<p>Here's an example of the <strong>ruok</strong>
-        command:</p>
-<pre class="code">$ echo ruok | nc 127.0.0.1 5111
-        imok
-        </pre>
-<a name="sc_adminserver"></a>
-<h4>The AdminServer</h4>
-<p>
-<strong>New in 3.5.0: </strong>The AdminServer is
-        an embedded Jetty server that provides an HTTP interface to the four
-        letter word commands.  By default, the server is started on port 8080,
-        and commands are issued by going to the URL "/commands/[command name]",
-        e.g., http://localhost:8080/commands/stat.  The command response is
-        returned as JSON.  Unlike the original protocol, commands are not
-        restricted to four-letter names, and commands can have multiple names;
-        for instance, "stmk" can also be referred to as "set_trace_mask".  To
-        view a list of all available commands, point a browser to the URL
-        /commands (e.g., http://localhost:8080/commands).  See the <a href="#sc_adminserver_config">AdminServer configuration options</a>
-        for how to change the port and URLs.</p>
-<p>The AdminServer is enabled by default, but can be disabled by either:</p>
-<ul>
-          
-<li>
-<p>Setting the zookeeper.admin.enableServer system
-          property to false.</p>
-</li>
-          
-<li>
-<p>Removing Jetty from the classpath.  (This option is
-          useful if you would like to override ZooKeeper's jetty
-          dependency.)</p>
-</li>
-        
-</ul>
-<p>Note that the TCP four letter word interface is still available if
-        the AdminServer is disabled.</p>
-<a name="sc_dataFileManagement"></a>
-<h3 class="h4">Data File Management</h3>
-<p>ZooKeeper stores its data in a data directory and its transaction
-      log in a transaction log directory. By default these two directories are
-      the same. The server can (and should) be configured to store the
-      transaction log files in a separate directory than the data files.
-      Throughput increases and latency decreases when transaction logs reside
-      on a dedicated log devices.</p>
-<a name="The+Data+Directory"></a>
-<h4>The Data Directory</h4>
-<p>This directory has two or three files in it:</p>
-<ul>
-          
-<li>
-            
-<p>
-<span class="codefrag filename">myid</span> - contains a single integer in
-            human readable ASCII text that represents the server id.</p>
-          
-</li>
-
-          
-<li>
-            
-<p>
-<span class="codefrag filename">initialize</span> - presence indicates lack of
-              data tree is expected. Cleaned up once data tree is created.</p>
-          
-</li>
-
-          
-<li>
-            
-<p>
-<span class="codefrag filename">snapshot.&lt;zxid&gt;</span> - holds the fuzzy
-            snapshot of a data tree.</p>
-          
-</li>
-        
-</ul>
-<p>Each ZooKeeper server has a unique id. This id is used in two
-        places: the <span class="codefrag filename">myid</span> file and the configuration file.
-        The <span class="codefrag filename">myid</span> file identifies the server that
-        corresponds to the given data directory. The configuration file lists
-        the contact information for each server identified by its server id.
-        When a ZooKeeper server instance starts, it reads its id from the
-        <span class="codefrag filename">myid</span> file and then, using that id, reads from the
-        configuration file, looking up the port on which it should
-        listen.</p>
-<p>The <span class="codefrag filename">snapshot</span> files stored in the data
-        directory are fuzzy snapshots in the sense that during the time the
-        ZooKeeper server is taking the snapshot, updates are occurring to the
-        data tree. The suffix of the <span class="codefrag filename">snapshot</span> file names
-        is the <em>zxid</em>, the ZooKeeper transaction id, of the
-        last committed transaction at the start of the snapshot. Thus, the
-        snapshot includes a subset of the updates to the data tree that
-        occurred while the snapshot was in process. The snapshot, then, may
-        not correspond to any data tree that actually existed, and for this
-        reason we refer to it as a fuzzy snapshot. Still, ZooKeeper can
-        recover using this snapshot because it takes advantage of the
-        idempotent nature of its updates. By replaying the transaction log
-        against fuzzy snapshots ZooKeeper gets the state of the system at the
-        end of the log.</p>
-<a name="The+Log+Directory"></a>
-<h4>The Log Directory</h4>
-<p>The Log Directory contains the ZooKeeper transaction logs.
-        Before any update takes place, ZooKeeper ensures that the transaction
-        that represents the update is written to non-volatile storage. A new
-        log file is started when the number of transactions written to the
-        current log file reaches a (variable) threshold. The threshold is
-        computed using the same parameter which influences the frequency of
-        snapshotting (see snapCount above). The log file's suffix is the first
-        zxid written to that log.</p>
-<a name="sc_filemanagement"></a>
-<h4>File Management</h4>
-<p>The format of snapshot and log files does not change between
-        standalone ZooKeeper servers and different configurations of
-        replicated ZooKeeper servers. Therefore, you can pull these files from
-        a running replicated ZooKeeper server to a development machine with a
-        stand-alone ZooKeeper server for trouble shooting.</p>
-<p>Using older log and snapshot files, you can look at the previous
-        state of ZooKeeper servers and even restore that state. The
-        LogFormatter class allows an administrator to look at the transactions
-        in a log. The LogChopper class allows an administrator to create
-         truncated versions of transaction logs.</p>
-<p>The ZooKeeper server creates snapshot and log files, but
-        never deletes them. The retention policy of the data and log
-        files is implemented outside of the ZooKeeper server. The
-        server itself only needs the latest complete fuzzy snapshot, all log
-        files following it, and the last log file preceding it.  The latter
-        requirement is necessary to include updates which happened after this
-        snapshot was started but went into the existing log file at that time.
-        This is possible because snapshotting and rolling over of logs
-        proceed somewhat independently in ZooKeeper. See the
-        <a href="#sc_maintenance">maintenance</a> section in
-        this document for more details on setting a retention policy
-        and maintenance of ZooKeeper storage.
-        </p>
-<div class="note">
-<div class="label">Note</div>
-<div class="content">
-        
-<p>The data stored in these files is not encrypted. In the case of
-        storing sensitive data in ZooKeeper, necessary measures need to be
-        taken to prevent unauthorized access. Such measures are external to
-        ZooKeeper (e.g., control access to the files) and depend on the
-        individual settings in which it is being deployed. </p>
-        
-</div>
-</div>
-<a name="Recovery+-+TxnLogToolkit"></a>
-<h4>Recovery - TxnLogToolkit</h4>
-<p>TxnLogToolkit is a command line tool shipped with ZooKeeper which
-          is capable of recovering transaction log entries with broken CRC.</p>
-<p>Running it without any command line parameters or with the "-h,--help"
-          argument, it outputs the following help page:</p>
-<pre class="code">
-          $ 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
-        </pre>
-<p>The default behaviour is safe: it dumps the entries of the given
-        transaction log file to the screen: (same as using '-d,--dump' parameter)</p>
-<pre class="code">
-          $ 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
-          <strong>CRC ERROR - 4/5/18 2:16:05 PM CEST session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null</strong>
-          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.
-        </pre>
-<p>There's a CRC error in the 2nd entry of the above transaction log file. In <strong>dump</strong>
-          mode, the toolkit only prints this information to the screen without touching the original file. In
-          <strong>recovery</strong> 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.</p>
-<pre class="code">
-          $ 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) ?
-        </pre>
-<p>Answering <strong>Yes</strong> means the newly calculated CRC value will be outputted
-          to the new file. <strong>No</strong> means that the original CRC value will be copied over.
-          <strong>Abort</strong> 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.)</p>
-<pre class="code">
-          $ 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)
-        </pre>
-<p>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.</p>
-<a name="sc_commonProblems"></a>
-<h3 class="h4">Things to Avoid</h3>
-<p>Here are some common problems you can avoid by configuring
-      ZooKeeper correctly:</p>
-<dl>
-        
-<dt>
-<term>inconsistent lists of servers</term>
-</dt>
-<dd>
-<p>The list of ZooKeeper servers used by the clients must match
-            the list of ZooKeeper servers that each ZooKeeper server has.
-            Things work okay if the client list is a subset of the real list,
-            but things will really act strange if clients have a list of
-            ZooKeeper servers that are in different ZooKeeper clusters. Also,
-            the server lists in each Zookeeper server configuration file
-            should be consistent with one another.</p>
-</dd>
-
-        
-<dt>
-<term>incorrect placement of transaction log</term>
-</dt>
-<dd>
-<p>The most performance critical part of ZooKeeper is the
-            transaction log. ZooKeeper syncs transactions to media before it
-            returns a response. A dedicated transaction log device is key to
-            consistent good performance. Putting the log on a busy device will
-            adversely effect performance. If you only have one storage device,
-            put trace files on NFS and increase the snapshotCount; it doesn't
-            eliminate the problem, but it should mitigate it.</p>
-</dd>
-
-        
-<dt>
-<term>incorrect Java heap size</term>
-</dt>
-<dd>
-<p>You should take special care to set your Java max heap size
-            correctly. In particular, you should not create a situation in
-            which ZooKeeper swaps to disk. The disk is death to ZooKeeper.
-            Everything is ordered, so if processing one request swaps the
-            disk, all other queued requests will probably do the same. the
-            disk. DON'T SWAP.</p>
-<p>Be conservative in your estimates: if you have 4G of RAM, do
-            not set the Java max heap size to 6G or even 4G. For example, it
-            is more likely you would use a 3G heap for a 4G machine, as the
-            operating system and the cache also need memory. The best and only
-            recommend practice for estimating the heap size your system needs
-            is to run load tests, and then make sure you are well below the
-            usage limit that would cause the system to swap.</p>
-</dd>
-
-        
-<dt>
-<term>Publicly accessible deployment</term>
-</dt>
-<dd>
-<p>
-              A ZooKeeper ensemble is expected to operate in a trusted computing environment.
-              It is thus recommended to deploy ZooKeeper behind a firewall.
-            </p>
-</dd>
-      
-</dl>
-<a name="sc_bestPractices"></a>
-<h3 class="h4">Best Practices</h3>
-<p>For best results, take note of the following list of good
-      Zookeeper practices:</p>
-<p>For multi-tenant installations see the <a href="zookeeperProgrammers.html#ch_zkSessions">section</a>
-      detailing ZooKeeper "chroot" support, this can be very useful
-      when deploying many applications/services interfacing to a
-      single ZooKeeper cluster.</p>
-</div>
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/zookeeperAdmin.pdf


+ 0 - 264
docs/zookeeperHierarchicalQuorums.html

@@ -1,264 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>Introduction to hierarchical quorums</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="zookeeperHierarchicalQuorums.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>Introduction to hierarchical quorums</h1>
-<div id="front-matter"></div>
-  
-
-  
-
-    
-<p>
-    This document gives an example of how to use hierarchical quorums. The basic idea is
-    very simple. First, we split servers into groups, and add a line for each group listing
-    the servers that form this group. Next we have to assign a weight to each server.  
-    </p>
-    
-    
-<p>
-    The following example shows how to configure a system with three groups of three servers
-    each, and we assign a weight of 1 to each server:
-    </p>
-    
-    
-<pre class="code">
-    group.1=1:2:3
-    group.2=4:5:6
-    group.3=7:8:9
-   
-    weight.1=1
-    weight.2=1
-    weight.3=1
-    weight.4=1
-    weight.5=1
-    weight.6=1
-    weight.7=1
-    weight.8=1
-    weight.9=1
- 	</pre>
-
-	
-<p>    
-    When running the system, we are able to form a quorum once we have a majority of votes from
-    a majority of non-zero-weight groups. Groups that have zero weight are discarded and not
-    considered when forming quorums. Looking at the example, we are able to form a quorum once
-    we have votes from at least two servers from each of two different groups.
-    </p> 
- 
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/zookeeperHierarchicalQuorums.pdf


+ 0 - 793
docs/zookeeperInternals.html

@@ -1,793 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper Internals</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Admin &amp; Ops</div>
-<div id="menu_1.3" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperJMX.html">JMX</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.4', 'skin/')" id="menu_selected_1.4Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Contributor</div>
-<div id="menu_selected_1.4" class="selectedmenuitemgroup" style="display: block;">
-<div class="menupage">
-<div class="menupagetitle">ZooKeeper Internals</div>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="zookeeperInternals.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper Internals</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#ch_Introduction">Introduction</a>
-</li>
-<li>
-<a href="#sc_atomicBroadcast">Atomic Broadcast</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_guaranteesPropertiesDefinitions">Guarantees, Properties, and Definitions</a>
-</li>
-<li>
-<a href="#sc_leaderElection">Leader Activation</a>
-</li>
-<li>
-<a href="#sc_activeMessaging">Active Messaging</a>
-</li>
-<li>
-<a href="#sc_summary">Summary</a>
-</li>
-<li>
-<a href="#sc_comparisons">Comparisons</a>
-</li>
-</ul>
-</li>
-<li>
-<a href="#sc_quorum">Quorums</a>
-</li>
-<li>
-<a href="#sc_logging">Logging</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_developerGuidelines">Developer Guidelines</a>
-<ul class="minitoc">
-<li>
-<a href="#sc_rightLevel">Logging at the Right Level</a>
-</li>
-<li>
-<a href="#sc_slf4jIdioms">Use of Standard slf4j Idioms</a>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-<a name="ch_Introduction"></a>
-<h2 class="h3">Introduction</h2>
-<div class="section">
-<p>This document contains information on the inner workings of ZooKeeper. 
-    So far, it discusses these topics:
-    </p>
-<ul>    
-
-<li>
-<p>
-<a href="#sc_atomicBroadcast">Atomic Broadcast</a>
-</p>
-</li>
-
-<li>
-<p>
-<a href="#sc_logging">Logging</a>
-</p>
-</li>
-
-</ul>
-</div>
-
-
-<a name="sc_atomicBroadcast"></a>
-<h2 class="h3">Atomic Broadcast</h2>
-<div class="section">
-<p>
-At the heart of ZooKeeper is an atomic messaging system that keeps all of the servers in sync.</p>
-<a name="sc_guaranteesPropertiesDefinitions"></a>
-<h3 class="h4">Guarantees, Properties, and Definitions</h3>
-<p>
-The specific guarantees provided by the messaging system used by ZooKeeper are the following:</p>
-<dl>
-
-
-<dt>
-<term>
-<em>Reliable delivery</em>
-</term>
-</dt>
-<dd>
-<p>If a message, m, is delivered 
-by one server, it will be eventually delivered by all servers.</p>
-</dd>
-
-
-<dt>
-<term>
-<em>Total order</em>
-</term>
-</dt>
-<dd>
-<p> If a message is 
-delivered before message b by one server, a will be delivered before b by all 
-servers. If a and b are delivered messages, either a will be delivered before b 
-or b will be delivered before a.</p>
-</dd>
-
-
-<dt>
-<term>
-<em>Causal order</em> 
-</term>
-</dt>
-<dd>
-<p>
-If a message b is sent after a message a has been delivered by the sender of b, 
-a must be ordered before b. If a sender sends c after sending b, c must be ordered after b.
-</p>
-</dd>
-
-
-</dl>
-<p>
-The ZooKeeper messaging system also needs to be efficient, reliable, and easy to 
-implement and maintain. We make heavy use of messaging, so we need the system to 
-be able to handle thousands of requests per second. Although we can require at 
-least k+1 correct servers to send new messages, we must be able to recover from 
-correlated failures such as power outages. When we implemented the system we had 
-little time and few engineering resources, so we needed a protocol that is 
-accessible to engineers and is easy to implement. We found that our protocol 
-satisfied all of these goals.
-
-</p>
-<p>
-Our protocol assumes that we can construct point-to-point FIFO channels between 
-the servers. While similar services usually assume message delivery that can 
-lose or reorder messages, our assumption of FIFO channels is very practical 
-given that we use TCP for communication. Specifically we rely on the following property of TCP:</p>
-<dl>
-
-
-<dt>
-<term>
-<em>Ordered delivery</em>
-</term>
-</dt>
-<dd>
-<p>Data is delivered in the same order it is sent and a message m is 
-delivered only after all messages sent before m have been delivered. 
-(The corollary to this is that if message m is lost all messages after m will be lost.)</p>
-</dd>
-
-
-<dt>
-<term>
-<em>No message after close</em>
-</term>
-</dt>
-<dd>
-<p>Once a FIFO channel is closed, no messages will be received from it.</p>
-</dd>
-
-
-</dl>
-<p>
-FLP proved that consensus cannot be achieved in asynchronous distributed systems 
-if failures are possible. To ensure we achieve consensus in the presence of failures 
-we use timeouts. However, we rely on times for liveness not for correctness. So, 
-if timeouts stop working (clocks malfunction for example) the messaging system may 
-hang, but it will not violate its guarantees.</p>
-<p>When describing the ZooKeeper messaging protocol we will talk of packets, 
-proposals, and messages:</p>
-<dl>
-
-<dt>
-<term>
-<em>Packet</em>
-</term>
-</dt>
-<dd>
-<p>a sequence of bytes sent through a FIFO channel</p>
-</dd>
-<dt>
-<term>
-<em>Proposal</em>
-</term>
-</dt>
-<dd>
-<p>a unit of agreement. Proposals are agreed upon by exchanging packets 
-with a quorum of ZooKeeper servers. Most proposals contain messages, however the 
-NEW_LEADER proposal is an example of a proposal that does not correspond to a message.</p>
-</dd>
-<dt>
-<term>
-<em>Message</em>
-</term>
-</dt>
-<dd>
-<p>a sequence of bytes to be atomically broadcast to all ZooKeeper 
-servers. A message put into a proposal and agreed upon before it is delivered.</p>
-</dd>
-
-
-</dl>
-<p>
-As stated above, ZooKeeper guarantees a total order of messages, and it also 
-guarantees a total order of proposals. ZooKeeper exposes the total ordering using
-a ZooKeeper transaction id (<em>zxid</em>). All proposals will be stamped with a zxid when 
-it is proposed and exactly reflects the total ordering. Proposals are sent to all 
-ZooKeeper servers and committed when a quorum of them acknowledge the proposal. 
-If a proposal contains a message, the message will be delivered when the proposal 
-is committed. Acknowledgement means the server has recorded the proposal to persistent storage. 
-Our quorums have the requirement that any pair of quorum must have at least one server 
-in common. We ensure this by requiring that all quorums have size (<em>n/2+1</em>) where 
-n is the number of servers that make up a ZooKeeper service.
-</p>
-<p>
-The zxid has two parts: the epoch and a counter. In our implementation the zxid 
-is a 64-bit number. We use the high order 32-bits for the epoch and the low order 
-32-bits for the counter. Because it has two parts represent the zxid both as a 
-number and as a pair of integers, (<em>epoch, count</em>). The epoch number represents a 
-change in leadership. Each time a new leader comes into power it will have its 
-own epoch number. We have a simple algorithm to assign a unique zxid to a proposal: 
-the leader simply increments the zxid to obtain a unique zxid for each proposal. 
-<em>Leadership activation will ensure that only one leader uses a given epoch, so our 
-simple algorithm guarantees that every proposal will have a unique id.</em>
-
-</p>
-<p>
-ZooKeeper messaging consists of two phases:</p>
-<dl>
-
-<dt>
-<term>
-<em>Leader activation</em>
-</term>
-</dt>
-<dd>
-<p>In this phase a leader establishes the correct state of the system 
-and gets ready to start making proposals.</p>
-</dd>
-
-
-<dt>
-<term>
-<em>Active messaging</em>
-</term>
-</dt>
-<dd>
-<p>In this phase a leader accepts messages to propose and coordinates message delivery.</p>
-</dd>
-
-</dl>
-<p>
-ZooKeeper is a holistic protocol. We do not focus on individual proposals, rather 
-look at the stream of proposals as a whole. Our strict ordering allows us to do this 
-efficiently and greatly simplifies our protocol. Leadership activation embodies 
-this holistic concept. A leader becomes active only when a quorum of followers 
-(The leader counts as a follower as well. You can always vote for yourself ) has synced 
-up with the leader, they have the same state. This state consists of all of the 
-proposals that the leader believes have been committed and the proposal to follow 
-the leader, the NEW_LEADER proposal. (Hopefully you are thinking to 
-yourself, <em>Does the set of proposals that the leader believes has been committed 
-included all the proposals that really have been committed?</em> The answer is <em>yes</em>. 
-Below, we make clear why.)
-</p>
-<a name="sc_leaderElection"></a>
-<h3 class="h4">Leader Activation</h3>
-<p>
-Leader activation includes leader election. We currently have two leader election 
-algorithms in ZooKeeper: LeaderElection and FastLeaderElection (AuthFastLeaderElection 
-is a variant of FastLeaderElection that uses UDP and allows servers to perform a simple
-form of authentication to avoid IP spoofing). ZooKeeper messaging doesn't care about the 
-exact method of electing a leader has long as the following holds:
-</p>
-<ul>
-
-
-<li>
-<p>The leader has seen the highest zxid of all the followers.</p>
-</li>
-
-<li>
-<p>A quorum of servers have committed to following the leader.</p>
-</li>
-
-
-</ul>
-<p>
-Of these two requirements only the first, the highest zxid amoung the followers 
-needs to hold for correct operation. The second requirement, a quorum of followers, 
-just needs to hold with high probability. We are going to recheck the second requirement, 
-so if a failure happens during or after the leader election and quorum is lost, 
-we will recover by abandoning leader activation and running another election.
-</p>
-<p>
-After leader election a single server will be designated as a leader and start 
-waiting for followers to connect. The rest of the servers will try to connect to 
-the leader. The leader will sync up with followers by sending any proposals they 
-are missing, or if a follower is missing too many proposals, it will send a full 
-snapshot of the state to the follower.
-</p>
-<p>
-There is a corner case in which a follower that has proposals, U, not seen 
-by a leader arrives. Proposals are seen in order, so the proposals of U will have a zxids 
-higher than zxids seen by the leader. The follower must have arrived after the 
-leader election, otherwise the follower would have been elected leader given that 
-it has seen a higher zxid. Since committed proposals must be seen by a quorum of 
-servers, and a quorum of servers that elected the leader did not see U, the proposals 
-of you have not been committed, so they can be discarded. When the follower connects 
-to the leader, the leader will tell the follower to discard U.
-</p>
-<p>
-A new leader establishes a zxid to start using for new proposals by getting the 
-epoch, e, of the highest zxid it has seen and setting the next zxid to use to be 
-(e+1, 0), fter the leader syncs with a follower, it will propose a NEW_LEADER 
-proposal. Once the NEW_LEADER proposal has been committed, the leader will activate 
-and start receiving and issuing proposals.
-</p>
-<p>
-It all sounds complicated but here are the basic rules of operation during leader 
-activation:
-</p>
-<ul>
-
-<li>
-<p>A follower will ACK the NEW_LEADER proposal after it has synced with the leader.</p>
-</li>
-
-<li>
-<p>A follower will only ACK a NEW_LEADER proposal with a given zxid from a single server.</p>
-</li>
-
-<li>
-<p>A new leader will COMMIT the NEW_LEADER proposal when a quorum of followers have ACKed it.</p>
-</li>
-
-<li>
-<p>A follower will commit any state it received from the leader when the NEW_LEADER proposal is COMMIT.</p>
-</li>
-
-<li>
-<p>A new leader will not accept new proposals until the NEW_LEADER proposal has been COMMITED.</p>
-</li>
-
-</ul>
-<p>
-If leader election terminates erroneously, we don't have a problem since the 
-NEW_LEADER proposal will not be committed since the leader will not have quorum. 
-When this happens, the leader and any remaining followers will timeout and go back 
-to leader election.
-</p>
-<a name="sc_activeMessaging"></a>
-<h3 class="h4">Active Messaging</h3>
-<p>
-Leader Activation does all the heavy lifting. Once the leader is coronated he can 
-start blasting out proposals. As long as he remains the leader no other leader can 
-emerge since no other leader will be able to get a quorum of followers. If a new 
-leader does emerge, 
-it means that the leader has lost quorum, and the new leader will clean up any 
-mess left over during her leadership activation.
-</p>
-<p>ZooKeeper messaging operates similar to a classic two-phase commit.</p>
-<img alt="" src="images/2pc.jpg"><p>
-All communication channels are FIFO, so everything is done in order. Specifically 
-the following operating constraints are observed:</p>
-<ul>
-
-
-<li>
-<p>The leader sends proposals to all followers using 
-the same order. Moreover, this order follows the order in which requests have been 
-received. Because we use FIFO channels this means that followers also receive proposals in order.
-</p>
-</li>
-
-
-<li>
-<p>Followers process messages in the order they are received. This 
-means that messages will be ACKed in order and the leader will receive ACKs from 
-followers in order, due to the FIFO channels. It also means that if message $m$ 
-has been written to non-volatile storage, all messages that were proposed before 
-$m$ have been written to non-volatile storage.</p>
-</li>
-
-
-<li>
-<p>The leader will issue a COMMIT to all followers as soon as a 
-quorum of followers have ACKed a message. Since messages are ACKed in order, 
-COMMITs will be sent by the leader as received by the followers in order.</p>
-</li>
-
-
-<li>
-<p>COMMITs are processed in order. Followers deliver a proposals 
-message when that proposal is committed.</p>
-</li>
-
-
-</ul>
-<a name="sc_summary"></a>
-<h3 class="h4">Summary</h3>
-<p>So there you go. Why does it work? Specifically, why does a set of proposals 
-believed by a new leader always contain any proposal that has actually been committed? 
-First, all proposals have a unique zxid, so unlike other protocols, we never have 
-to worry about two different values being proposed for the same zxid; followers 
-(a leader is also a follower) see and record proposals in order; proposals are 
-committed in order; there is only one active leader at a time since followers only 
-follow a single leader at a time; a new leader has seen all committed proposals 
-from the previous epoch since it has seen the highest zxid from a quorum of servers; 
-any uncommited proposals from a previous epoch seen by a new leader will be committed 
-by that leader before it becomes active.</p>
-<a name="sc_comparisons"></a>
-<h3 class="h4">Comparisons</h3>
-<p>
-Isn't this just Multi-Paxos? No, Multi-Paxos requires some way of assuring that 
-there is only a single coordinator. We do not count on such assurances. Instead 
-we use the leader activation to recover from leadership change or old leaders 
-believing they are still active.
-</p>
-<p>
-Isn't this just Paxos? Your active messaging phase looks just like phase 2 of Paxos? 
-Actually, to us active messaging looks just like 2 phase commit without the need to 
-handle aborts. Active messaging is different from both in the sense that it has 
-cross proposal ordering requirements. If we do not maintain strict FIFO ordering of 
-all packets, it all falls apart. Also, our leader activation phase is different from 
-both of them. In particular, our use of epochs allows us to skip blocks of uncommitted
-proposals and to not worry about duplicate proposals for a given zxid.
-</p>
-</div>
-
-
-<a name="sc_quorum"></a>
-<h2 class="h3">Quorums</h2>
-<div class="section">
-<p>
-Atomic broadcast and leader election use the notion of quorum to guarantee a consistent
-view of the system. By default, ZooKeeper uses majority quorums, which means that every
-voting that happens in one of these protocols requires a majority to vote on. One example is
-acknowledging a leader proposal: the leader can only commit once it receives an
-acknowledgement from a quorum of servers.
-</p>
-<p>
-If we extract the properties that we really need from our use of majorities, we have that we only
-need to guarantee that groups of processes used to validate an operation by voting (e.g., acknowledging
-a leader proposal) pairwise intersect in at least one server. Using majorities guarantees such a property.
-However, there are other ways of constructing quorums different from majorities. For example, we can assign
-weights to the votes of servers, and say that the votes of some servers are more important. To obtain a quorum,
-we get enough votes so that the sum of weights of all votes is larger than half of the total sum of all weights.    
-</p>
-<p>
-A different construction that uses weights and is useful in wide-area deployments (co-locations) is a hierarchical
-one. With this construction, we split the servers into disjoint groups and assign weights to processes. To form 
-a quorum, we have to get a hold of enough servers from a majority of groups G, such that for each group g in G,
-the sum of votes from g is larger than half of the sum of weights in g. Interestingly, this construction enables
-smaller quorums. If we have, for example, 9 servers, we split them into 3 groups, and assign a weight of 1 to each
-server, then we are able to form quorums of size 4. Note that two subsets of processes composed each of a majority
-of servers from each of a majority of groups necessarily have a non-empty intersection. It is reasonable to expect
-that a majority of co-locations will have a majority of servers available with high probability. 
-</p>
-<p>
-With ZooKeeper, we provide a user with the ability of configuring servers to use majority quorums, weights, or a 
-hierarchy of groups.
-</p>
-</div>
-
-
-<a name="sc_logging"></a>
-<h2 class="h3">Logging</h2>
-<div class="section">
-<p>
-Zookeeper uses 
-<a href="http://www.slf4j.org/index.html">slf4j</a> as an abstraction layer for logging. 
-<a href="http://logging.apache.org/log4j">log4j</a> in version 1.2 is chosen as the final logging implementation for now.
-For better embedding support, it is planned in the future to leave the decision of choosing the final logging implementation to the end user.
-Therefore, always use the slf4j api to write log statements in the code, but configure log4j for how to log at runtime.
-Note that slf4j has no FATAL level, former messages at FATAL level have been moved to ERROR level. 
-For information on configuring log4j for
-ZooKeeper, see the <a href="zookeeperAdmin.html#sc_logging">Logging</a> section 
-of the <a href="zookeeperAdmin.html">ZooKeeper Administrator's Guide.</a>
-
-
-</p>
-<a name="sc_developerGuidelines"></a>
-<h3 class="h4">Developer Guidelines</h3>
-<p>Please follow the  
-<a href="http://www.slf4j.org/manual.html">slf4j manual</a> when creating log statements within code.
-Also read the
-<a href="http://www.slf4j.org/faq.html#logging_performance">FAQ on performance</a>
-, when creating log statements. Patch reviewers will look for the following:</p>
-<a name="sc_rightLevel"></a>
-<h4>Logging at the Right Level</h4>
-<p>
-There are several levels of logging in slf4j. 
-It's important to pick the right one. In order of higher to lower severity:</p>
-<ol>
-   
-<li>
-<p>ERROR level designates error events that might still allow the application to continue running.</p>
-</li>
-   
-<li>
-<p>WARN level designates potentially harmful situations.</p>
-</li>
-   
-<li>
-<p>INFO level designates informational messages that highlight the progress of the application at coarse-grained level.</p>
-</li>
-   
-<li>
-<p>DEBUG Level designates fine-grained informational events that are most useful to debug an application.</p>
-</li>
-   
-<li>
-<p>TRACE Level designates finer-grained informational events than the DEBUG.</p>
-</li>
-
-</ol>
-<p>
-ZooKeeper is typically run in production such that log messages of INFO level 
-severity and higher (more severe) are output to the log.</p>
-<a name="sc_slf4jIdioms"></a>
-<h4>Use of Standard slf4j Idioms</h4>
-<p>
-<em>Static Message Logging</em>
-</p>
-<pre class="code">
-LOG.debug("process completed successfully!");
-</pre>
-<p>
-However when creating parameterized messages are required, use formatting anchors.
-</p>
-<pre class="code">
-LOG.debug("got {} messages in {} minutes",new Object[]{count,time});    
-</pre>
-<p>
-<em>Naming</em>
-</p>
-<p>
-Loggers should be named after the class in which they are used.
-</p>
-<pre class="code">
-public class Foo {
-    private static final Logger LOG = LoggerFactory.getLogger(Foo.class);
-    ....
-    public Foo() {
-       LOG.info("constructing Foo");
-</pre>
-<p>
-<em>Exception handling</em>
-</p>
-<pre class="code">
-try {
-  // code
-} catch (XYZException e) {
-  // do this
-  LOG.error("Something bad happened", e);
-  // don't do this (generally)
-  // LOG.error(e);
-  // why? because "don't do" case hides the stack trace
- 
-  // continue process here as you need... recover or (re)throw
-}
-</pre>
-</div>
-
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

BIN
docs/zookeeperInternals.pdf


+ 0 - 467
docs/zookeeperJMX.html

@@ -1,467 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta content="Apache Forrest" name="Generator">
-<meta name="Forrest-version" content="0.9">
-<meta name="Forrest-skin-name" content="pelt">
-<title>ZooKeeper JMX</title>
-<link type="text/css" href="skin/basic.css" rel="stylesheet">
-<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
-<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
-<link type="text/css" href="skin/profile.css" rel="stylesheet">
-<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
-<link rel="shortcut icon" href="images/favicon.ico">
-</head>
-<body onload="init()">
-<script type="text/javascript">ndeSetTextSize();</script>
-<div id="top">
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a> &gt; <a href="http://zookeeper.apache.org/">ZooKeeper</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
-</div>
-<!--+
-    |header
-    +-->
-<div class="header">
-<!--+
-    |start group logo
-    +-->
-<div class="grouplogo">
-<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
-</div>
-<!--+
-    |end group logo
-    +-->
-<!--+
-    |start Project Logo
-    +-->
-<div class="projectlogo">
-<a href="http://zookeeper.apache.org/"><img class="logoImage" alt="ZooKeeper" src="images/zookeeper_small.gif" title="ZooKeeper: distributed coordination"></a>
-</div>
-<!--+
-    |end Project Logo
-    +-->
-<!--+
-    |start Search
-    +-->
-<div class="searchbox">
-<form action="http://www.google.com/search" method="get" class="roundtopsmall">
-<input value="zookeeper.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
-                    <input name="Search" value="Search" type="submit">
-</form>
-</div>
-<!--+
-    |end search
-    +-->
-<!--+
-    |start Tabs
-    +-->
-<ul id="tabs">
-<li>
-<a class="unselected" href="http://zookeeper.apache.org/">Project</a>
-</li>
-<li>
-<a class="unselected" href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/">Wiki</a>
-</li>
-<li class="current">
-<a class="selected" href="index.html">ZooKeeper 3.6 Documentation</a>
-</li>
-</ul>
-<!--+
-    |end Tabs
-    +-->
-</div>
-</div>
-<div id="main">
-<div id="publishedStrip">
-<!--+
-    |start Subtabs
-    +-->
-<div id="level2tabs"></div>
-<!--+
-    |end Endtabs
-    +-->
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<!--+
-    |breadtrail
-    +-->
-<div class="breadtrail">
-
-             &nbsp;
-           </div>
-<!--+
-    |start Menu, mainarea
-    +-->
-<!--+
-    |start Menu
-    +-->
-<div id="menu">
-<div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Overview</div>
-<div id="menu_1.1" class="menuitemgroup">
-<div class="menuitem">
-<a href="index.html">Welcome</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperOver.html">Overview</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperStarted.html">Getting Started</a>
-</div>
-<div class="menuitem">
-<a href="releasenotes.html">Release Notes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Developer</div>
-<div id="menu_1.2" class="menuitemgroup">
-<div class="menuitem">
-<a href="api/index.html">API Docs</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperProgrammers.html">Programmer's Guide</a>
-</div>
-<div class="menuitem">
-<a href="javaExample.html">Java Example</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a>
-</div>
-<div class="menuitem">
-<a href="recipes.html">Recipes</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Admin &amp; Ops</div>
-<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
-<div class="menuitem">
-<a href="zookeeperAdmin.html">Administrator's Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperQuotas.html">Quota Guide</a>
-</div>
-<div class="menupage">
-<div class="menupagetitle">JMX</div>
-</div>
-<div class="menuitem">
-<a href="zookeeperObservers.html">Observers Guide</a>
-</div>
-<div class="menuitem">
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">Contributor</div>
-<div id="menu_1.4" class="menuitemgroup">
-<div class="menuitem">
-<a href="zookeeperInternals.html">ZooKeeper Internals</a>
-</div>
-</div>
-<div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div>
-<div id="menu_1.5" class="menuitemgroup">
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a>
-</div>
-<div class="menuitem">
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a>
-</div>
-<div class="menuitem">
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a>
-</div>
-</div>
-<div id="credit"></div>
-<div id="roundbottom">
-<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
-<!--+
-  |alternative credits
-  +-->
-<div id="credit2"></div>
-</div>
-<!--+
-    |end Menu
-    +-->
-<!--+
-    |start content
-    +-->
-<div id="content">
-<div title="Portable Document Format" class="pdflink">
-<a class="dida" href="zookeeperJMX.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
-        PDF</a>
-</div>
-<h1>ZooKeeper JMX</h1>
-<div id="front-matter">
-<div id="minitoc-area">
-<ul class="minitoc">
-<li>
-<a href="#ch_jmx">JMX</a>
-</li>
-<li>
-<a href="#ch_starting">Starting ZooKeeper with JMX enabled</a>
-</li>
-<li>
-<a href="#ch_console">Run a JMX console</a>
-</li>
-<li>
-<a href="#ch_reference">ZooKeeper MBean Reference</a>
-</li>
-</ul>
-</div>
-</div>
-  
-
-  
-
-  
-<a name="ch_jmx"></a>
-<h2 class="h3">JMX</h2>
-<div class="section">
-<p>Apache ZooKeeper has extensive support for JMX, allowing you
-    to view and manage a ZooKeeper serving ensemble.</p>
-<p>This document assumes that you have basic knowledge of
-    JMX. See <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">
-    Sun JMX Technology</a> page to get started with JMX.
-    </p>
-<p>See the <a href="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html">
-    JMX Management Guide</a> for details on setting up local and
-    remote management of VM instances. By default the included
-    <em>zkServer.sh</em> supports only local management -
-    review the linked document to enable support for remote management
-    (beyond the scope of this document).
-    </p>
-</div>
-
-  
-<a name="ch_starting"></a>
-<h2 class="h3">Starting ZooKeeper with JMX enabled</h2>
-<div class="section">
-<p>The class
-      <em>org.apache.zookeeper.server.quorum.QuorumPeerMain</em>
-      will start a JMX manageable ZooKeeper server. This class
-      registers the proper MBeans during initalization to support JMX
-      monitoring and management of the
-      instance. See <em>bin/zkServer.sh</em> for one
-      example of starting ZooKeeper using QuorumPeerMain.</p>
-</div>
-
-  
-<a name="ch_console"></a>
-<h2 class="h3">Run a JMX console</h2>
-<div class="section">
-<p>There are a number of JMX consoles available which can connect
-      to the running server. For this example we will use Sun's
-      <em>jconsole</em>.</p>
-<p>The Java JDK ships with a simple JMX console
-      named <a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html">jconsole</a>
-      which can be used to connect to ZooKeeper and inspect a running
-      server. Once you've started ZooKeeper using QuorumPeerMain
-      start <em>jconsole</em>, which typically resides in
-      <em>JDK_HOME/bin/jconsole</em>
-</p>
-<p>When the "new connection" window is displayed either connect
-      to local process (if jconsole started on same host as Server) or
-      use the remote process connection.</p>
-<p>By default the "overview" tab for the VM is displayed (this
-      is a great way to get insight into the VM btw). Select
-      the "MBeans" tab.</p>
-<p>You should now see <em>org.apache.ZooKeeperService</em>
-      on the left hand side. Expand this item and depending on how you've
-      started the server you will be able to monitor and manage various
-      service related features.</p>
-<p>Also note that ZooKeeper will register log4j MBeans as
-    well. In the same section along the left hand side you will see
-    "log4j". Expand that to manage log4j through JMX. Of particular
-    interest is the ability to dynamically change the logging levels
-    used by editing the appender and root thresholds. Log4j MBean
-    registration can be disabled by passing
-    <em>-Dzookeeper.jmx.log4j.disable=true</em> to the JVM
-    when starting ZooKeeper.
-    </p>
-</div>
-
-  
-<a name="ch_reference"></a>
-<h2 class="h3">ZooKeeper MBean Reference</h2>
-<div class="section">
-<p>This table details JMX for a server participating in a
-    replicated ZooKeeper ensemble (ie not standalone). This is the
-    typical case for a production environment.</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>MBeans, their names and description</caption>
-      
-<title>MBeans, their names and description</title>
-
-      
-          
-<tr>
-            
-<th>MBean</th>
-            <th>MBean Object Name</th>
-            <th>Description</th>
-          
-</tr>
-        
-          
-<tr>
-            
-<td>Quorum</td>
-            <td>ReplicatedServer_id&lt;#&gt;</td>
-            <td>Represents the Quorum, or Ensemble - parent of all
-            cluster members. Note that the object name includes the
-            "myid" of the server (name suffix) that your JMX agent has
-            connected to.</td>
-          
-</tr>
-          
-<tr>
-            
-<td>LocalPeer|RemotePeer</td>
-            <td>replica.&lt;#&gt;</td>
-            <td>Represents a local or remote peer (ie server
-            participating in the ensemble). Note that the object name
-            includes the "myid" of the server (name suffix).</td>
-          
-</tr>
-          
-<tr>
-            
-<td>LeaderElection</td>
-            <td>LeaderElection</td>
-            <td>Represents a ZooKeeper cluster leader election which is
-            in progress. Provides information about the election, such as
-            when it started.</td>
-          
-</tr>
-          
-<tr>
-            
-<td>Leader</td>
-            <td>Leader</td>
-            <td>Indicates that the parent replica is the leader and
-            provides attributes/operations for that server. Note that
-            Leader is a subclass of ZooKeeperServer, so it provides
-            all of the information normally associated with a
-            ZooKeeperServer node.</td>
-          
-</tr>
-          
-<tr>
-            
-<td>Follower</td>
-            <td>Follower</td>
-            <td>Indicates that the parent replica is a follower and
-            provides attributes/operations for that server. Note that
-            Follower is a subclass of ZooKeeperServer, so it provides
-            all of the information normally associated with a
-            ZooKeeperServer node.</td>
-          
-</tr>
-          
-<tr>
-            
-<td>DataTree</td>
-            <td>InMemoryDataTree</td>
-            <td>Statistics on the in memory znode database, also
-            operations to access finer (and more computationally
-            intensive) statistics on the data (such as ephemeral
-            count). InMemoryDataTrees are children of ZooKeeperServer
-            nodes.</td>
-          
-</tr>
-          
-<tr>
-            
-<td>ServerCnxn</td>
-            <td>&lt;session_id&gt;</td>
-            <td>Statistics on each client connection, also
-            operations on those connections (such as
-            termination). Note the object name is the session id of
-            the connection in hex form.</td>
-          
-</tr>
-    
-</table>
-<p>This table details JMX for a standalone server. Typically
-    standalone is only used in development situations.</p>
-<table class="ForrestTable" cellspacing="1" cellpadding="4">
-<caption>MBeans, their names and description</caption>
-      
-<title>MBeans, their names and description</title>
-
-      
-          
-<tr>
-            
-<th>MBean</th>
-            <th>MBean Object Name</th>
-            <th>Description</th>
-          
-</tr>
-        
-          
-<tr>
-            
-<td>ZooKeeperServer</td>
-            <td>StandaloneServer_port&lt;#&gt;</td>
-            <td>Statistics on the running server, also operations
-            to reset these attributes. Note that the object name
-            includes the client port of the server (name
-            suffix).</td>
-          
-</tr>
-          
-<tr>
-            
-<td>DataTree</td>
-            <td>InMemoryDataTree</td>
-            <td>Statistics on the in memory znode database, also
-            operations to access finer (and more computationally
-            intensive) statistics on the data (such as ephemeral
-            count).</td>
-          
-</tr>
-          
-<tr>
-            
-<td>ServerCnxn</td>
-            <td>&lt;session_id&gt;</td>
-            <td>Statistics on each client connection, also
-            operations on those connections (such as
-            termination). Note the object name is the session id of
-            the connection in hex form.</td>
-          
-</tr>
-    
-</table>
-</div>
-
-
-<p align="right">
-<font size="-2"></font>
-</p>
-</div>
-<!--+
-    |end content
-    +-->
-<div class="clearboth">&nbsp;</div>
-</div>
-<div id="footer">
-<!--+
-    |start bottomstrip
-    +-->
-<div class="lastmodified">
-<script type="text/javascript"><!--
-document.write("Last Published: " + document.lastModified);
-//  --></script>
-</div>
-<div class="copyright">
-        Copyright &copy;
-          <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
-    |end bottomstrip
-    +-->
-</div>
-</body>
-</html>

Некоторые файлы не были показаны из-за большого количества измененных файлов