Modified: helix/site-content/0.9.9-docs/recipes/lock_manager.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/0.9.9-docs/recipes/lock_manager.html?rev=1899880&r1=1899879&r2=1899880&view=diff
==============================================================================
--- helix/site-content/0.9.9-docs/recipes/lock_manager.html (original)
+++ helix/site-content/0.9.9-docs/recipes/lock_manager.html Fri Apr 15 07:24:01 
2022
@@ -1,20 +1,20 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2021-11-21
+ Generated by Apache Maven Doxia at 2022-04-15
  Rendered using Maven Reflow Skin 1.0.0 
(http://andriusvelykis.github.com/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
 
        <head>
                <meta charset="UTF-8" />
-               <title>Apache Helix - Distributed Lock Manager</title>
+               <title>Apache Helix &#x2013; </title>
                <meta name="viewport" content="width=device-width, 
initial-scale=1.0" />
                <meta name="description" content="" />
                <meta http-equiv="content-language" content="en" />
 
-               <link href="../css/bootstrap.min.css" rel="stylesheet" />
-               <link href="../css/bootstrap-responsive.min.css" 
rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css";
 rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css";
 rel="stylesheet" />
                <link href="../css/docs.css" rel="stylesheet" />
                <link href="../css/reflow-skin.css" rel="stylesheet" />
                
@@ -29,18 +29,9 @@
                        <script 
src="http://html5shim.googlecode.com/svn/trunk/html5.js";></script>
                <![endif]-->
                
-<script type="text/javascript">var _gaq = _gaq || [];
-        _gaq.push(['_setAccount', 'UA-3211522-12']);
-        _gaq.push(['_trackPageview']);
-
-        (function() {
-        var ga = document.createElement('script'); ga.type = 
'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
-        })();</script>
        </head>
 
-       <body class="page-recipes-lock_manager project-099-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+       <body class="page-$config.fileId project-$config.projectId" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
 
                <div class="navbar navbar-fixed-top">
                        <div class="navbar-inner">
@@ -50,34 +41,33 @@
                                                <span class="icon-bar"></span>
                                                <span class="icon-bar"></span>
                                        </a>
-                                       <a class="brand" href="../..">Apache 
Helix</a>
                                        <div class="nav-collapse">
                                                <ul class="nav pull-right">
-                                                       <li><a 
href="../index.html" title="Helix 0.9.9">Helix 0.9.9 </a></li>
-                                                       <li class="dropdown">
+                                                       <li class="active"><a 
href="" title="Helix 0.9.9">Helix 0.9.9 </a></li>
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Get Helix <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../download.html" title="Download">Download </a></li>
-                                                                       <li><a 
href="../Building.html" title="Building">Building </a></li>
-                                                                       <li><a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a></li>
+                                                                       <li 
class="active"><a href="" title="Download">Download </a></li>
+                                                                       <li 
class="active"><a href="" title="Building">Building </a></li>
+                                                                       <li 
class="active"><a href="" title="Release Notes">Release Notes </a></li>
                                                                </ul>
                                                        </li>
-                                                       <li class="dropdown">
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Hands-On <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../Quickstart.html" title="Quick Start">Quick Start </a></li>
-                                                                       <li><a 
href="../Tutorial.html" title="Tutorial">Tutorial </a></li>
-                                                                       <li><a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a></li>
+                                                                       <li 
class="active"><a href="" title="Quick Start">Quick Start </a></li>
+                                                                       <li 
class="active"><a href="" title="Tutorial">Tutorial </a></li>
+                                                                       <li 
class="active"><a href="" title="Javadocs">Javadocs </a></li>
                                                                </ul>
                                                        </li>
                                                        <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
                                                                        <li 
class="active"><a href="" title="Distributed lock manager">Distributed lock 
manager </a></li>
-                                                                       <li><a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a></li>
-                                                                       <li><a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a></li>
-                                                                       <li><a 
href="service_discovery.html" title="Service discovery">Service discovery 
</a></li>
-                                                                       <li><a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a></li>
+                                                                       <li 
class="active"><a href="" title="Rabbit MQ consumer group">Rabbit MQ consumer 
group </a></li>
+                                                                       <li 
class="active"><a href="" title="Rsync replicated file store">Rsync replicated 
file store </a></li>
+                                                                       <li 
class="active"><a href="" title="Service discovery">Service discovery </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed task DAG execution">Distributed 
task DAG execution </a></li>
                                                                </ul>
                                                        </li>
                                                </ul>
@@ -94,22 +84,21 @@
                <div class="row" id="banner">
                        <div class="span12">
                                <div class="pull-left">
-                                       <a href="../../" id="bannerLeft"><img 
src="../../images/helix-logo.jpg" alt='"''"' /></a>
-                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                                       <a href="" id="bannerLeft"><img src="" 
alt='"''"' /></a>
                                </div>
                                <div class="pull-right">
-                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../../images/feather_small.gif" alt='"''"' /></a>
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="" alt='"''"' /></a>
                                </div>
                        </div>
                </div>
                <div>
                        <ul class="breadcrumb">
-                               <li><a href="../../" title="Apache 
Helix">Apache Helix </a></li>
+                               <li><a href="" title="Apache Helix">Apache 
Helix </a></li>
                                <li class="divider">/</li>
-                               <li><a href="../" title="Release 0.9.9">Release 
0.9.9 </a></li>
+                               <li><a href="" title="Release 0.9.9">Release 
0.9.9 </a></li>
                                <li class="divider">/</li>
-                               <li>Distributed Lock Manager</li>
-                               <li class="publishDate version-date 
pull-right">Last Published: 2021-11-21</li>
+                               <li></li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2022-04-15</li>
                        </ul>
                </div>
        </header>
@@ -118,245 +107,7 @@
        <div class="row">
                <div class="span12">
                        <div class="body-content">
-<!-- -
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License. --> 
-<div class="section"> 
- <div class="page-header">
-  <h2 id="Distributed_Lock_Manager">Distributed Lock Manager</h2>
- </div> 
- <p>Distributed locks are used to synchronize accesses shared resources. Most 
applications today use ZooKeeper to model distributed locks.</p> 
- <p>The simplest way to model a lock using ZooKeeper is (See ZooKeeper leader 
recipe for an exact and more advanced solution)</p> 
- <ul> 
-  <li>Each process tries to create an emphemeral node</li> 
-  <li>If the node is successfully created, the process acquires the lock</li> 
-  <li>Otherwise, it will watch the ZNode and try to acquire the lock again if 
the current lock holder disappears</li> 
- </ul> 
- <p>This is good enough if there is only one lock. But in practice, an 
application will need many such locks. Distributing and managing the locks 
among difference process becomes challenging. Extending such a solution to many 
locks will result in:</p> 
- <ul> 
-  <li>Uneven distribution of locks among nodes; the node that starts first 
will acquire all the locks. Nodes that start later will be idle.</li> 
-  <li>When a node fails, how the locks will be distributed among remaining 
nodes is not predicable.</li> 
-  <li>When new nodes are added the current nodes don't relinquish the locks so 
that new nodes can acquire some locks</li> 
- </ul> 
- <p>In other words we want a system to satisfy the following requirements.</p> 
- <ul> 
-  <li>Distribute locks evenly among all nodes to get better hardware 
utilization</li> 
-  <li>If a node fails, the locks that were acquired by that node should be 
evenly distributed among other nodes</li> 
-  <li>If nodes are added, locks must be evenly re-distributed among 
nodes.</li> 
- </ul> 
- <p>Helix provides a simple and elegant solution to this problem. Simply 
specify the number of locks and Helix will ensure that above constraints are 
satisfied.</p> 
- <p>To quickly see this working run the <tt>lock-manager-demo</tt> script 
where 12 locks are evenly distributed among three nodes, and when a node fails, 
the locks get re-distributed among remaining two nodes. Note that Helix does 
not re-shuffle the locks completely, instead it simply distributes the locks 
relinquished by dead node among 2 remaining nodes evenly.</p> 
- <hr /> 
- <div class="section"> 
-  <h3 id="Short_Version">Short Version</h3> 
-  <p>This version starts multiple threads within the same process to simulate 
a multi node deployment. Try the long version to get a better idea of how it 
works.</p> 
-  <div class="source"> 
-   <pre>git clone https://git-wip-us.apache.org/repos/asf/helix.git
-cd helix
-git checkout tags/helix-0.9.9
-mvn clean install package -DskipTests
-cd recipes/distributed-lock-manager/target/distributed-lock-manager-pkg/bin
-chmod +x *
-./lock-manager-demo
-</pre> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Output">Output</h4> 
-   <div class="source"> 
-    <pre>./lock-manager-demo
-STARTING localhost_12000
-STARTING localhost_12002
-STARTING localhost_12001
-STARTED localhost_12000
-STARTED localhost_12002
-STARTED localhost_12001
-localhost_12001 acquired lock:lock-group_3
-localhost_12000 acquired lock:lock-group_8
-localhost_12001 acquired lock:lock-group_2
-localhost_12001 acquired lock:lock-group_4
-localhost_12002 acquired lock:lock-group_1
-localhost_12002 acquired lock:lock-group_10
-localhost_12000 acquired lock:lock-group_7
-localhost_12001 acquired lock:lock-group_5
-localhost_12002 acquired lock:lock-group_11
-localhost_12000 acquired lock:lock-group_6
-localhost_12002 acquired lock:lock-group_0
-localhost_12000 acquired lock:lock-group_9
-lockName    acquired By
-======================================
-lock-group_0    localhost_12002
-lock-group_1    localhost_12002
-lock-group_10    localhost_12002
-lock-group_11    localhost_12002
-lock-group_2    localhost_12001
-lock-group_3    localhost_12001
-lock-group_4    localhost_12001
-lock-group_5    localhost_12001
-lock-group_6    localhost_12000
-lock-group_7    localhost_12000
-lock-group_8    localhost_12000
-lock-group_9    localhost_12000
-Stopping localhost_12000
-localhost_12000 Interrupted
-localhost_12001 acquired lock:lock-group_9
-localhost_12001 acquired lock:lock-group_8
-localhost_12002 acquired lock:lock-group_6
-localhost_12002 acquired lock:lock-group_7
-lockName    acquired By
-======================================
-lock-group_0    localhost_12002
-lock-group_1    localhost_12002
-lock-group_10    localhost_12002
-lock-group_11    localhost_12002
-lock-group_2    localhost_12001
-lock-group_3    localhost_12001
-lock-group_4    localhost_12001
-lock-group_5    localhost_12001
-lock-group_6    localhost_12002
-lock-group_7    localhost_12002
-lock-group_8    localhost_12001
-lock-group_9    localhost_12001
-
-</pre> 
-   </div> 
-   <hr /> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Long_version">Long version</h3> 
-  <p>This provides more details on how to setup the cluster and where to 
plugin application code.</p> 
-  <div class="section"> 
-   <h4 id="Start_ZooKeeper">Start ZooKeeper</h4> 
-   <div class="source"> 
-    <pre>./start-standalone-zookeeper 2199
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Create_a_Cluster">Create a Cluster</h4> 
-   <div class="source"> 
-    <pre>./helix-admin --zkSvr localhost:2199 --addCluster lock-manager-demo
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Create_a_Lock_Group">Create a Lock Group</h4> 
-   <p>Create a lock group and specify the number of locks in the lock 
group.</p> 
-   <div class="source"> 
-    <pre>./helix-admin --zkSvr localhost:2199  --addResource lock-manager-demo 
lock-group 6 OnlineOffline --mode AUTO_REBALANCE
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Start_the_Nodes">Start the Nodes</h4> 
-   <p>Create a Lock class that handles the callbacks.</p> 
-   <div class="source"> 
-    <pre>public class Lock extends StateModel {
-  private String lockName;
-
-  public Lock(String lockName) {
-    this.lockName = lockName;
-  }
-
-  public void lock(Message m, NotificationContext context) {
-    System.out.println(&quot; acquired lock:&quot;+ lockName );
-  }
-
-  public void release(Message m, NotificationContext context) {
-    System.out.println(&quot; releasing lock:&quot;+ lockName );
-  }
-
-}
-</pre> 
-   </div> 
-   <p>and a LockFactory that creates Locks</p> 
-   <div class="source"> 
-    <pre>public class LockFactory extends StateModelFactory&lt;Lock&gt; {
-    /* Instantiates the lock handler, one per lockName */
-    public Lock create(String lockName) {
-        return new Lock(lockName);
-    }
-}
-</pre> 
-   </div> 
-   <p>At node start up, simply join the cluster and Helix will invoke the 
appropriate callbacks on the appropriate Lock instance. One can start any 
number of nodes and Helix detects that a new node has joined the cluster and 
re-distributes the locks automatically.</p> 
-   <div class="source"> 
-    <pre>public class LockProcess {
-  public static void main(String args) {
-    String zkAddress= &quot;localhost:2199&quot;;
-    String clusterName = &quot;lock-manager-demo&quot;;
-    //Give a unique id to each process, most commonly used format hostname_port
-    String instanceName =&quot;localhost_12000&quot;;
-    ZKHelixAdmin helixAdmin = new ZKHelixAdmin(zkAddress);
-    //configure the instance and provide some metadata
-    InstanceConfig config = new InstanceConfig(instanceName);
-    config.setHostName(&quot;localhost&quot;);
-    config.setPort(&quot;12000&quot;);
-    admin.addInstance(clusterName, config);
-    //join the cluster
-    HelixManager manager;
-    manager = HelixManagerFactory.getHelixManager(clusterName,
-                                                  instanceName,
-                                                  InstanceType.PARTICIPANT,
-                                                  zkAddress);
-    
manager.getStateMachineEngine().registerStateModelFactory(&quot;OnlineOffline&quot;,
 modelFactory);
-    manager.connect();
-    Thread.currentThread.join();
-  }
-}
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Start_the_Controller">Start the Controller</h4> 
-   <p>The controller can be started either as a separate process or can be 
embedded within each node process</p> 
-   <div class="section"> 
-    <h5 id="Separate_Process">Separate Process</h5> 
-    <p>This is recommended when number of nodes in the cluster &gt; 100. For 
fault tolerance, you can run multiple controllers on different boxes.</p> 
-    <div class="source"> 
-     <pre>./run-helix-controller --zkSvr localhost:2199 --cluster 
lock-manager-demo 2&gt;&amp;1 &gt; /tmp/controller.log &amp;
-</pre> 
-    </div> 
-   </div> 
-   <div class="section"> 
-    <h5 id="Embedded_Within_the_Node_Process">Embedded Within the Node 
Process</h5> 
-    <p>This is recommended when the number of nodes in the cluster is less 
than 100. To start a controller from each process, simply add the following 
lines to MyClass</p> 
-    <div class="source"> 
-     <pre>public class LockProcess {
-  public static void main(String args) {
-    String zkAddress= &quot;localhost:2199&quot;;
-    String clusterName = &quot;lock-manager-demo&quot;;
-    // .
-    // .
-    manager.connect();
-    HelixManager controller;
-    controller = HelixControllerMain.startHelixController(zkAddress,
-                                                          clusterName,
-                                                          
&quot;controller&quot;,
-                                                          
HelixControllerMain.STANDALONE);
-    Thread.currentThread.join();
-  }
-}
-</pre> 
-    </div> 
-   </div> 
-  </div> 
- </div> 
-</div>
+$bodyWithHeader
                        </div>
                </div>
        </div>
@@ -369,51 +120,43 @@ lock-group_9    localhost_12001
        <footer class="well">
                <div class="container">
                        <div class="row">
-                               <div class="span3 bottom-nav">
+                               <div class="span9 bottom-nav">
                                        <ul class="nav nav-list">
                                                <li class="nav-header">Get 
Helix</li>
-                                               <li>
-                                                       <a 
href="../download.html" title="Download">Download </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Download">Download </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Building.html" title="Building">Building </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Building">Building </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Release Notes">Release Notes </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Hands-On</li>
-                                               <li>
-                                                       <a 
href="../Quickstart.html" title="Quick Start">Quick Start </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Quick Start">Quick Start </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Tutorial.html" title="Tutorial">Tutorial </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Tutorial">Tutorial </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Javadocs">Javadocs </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Recipes</li>
                                                <li class="active">
                                                        <a href="#" 
title="Distributed lock manager">Distributed lock manager </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rabbit MQ consumer group">Rabbit MQ consumer group </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rsync replicated file store">Rsync replicated file store </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="service_discovery.html" title="Service discovery">Service discovery </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Service discovery">Service discovery </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed task DAG execution">Distributed task DAG execution </a>
                                                </li>
                                        </ul>
                                </div>
@@ -425,14 +168,9 @@ lock-group_9    localhost_12001
                <div class="row">
                        <div class="span12">
                                <p class="pull-right"><a href="#">Back to 
top</a></p>
-                               <p class="copyright">Copyright &copy;2021 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p class="copyright">Copyright &copy;2022 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
                                <p><a 
href="http://github.com/andriusvelykis/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt"; 
target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
-               
-<div class="row span16">
-  <div>Apache Helix, Apache, the Apache feather logo, and the Apache Helix 
project logos are trademarks of The Apache Software Foundation.
-        All other marks mentioned may be trademarks or registered trademarks 
of their respective owners.</div>
-  <a href="http://helix.apache.org/0.9.9-docs/privacy-policy.html";>Privacy 
Policy</a>
-</div>                 </div>
+                                       </div>
                </div>
        </div>
 
@@ -450,7 +188,7 @@ lock-group_9    localhost_12001
                }
        </script>
        
