You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by bu...@apache.org on 2011/04/05 04:48:27 UTC

svn commit: r787995 [28/39] - in /websites/staging/zookeeper/trunk/content/doc/current: ./ api/ api/org/ api/org/apache/ api/org/apache/zookeeper/ api/org/apache/zookeeper/class-use/ api/org/apache/zookeeper/data/ api/org/apache/zookeeper/data/class-us...

Added: websites/staging/zookeeper/trunk/content/doc/current/bookkeeperStream.pdf
==============================================================================
--- websites/staging/zookeeper/trunk/content/doc/current/bookkeeperStream.pdf (added)
+++ websites/staging/zookeeper/trunk/content/doc/current/bookkeeperStream.pdf Tue Apr  5 02:48:22 2011
@@ -0,0 +1,249 @@
+%PDF-1.3
+%ª«¬­
+4 0 obj
+<< /Type /Info
+/Producer (FOP 0.20.5) >>
+endobj
+5 0 obj
+<< /Length 480 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gb!#Xb>Q22']&L6m]nC&H1nKW7i&[63o`P4'M+oBD(lDSr4Pf3Uii'@Q's=oPFUEtF-><u(0jWP:l[5?7=acD*ai(S"E=5M8F9Nt0k*u]=TpJ;e7b7OA\B)"'oeE#3o$!4jj@20pBN-+;NK`FZ?qo^m4o*eMMRs^*Q$+q-[#oOT;-IY0HhH"b@bU)EsauDWl"MnW]%.@bpf4aJqrk%VD]PCLiLfG,^h`P7X+/'o]`faEo$0:V*ogc>2b,\LtMtU]rW,.7#j%dA^u5*ZS'M]j?'Pdheh/^3.E3[]ogS.H"ARAeMp3rT6S3dNma[nG0uKSrCQ.0s6kfP`4k6>EB$P&bCU9!gt`&W3(C.Qme2DJ'qcie_.,1-AV-Md_^M3u/)OD7+p:L_!@^A[mVKF6S%UG@/)q#T.i#uIMK.WQ[ZV]eD";in:K:hH\aGGNe@&]EVGoG</R,DAE4MGZQAsCdEe1mq0Bni6`W~>
+endstream
+endobj
+6 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 5 0 R
+/Annots 7 0 R
+>>
+endobj
+7 0 obj
+[
+8 0 R
+10 0 R
+12 0 R
+]
+endobj
+8 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 102.0 529.541 156.668 517.541 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 9 0 R
+/H /I
+>>
+endobj
+10 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 102.0 511.341 231.98 499.341 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 11 0 R
+/H /I
+>>
+endobj
+12 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 102.0 493.141 234.644 481.141 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 13 0 R
+/H /I
+>>
+endobj
+14 0 obj
+<< /Length 1703 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gb!#\95iiK&AJ$CkdUX+Y"66QgFSe:gB-1T#56F95g-M\X<ag...@_>\CTM\B]7`*>a1'PIRh5qAu>:kU]BipNMkW3=d\)p>8$BA]`L%cM>@\rj;HL\bHg@45h7sK:qCk3"-hB5Q3qH(k*pmX;8Q&*]p3L6eS-^<lc]ZUI!e(9N4JkX7L(AQ;&^Mi_dk%57:<rAbJ<8rcE'Z*8SR!]#[h,j:Z<A>bfK=q-1bqAk)6X2geeDVt($4bU`Te;)Kg>qL1iY#/H3))Z^L4c"sAm=g!F3#I7jIa/Z[JI#jY!Ai]Drs'>/l<P1"))i=&8H*s9_:nu4+Y_;e0QZXG_$bIiWcS5]gJ@Hg.;q+uoogh=:9^oIC/ECs^QerDUc+\qGU-MKAGh(#+`<j;-<(o7a;\G.OP]E=5%ZhRM<%929/ZZ9"hK"e5<'o;=aAIm!%Rn>ec-oE(:0LdERjAoRVAYq`bTMj93'*8FSTkkViEPI!%&HNAd3@VS@a`K,Lg/!0>&t\G(=smQ%'9eoOs@eHM%01I!diKEWXkm3pOhC+R</P/9#RIZf]f<;8iTA'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9E\&/d>M1J713bkScSW'[+":o#8RC\!;8aFK<l+<DU0/@]Pg(LCi5S66qNN/n@9S)s@8kZAFC-,c=!J`Y+H;HgWVM\Au0&^9129rO6r/-MKYRI@`,\Y+X&R_HuoFlSS!U[8]RhEs&lROntMp!W1Buk4@6/O%Od3qfN$k55QAps2]XrI3H-th)#P2>V2FtB=,?.\cJ?/$hnHNQ)aCM?#@m:h[>W%%b]7<6TilMTK)L,h`&cP\?'V9]Dn:aqY@l$!IioeGEC(VW4XoK0=lSt\`6GL1=T,L+Q9U6BX"6DL%I@?[?LXtWUEVM"s\eP^`gWACAmUjbLK>g2+f$",WN'=o=!;h_H?+GT9WS1Zch574n\Tun:ZpSK'am+HO[<-hF[J5%R*A!/:p]Q^_S'3%`m74TfQCUY7ce;o+I9U;!(JHR+\2n"-VB,E1?.+?>iQPa;Ub1=qt("$p0@i,b5[Z7(:1JFY`RUH_"3,h1X7[h!(_GT%!ugoYQneB/Ft%SukUrI]5>L^&&2LN`#i~>
+endstream
+endobj
+19 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 18 0 R
+>>
+endobj
+21 0 obj
+<<
+ /Title (\376\377\0\61\0\40\0\123\0\165\0\155\0\155\0\141\0\162\0\171)
+ /Parent 20 0 R
+ /Next 22 0 R
+ /A 9 0 R
+>> endobj
+22 0 obj
+<<
+ /Title (\376\377\0\62\0\40\0\127\0\162\0\151\0\164\0\151\0\156\0\147\0\40\0\141\0\40\0\163\0\164\0\162\0\145\0\141\0\155\0\40\0\157\0\146\0\40\0\142\0\171\0\164\0\145\0\163)
+ /Parent 20 0 R
+ /Prev 21 0 R
+ /Next 23 0 R
+ /A 11 0 R
+>> endobj
+23 0 obj
+<<
+ /Title (\376\377\0\63\0\40\0\122\0\145\0\141\0\144\0\151\0\156\0\147\0\40\0\141\0\40\0\163\0\164\0\162\0\145\0\141\0\155\0\40\0\157\0\146\0\40\0\142\0\171\0\164\0\145\0\163)
+ /Parent 20 0 R
+ /Prev 22 0 R
+ /A 13 0 R
+>> endobj
+24 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /Helvetica
+/Encoding /WinAnsiEncoding >>
+endobj
+25 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+26 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+27 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica-Oblique
+/Encoding /WinAnsiEncoding >>
+endobj
+28 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F9
+/BaseFont /Courier
+/Encoding /WinAnsiEncoding >>
+endobj
+29 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F7
+/BaseFont /Times-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 4
+/Kids [6 0 R 15 0 R 17 0 R 19 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ /Outlines 20 0 R
+ /PageMode /UseOutlines
+ >>
+endobj
+3 0 obj
+<< 
+/Font << /F1 24 0 R /F5 25 0 R /F3 26 0 R /F2 27 0 R /F9 28 0 R /F7 29 0 R >> 
+/ProcSet [ /PDF /ImageC /Text ] >> 
+endobj
+9 0 obj
+<<
+/S /GoTo
+/D [15 0 R /XYZ 85.0 659.0 null]
+>>
+endobj
+11 0 obj
+<<
+/S /GoTo
+/D [15 0 R /XYZ 85.0 479.866 null]
+>>
+endobj
+13 0 obj
+<<
+/S /GoTo
+/D [17 0 R /XYZ 85.0 414.6 null]
+>>
+endobj
+20 0 obj
+<<
+ /First 21 0 R
+ /Last 23 0 R
+>> endobj
+xref
+0 30
+0000000000 65535 f 
+0000007018 00000 n 
+0000007097 00000 n 
+0000007189 00000 n 
+0000000015 00000 n 
+0000000071 00000 n 
+0000000642 00000 n 
+0000000762 00000 n 
+0000000801 00000 n 
+0000007323 00000 n 
+0000000936 00000 n 
+0000007386 00000 n 
+0000001072 00000 n 
+0000007452 00000 n 
+0000001209 00000 n 
+0000003005 00000 n 
+0000003113 00000 n 
+0000004573 00000 n 
+0000004681 00000 n 
+0000005625 00000 n 
+0000007516 00000 n 
+0000005733 00000 n 
+0000005866 00000 n 
+0000006118 00000 n 
+0000006356 00000 n 
+0000006464 00000 n 
+0000006574 00000 n 
+0000006687 00000 n 
+0000006803 00000 n 
+0000006909 00000 n 
+trailer
+<<
+/Size 30
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+7567
+%%EOF

Added: websites/staging/zookeeper/trunk/content/doc/current/broken-links.xml
==============================================================================
--- websites/staging/zookeeper/trunk/content/doc/current/broken-links.xml (added)
+++ websites/staging/zookeeper/trunk/content/doc/current/broken-links.xml Tue Apr  5 02:48:22 2011
@@ -0,0 +1,2 @@
+<broken-links>
+</broken-links>

Added: websites/staging/zookeeper/trunk/content/doc/current/images/2pc.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/2pc.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/bk-overview.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/bk-overview.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/built-with-forrest-button.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/built-with-forrest-button.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/favicon.ico
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/favicon.ico
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/hadoop-logo.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/hadoop-logo.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/instruction_arrow.png
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/instruction_arrow.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/state_dia.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/state_dia.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zkcomponents.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zkcomponents.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zknamespace.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zknamespace.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfRW-3.2.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfRW-3.2.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfRW.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfRW.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfreliability.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zkperfreliability.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zkservice.jpg
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zkservice.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/images/zookeeper_small.gif
==============================================================================
Binary file - no diff available.

Propchange: websites/staging/zookeeper/trunk/content/doc/current/images/zookeeper_small.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: websites/staging/zookeeper/trunk/content/doc/current/index.html
==============================================================================
--- websites/staging/zookeeper/trunk/content/doc/current/index.html (added)
+++ websites/staging/zookeeper/trunk/content/doc/current/index.html Tue Apr  5 02:48:22 2011
@@ -0,0 +1,390 @@
+<!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.8">
+<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://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/zookeeper/">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://hadoop.apache.org/zookeeper/"><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="hadoop.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://hadoop.apache.org/zookeeper/">Project</a>
+</li>
+<li>
+<a class="unselected" href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</li>
+<li class="current">
+<a class="selected" href="index.html">ZooKeeper 3.3 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">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="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ">FAQ</a>
+</div>
+<div class="menuitem">
+<a href="http://hadoop.apache.org/zookeeper/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>
+    
+<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://hadoop.apache.org/zookeeper/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>
+      
+</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="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</li>
+      
+<li>
+<a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ">FAQ</a>
+</li>    
+      
+</ul>
+      
+</li>
+
+	  
+<li>
+<strong>BookKeeper Documentation</strong>
+	  
+<p> BookKeeper is a highly-available system that implements high-performance write-ahead logging. It uses ZooKeeper for metadata, 
+	  which is the main reason for being a ZooKeeper contrib.
+	  </p>
+      
+<ul>
+      
+<li>
+<a href="bookkeeperOverview.html">henn, what's it again?</a>
+</li>
+	  
+<li>
+<a href="bookkeeperStarted.html">Ok, now how do I try it out</a>
+</li>
+	  
+<li>
+<a href="bookkeeperProgrammer.html">Awesome, but how do I integrate it with my app?</a>
+</li>
+      
+<li>
+<a href="bookkeeperStream.html">Can I stream bytes instead of entries?</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;
+         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<div id="logos"></div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Added: websites/staging/zookeeper/trunk/content/doc/current/index.pdf
==============================================================================
--- websites/staging/zookeeper/trunk/content/doc/current/index.pdf (added)
+++ websites/staging/zookeeper/trunk/content/doc/current/index.pdf Tue Apr  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ache.org/zookeeper/mailing_lists.html)
+/S /URI >>
+/H /I
+>>
+endobj
+9 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 420.0 173.316 408.0 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperOver.html)
+/S /URI >>
+/H /I
+>>
+endobj
+10 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 393.6 198.996 381.6 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperStarted.html)
+/S /URI >>
+/H /I
+>>
+endobj
+11 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 367.2 194.316 355.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (releasenotes.html)
+/S /URI >>
+/H /I
+>>
+endobj
+12 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 300.4 172.992 288.4 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (api/index.html)
+/S /URI >>
+/H /I
+>>
+endobj
+13 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 287.2 225.144 275.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperProgrammers.html)
+/S /URI >>
+/H /I
+>>
+endobj
+14 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 274.0 249.96 262.0 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (javaExample.html)
+/S /URI >>
+/H /I
+>>
+endobj
+15 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 260.8 256.296 248.8 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperTutorial.html)
+/S /URI >>
+/H /I
+>>
+endobj
+16 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 247.6 220.968 235.6 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (recipes.html)
+/S /URI >>
+/H /I
+>>
+endobj
+17 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 180.8 232.488 168.8 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperAdmin.html)
+/S /URI >>
+/H /I
+>>
+endobj
+18 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 154.4 187.656 142.4 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperQuotas.html)
+/S /URI >>
+/H /I
+>>
+endobj
+19 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 141.2 150.0 129.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperJMX.html)
+/S /URI >>
+/H /I
+>>
+endobj
+20 0 obj
+<< /Length 2095 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+GatU5>EbO7'Roe[i2t*pQ3Dh)oVIaG\o$0c,jBWP1VGol[aq;`a8rpps8,FNU4Y]d9IDJD`TR+^*M&*6*nICh8*p#lopk^Hb&d8,hsnWLhsiiR-6jM@OV^(Eh"g9\h[&2Mc9KVNQdq/_e[JQM6g+39S<]/0l`[Q4MI5P,:Ttdo^UfiWnQ^ZUkNk=5^9/O.SSbo]'P!%%(k5:`8^$KEh9sNcX>*:a@cne"&.J[ESfOQWgm\AqhbLgHj]*gU_Pps_7@i\m&@n`B=<+nL8G\_X:5+Y!2\diM=ZIobN`uiuE;.qo6eE&3D[Kh+^%+39p1fU&(!ANR;_ts$?h(abqESh(5cZ`RW,\7J9E#:bs5a)Z`f@.uY1'=$7r/_$e5[\NkU+R&qU5B<rmC1%\hd#*E9)?u-=b*R5K4q#G,p#JofAr\]Vs"qF/jNS4.&/u9:Q,;kq#'im3u[:%:&JJ9/ZLc?<P:/"/#7&")$4*H?IACC?kDQ'l*BZ:ZW?/Hn"m+Cg638DT'RgdN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i<gc^X@+:`iU6r#kUh?-h3Qc!!i<H,Zg+K@7s#=ncNlin&.h\m04pIucq9?hbPC$#2u22[bP/U2pJB@PfuMj8"YC*;I\;Dbr')HgPf-<WL*/NFGP<s\W:PLO$H/CuP`?)ge?bud#4dor]=,\=0%<^3<L8[,`XDG>\[cB)o'>f>bs=;*F2W6f5jRQ11Xk/e#B!_TQ"m<XCCjsejCb$QC6^60Rhf#+T#F08)Ra1oG.'+.efgcr:u;uBRf^Fsd<f&t"tPOdSS/Et1l+D'fV1B0HW-T&aX8rHFlhof&NRc=obZE!'*fRu3fEsPohhH3-M^u^k/FV'.Y4*K%r=m7'cYAFi4RjA"mnK#p&FP:XdZFec0'k2ros9d=q0WBiK+O=6Hmg@qpkAmg%Sr7`_Lc,C_RAr:<B$h`\I%t\m9-]:b3A!OMFFSQc/8P^X2pu2$c
 1bpY,@ZQ_6=VYhETt0A%GAE1,U3_E2)HFFUg7f#G!7L^nr`2+!m)e7d[N[Pid48%OE7-iRACBaJAmq5N"P+2_AlQ=XfMjfZCd?,+AH>iiTt!).%6AH~>
