You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by an...@apache.org on 2018/11/09 16:41:54 UTC
[17/18] zookeeper git commit: ZOOKEEPER-3155: Remove Forrest XMLs and their build process from the …
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/bookkeeperStarted.html
----------------------------------------------------------------------
diff --git a/docs/bookkeeperStarted.html b/docs/bookkeeperStarted.html
deleted file mode 100644
index d039ef4..0000000
--- a/docs/bookkeeperStarted.html
+++ /dev/null
@@ -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> > <a href="http://zookeeper.apache.org/">ZooKeeper</a> > <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">
- <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">
-
-
- </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 & 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-<version>-bookkeeper.jar:./zookeeper-<version>.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 < 10; i++){
- entry.putInt(i);
- entry.position(0);
- entries.add(entry.array());
- lh.addEntry(entry.array());
-}
-lh.close();
-lh = bkc.openLedger(ledgerId, ledgerPassword);
-
-Enumeration<LedgerEntry> 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"> </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 ©
- 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
- |end bottomstrip
- +-->
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/bookkeeperStarted.pdf
----------------------------------------------------------------------
diff --git a/docs/bookkeeperStarted.pdf b/docs/bookkeeperStarted.pdf
deleted file mode 100644
index 42e4987..0000000
Binary files a/docs/bookkeeperStarted.pdf and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/bookkeeperStream.html
----------------------------------------------------------------------
diff --git a/docs/bookkeeperStream.html b/docs/bookkeeperStream.html
deleted file mode 100644
index 0566340..0000000
--- a/docs/bookkeeperStream.html
+++ /dev/null
@@ -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> > <a href="http://zookeeper.apache.org/">ZooKeeper</a> > <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">
- <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">
-
-
- </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 & 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"> </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 ©
- 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
- |end bottomstrip
- +-->
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/bookkeeperStream.pdf
----------------------------------------------------------------------
diff --git a/docs/bookkeeperStream.pdf b/docs/bookkeeperStream.pdf
deleted file mode 100644
index 87aad97..0000000
Binary files a/docs/bookkeeperStream.pdf and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/broken-links.xml
----------------------------------------------------------------------
diff --git a/docs/broken-links.xml b/docs/broken-links.xml
deleted file mode 100644
index f95aa9b..0000000
--- a/docs/broken-links.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<broken-links>
-</broken-links>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/2pc.jpg
----------------------------------------------------------------------
diff --git a/docs/images/2pc.jpg b/docs/images/2pc.jpg
deleted file mode 100644
index fe4488f..0000000
Binary files a/docs/images/2pc.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/bk-overview.jpg
----------------------------------------------------------------------
diff --git a/docs/images/bk-overview.jpg b/docs/images/bk-overview.jpg
deleted file mode 100644
index 6e12fb4..0000000
Binary files a/docs/images/bk-overview.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/built-with-forrest-button.png
----------------------------------------------------------------------
diff --git a/docs/images/built-with-forrest-button.png b/docs/images/built-with-forrest-button.png
deleted file mode 100644
index 4a787ab..0000000
Binary files a/docs/images/built-with-forrest-button.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/favicon.ico
----------------------------------------------------------------------
diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico
deleted file mode 100644
index 161bcf7..0000000
Binary files a/docs/images/favicon.ico and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/hadoop-logo.jpg
----------------------------------------------------------------------
diff --git a/docs/images/hadoop-logo.jpg b/docs/images/hadoop-logo.jpg
deleted file mode 100644
index 809525d..0000000
Binary files a/docs/images/hadoop-logo.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/instruction_arrow.png
----------------------------------------------------------------------
diff --git a/docs/images/instruction_arrow.png b/docs/images/instruction_arrow.png
deleted file mode 100644
index 0fbc724..0000000
Binary files a/docs/images/instruction_arrow.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/state_dia.jpg
----------------------------------------------------------------------
diff --git a/docs/images/state_dia.jpg b/docs/images/state_dia.jpg
deleted file mode 100644
index b6f4a8b..0000000
Binary files a/docs/images/state_dia.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zkcomponents.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zkcomponents.jpg b/docs/images/zkcomponents.jpg
deleted file mode 100644
index 7690578..0000000
Binary files a/docs/images/zkcomponents.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zknamespace.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zknamespace.jpg b/docs/images/zknamespace.jpg
deleted file mode 100644
index 05534bc..0000000
Binary files a/docs/images/zknamespace.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zkperfRW-3.2.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zkperfRW-3.2.jpg b/docs/images/zkperfRW-3.2.jpg
deleted file mode 100644
index 594b50b..0000000
Binary files a/docs/images/zkperfRW-3.2.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zkperfRW.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zkperfRW.jpg b/docs/images/zkperfRW.jpg
deleted file mode 100644
index ad3019f..0000000
Binary files a/docs/images/zkperfRW.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zkperfreliability.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zkperfreliability.jpg b/docs/images/zkperfreliability.jpg
deleted file mode 100644
index 232bba8..0000000
Binary files a/docs/images/zkperfreliability.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zkservice.jpg
----------------------------------------------------------------------
diff --git a/docs/images/zkservice.jpg b/docs/images/zkservice.jpg
deleted file mode 100644
index 1ec9154..0000000
Binary files a/docs/images/zkservice.jpg and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/images/zookeeper_small.gif
----------------------------------------------------------------------
diff --git a/docs/images/zookeeper_small.gif b/docs/images/zookeeper_small.gif
deleted file mode 100644
index 4e8014f..0000000
Binary files a/docs/images/zookeeper_small.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/index.html
----------------------------------------------------------------------
diff --git a/docs/index.html b/docs/index.html
deleted file mode 100644
index 8174a86..0000000
--- a/docs/index.html
+++ /dev/null
@@ -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> > <a href="http://zookeeper.apache.org/">ZooKeeper</a> > <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">
- <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.5 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">
-
-
- </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 & 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 & 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"> </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 ©
- <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<div id="logos"></div>
-<!--+
- |end bottomstrip
- +-->
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/index.pdf
----------------------------------------------------------------------
diff --git a/docs/index.pdf b/docs/index.pdf
deleted file mode 100644
index 9ffd60f..0000000
Binary files a/docs/index.pdf and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/javaExample.html
----------------------------------------------------------------------
diff --git a/docs/javaExample.html b/docs/javaExample.html
deleted file mode 100644
index 12bb13b..0000000
--- a/docs/javaExample.html
+++ /dev/null
@@ -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> > <a href="http://zookeeper.apache.org/">ZooKeeper</a> > <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">
- <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.5 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">
-
-
- </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 & 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 < 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 && b != prevData)
- || (b != null && !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 && 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 < 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)) > 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 && 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 && b != prevData)
- || (b != null && !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"> </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 ©
- <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
- |end bottomstrip
- +-->
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/javaExample.pdf
----------------------------------------------------------------------
diff --git a/docs/javaExample.pdf b/docs/javaExample.pdf
deleted file mode 100644
index fb9d678..0000000
Binary files a/docs/javaExample.pdf and /dev/null differ
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/linkmap.html
----------------------------------------------------------------------
diff --git a/docs/linkmap.html b/docs/linkmap.html
deleted file mode 100644
index b1f888f..0000000
--- a/docs/linkmap.html
+++ /dev/null
@@ -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> > <a href="http://zookeeper.apache.org/">ZooKeeper</a> > <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">
- <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.5 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">
-
-
- </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 & 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> ___________________ <em>site</em>
-</li>
-<ul>
-
-
-<ul>
-<li>
-<a>Overview</a> ___________________ <em>docs</em>
-</li>
-<ul>
-
-<ul>
-<li>
-<a href="index.html">Welcome</a> ___________________ <em>welcome</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperOver.html">Overview</a> ___________________ <em>overview</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperStarted.html">Getting Started</a> ___________________ <em>started</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="releasenotes.html">Release Notes</a> ___________________ <em>relnotes</em>
-</li>
-</ul>
-
-</ul>
-</ul>
-
-
-<ul>
-<li>
-<a>Developer</a> ___________________ <em>docs</em>
-</li>
-<ul>
-
-<ul>
-<li>
-<a href="api/index.html">API Docs</a> ___________________ <em>api</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperProgrammers.html">Programmer's Guide</a> ___________________ <em>program</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="javaExample.html">Java Example</a> ___________________ <em>javaEx</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperTutorial.html">Barrier and Queue Tutorial</a> ___________________ <em>barTutor</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="recipes.html">Recipes</a> ___________________ <em>recipes</em>
-</li>
-</ul>
-
-</ul>
-</ul>
-
-
-<ul>
-<li>
-<a>Admin & Ops</a> ___________________ <em>docs</em>
-</li>
-<ul>
-
-<ul>
-<li>
-<a href="zookeeperAdmin.html">Administrator's Guide</a> ___________________ <em>admin</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperQuotas.html">Quota Guide</a> ___________________ <em>quota</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperJMX.html">JMX</a> ___________________ <em>jmx</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperObservers.html">Observers Guide</a> ___________________ <em>observers</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="zookeeperReconfig.html">Dynamic Reconfiguration</a> ___________________ <em>reconfig</em>
-</li>
-</ul>
-
-</ul>
-</ul>
-
-
-<ul>
-<li>
-<a>Contributor</a> ___________________ <em>docs</em>
-</li>
-<ul>
-
-<ul>
-<li>
-<a href="zookeeperInternals.html">ZooKeeper Internals</a> ___________________ <em>internals</em>
-</li>
-</ul>
-
-</ul>
-</ul>
-
-
-<ul>
-<li>
-<a>Miscellaneous</a> ___________________ <em>docs</em>
-</li>
-<ul>
-
-<ul>
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER">Wiki</a> ___________________ <em>wiki</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ">FAQ</a> ___________________ <em>faq</em>
-</li>
-</ul>
-
-<ul>
-<li>
-<a href="http://zookeeper.apache.org/mailing_lists.html">Mailing Lists</a> ___________________ <em>lists</em>
-</li>
-</ul>
-
-
-</ul>
-</ul>
-
-
-
-
-
-
-</ul>
-</ul>
-</div>
-<!--+
- |end content
- +-->
-<div class="clearboth"> </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 ©
- <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
-</div>
-<!--+
- |end bottomstrip
- +-->
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ab59048a/docs/linkmap.pdf
----------------------------------------------------------------------
diff --git a/docs/linkmap.pdf b/docs/linkmap.pdf
deleted file mode 100644
index 89ae180..0000000
Binary files a/docs/linkmap.pdf and /dev/null differ