-       <script src="../js/bootstrap.min.js"></script>
+       <script 
src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js";></script>
        <script src="../js/lightbox.js"></script>
        <script src="../js/jquery.smooth-scroll.min.js"></script>
        <!-- back button support for smooth scroll -->

Modified: helix/site-content/0.9.9-docs/recipes/rabbitmq_consumer_group.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/0.9.9-docs/recipes/rabbitmq_consumer_group.html?rev=1899880&r1=1899879&r2=1899880&view=diff
==============================================================================
--- helix/site-content/0.9.9-docs/recipes/rabbitmq_consumer_group.html 
(original)
+++ helix/site-content/0.9.9-docs/recipes/rabbitmq_consumer_group.html Fri Apr 
15 07:24:01 2022
@@ -1,20 +1,20 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2021-11-21
+ Generated by Apache Maven Doxia at 2022-04-15
  Rendered using Maven Reflow Skin 1.0.0 
(http://andriusvelykis.github.com/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
 
        <head>
                <meta charset="UTF-8" />
-               <title>Apache Helix - RabbitMQ Consumer Group</title>
+               <title>Apache Helix &#x2013; RabbitMQ Consumer Group</title>
                <meta name="viewport" content="width=device-width, 
initial-scale=1.0" />
                <meta name="description" content="" />
                <meta http-equiv="content-language" content="en" />
 
-               <link href="../css/bootstrap.min.css" rel="stylesheet" />
-               <link href="../css/bootstrap-responsive.min.css" 
rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css";
 rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css";
 rel="stylesheet" />
                <link href="../css/docs.css" rel="stylesheet" />
                <link href="../css/reflow-skin.css" rel="stylesheet" />
                
@@ -29,18 +29,9 @@
                        <script 
src="http://html5shim.googlecode.com/svn/trunk/html5.js";></script>
                <![endif]-->
                
-<script type="text/javascript">var _gaq = _gaq || [];
-        _gaq.push(['_setAccount', 'UA-3211522-12']);
-        _gaq.push(['_trackPageview']);
-
-        (function() {
-        var ga = document.createElement('script'); ga.type = 
'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
-        })();</script>
        </head>
 
-       <body class="page-recipes-rabbitmq_consumer_group project-099-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+       <body class="page-$config.fileId project-$config.projectId" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
 
                <div class="navbar navbar-fixed-top">
                        <div class="navbar-inner">
@@ -50,34 +41,33 @@
                                                <span class="icon-bar"></span>
                                                <span class="icon-bar"></span>
                                        </a>
-                                       <a class="brand" href="../..">Apache 
Helix</a>
                                        <div class="nav-collapse">
                                                <ul class="nav pull-right">
-                                                       <li><a 
href="../index.html" title="Helix 0.9.9">Helix 0.9.9 </a></li>
-                                                       <li class="dropdown">
+                                                       <li class="active"><a 
href="" title="Helix 0.9.9">Helix 0.9.9 </a></li>
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Get Helix <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../download.html" title="Download">Download </a></li>
-                                                                       <li><a 
href="../Building.html" title="Building">Building </a></li>
-                                                                       <li><a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a></li>
+                                                                       <li 
class="active"><a href="" title="Download">Download </a></li>
+                                                                       <li 
class="active"><a href="" title="Building">Building </a></li>
+                                                                       <li 
class="active"><a href="" title="Release Notes">Release Notes </a></li>
                                                                </ul>
                                                        </li>
-                                                       <li class="dropdown">
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Hands-On <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../Quickstart.html" title="Quick Start">Quick Start </a></li>
-                                                                       <li><a 
href="../Tutorial.html" title="Tutorial">Tutorial </a></li>
-                                                                       <li><a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a></li>
+                                                                       <li 
class="active"><a href="" title="Quick Start">Quick Start </a></li>
+                                                                       <li 
class="active"><a href="" title="Tutorial">Tutorial </a></li>
+                                                                       <li 
class="active"><a href="" title="Javadocs">Javadocs </a></li>
                                                                </ul>
                                                        </li>
                                                        <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed lock manager">Distributed lock 
manager </a></li>
                                                                        <li 
class="active"><a href="" title="Rabbit MQ consumer group">Rabbit MQ consumer 
group </a></li>
-                                                                       <li><a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a></li>
-                                                                       <li><a 
href="service_discovery.html" title="Service discovery">Service discovery 
</a></li>
-                                                                       <li><a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a></li>
+                                                                       <li 
class="active"><a href="" title="Rsync replicated file store">Rsync replicated 
file store </a></li>
+                                                                       <li 
class="active"><a href="" title="Service discovery">Service discovery </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed task DAG execution">Distributed 
task DAG execution </a></li>
                                                                </ul>
                                                        </li>
                                                </ul>
@@ -94,22 +84,21 @@
                <div class="row" id="banner">
                        <div class="span12">
                                <div class="pull-left">
-                                       <a href="../../" id="bannerLeft"><img 
src="../../images/helix-logo.jpg" alt='"''"' /></a>
-                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                                       <a href="" id="bannerLeft"><img src="" 
alt='"''"' /></a>
                                </div>
                                <div class="pull-right">
-                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../../images/feather_small.gif" alt='"''"' /></a>
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="" alt='"''"' /></a>
                                </div>
                        </div>
                </div>
                <div>
                        <ul class="breadcrumb">
-                               <li><a href="../../" title="Apache 
Helix">Apache Helix </a></li>
+                               <li><a href="" title="Apache Helix">Apache 
Helix </a></li>
                                <li class="divider">/</li>
-                               <li><a href="../" title="Release 0.9.9">Release 
0.9.9 </a></li>
+                               <li><a href="" title="Release 0.9.9">Release 
0.9.9 </a></li>
                                <li class="divider">/</li>
                                <li>RabbitMQ Consumer Group</li>
-                               <li class="publishDate version-date 
pull-right">Last Published: 2021-11-21</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2022-04-15</li>
                        </ul>
                </div>
        </header>
@@ -118,200 +107,7 @@
        <div class="row">
                <div class="span12">
                        <div class="body-content">
-<!-- -
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License. --> 
-<div class="section"> 
- <div class="page-header">
-  <h2 id="RabbitMQ_Consumer_Group">RabbitMQ Consumer Group</h2>
- </div> 
- <p><a class="externalLink" href="http://www.rabbitmq.com/";>RabbitMQ</a> is 
well-known open source software the provides robust messaging for 
applications.</p> 
- <p>One of the commonly implemented recipes using this software is a work 
queue. <a class="externalLink" 
href="http://www.rabbitmq.com/tutorials/tutorial-four-java.html";>http://www.rabbitmq.com/tutorials/tutorial-four-java.html</a>
 describes the use case where</p> 
- <ul> 
-  <li>A producer sends a message with a routing key</li> 
-  <li>The message is routed to the queue whose binding key exactly matches the 
routing key of the message</li> 
-  <li>There are multiple consumers and each consumer is interested in 
processing only a subset of the messages by binding to the interested keys</li> 
- </ul> 
- <p>The example provided <a class="externalLink" 
href="http://www.rabbitmq.com/tutorials/tutorial-four-java.html";>here</a> 
describes how multiple consumers can be started to process all the 
messages.</p> 
- <p>While this works, in production systems one needs the following:</p> 
- <ul> 
-  <li>Ability to handle failures: when a consumer fails, another consumer must 
be started or the other consumers must start processing these messages that 
should have been processed by the failed consumer</li> 
-  <li>When the existing consumers cannot keep up with the task generation 
rate, new consumers will be added. The tasks must be redistributed among all 
the consumers</li> 
- </ul> 
- <p>In this recipe, we demonstrate handling of consumer failures and new 
consumer additions using Helix.</p> 
- <p>Mapping this usecase to Helix is pretty easy as the binding key/routing 
key is equivalent to a partition.</p> 
- <p>Let’s take an example. Lets say the queue has 6 partitions, and we have 
2 consumers to process all the queues. What we want is all 6 queues to be 
evenly divided among 2 consumers. Eventually when the system scales, we add 
more consumers to keep up. This will make each consumer process tasks from 2 
queues. Now let’s say that a consumer failed, reducing the number of active 
consumers to 2. This means each consumer must process 3 queues.</p> 
- <p>We showcase how such a dynamic application can be developed using Helix. 
Even though we use RabbitMQ as the pub/sub system one can extend this solution 
to other pub/sub systems.</p> 
- <div class="section"> 
-  <h3 id="Try_It">Try It</h3> 
-  <div class="source"> 
-   <pre>git clone https://git-wip-us.apache.org/repos/asf/helix.git
-cd helix
-git checkout tags/helix-0.9.9
-mvn clean install package -DskipTests
-cd recipes/rabbitmq-consumer-group/bin
-chmod +x *
-export HELIX_PKG_ROOT=`pwd`/helix-core/target/helix-core-pkg
-export HELIX_RABBITMQ_ROOT=`pwd`/recipes/rabbitmq-consumer-group/
-chmod +x $HELIX_PKG_ROOT/bin/*
-chmod +x $HELIX_RABBITMQ_ROOT/bin/*
-</pre> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Install_RabbitMQ">Install RabbitMQ</h4> 
-   <p>Setting up RabbitMQ on a local box is straightforward. You can find the 
instructions here <a class="externalLink" 
href="http://www.rabbitmq.com/download.html";>http://www.rabbitmq.com/download.html</a></p>
 
-  </div> 
-  <div class="section"> 
-   <h4 id="Start_ZK">Start ZK</h4> 
-   <p>Start ZooKeeper at port 2199</p> 
-   <div class="source"> 
-    <pre>$HELIX_PKG_ROOT/bin/start-standalone-zookeeper 2199
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Setup_the_Consumer_Group_Cluster">Setup the Consumer Group 
Cluster</h4> 
-   <p>This will setup the cluster by creating a “rabbitmq-consumer-group” 
cluster and adds a “topic” with “6” queues.</p> 
-   <div class="source"> 
-    <pre>$HELIX_RABBITMQ_ROOT/bin/setup-cluster.sh localhost:2199
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Add_Consumers">Add Consumers</h4> 
-   <p>Start 2 consumers in 2 different terminals. Each consumer is given a 
unique ID.</p> 
-   <div class="source"> 
-    <pre>//start-consumer.sh zookeeperAddress (e.g. localhost:2181) consumerId 
, rabbitmqServer (e.g. localhost)
-$HELIX_RABBITMQ_ROOT/bin/start-consumer.sh localhost:2199 0 localhost
-$HELIX_RABBITMQ_ROOT/bin/start-consumer.sh localhost:2199 1 localhost
-
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Start_the_Helix_Controller">Start the Helix Controller</h4> 
-   <p>Now start a Helix controller that starts managing the 
“rabbitmq-consumer-group” cluster.</p> 
-   <div class="source"> 
-    <pre>$HELIX_RABBITMQ_ROOT/bin/start-cluster-manager.sh localhost:2199
-</pre> 
-   </div> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Send_Messages_to_the_Topic">Send Messages to the Topic</h4> 
-   <p>Start sending messages to the topic. This script randomly selects a 
routing key (1-6) and sends the message to topic. Based on the key, messages 
gets routed to the appropriate queue.</p> 
-   <div class="source"> 
-    <pre>$HELIX_RABBITMQ_ROOT/bin/send-message.sh localhost 20
-</pre> 
-   </div> 
-   <p>After running this, you should see all 20 messages being processed by 2 
consumers.</p> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Add_Another_Consumer">Add Another Consumer</h4> 
-   <p>Once a new consumer is started, Helix detects it. In order to balance 
the load between 3 consumers, it deallocates 1 partition from the existing 
consumers and allocates it to the new consumer. We see that each consumer is 
now processing only 2 queues. Helix makes sure that old nodes are asked to stop 
consuming before the new consumer is asked to start consuming for a given 
partition. But the transitions for each partition can happen in parallel.</p> 
-   <div class="source"> 
-    <pre>$HELIX_RABBITMQ_ROOT/bin/start-consumer.sh localhost:2199 2 localhost
-</pre> 
-   </div> 
-   <p>Send messages again to the topic</p> 
-   <div class="source"> 
-    <pre>$HELIX_RABBITMQ_ROOT/bin/send-message.sh localhost 100
-</pre> 
-   </div> 
-   <p>You should see that messages are now received by all 3 consumers.</p> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Stop_a_Consumer">Stop a Consumer</h4> 
-   <p>In any terminal press CTRL^C and notice that Helix detects the consumer 
failure and distributes the 2 partitions that were processed by failed consumer 
to the remaining 2 active consumers.</p> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="How_does_this_work">How does this work?</h3> 
-  <p>Find the entire code <a class="externalLink" 
href="https://git-wip-us.apache.org/repos/asf?p=helix.git;a=tree;f=recipes/rabbitmq-consumer-group/src/main/java/org/apache/helix/recipes/rabbitmq";>here</a>.</p>
 
-  <div class="section"> 
-   <h4 id="Cluster_Setup">Cluster Setup</h4> 
-   <p>This step creates ZNode on ZooKeeper for the cluster and adds the state 
model. We use online offline state model since there is no need for other 
states. The consumer is either processing a queue or it is not.</p> 
-   <p>It creates a resource called “rabbitmq-consumer-group” with 6 
partitions. The execution mode is set to AUTO_REBALANCE. This means that the 
Helix controls the assignment of partition to consumers and automatically 
distributes the partitions evenly among the active consumers. When a consumer 
is added or removed, it ensures that a minimum number of partitions are 
shuffled.</p> 
-   <div class="source"> 
-    <pre>zkclient = new ZkClient(zkAddr, ZkClient.DEFAULT_SESSION_TIMEOUT,
-    ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
-ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);
-
-// add cluster
-admin.addCluster(clusterName, true);
-
-// add state model definition
-StateModelConfigGenerator generator = new StateModelConfigGenerator();
-admin.addStateModelDef(clusterName, &quot;OnlineOffline&quot;,
-    new StateModelDefinition(generator.generateConfigForOnlineOffline()));
-
-// add resource &quot;topic&quot; which has 6 partitions
-String resourceName = &quot;rabbitmq-consumer-group&quot;;
-admin.addResource(clusterName, resourceName, 6, &quot;OnlineOffline&quot;, 
&quot;AUTO_REBALANCE&quot;);
-</pre> 
-   </div> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Starting_the_Consumers">Starting the Consumers</h3> 
-  <p>The only thing consumers need to know is the ZooKeeper address, cluster 
name and consumer ID. It does not need to know anything else.</p> 
-  <div class="source"> 
-   <pre>_manager = HelixManagerFactory.getZKHelixManager(_clusterName,
-                                                 _consumerId,
-                                                 InstanceType.PARTICIPANT,
-                                                 _zkAddr);
-
-StateMachineEngine stateMach = _manager.getStateMachineEngine();
-ConsumerStateModelFactory modelFactory =
-    new ConsumerStateModelFactory(_consumerId, _mqServer);
-stateMach.registerStateModelFactory(&quot;OnlineOffline&quot;, modelFactory);
-
-_manager.connect();
-</pre> 
-  </div> 
-  <p>Once the consumer has registered the state model and the controller is 
started, the consumer starts getting callbacks (onBecomeOnlineFromOffline) for 
the partition it needs to host. All it needs to do as part of the callback is 
to start consuming messages from the appropriate queue. Similarly, when the 
controller deallocates a partitions from a consumer, it fires 
onBecomeOfflineFromOnline for the same partition. As a part of this transition, 
the consumer will stop consuming from a that queue.</p> 
-  <div class="source"> 
-   <pre>@Transition(to = &quot;ONLINE&quot;, from = &quot;OFFLINE&quot;)
-public void onBecomeOnlineFromOffline(Message message, NotificationContext 
context) {
-  LOG.debug(_consumerId + &quot; becomes ONLINE from OFFLINE for &quot; + 
_partition);
-  if (_thread == null) {
-    LOG.debug(&quot;Starting ConsumerThread for &quot; + _partition + 
&quot;...&quot;);
-    _thread = new ConsumerThread(_partition, _mqServer, _consumerId);
-    _thread.start();
-    LOG.debug(&quot;Starting ConsumerThread for &quot; + _partition + &quot; 
done&quot;);
-
-  }
-}
-
-@Transition(to = &quot;OFFLINE&quot;, from = &quot;ONLINE&quot;)
-public void onBecomeOfflineFromOnline(Message message, NotificationContext 
context)
-    throws InterruptedException {
-  LOG.debug(_consumerId + &quot; becomes OFFLINE from ONLINE for &quot; + 
_partition);
-  if (_thread != null) {
-    LOG.debug(&quot;Stopping &quot; + _consumerId + &quot; for &quot; + 
_partition + &quot;...&quot;);
-    _thread.interrupt();
-    _thread.join(2000);
-    _thread = null;
-    LOG.debug(&quot;Stopping &quot; +  _consumerId + &quot; for &quot; + 
_partition + &quot; done&quot;);
-  }
-}
-</pre> 
-  </div> 
- </div> 
-</div>
+$bodyWithHeader
                        </div>
                </div>
        </div>
@@ -324,51 +120,43 @@ public void onBecomeOfflineFromOnline(Me
        <footer class="well">
                <div class="container">
                        <div class="row">
-                               <div class="span3 bottom-nav">
+                               <div class="span9 bottom-nav">
                                        <ul class="nav nav-list">
                                                <li class="nav-header">Get 
Helix</li>
-                                               <li>
-                                                       <a 
href="../download.html" title="Download">Download </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Download">Download </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Building.html" title="Building">Building </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Building">Building </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Release Notes">Release Notes </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Hands-On</li>
-                                               <li>
-                                                       <a 
href="../Quickstart.html" title="Quick Start">Quick Start </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Quick Start">Quick Start </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Tutorial.html" title="Tutorial">Tutorial </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Tutorial">Tutorial </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Javadocs">Javadocs </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Recipes</li>
-                                               <li>
-                                                       <a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed lock manager">Distributed lock manager </a>
                                                </li>
                                                <li class="active">
                                                        <a href="#" 
title="Rabbit MQ consumer group">Rabbit MQ consumer group </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rsync replicated file store">Rsync replicated file store </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="service_discovery.html" title="Service discovery">Service discovery </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Service discovery">Service discovery </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed task DAG execution">Distributed task DAG execution </a>
                                                </li>
                                        </ul>
                                </div>
@@ -380,14 +168,9 @@ public void onBecomeOfflineFromOnline(Me
                <div class="row">
                        <div class="span12">
                                <p class="pull-right"><a href="#">Back to 
top</a></p>
-                               <p class="copyright">Copyright &copy;2021 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p class="copyright">Copyright &copy;2022 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
                                <p><a 
href="http://github.com/andriusvelykis/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt"; 
target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
-               
-<div class="row span16">
-  <div>Apache Helix, Apache, the Apache feather logo, and the Apache Helix 
project logos are trademarks of The Apache Software Foundation.
-        All other marks mentioned may be trademarks or registered trademarks 
of their respective owners.</div>
-  <a href="http://helix.apache.org/0.9.9-docs/privacy-policy.html";>Privacy 
Policy</a>
-</div>                 </div>
+                                       </div>
                </div>
        </div>
 
@@ -405,7 +188,7 @@ public void onBecomeOfflineFromOnline(Me
                }
        </script>
        
-       <script src="../js/bootstrap.min.js"></script>
+       <script 
src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js";></script>
        <script src="../js/lightbox.js"></script>
        <script src="../js/jquery.smooth-scroll.min.js"></script>
        <!-- back button support for smooth scroll -->

Modified: helix/site-content/0.9.9-docs/recipes/rsync_replicated_file_store.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/0.9.9-docs/recipes/rsync_replicated_file_store.html?rev=1899880&r1=1899879&r2=1899880&view=diff
==============================================================================
--- helix/site-content/0.9.9-docs/recipes/rsync_replicated_file_store.html 
(original)
+++ helix/site-content/0.9.9-docs/recipes/rsync_replicated_file_store.html Fri 
Apr 15 07:24:01 2022
@@ -1,20 +1,20 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2021-11-21
+ Generated by Apache Maven Doxia at 2022-04-15
  Rendered using Maven Reflow Skin 1.0.0 
(http://andriusvelykis.github.com/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
 
        <head>
                <meta charset="UTF-8" />
-               <title>Apache Helix - Near-Realtime Rsync Replicated File 
System</title>
+               <title>Apache Helix &#x2013; Near-Realtime Rsync Replicated 
File System</title>
                <meta name="viewport" content="width=device-width, 
initial-scale=1.0" />
                <meta name="description" content="" />
                <meta http-equiv="content-language" content="en" />
 
-               <link href="../css/bootstrap.min.css" rel="stylesheet" />
-               <link href="../css/bootstrap-responsive.min.css" 
rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css";
 rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css";
 rel="stylesheet" />
                <link href="../css/docs.css" rel="stylesheet" />
                <link href="../css/reflow-skin.css" rel="stylesheet" />
                
@@ -29,18 +29,9 @@
                        <script 
src="http://html5shim.googlecode.com/svn/trunk/html5.js";></script>
                <![endif]-->
                
-<script type="text/javascript">var _gaq = _gaq || [];
-        _gaq.push(['_setAccount', 'UA-3211522-12']);
-        _gaq.push(['_trackPageview']);
-
-        (function() {
-        var ga = document.createElement('script'); ga.type = 
'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
-        })();</script>
        </head>
 
-       <body class="page-recipes-rsync_replicated_file_store project-099-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+       <body class="page-$config.fileId project-$config.projectId" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
 
                <div class="navbar navbar-fixed-top">
                        <div class="navbar-inner">
@@ -50,34 +41,33 @@
                                                <span class="icon-bar"></span>
                                                <span class="icon-bar"></span>
                                        </a>
-                                       <a class="brand" href="../..">Apache 
Helix</a>
                                        <div class="nav-collapse">
                                                <ul class="nav pull-right">
-                                                       <li><a 
href="../index.html" title="Helix 0.9.9">Helix 0.9.9 </a></li>
-                                                       <li class="dropdown">
+                                                       <li class="active"><a 
href="" title="Helix 0.9.9">Helix 0.9.9 </a></li>
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Get Helix <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../download.html" title="Download">Download </a></li>
-                                                                       <li><a 
href="../Building.html" title="Building">Building </a></li>
-                                                                       <li><a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a></li>
+                                                                       <li 
class="active"><a href="" title="Download">Download </a></li>
+                                                                       <li 
class="active"><a href="" title="Building">Building </a></li>
+                                                                       <li 
class="active"><a href="" title="Release Notes">Release Notes </a></li>
                                                                </ul>
                                                        </li>
-                                                       <li class="dropdown">
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Hands-On <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../Quickstart.html" title="Quick Start">Quick Start </a></li>
-                                                                       <li><a 
href="../Tutorial.html" title="Tutorial">Tutorial </a></li>
-                                                                       <li><a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a></li>
+                                                                       <li 
class="active"><a href="" title="Quick Start">Quick Start </a></li>
+                                                                       <li 
class="active"><a href="" title="Tutorial">Tutorial </a></li>
+                                                                       <li 
class="active"><a href="" title="Javadocs">Javadocs </a></li>
                                                                </ul>
                                                        </li>
                                                        <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a></li>
-                                                                       <li><a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed lock manager">Distributed lock 
manager </a></li>
+                                                                       <li 
class="active"><a href="" title="Rabbit MQ consumer group">Rabbit MQ consumer 
group </a></li>
                                                                        <li 
class="active"><a href="" title="Rsync replicated file store">Rsync replicated 
file store </a></li>
-                                                                       <li><a 
href="service_discovery.html" title="Service discovery">Service discovery 
</a></li>
-                                                                       <li><a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a></li>
+                                                                       <li 
class="active"><a href="" title="Service discovery">Service discovery </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed task DAG execution">Distributed 
task DAG execution </a></li>
                                                                </ul>
                                                        </li>
                                                </ul>
@@ -94,22 +84,21 @@
                <div class="row" id="banner">
                        <div class="span12">
                                <div class="pull-left">
-                                       <a href="../../" id="bannerLeft"><img 
src="../../images/helix-logo.jpg" alt='"''"' /></a>
-                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                                       <a href="" id="bannerLeft"><img src="" 
alt='"''"' /></a>
                                </div>
                                <div class="pull-right">
-                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../../images/feather_small.gif" alt='"''"' /></a>
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="" alt='"''"' /></a>
                                </div>
                        </div>
                </div>
                <div>
                        <ul class="breadcrumb">
-                               <li><a href="../../" title="Apache 
Helix">Apache Helix </a></li>
+                               <li><a href="" title="Apache Helix">Apache 
Helix </a></li>
                                <li class="divider">/</li>
-                               <li><a href="../" title="Release 0.9.9">Release 
0.9.9 </a></li>
+                               <li><a href="" title="Release 0.9.9">Release 
0.9.9 </a></li>
                                <li class="divider">/</li>
                                <li>Near-Realtime Rsync Replicated File 
System</li>
-                               <li class="publishDate version-date 
pull-right">Last Published: 2021-11-21</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2022-04-15</li>
                        </ul>
                </div>
        </header>
@@ -118,142 +107,7 @@
        <div class="row">
                <div class="span12">
                        <div class="body-content">
-<!-- -
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License. --> 
-<div class="section"> 
- <div class="page-header">
-  <h2 id="Near-Realtime_Rsync_Replicated_File_System">Near-Realtime Rsync 
Replicated File System</h2>
- </div> 
- <div class="section"> 
-  <h3 id="Quick_Demo">Quick Demo</h3> 
-  <ul> 
-   <li>This demo starts 3 instances with id’s as <tt>localhost_12001, 
localhost_12002, localhost_12003</tt></li> 
-   <li>Each instance stores its files under 
<tt>/tmp/&lt;id&gt;/filestore</tt></li> 
-   <li><tt>localhost_12001</tt> is designated as the master, and 
<tt>localhost_12002</tt> and <tt>localhost_12003</tt> are the slaves</li> 
-   <li>Files written to the master are replicated to the slaves automatically. 
In this demo, a.txt and b.txt are written to 
<tt>/tmp/localhost_12001/filestore</tt> and they get replicated to other 
folders.</li> 
-   <li>When the master is stopped, <tt>localhost_12002</tt> is promoted to 
master.</li> 
-   <li>The other slave <tt>localhost_12003</tt> stops replicating from 
<tt>localhost_12001</tt> and starts replicating from new master 
<tt>localhost_12002</tt></li> 
-   <li>Files written to new master <tt>localhost_12002</tt> are replicated to 
<tt>localhost_12003</tt></li> 
-   <li>In the end state of this quick demo, <tt>localhost_12002</tt> is the 
master and <tt>localhost_12003</tt> is the slave. Manually create files under 
<tt>/tmp/localhost_12002/filestore</tt> and see that appear in 
<tt>/tmp/localhost_12003/filestore</tt></li> 
-   <li>Ignore the interrupted exceptions on the console :-)</li> 
-  </ul> 
-  <div class="source"> 
-   <pre>git clone https://git-wip-us.apache.org/repos/asf/helix.git
-cd helix
-git checkout tags/helix-0.9.9
-cd recipes/rsync-replicated-file-system/
-mvn clean install package -DskipTests
-cd target/rsync-replicated-file-system-pkg/bin
-chmod +x *
-./quickdemo
-
-</pre> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Overview">Overview</h3> 
-  <p>There are many applications that require storage for storing large number 
of relatively small data files. Examples include media stores to store small 
videos, images, mail attachments etc. Each of these objects is typically 
kilobytes, often no larger than a few megabytes. An additional distinguishing 
feature of these use cases is that files are typically only added or deleted, 
rarely updated. When there are updates, they do not have any concurrency 
requirements.</p> 
-  <p>These are much simpler requirements than what general purpose distributed 
file system have to satisfy; these would include concurrent access to files, 
random access for reads and updates, posix compliance, and others. To satisfy 
those requirements, general DFSs are also pretty complex that are expensive to 
build and maintain.</p> 
-  <p>A different implementation of a distributed file system includes HDFS 
which is inspired by Google’s GFS. This is one of the most widely used 
distributed file system that forms the main data storage platform for Hadoop. 
HDFS is primary aimed at processing very large data sets and distributes files 
across a cluster of commodity servers by splitting up files in fixed size 
chunks. HDFS is not particularly well suited for storing a very large number of 
relatively tiny files.</p> 
- </div> 
- <div class="section"> 
-  <h3 id="File_Store">File Store</h3> 
-  <p>It’s possible to build a vastly simpler system for the class of 
applications that have simpler requirements as we have pointed out.</p> 
-  <ul> 
-   <li>Large number of files but each file is relatively small</li> 
-   <li>Access is limited to create, delete and get entire files</li> 
-   <li>No updates to files that are already created (or it’s feasible to 
delete the old file and create a new one)</li> 
-  </ul> 
-  <p>We call this system a Partitioned File Store (PFS) to distinguish it from 
other distributed file systems. This system needs to provide the following 
features:</p> 
-  <ul> 
-   <li>CRD access to large number of small files</li> 
-   <li>Scalability: Files should be distributed across a large number of 
commodity servers based on the storage requirement</li> 
-   <li>Fault-tolerance: Each file should be replicated on multiple servers so 
that individual server failures do not reduce availability</li> 
-   <li>Elasticity: It should be possible to add capacity to the cluster 
easily</li> 
-  </ul> 
-  <p>Apache Helix is a generic cluster management framework that makes it very 
easy to provide scalability, fault-tolerance and elasticity features. rsync can 
be easily used as a replication channel between servers so that each file gets 
replicated on multiple servers.</p> 
- </div> 
- <div class="section"> 
-  <h3 id="Design">Design</h3> 
-  <div class="section"> 
-   <h4 id="High_Level">High Level</h4> 
-   <ul> 
-    <li>Partition the file system based on the file name</li> 
-    <li>At any time a single writer can write, we call this a master</li> 
-    <li>For redundancy, we need to have additional replicas called slave. 
Slaves can optionally serve reads</li> 
-    <li>Slave replicates data from the master</li> 
-    <li>When a master fails, a slave gets promoted to master</li> 
-   </ul> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Transaction_Log">Transaction Log</h4> 
-   <p>Every write on the master will result in creation/deletion of one or 
more files. In order to maintain timeline consistency slaves need to apply the 
changes in the same order To facilitate this, the master logs each transaction 
in a file and each transaction is associated with an 64 bit ID in which the 32 
LSB represents a sequence number and MSB represents the generation number The 
sequence number gets incremented on every transaction and the generation is 
incremented when a new master is elected</p> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Replication">Replication</h4> 
-   <p>Replication is required for slaves to keep up with changes on the 
master. Every time the slave applies a change it checkpoints the last applied 
transaction ID. During restarts, this allows the slave to pull changes from the 
last checkpointed ID. Similar to master, the slave logs each transaction to the 
transaction logs but instead of generating new transaction ID, it uses the same 
ID generated by the master.</p> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Failover">Failover</h4> 
-   <p>When a master fails, a new slave will be promoted to master. If the 
previous master node is reachable, then the new master will flush all the 
changes from previous the master before taking up mastership. The new master 
will record the end transaction ID of the current generation and then start a 
new generation with sequence starting from 1. After this the master will begin 
accepting writes.</p> 
-   <p><img src="../images/PFS-Generic.png" alt="Partitioned File Store" /></p> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Rsync-based_Solution">Rsync-based Solution</h3> 
-  <p><img src="../images/RSYNC_BASED_PFS.png" alt="Rsync based File Store" 
/></p> 
-  <p>This application demonstrates a file store that uses rsync as the 
replication mechanism. One can envision a similar system where instead of using 
rsync, one can implement a custom solution to notify the slave of the changes 
and also provide an api to pull the change files.</p> 
-  <div class="section"> 
-   <h4 id="Concepts">Concepts</h4> 
-   <ul> 
-    <li>file_store_dir: Root directory for the actual data files</li> 
-    <li>change_log_dir: The transaction logs are generated under this 
folder</li> 
-    <li>check_point_dir: The slave stores the check points ( last processed 
transaction) here</li> 
-   </ul> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Master">Master</h4> 
-   <ul> 
-    <li>File server: This component supports file uploads and downloads and 
writes the files to <tt>file_store_dir</tt>. This is not included in this 
application. The idea is that most applications have different ways of 
implementing this component and have some associated business logic. It is not 
hard to come up with such a component if needed.</li> 
-    <li>File store watcher: This component watches the <tt>file_store_dir</tt> 
directory on the local file system for any changes and notifies the registered 
listeners of the changes</li> 
-    <li>Change log generator: This registers as a listener of the file store 
watcher and on each notification logs the changes into a file under 
<tt>change_log_dir</tt></li> 
-   </ul> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Slave">Slave</h4> 
-   <ul> 
-    <li>File server: This component on the slave will only support reads</li> 
-    <li>Cluster state observer: Slave observes the cluster state and is able 
to know who is the current master</li> 
-    <li>Replicator: This has two subcomponents 
-     <ul> 
-      <li>Periodic rsync of change log: This is a background process that 
periodically rsyncs the <tt>change_log_dir</tt> of the master to its local 
directory</li> 
-      <li>Change Log Watcher: This watches the <tt>change_log_dir</tt> for 
changes and notifies the registered listeners of the change</li> 
-      <li>On demand rsync invoker: This is registered as a listener to change 
log watcher and on every change invokes rsync to sync only the changed 
file</li> 
-     </ul></li> 
-   </ul> 
-  </div> 
-  <div class="section"> 
-   <h4 id="Coordination">Coordination</h4> 
-   <p>The coordination between nodes is done by Helix. Helix does the 
partition management and assigns the partition to multiple nodes based on the 
replication factor. It elects one the nodes as master and designates others as 
slaves. It provides notifications to each node in the form of state transitions 
(Offline to Slave, Slave to Master). It also provides notifications when there 
is change is cluster state. This allows the slave to stop replicating from 
current master and start replicating from new master.</p> 
-   <p>In this application, we have only one partition but its very easy to 
extend it to support multiple partitions. By partitioning the file store, one 
can add new nodes and Helix will automatically re-distribute partitions among 
the nodes. To summarize, Helix provides partition management, fault tolerance 
and facilitates automated cluster expansion.</p> 
-  </div> 
- </div> 
-</div>
+$bodyWithHeader
                        </div>
                </div>
        </div>
@@ -266,51 +120,43 @@ chmod +x *
        <footer class="well">
                <div class="container">
                        <div class="row">
-                               <div class="span3 bottom-nav">
+                               <div class="span9 bottom-nav">
                                        <ul class="nav nav-list">
                                                <li class="nav-header">Get 
Helix</li>
-                                               <li>
-                                                       <a 
href="../download.html" title="Download">Download </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Download">Download </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Building.html" title="Building">Building </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Building">Building </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Release Notes">Release Notes </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Hands-On</li>
-                                               <li>
-                                                       <a 
href="../Quickstart.html" title="Quick Start">Quick Start </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Quick Start">Quick Start </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Tutorial.html" title="Tutorial">Tutorial </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Tutorial">Tutorial </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Javadocs">Javadocs </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Recipes</li>
-                                               <li>
-                                                       <a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed lock manager">Distributed lock manager </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rabbit MQ consumer group">Rabbit MQ consumer group </a>
                                                </li>
                                                <li class="active">
                                                        <a href="#" 
title="Rsync replicated file store">Rsync replicated file store </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="service_discovery.html" title="Service discovery">Service discovery </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Service discovery">Service discovery </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed task DAG execution">Distributed task DAG execution </a>
                                                </li>
                                        </ul>
                                </div>
@@ -322,14 +168,9 @@ chmod +x *
                <div class="row">
                        <div class="span12">
                                <p class="pull-right"><a href="#">Back to 
top</a></p>
-                               <p class="copyright">Copyright &copy;2021 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p class="copyright">Copyright &copy;2022 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
                                <p><a 
href="http://github.com/andriusvelykis/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt"; 
target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
-               
-<div class="row span16">
-  <div>Apache Helix, Apache, the Apache feather logo, and the Apache Helix 
project logos are trademarks of The Apache Software Foundation.
-        All other marks mentioned may be trademarks or registered trademarks 
of their respective owners.</div>
-  <a href="http://helix.apache.org/0.9.9-docs/privacy-policy.html";>Privacy 
Policy</a>
-</div>                 </div>
+                                       </div>
                </div>
        </div>
 
@@ -347,7 +188,7 @@ chmod +x *
                }
        </script>
        
-       <script src="../js/bootstrap.min.js"></script>
+       <script 
src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js";></script>
        <script src="../js/lightbox.js"></script>
        <script src="../js/jquery.smooth-scroll.min.js"></script>
        <!-- back button support for smooth scroll -->

Modified: helix/site-content/0.9.9-docs/recipes/service_discovery.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/0.9.9-docs/recipes/service_discovery.html?rev=1899880&r1=1899879&r2=1899880&view=diff
==============================================================================
--- helix/site-content/0.9.9-docs/recipes/service_discovery.html (original)
+++ helix/site-content/0.9.9-docs/recipes/service_discovery.html Fri Apr 15 
07:24:01 2022
@@ -1,20 +1,20 @@
 
 <!DOCTYPE html>
 <!--
- Generated by Apache Maven Doxia at 2021-11-21
+ Generated by Apache Maven Doxia at 2022-04-15
  Rendered using Maven Reflow Skin 1.0.0 
(http://andriusvelykis.github.com/reflow-maven-skin)
 -->
 <html  xml:lang="en" lang="en">
 
        <head>
                <meta charset="UTF-8" />
-               <title>Apache Helix - Service Discovery</title>
+               <title>Apache Helix &#x2013; </title>
                <meta name="viewport" content="width=device-width, 
initial-scale=1.0" />
                <meta name="description" content="" />
                <meta http-equiv="content-language" content="en" />
 
-               <link href="../css/bootstrap.min.css" rel="stylesheet" />
-               <link href="../css/bootstrap-responsive.min.css" 
rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css";
 rel="stylesheet" />
+               <link 
href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css";
 rel="stylesheet" />
                <link href="../css/docs.css" rel="stylesheet" />
                <link href="../css/reflow-skin.css" rel="stylesheet" />
                
@@ -29,18 +29,9 @@
                        <script 
src="http://html5shim.googlecode.com/svn/trunk/html5.js";></script>
                <![endif]-->
                
-<script type="text/javascript">var _gaq = _gaq || [];
-        _gaq.push(['_setAccount', 'UA-3211522-12']);
-        _gaq.push(['_trackPageview']);
-
-        (function() {
-        var ga = document.createElement('script'); ga.type = 
'text/javascript'; ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
-        })();</script>
        </head>
 
-       <body class="page-recipes-service_discovery project-099-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+       <body class="page-$config.fileId project-$config.projectId" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
 
                <div class="navbar navbar-fixed-top">
                        <div class="navbar-inner">
@@ -50,34 +41,33 @@
                                                <span class="icon-bar"></span>
                                                <span class="icon-bar"></span>
                                        </a>
-                                       <a class="brand" href="../..">Apache 
Helix</a>
                                        <div class="nav-collapse">
                                                <ul class="nav pull-right">
-                                                       <li><a 
href="../index.html" title="Helix 0.9.9">Helix 0.9.9 </a></li>
-                                                       <li class="dropdown">
+                                                       <li class="active"><a 
href="" title="Helix 0.9.9">Helix 0.9.9 </a></li>
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Get Helix <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../download.html" title="Download">Download </a></li>
-                                                                       <li><a 
href="../Building.html" title="Building">Building </a></li>
-                                                                       <li><a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a></li>
+                                                                       <li 
class="active"><a href="" title="Download">Download </a></li>
+                                                                       <li 
class="active"><a href="" title="Building">Building </a></li>
+                                                                       <li 
class="active"><a href="" title="Release Notes">Release Notes </a></li>
                                                                </ul>
                                                        </li>
-                                                       <li class="dropdown">
+                                                       <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Hands-On <b 
class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="../Quickstart.html" title="Quick Start">Quick Start </a></li>
-                                                                       <li><a 
href="../Tutorial.html" title="Tutorial">Tutorial </a></li>
-                                                                       <li><a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a></li>
+                                                                       <li 
class="active"><a href="" title="Quick Start">Quick Start </a></li>
+                                                                       <li 
class="active"><a href="" title="Tutorial">Tutorial </a></li>
+                                                                       <li 
class="active"><a href="" title="Javadocs">Javadocs </a></li>
                                                                </ul>
                                                        </li>
                                                        <li class="dropdown 
active">
                                                                <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
                                                                <ul 
class="dropdown-menu">
-                                                                       <li><a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a></li>
-                                                                       <li><a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a></li>
-                                                                       <li><a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed lock manager">Distributed lock 
manager </a></li>
+                                                                       <li 
class="active"><a href="" title="Rabbit MQ consumer group">Rabbit MQ consumer 
group </a></li>
+                                                                       <li 
class="active"><a href="" title="Rsync replicated file store">Rsync replicated 
file store </a></li>
                                                                        <li 
class="active"><a href="" title="Service discovery">Service discovery </a></li>
-                                                                       <li><a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a></li>
+                                                                       <li 
class="active"><a href="" title="Distributed task DAG execution">Distributed 
task DAG execution </a></li>
                                                                </ul>
                                                        </li>
                                                </ul>
@@ -94,22 +84,21 @@
                <div class="row" id="banner">
                        <div class="span12">
                                <div class="pull-left">
-                                       <a href="../../" id="bannerLeft"><img 
src="../../images/helix-logo.jpg" alt='"''"' /></a>
-                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                                       <a href="" id="bannerLeft"><img src="" 
alt='"''"' /></a>
                                </div>
                                <div class="pull-right">
-                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../../images/feather_small.gif" alt='"''"' /></a>
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="" alt='"''"' /></a>
                                </div>
                        </div>
                </div>
                <div>
                        <ul class="breadcrumb">
-                               <li><a href="../../" title="Apache 
Helix">Apache Helix </a></li>
+                               <li><a href="" title="Apache Helix">Apache 
Helix </a></li>
                                <li class="divider">/</li>
-                               <li><a href="../" title="Release 0.9.9">Release 
0.9.9 </a></li>
+                               <li><a href="" title="Release 0.9.9">Release 
0.9.9 </a></li>
                                <li class="divider">/</li>
-                               <li>Service Discovery</li>
-                               <li class="publishDate version-date 
pull-right">Last Published: 2021-11-21</li>
+                               <li></li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2022-04-15</li>
                        </ul>
                </div>
        </header>
@@ -118,187 +107,7 @@
        <div class="row">
                <div class="span12">
                        <div class="body-content">
-<!-- -
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License. --> 
-<div class="section"> 
- <div class="page-header">
-  <h2 id="Service_Discovery">Service Discovery</h2>
- </div> 
- <p>One of the common usage of ZooKeeper is to enable service discovery. The 
basic idea is that when a server starts up it advertises its 
configuration/metadata such as its hostname and port on ZooKeeper. This allows 
clients to dynamically discover the servers that are currently active. One can 
think of this like a service registry to which a server registers when it 
starts and is automatically deregistered when it shutdowns or crashes. In many 
cases it serves as an alternative to VIPs.</p> 
- <p>The core idea behind this is to use ZooKeeper ephemeral nodes. The 
ephemeral nodes are created when the server registers and all its metadata is 
put into a ZNode. When the server shutdowns, ZooKeeper automatically removes 
this ZNode.</p> 
- <p>There are two ways the clients can dynamically discover the active 
servers:</p> 
- <div class="section"> 
-  <h3 id="ZooKeeper_Watch">ZooKeeper Watch</h3> 
-  <p>Clients can set a child watch under specific path on ZooKeeper. When a 
new service is registered/deregistered, ZooKeeper notifies the client via a 
watch event and the client can read the list of services. Even though this 
looks trivial, there are lot of things one needs to keep in mind like ensuring 
that you first set the watch back on ZooKeeper before reading data.</p> 
- </div> 
- <div class="section"> 
-  <h3 id="Poll">Poll</h3> 
-  <p>Another approach is for the client to periodically read the ZooKeeper 
path and get the list of services.</p> 
-  <p>Both approaches have pros and cons, for example setting a watch might 
trigger herd effect if there are large number of clients. This is problematic, 
especially when servers are starting up. But the advantage to setting watches 
is that clients are immediately notified of a change which is not true in case 
of polling. In some cases, having both watches and polls makes sense; watch 
allows one to get notifications as soon as possible while poll provides a 
safety net if a watch event is missed because of code bug or ZooKeeper fails to 
notify.</p> 
- </div> 
- <div class="section"> 
-  <h3 id="Other_Developer_Considerations">Other Developer Considerations</h3> 
-  <ul> 
-   <li>What happens when the ZooKeeper session expires? All the watches and 
ephemeral nodes previously added or created by this server are lost. One needs 
to add the watches again, recreate the ephemeral nodes, and so on.</li> 
-   <li>Due to network issues or Java GC pauses session expiry might happen 
again and again; this phenomenon is known as flapping. It's important for the 
server to detect this and deregister itself.</li> 
-  </ul> 
- </div> 
- <div class="section"> 
-  <h3 id="Other_Operational_Considerations">Other Operational 
Considerations</h3> 
-  <ul> 
-   <li>What if the node is behaving badly? One might kill the server, but it 
will lose the ability to debug. It would be nice to have the ability to mark a 
server as disabled and clients know that a node is disabled and will not 
contact that node.</li> 
-  </ul> 
- </div> 
- <div class="section"> 
-  <h3 id="Configuration_Ownership">Configuration Ownership</h3> 
-  <p>This is an important aspect that is often ignored in the initial stages 
of your development. Typically, the service discovery pattern means that 
servers start up with some configuration which it simply puts into ZooKeeper. 
While this works well in the beginning, configuration management becomes very 
difficult since the servers themselves are statically configured. Any change in 
server configuration implies restarting the server. Ideally, it will be nice to 
have the ability to change configuration dynamically without having to restart 
a server.</p> 
-  <p>Ideally you want a hybrid solution, a node starts with minimal 
configuration and gets the rest of configuration from ZooKeeper.</p> 
- </div> 
- <div class="section"> 
-  <h3 id="Using_Helix_for_Service_Discovery">Using Helix for Service 
Discovery</h3> 
-  <p>Even though Helix has a higher-level abstraction in terms of state 
machines, constraints and objectives, service discovery is one of things has 
been a prevalent use case from the start. The controller uses the exact 
mechanism we described above to discover when new servers join the cluster. We 
create these ZNodes under /CLUSTERNAME/LIVEINSTANCES. Since at any time there 
is only one controller, we use a ZK watch to track the liveness of a 
server.</p> 
-  <p>This recipe simply demonstrates how one can re-use that part for 
implementing service discovery. This demonstrates multiple modes of service 
discovery:</p> 
-  <ul> 
-   <li>POLL: The client reads from zookeeper at regular intervals 30 seconds. 
Use this if you have 100’s of clients</li> 
-   <li>WATCH: The client sets up watcher and gets notified of the changes. Use 
this if you have 10’s of clients</li> 
-   <li>NONE: This does neither of the above, but reads directly from zookeeper 
when ever needed</li> 
-  </ul> 
-  <p>Helix provides these additional features compared to other 
implementations available elsewhere:</p> 
-  <ul> 
-   <li>It has the concept of disabling a node which means that a badly 
behaving node can be disabled using the Helix admin API</li> 
-   <li>It automatically detects if a node connects/disconnects from zookeeper 
repeatedly and disables the node</li> 
-   <li>Configuration management 
-    <ul> 
-     <li>Allows one to set configuration via the admin API at various 
granulaties like cluster, instance, resource, partition</li> 
-     <li>Configurations can be dynamically changed</li> 
-     <li>The server is notified when configurations change</li> 
-    </ul></li> 
-  </ul> 
- </div> 
- <div class="section"> 
-  <h3 id="Checkout_and_Build">Checkout and Build</h3> 
-  <div class="source"> 
-   <pre>git clone https://git-wip-us.apache.org/repos/asf/helix.git
-cd helix
-git checkout tags/helix-0.9.9
-mvn clean install package -DskipTests
-cd recipes/service-discovery/target/service-discovery-pkg/bin
-chmod +x *
-</pre> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Start_ZooKeeper">Start ZooKeeper</h3> 
-  <div class="source"> 
-   <pre>./start-standalone-zookeeper 2199
-</pre> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Run_the_Demo">Run the Demo</h3> 
-  <div class="source"> 
-   <pre>./service-discovery-demo.sh
-</pre> 
-  </div> 
- </div> 
- <div class="section"> 
-  <h3 id="Output">Output</h3> 
-  <div class="source"> 
-   <pre>START:Service discovery demo mode:WATCH
-       Registering service
-               host.x.y.z_12000
-               host.x.y.z_12001
-               host.x.y.z_12002
-               host.x.y.z_12003
-               host.x.y.z_12004
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12000
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12002
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Deregistering service:
-               host.x.y.z_12002
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12000
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Registering service:host.x.y.z_12002
-END:Service discovery demo mode:WATCH
-=============================================
-START:Service discovery demo mode:POLL
-       Registering service
-               host.x.y.z_12000
-               host.x.y.z_12001
-               host.x.y.z_12002
-               host.x.y.z_12003
-               host.x.y.z_12004
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12000
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12002
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Deregistering service:
-               host.x.y.z_12002
-       Sleeping for poll interval:30000
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12000
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Registering service:host.x.y.z_12002
-END:Service discovery demo mode:POLL
-=============================================
-START:Service discovery demo mode:NONE
-       Registering service
-               host.x.y.z_12000
-               host.x.y.z_12001
-               host.x.y.z_12002
-               host.x.y.z_12003
-               host.x.y.z_12004
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12000
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12002
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Deregistering service:
-               host.x.y.z_12000
-       SERVICES AVAILABLE
-               SERVICENAME     HOST                    PORT
-               myServiceName   host.x.y.z              12001
-               myServiceName   host.x.y.z              12002
-               myServiceName   host.x.y.z              12003
-               myServiceName   host.x.y.z              12004
-       Registering service:host.x.y.z_12000
-END:Service discovery demo mode:NONE
-=============================================
-</pre> 
-  </div> 
- </div> 
-</div>
+$bodyWithHeader
                        </div>
                </div>
        </div>
@@ -311,51 +120,43 @@ END:Service discovery demo mode:NONE
        <footer class="well">
                <div class="container">
                        <div class="row">
-                               <div class="span3 bottom-nav">
+                               <div class="span9 bottom-nav">
                                        <ul class="nav nav-list">
                                                <li class="nav-header">Get 
Helix</li>
-                                               <li>
-                                                       <a 
href="../download.html" title="Download">Download </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Download">Download </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Building.html" title="Building">Building </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Building">Building </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../releasenotes/release-0.9.9.html" title="Release Notes">Release Notes 
</a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Release Notes">Release Notes </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Hands-On</li>
-                                               <li>
-                                                       <a 
href="../Quickstart.html" title="Quick Start">Quick Start </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Quick Start">Quick Start </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../Tutorial.html" title="Tutorial">Tutorial </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Tutorial">Tutorial </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="../../javadocs/0.9.9" title="Javadocs">Javadocs </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Javadocs">Javadocs </a>
                                                </li>
-                                       </ul>
-                               </div>
-                               <div class="span3 bottom-nav">
-                                       <ul class="nav nav-list">
                                                <li 
class="nav-header">Recipes</li>
-                                               <li>
-                                                       <a 
href="lock_manager.html" title="Distributed lock manager">Distributed lock 
manager </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed lock manager">Distributed lock manager </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rabbitmq_consumer_group.html" title="Rabbit MQ consumer group">Rabbit MQ 
consumer group </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rabbit MQ consumer group">Rabbit MQ consumer group </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Rsync replicated file store">Rsync replicated file store </a>
                                                </li>
                                                <li class="active">
                                                        <a href="#" 
title="Service discovery">Service discovery </a>
                                                </li>
-                                               <li>
-                                                       <a 
href="task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution </a>
+                                               <li class="active">
+                                                       <a href="#" 
title="Distributed task DAG execution">Distributed task DAG execution </a>
                                                </li>
                                        </ul>
                                </div>
@@ -367,14 +168,9 @@ END:Service discovery demo mode:NONE
                <div class="row">
                        <div class="span12">
                                <p class="pull-right"><a href="#">Back to 
top</a></p>
-                               <p class="copyright">Copyright &copy;2021 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p class="copyright">Copyright &copy;2022 <a 
href="https://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</p>
                                <p><a 
href="http://github.com/andriusvelykis/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt"; 
target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
-               
-<div class="row span16">
-  <div>Apache Helix, Apache, the Apache feather logo, and the Apache Helix 
project logos are trademarks of The Apache Software Foundation.
-        All other marks mentioned may be trademarks or registered trademarks 
of their respective owners.</div>
-  <a href="http://helix.apache.org/0.9.9-docs/privacy-policy.html";>Privacy 
Policy</a>
-</div>                 </div>
+                                       </div>
                </div>
        </div>
 
@@ -392,7 +188,7 @@ END:Service discovery demo mode:NONE
                }
        </script>
        
-       <script src="../js/bootstrap.min.js"></script>
+       <script 
src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js";></script>
        <script src="../js/lightbox.js"></script>
        <script src="../js/jquery.smooth-scroll.min.js"></script>
        <!-- back button support for smooth scroll -->


Reply via email to