+endstream
+endobj
+21 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 20 0 R
+/Annots 22 0 R
+>>
+endobj
+22 0 obj
+[
+23 0 R
+24 0 R
+25 0 R
+26 0 R
+27 0 R
+28 0 R
+29 0 R
+30 0 R
+31 0 R
+]
+endobj
+23 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 664.8 230.304 652.8 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperHierarchicalQuorums.html)
+/S /URI >>
+/H /I
+>>
+endobj
+24 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 651.6 174.648 639.6 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperObservers.html)
+/S /URI >>
+/H /I
+>>
+endobj
+25 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 584.8 224.964 572.8 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (zookeeperInternals.html)
+/S /URI >>
+/H /I
+>>
+endobj
+26 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 552.4 150.0 540.4 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (http://wiki.apache.org/hadoop/ZooKeeper)
+/S /URI >>
+/H /I
+>>
+endobj
+27 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 539.2 150.0 527.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (http://wiki.apache.org/hadoop/ZooKeeper/FAQ)
+/S /URI >>
+/H /I
+>>
+endobj
+28 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 459.2 229.476 447.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (bookkeeperOverview.html)
+/S /URI >>
+/H /I
+>>
+endobj
+29 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 446.0 257.328 434.0 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (bookkeeperStarted.html)
+/S /URI >>
+/H /I
+>>
+endobj
+30 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 432.8 363.972 420.8 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (bookkeeperProgrammer.html)
+/S /URI >>
+/H /I
+>>
+endobj
+31 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 126.0 419.6 305.964 407.6 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (bookkeeperStream.html)
+/S /URI >>
+/H /I
+>>
+endobj
+32 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /Helvetica
+/Encoding /WinAnsiEncoding >>
+endobj
+33 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+34 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+35 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica-Oblique
+/Encoding /WinAnsiEncoding >>
+endobj
+36 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F7
+/BaseFont /Times-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 2
+/Kids [6 0 R 21 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ >>
+endobj
+3 0 obj
+<< 
+/Font << /F1 32 0 R /F5 33 0 R /F3 34 0 R /F2 35 0 R /F7 36 0 R >> 
+/ProcSet [ /PDF /ImageC /Text ] >> 
+endobj
+xref
+0 37
+0000000000 65535 f 
+0000009559 00000 n 
+0000009624 00000 n 
+0000009674 00000 n 
+0000000015 00000 n 
+0000000071 00000 n 
+0000002781 00000 n 
+0000002901 00000 n 
+0000003002 00000 n 
+0000003204 00000 n 
+0000003369 00000 n 
+0000003538 00000 n 
+0000003703 00000 n 
+0000003865 00000 n 
+0000004038 00000 n 
+0000004201 00000 n 
+0000004371 00000 n 
+0000004531 00000 n 
+0000004698 00000 n 
+0000004866 00000 n 
+0000005029 00000 n 
+0000007217 00000 n 
+0000007340 00000 n 
+0000007423 00000 n 
+0000007604 00000 n 
+0000007775 00000 n 
+0000007946 00000 n 
+0000008131 00000 n 
+0000008320 00000 n 
+0000008491 00000 n 
+0000008661 00000 n 
+0000008834 00000 n 
+0000009003 00000 n 
+0000009111 00000 n 
+0000009221 00000 n 
+0000009334 00000 n 
+0000009450 00000 n 
+trailer
+<<
+/Size 37
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+9797
+%%EOF

Added: websites/staging/zookeeper/trunk/content/doc/current/javaExample.html
==============================================================================
--- websites/staging/zookeeper/trunk/content/doc/current/javaExample.html (added)
+++ websites/staging/zookeeper/trunk/content/doc/current/javaExample.html Tue Apr  5 02:48:22 2011
@@ -0,0 +1,906 @@
+<!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.8">
+<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://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/zookeeper/">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://hadoop.apache.org/zookeeper/"><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="hadoop.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://hadoop.apache.org/zookeeper/">Project</a>
+</li>
+<li>
+<a class="unselected" href="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</li>
+<li class="current">
+<a class="selected" href="index.html">ZooKeeper 3.3 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">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="http://wiki.apache.org/hadoop/ZooKeeper">Wiki</a>
+</div>
+<div class="menuitem">
+<a href="http://wiki.apache.org/hadoop/ZooKeeper/FAQ">FAQ</a>
+</div>
+<div class="menuitem">
+<a href="http://hadoop.apache.org/zookeeper/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="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>
+  
+
+  
+
+  
+<a name="N10009"></a><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="N10012"></a><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>then name of a znode - the one to be watched</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="N1003B"></a><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="N1004C"></a><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="N100A0"></a><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="N10104"></a><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;
+         2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>