Added: helix/site-content/1.4.1-docs/tutorial_messaging.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.4.1-docs/tutorial_messaging.html?rev=1926553&view=auto
==============================================================================
--- helix/site-content/1.4.1-docs/tutorial_messaging.html (added)
+++ helix/site-content/1.4.1-docs/tutorial_messaging.html Wed Jun 18 18:28:44 
2025
@@ -0,0 +1,295 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2024-11-18  Rendered using Reflow Maven 
Skin 2.0.0 (https://olamy.github.io/reflow-maven-skin)
+-->
+<html  xml:lang="en" lang="en">
+
+       <head>
+               <meta charset="UTF-8" />
+               <title>Apache Helix &#x2013; Tutorial - Messaging</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="./css/docs.css" rel="stylesheet" />
+               <link href="./css/reflow-skin.css" rel="stylesheet" />
+
+
+               <link href="./css/lightbox.css" rel="stylesheet" />
+
+               <link href="./css/site.css" rel="stylesheet" />
+               <link href="./css/print.css" rel="stylesheet" media="print" />
+
+               <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+               <!--[if lt IE 9]>
+                       <script src="./js/html5.js"></script>
+               <![endif]-->
+
+
+
+
+
+    
+<!-- Matomo -->
+<script>
+    var _paq = window._paq = window._paq || [];
+                        _paq.push(['disableCookies']);
+                                    _paq.push(['trackPageView']);
+                                    _paq.push(['enableLinkTracking']);
+                    
+    (function() {
+        var u="https://analytics.apache.org";;
+        _paq.push(['setTrackerUrl', u+'/matomo.php']);
+        _paq.push(['setSiteId', '15']);
+        var d=document, g=d.createElement('script'), 
s=d.getElementsByTagName('script')[0];
+        g.async=true; g.src=u+'/matomo.js'; s.parentNode.insertBefore(g,s);
+    })();
+</script>
+<!-- End Matomo Code -->
+       </head>
+
+       <body class="page-tutorial_messaging project-141-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+
+    
+               <div class="navbar navbar-fixed-top">
+                       <div class="navbar-inner">
+                               <div class="container">
+                                       <a class="btn btn-navbar" 
data-toggle="collapse" data-target="#top-nav-collapse">
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                       </a>
+                                       <a class="brand" 
href="http://helix.apache.org";>Apache Helix</a>
+                                       <div class="nav-collapse collapse" 
id="top-nav-collapse">
+                                               <ul class="nav pull-right">
+                                                       <li ><a 
href="index.html" title="Helix 1.4.1">Helix 1.4.1</a></li>
+                                                       <li class="dropdown">
+                                                               <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-1.4.1.html" title="Release Notes">Release 
Notes</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <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/1.4.1" title="Javadocs">Javadocs</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
+                                                               <ul 
class="dropdown-menu">
+                                                                       <li ><a 
href="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a></li>
+                                                                       <li ><a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a></li>
+                                                                       <li ><a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a></li>
+                                                                       <li ><a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a></li>
+                                                                       <li ><a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a></li>
+                                                               </ul>
+                                                       </li>
+                                               </ul>
+                                       </div><!--/.nav-collapse -->
+                               </div>
+                       </div>
+               </div>
+
+       <div class="container">
+
+       <!-- Masthead
+       ================================================== -->
+
+       <header>
+       <div class="jumbotron subhead">
+               <div class="row" id="banner">
+                       <div class="span12">
+                               <div class="pull-left">
+                                       <a href="http://helix.apache.org/"; 
id="bannerLeft"><img src="../images/helix-logo.jpg" alt='"''"' /></a>
+                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                               </div>
+                               <div class="pull-right">
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../images/feather_small.gif" alt='"''"' /></a>
+                               </div>
+                       </div>
+               </div>
+       </div>
+               <div>
+                       <ul class="breadcrumb">
+                               <li><a href="../" title="Apache Helix">Apache 
Helix</a></li>
+                               <li class="divider">/</li>
+                               <li><a href="./" title="Release 1.4.1">Release 
1.4.1</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Messaging</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2024-11-18</li>
+                       </ul>
+               </div>
+       </header>
+
+       <div class="main-body">
+       <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.
+--> 
+<section> 
+ <div class="page-header">
+  <h2 id="Helix_Tutorial:_Messaging"><a href="./Tutorial.html">Helix 
Tutorial</a>: Messaging</h2>
+ </div> 
+ <p>In this chapter, we'll learn about messaging, a convenient feature in 
Helix for sending messages between nodes of a cluster. This is an interesting 
feature that is quite useful in practice. It is common that nodes in a 
distributed system require a mechanism to interact with each other.</p> 
+ <section> 
+  <h3 id="Example:_Bootstrapping_a_Replica">Example: Bootstrapping a 
Replica</h3> 
+  <p>Consider a search system where the index replica starts up and it does 
not have an index. A typical solution is to get the index from a common 
location, or to copy the index from another replica.</p> 
+  <p>Helix provides a messaging API for intra-cluster communication between 
nodes in the system. This API provides a mechanism to specify the message 
recipient in terms of resource, partition, and state rather than specifying 
hostnames. Helix ensures that the message is delivered to all of the required 
recipients. In this particular use case, the instance can specify the recipient 
criteria as all replicas of the desired partition to bootstrap. Since Helix is 
aware of the global state of the system, it can send the message to the 
appropriate nodes. Once the nodes respond, Helix provides the bootstrapping 
replica with all the responses.</p> 
+  <p>This is a very generic API and can also be used to schedule various 
periodic tasks in the cluster, such as data backups, log cleanup, etc. System 
Admins can also perform ad-hoc tasks, such as on-demand backups or a system 
command (such as rm -rf ;) across all nodes of the cluster</p> 
+  <div class="source"> 
+   <pre><code>ClusterMessagingService messagingService = 
manager.getMessagingService();
+
+// Construct the Message
+Message requestBackupUriRequest = new Message(
+    MessageType.USER_DEFINE_MSG, UUID.randomUUID().toString());
+requestBackupUriRequest
+    .setMsgSubType(BootstrapProcess.REQUEST_BOOTSTRAP_URL);
+requestBackupUriRequest.setMsgState(MessageState.NEW);
+
+// Set the Recipient criteria: all nodes that satisfy the criteria will 
receive the message
+Criteria recipientCriteria = new Criteria();
+recipientCriteria.setInstanceName("%");
+recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
+recipientCriteria.setResource("MyDB");
+recipientCriteria.setPartition("");
+
+// Should be processed only by process(es) that are active at the time of 
sending the message
+// This means if the recipient is restarted after message is sent, it will not 
be processe.
+recipientCriteria.setSessionSpecific(true);
+
+// wait for 30 seconds
+int timeout = 30000;
+
+// the handler that will be invoked when any recipient responds to the message.
+BootstrapReplyHandler responseHandler = new BootstrapReplyHandler();
+
+// this will return only after all recipients respond or after timeout
+int sentMessageCount = messagingService.sendAndWait(recipientCriteria,
+    requestBackupUriRequest, responseHandler, timeout);
+</code></pre> 
+  </div> 
+  <p>See HelixManager.DefaultMessagingService in the <a class="externalLink" 
href="http://helix.apache.org/javadocs/1.4.1/reference/org/apache/helix/messaging/DefaultMessagingService.html";>Javadocs</a>
 for more information.</p> 
+ </section> 
+</section>
+                       </div>
+               </div>
+       </div>
+       </div>
+
+       </div><!-- /container -->
+
+       <!-- Footer
+       ================================================== -->
+       <footer class="well">
+               <div class="container">
+                       <div class="row">
+                               <div class="span3 bottom-nav">
+                                       <ul class="nav nav-list">
+                                               <li class="nav-header">Get 
Helix</li>
+                                               <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-1.4.1.html" 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>
+                                               <li >
+                                                       <a href="Tutorial.html" 
title="Tutorial">Tutorial</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="../javadocs/1.4.1" 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="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a>
+                                               </li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </footer>
+
+       <div class="container subfooter">
+               <div class="row">
+                       <div class="span12">
+                               <p class="pull-right"><a href="#">Back to 
top</a></p>
+                               <p class="copyright">Copyright &copy;2024 <a 
href="http://www.apache.org";>Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p><a 
href="https://github.com/olamy/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> maintained by <a href="https://twitter.com/olamy"; 
target="_blank" title="Olivier Lamy">Olivier Lamy</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="https://helix.apache.org/1.4.1-docs/privacy-policy.html";>Privacy 
Policy</a>
+      </div>
+                       </div>
+               </div>
+       </div>
+
+       <!-- Le javascript
+       ================================================== -->
+       <!-- Placed at the end of the document so the pages load faster -->
+       <script src="./js/jquery.min.js"></script>
+
+       <script src="./js/bootstrap.min.js"></script>
+       <script src="./js/lightbox.min.js"></script>
+       <script src="./js/reflow-scroll.js"></script>
+
+       <script src="./js/reflow-skin.js"></script>
+
+       </body>
+</html>
\ No newline at end of file

Added: helix/site-content/1.4.1-docs/tutorial_participant.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.4.1-docs/tutorial_participant.html?rev=1926553&view=auto
==============================================================================
--- helix/site-content/1.4.1-docs/tutorial_participant.html (added)
+++ helix/site-content/1.4.1-docs/tutorial_participant.html Wed Jun 18 18:28:44 
2025
@@ -0,0 +1,331 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2024-11-18  Rendered using Reflow Maven 
Skin 2.0.0 (https://olamy.github.io/reflow-maven-skin)
+-->
+<html  xml:lang="en" lang="en">
+
+       <head>
+               <meta charset="UTF-8" />
+               <title>Apache Helix &#x2013; Tutorial - Participant</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="./css/docs.css" rel="stylesheet" />
+               <link href="./css/reflow-skin.css" rel="stylesheet" />
+
+
+               <link href="./css/lightbox.css" rel="stylesheet" />
+
+               <link href="./css/site.css" rel="stylesheet" />
+               <link href="./css/print.css" rel="stylesheet" media="print" />
+
+               <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+               <!--[if lt IE 9]>
+                       <script src="./js/html5.js"></script>
+               <![endif]-->
+
+
+
+
+
+    
+<!-- Matomo -->
+<script>
+    var _paq = window._paq = window._paq || [];
+                        _paq.push(['disableCookies']);
+                                    _paq.push(['trackPageView']);
+                                    _paq.push(['enableLinkTracking']);
+                    
+    (function() {
+        var u="https://analytics.apache.org";;
+        _paq.push(['setTrackerUrl', u+'/matomo.php']);
+        _paq.push(['setSiteId', '15']);
+        var d=document, g=d.createElement('script'), 
s=d.getElementsByTagName('script')[0];
+        g.async=true; g.src=u+'/matomo.js'; s.parentNode.insertBefore(g,s);
+    })();
+</script>
+<!-- End Matomo Code -->
+       </head>
+
+       <body class="page-tutorial_participant project-141-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+
+    
+               <div class="navbar navbar-fixed-top">
+                       <div class="navbar-inner">
+                               <div class="container">
+                                       <a class="btn btn-navbar" 
data-toggle="collapse" data-target="#top-nav-collapse">
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                       </a>
+                                       <a class="brand" 
href="http://helix.apache.org";>Apache Helix</a>
+                                       <div class="nav-collapse collapse" 
id="top-nav-collapse">
+                                               <ul class="nav pull-right">
+                                                       <li ><a 
href="index.html" title="Helix 1.4.1">Helix 1.4.1</a></li>
+                                                       <li class="dropdown">
+                                                               <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-1.4.1.html" title="Release Notes">Release 
Notes</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <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/1.4.1" title="Javadocs">Javadocs</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
+                                                               <ul 
class="dropdown-menu">
+                                                                       <li ><a 
href="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a></li>
+                                                                       <li ><a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a></li>
+                                                                       <li ><a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a></li>
+                                                                       <li ><a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a></li>
+                                                                       <li ><a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a></li>
+                                                               </ul>
+                                                       </li>
+                                               </ul>
+                                       </div><!--/.nav-collapse -->
+                               </div>
+                       </div>
+               </div>
+
+       <div class="container">
+
+       <!-- Masthead
+       ================================================== -->
+
+       <header>
+       <div class="jumbotron subhead">
+               <div class="row" id="banner">
+                       <div class="span12">
+                               <div class="pull-left">
+                                       <a href="http://helix.apache.org/"; 
id="bannerLeft"><img src="../images/helix-logo.jpg" alt='"''"' /></a>
+                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                               </div>
+                               <div class="pull-right">
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../images/feather_small.gif" alt='"''"' /></a>
+                               </div>
+                       </div>
+               </div>
+       </div>
+               <div>
+                       <ul class="breadcrumb">
+                               <li><a href="../" title="Apache Helix">Apache 
Helix</a></li>
+                               <li class="divider">/</li>
+                               <li><a href="./" title="Release 1.4.1">Release 
1.4.1</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Participant</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2024-11-18</li>
+                       </ul>
+               </div>
+       </header>
+
+       <div class="main-body">
+       <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.
+--> 
+<section> 
+ <div class="page-header">
+  <h2 id="Helix_Tutorial:_Participant"><a href="./Tutorial.html">Helix 
Tutorial</a>: Participant</h2>
+ </div> 
+ <p>In this chapter, we'll learn how to implement a <b>Participant</b>, which 
is a primary functional component of a distributed system.</p> 
+ <section> 
+  <h3 id="Start_a_Connection">Start a Connection</h3> 
+  <p>The Helix manager is a common component that connects each system 
component with the controller.</p> 
+  <p>It requires the following parameters:</p> 
+  <ul> 
+   <li>clusterName: A logical name to represent the group of nodes</li> 
+   <li>instanceName: A logical name of the process creating the manager 
instance. Generally this is host:port</li> 
+   <li>instanceType: Type of the process. This can be one of the following 
types, in this case, use PARTICIPANT 
+    <ul> 
+     <li>CONTROLLER: Process that controls the cluster, any number of 
controllers can be started but only one will be active at any given time</li> 
+     <li>PARTICIPANT: Process that performs the actual task in the distributed 
system</li> 
+     <li>SPECTATOR: Process that observes the changes in the cluster</li> 
+     <li>ADMIN: To carry out system admin actions</li> 
+    </ul> </li> 
+   <li>zkConnectString: Connection string to ZooKeeper. This is of the form 
host1:port1,host2:port2,host3:port3</li> 
+  </ul> 
+  <p>After the Helix manager instance is created, the only thing that needs to 
be registered is the state model factory. The methods of the state model will 
be called when controller sends transitions to the participant. In this 
example, we'll use the OnlineOffline factory. Other options include:</p> 
+  <ul> 
+   <li>MasterSlaveStateModelFactory</li> 
+   <li>LeaderStandbyStateModelFactory</li> 
+   <li>BootstrapHandler</li> 
+  </ul> 
+  <div class="source"> 
+   <pre><code>manager = HelixManagerFactory.getZKHelixManager(clusterName,
+                                                instanceName,
+                                                InstanceType.PARTICIPANT,
+                                                zkConnectString);
+StateMachineEngine stateMach = manager.getStateMachineEngine();
+
+//create a stateModelFactory that returns a statemodel object for each 
partition.
+stateModelFactory = new OnlineOfflineStateModelFactory();
+stateMach.registerStateModelFactory(stateModelType, stateModelFactory);
+manager.connect();
+</code></pre> 
+  </div> 
+ </section> 
+ <section> 
+  <h3 id="Example_State_Model_Factory">Example State Model Factory</h3> 
+  <p>Helix doesn't know what it means to change from OFFLINE--&gt;ONLINE or 
ONLINE--&gt;OFFLINE. The following code snippet shows where you insert your 
system logic for these two state transitions.</p> 
+  <div class="source"> 
+   <pre><code>public class OnlineOfflineStateModelFactory extends
+    StateModelFactory&lt;StateModel&gt; {
+  @Override
+  public StateModel createNewStateModel(String stateUnitKey) {
+    OnlineOfflineStateModel stateModel = new OnlineOfflineStateModel();
+    return stateModel;
+  }
+  @StateModelInfo(states = "{'OFFLINE','ONLINE'}", initialState = "OFFINE")
+  public static class OnlineOfflineStateModel extends StateModel {
+    @Transition(from = "OFFLINE", to = "ONLINE")
+    public void onBecomeOnlineFromOffline(Message message,
+        NotificationContext context) {
+      
System.out.println("OnlineOfflineStateModel.onBecomeOnlineFromOffline()");
+
+      
////////////////////////////////////////////////////////////////////////////////////////////////
+      // Application logic to handle transition                                
                     //
+      // For example, you might start a service, run initialization, etc       
                     //
+      
////////////////////////////////////////////////////////////////////////////////////////////////
+    }
+
+    @Transition(from = "ONLINE", to = "OFFLINE")
+    public void onBecomeOfflineFromOnline(Message message,
+        NotificationContext context) {
+      
System.out.println("OnlineOfflineStateModel.onBecomeOfflineFromOnline()");
+
+      
////////////////////////////////////////////////////////////////////////////////////////////////
+      // Application logic to handle transition                                
                     //
+      // For example, you might shutdown a service, log this event, or change 
monitoring settings   //
+      
////////////////////////////////////////////////////////////////////////////////////////////////
+    }
+  }
+}
+</code></pre> 
+  </div> 
+ </section> 
+</section>
+                       </div>
+               </div>
+       </div>
+       </div>
+
+       </div><!-- /container -->
+
+       <!-- Footer
+       ================================================== -->
+       <footer class="well">
+               <div class="container">
+                       <div class="row">
+                               <div class="span3 bottom-nav">
+                                       <ul class="nav nav-list">
+                                               <li class="nav-header">Get 
Helix</li>
+                                               <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-1.4.1.html" 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>
+                                               <li >
+                                                       <a href="Tutorial.html" 
title="Tutorial">Tutorial</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="../javadocs/1.4.1" 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="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a>
+                                               </li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </footer>
+
+       <div class="container subfooter">
+               <div class="row">
+                       <div class="span12">
+                               <p class="pull-right"><a href="#">Back to 
top</a></p>
+                               <p class="copyright">Copyright &copy;2024 <a 
href="http://www.apache.org";>Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p><a 
href="https://github.com/olamy/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> maintained by <a href="https://twitter.com/olamy"; 
target="_blank" title="Olivier Lamy">Olivier Lamy</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="https://helix.apache.org/1.4.1-docs/privacy-policy.html";>Privacy 
Policy</a>
+      </div>
+                       </div>
+               </div>
+       </div>
+
+       <!-- Le javascript
+       ================================================== -->
+       <!-- Placed at the end of the document so the pages load faster -->
+       <script src="./js/jquery.min.js"></script>
+
+       <script src="./js/bootstrap.min.js"></script>
+       <script src="./js/lightbox.min.js"></script>
+       <script src="./js/reflow-scroll.js"></script>
+
+       <script src="./js/reflow-skin.js"></script>
+
+       </body>
+</html>
\ No newline at end of file

Added: helix/site-content/1.4.1-docs/tutorial_propstore.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.4.1-docs/tutorial_propstore.html?rev=1926553&view=auto
==============================================================================
--- helix/site-content/1.4.1-docs/tutorial_propstore.html (added)
+++ helix/site-content/1.4.1-docs/tutorial_propstore.html Wed Jun 18 18:28:44 
2025
@@ -0,0 +1,262 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2024-11-18  Rendered using Reflow Maven 
Skin 2.0.0 (https://olamy.github.io/reflow-maven-skin)
+-->
+<html  xml:lang="en" lang="en">
+
+       <head>
+               <meta charset="UTF-8" />
+               <title>Apache Helix &#x2013; Tutorial - Application Property 
Store</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="./css/docs.css" rel="stylesheet" />
+               <link href="./css/reflow-skin.css" rel="stylesheet" />
+
+
+               <link href="./css/lightbox.css" rel="stylesheet" />
+
+               <link href="./css/site.css" rel="stylesheet" />
+               <link href="./css/print.css" rel="stylesheet" media="print" />
+
+               <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+               <!--[if lt IE 9]>
+                       <script src="./js/html5.js"></script>
+               <![endif]-->
+
+
+
+
+
+    
+<!-- Matomo -->
+<script>
+    var _paq = window._paq = window._paq || [];
+                        _paq.push(['disableCookies']);
+                                    _paq.push(['trackPageView']);
+                                    _paq.push(['enableLinkTracking']);
+                    
+    (function() {
+        var u="https://analytics.apache.org";;
+        _paq.push(['setTrackerUrl', u+'/matomo.php']);
+        _paq.push(['setSiteId', '15']);
+        var d=document, g=d.createElement('script'), 
s=d.getElementsByTagName('script')[0];
+        g.async=true; g.src=u+'/matomo.js'; s.parentNode.insertBefore(g,s);
+    })();
+</script>
+<!-- End Matomo Code -->
+       </head>
+
+       <body class="page-tutorial_propstore project-141-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+
+    
+               <div class="navbar navbar-fixed-top">
+                       <div class="navbar-inner">
+                               <div class="container">
+                                       <a class="btn btn-navbar" 
data-toggle="collapse" data-target="#top-nav-collapse">
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                       </a>
+                                       <a class="brand" 
href="http://helix.apache.org";>Apache Helix</a>
+                                       <div class="nav-collapse collapse" 
id="top-nav-collapse">
+                                               <ul class="nav pull-right">
+                                                       <li ><a 
href="index.html" title="Helix 1.4.1">Helix 1.4.1</a></li>
+                                                       <li class="dropdown">
+                                                               <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-1.4.1.html" title="Release Notes">Release 
Notes</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <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/1.4.1" title="Javadocs">Javadocs</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
+                                                               <ul 
class="dropdown-menu">
+                                                                       <li ><a 
href="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a></li>
+                                                                       <li ><a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a></li>
+                                                                       <li ><a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a></li>
+                                                                       <li ><a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a></li>
+                                                                       <li ><a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a></li>
+                                                               </ul>
+                                                       </li>
+                                               </ul>
+                                       </div><!--/.nav-collapse -->
+                               </div>
+                       </div>
+               </div>
+
+       <div class="container">
+
+       <!-- Masthead
+       ================================================== -->
+
+       <header>
+       <div class="jumbotron subhead">
+               <div class="row" id="banner">
+                       <div class="span12">
+                               <div class="pull-left">
+                                       <a href="http://helix.apache.org/"; 
id="bannerLeft"><img src="../images/helix-logo.jpg" alt='"''"' /></a>
+                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                               </div>
+                               <div class="pull-right">
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../images/feather_small.gif" alt='"''"' /></a>
+                               </div>
+                       </div>
+               </div>
+       </div>
+               <div>
+                       <ul class="breadcrumb">
+                               <li><a href="../" title="Apache Helix">Apache 
Helix</a></li>
+                               <li class="divider">/</li>
+                               <li><a href="./" title="Release 1.4.1">Release 
1.4.1</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Application Property Store</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2024-11-18</li>
+                       </ul>
+               </div>
+       </header>
+
+       <div class="main-body">
+       <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.
+--> 
+<section> 
+ <div class="page-header">
+  <h2 id="Helix_Tutorial:_Application_Property_Store"><a 
href="./Tutorial.html">Helix Tutorial</a>: Application Property Store</h2>
+ </div> 
+ <p>In this chapter, we'll learn how to use the application property 
store.</p> 
+ <section> 
+  <h3 id="Property_Store">Property Store</h3> 
+  <p>It is common that an application needs support for distributed, shared 
data structures. Helix uses ZooKeeper to store the application data and hence 
provides notifications when the data changes.</p> 
+  <p>While you could use ZooKeeper directly, Helix supports caching the data 
with a write-through cache. This is far more efficient than reading from 
ZooKeeper for every access.</p> 
+  <p>See <a class="externalLink" 
href="http://helix.apache.org/javadocs/1.4.1/reference/org/apache/helix/store/package-summary.html";>HelixManager.getHelixPropertyStore</a>
 for details.</p> 
+ </section> 
+</section>
+                       </div>
+               </div>
+       </div>
+       </div>
+
+       </div><!-- /container -->
+
+       <!-- Footer
+       ================================================== -->
+       <footer class="well">
+               <div class="container">
+                       <div class="row">
+                               <div class="span3 bottom-nav">
+                                       <ul class="nav nav-list">
+                                               <li class="nav-header">Get 
Helix</li>
+                                               <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-1.4.1.html" 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>
+                                               <li >
+                                                       <a href="Tutorial.html" 
title="Tutorial">Tutorial</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="../javadocs/1.4.1" 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="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a>
+                                               </li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </footer>
+
+       <div class="container subfooter">
+               <div class="row">
+                       <div class="span12">
+                               <p class="pull-right"><a href="#">Back to 
top</a></p>
+                               <p class="copyright">Copyright &copy;2024 <a 
href="http://www.apache.org";>Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p><a 
href="https://github.com/olamy/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> maintained by <a href="https://twitter.com/olamy"; 
target="_blank" title="Olivier Lamy">Olivier Lamy</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="https://helix.apache.org/1.4.1-docs/privacy-policy.html";>Privacy 
Policy</a>
+      </div>
+                       </div>
+               </div>
+       </div>
+
+       <!-- Le javascript
+       ================================================== -->
+       <!-- Placed at the end of the document so the pages load faster -->
+       <script src="./js/jquery.min.js"></script>
+
+       <script src="./js/bootstrap.min.js"></script>
+       <script src="./js/lightbox.min.js"></script>
+       <script src="./js/reflow-scroll.js"></script>
+
+       <script src="./js/reflow-skin.js"></script>
+
+       </body>
+</html>
\ No newline at end of file

Added: helix/site-content/1.4.1-docs/tutorial_rebalance.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.4.1-docs/tutorial_rebalance.html?rev=1926553&view=auto
==============================================================================
--- helix/site-content/1.4.1-docs/tutorial_rebalance.html (added)
+++ helix/site-content/1.4.1-docs/tutorial_rebalance.html Wed Jun 18 18:28:44 
2025
@@ -0,0 +1,398 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2024-11-18  Rendered using Reflow Maven 
Skin 2.0.0 (https://olamy.github.io/reflow-maven-skin)
+-->
+<html  xml:lang="en" lang="en">
+
+       <head>
+               <meta charset="UTF-8" />
+               <title>Apache Helix &#x2013; Tutorial - Rebalancing 
Algorithms</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="./css/docs.css" rel="stylesheet" />
+               <link href="./css/reflow-skin.css" rel="stylesheet" />
+
+
+               <link href="./css/lightbox.css" rel="stylesheet" />
+
+               <link href="./css/site.css" rel="stylesheet" />
+               <link href="./css/print.css" rel="stylesheet" media="print" />
+
+               <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+               <!--[if lt IE 9]>
+                       <script src="./js/html5.js"></script>
+               <![endif]-->
+
+
+
+
+
+    
+<!-- Matomo -->
+<script>
+    var _paq = window._paq = window._paq || [];
+                        _paq.push(['disableCookies']);
+                                    _paq.push(['trackPageView']);
+                                    _paq.push(['enableLinkTracking']);
+                    
+    (function() {
+        var u="https://analytics.apache.org";;
+        _paq.push(['setTrackerUrl', u+'/matomo.php']);
+        _paq.push(['setSiteId', '15']);
+        var d=document, g=d.createElement('script'), 
s=d.getElementsByTagName('script')[0];
+        g.async=true; g.src=u+'/matomo.js'; s.parentNode.insertBefore(g,s);
+    })();
+</script>
+<!-- End Matomo Code -->
+       </head>
+
+       <body class="page-tutorial_rebalance project-141-docs" 
data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
+
+    
+               <div class="navbar navbar-fixed-top">
+                       <div class="navbar-inner">
+                               <div class="container">
+                                       <a class="btn btn-navbar" 
data-toggle="collapse" data-target="#top-nav-collapse">
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                               <span class="icon-bar"></span>
+                                       </a>
+                                       <a class="brand" 
href="http://helix.apache.org";>Apache Helix</a>
+                                       <div class="nav-collapse collapse" 
id="top-nav-collapse">
+                                               <ul class="nav pull-right">
+                                                       <li ><a 
href="index.html" title="Helix 1.4.1">Helix 1.4.1</a></li>
+                                                       <li class="dropdown">
+                                                               <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-1.4.1.html" title="Release Notes">Release 
Notes</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <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/1.4.1" title="Javadocs">Javadocs</a></li>
+                                                               </ul>
+                                                       </li>
+                                                       <li class="dropdown">
+                                                               <a href="#" 
class="dropdown-toggle" data-toggle="dropdown">Recipes <b class="caret"></b></a>
+                                                               <ul 
class="dropdown-menu">
+                                                                       <li ><a 
href="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a></li>
+                                                                       <li ><a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a></li>
+                                                                       <li ><a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a></li>
+                                                                       <li ><a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a></li>
+                                                                       <li ><a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a></li>
+                                                               </ul>
+                                                       </li>
+                                               </ul>
+                                       </div><!--/.nav-collapse -->
+                               </div>
+                       </div>
+               </div>
+
+       <div class="container">
+
+       <!-- Masthead
+       ================================================== -->
+
+       <header>
+       <div class="jumbotron subhead">
+               <div class="row" id="banner">
+                       <div class="span12">
+                               <div class="pull-left">
+                                       <a href="http://helix.apache.org/"; 
id="bannerLeft"><img src="../images/helix-logo.jpg" alt='"''"' /></a>
+                                       <p class="lead">A cluster management 
framework for partitioned and replicated distributed resources</p>
+                               </div>
+                               <div class="pull-right">
+                                       <a href="http://www.apache.org/"; 
id="bannerRight"><img src="../images/feather_small.gif" alt='"''"' /></a>
+                               </div>
+                       </div>
+               </div>
+       </div>
+               <div>
+                       <ul class="breadcrumb">
+                               <li><a href="../" title="Apache Helix">Apache 
Helix</a></li>
+                               <li class="divider">/</li>
+                               <li><a href="./" title="Release 1.4.1">Release 
1.4.1</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Rebalancing Algorithms</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2024-11-18</li>
+                       </ul>
+               </div>
+       </header>
+
+       <div class="main-body">
+       <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.
+--> 
+<section> 
+ <div class="page-header">
+  <h2 id="Helix_Tutorial:_Rebalancing_Algorithms"><a 
href="./Tutorial.html">Helix Tutorial</a>: Rebalancing Algorithms</h2>
+ </div> 
+ <p>The placement of partitions in a distributed system is essential for the 
reliability and scalability of the system. For example, when a node fails, it 
is important that the partitions hosted on that node are reallocated evenly 
among the remaining nodes. Consistent hashing is one such algorithm that can 
satisfy this guarantee. Helix provides a variant of consistent hashing based on 
the RUSH algorithm, among others.</p> 
+ <p>This means given a number of partitions, replicas and number of nodes, 
Helix does the automatic assignment of partition to nodes such that:</p> 
+ <ul> 
+  <li>Each node has the same number of partitions</li> 
+  <li>Replicas of the same partition do not stay on the same node</li> 
+  <li>When a node fails, the partitions will be equally distributed among the 
remaining nodes</li> 
+  <li>When new nodes are added, the number of partitions moved will be 
minimized along with satisfying the above criteria</li> 
+ </ul> 
+ <p>Helix employs a rebalancing algorithm to compute the <i>ideal state</i> of 
the system. When the <i>current state</i> differs from the <i>ideal state</i>, 
Helix uses it as the target state of the system and computes the appropriate 
transitions needed to bring it to the <i>ideal state</i>.</p> 
+ <p>Helix makes it easy to perform this operation, while giving you control 
over the algorithm. In this section, we'll see how to implement the desired 
behavior.</p> 
+ <p>Helix has four options for rebalancing, in increasing order of 
customization by the system builder:</p> 
+ <ul> 
+  <li>FULL_AUTO</li> 
+  <li>SEMI_AUTO</li> 
+  <li>CUSTOMIZED</li> 
+  <li>USER_DEFINED</li> 
+ </ul> 
+ <div class="source"> 
+  <pre><code>            |FULL_AUTO     |  SEMI_AUTO | CUSTOMIZED|  
USER_DEFINED  |
+            ---------------------------------------------------------|
+   LOCATION | HELIX        |  APP       |  APP      |      APP       |
+            ---------------------------------------------------------|
+      STATE | HELIX        |  HELIX     |  APP      |      APP       |
+            ----------------------------------------------------------
+</code></pre> 
+ </div> 
+ <section> 
+  <h3 id="FULL_AUTO">FULL_AUTO</h3> 
+  <p>When the rebalance mode is set to FULL_AUTO, Helix controls both the 
location of the replica along with the state. This option is useful for 
applications where creation of a replica is not expensive.</p> 
+  <p>For example, consider this system that uses a LeaderStandby state model, 
with 3 partitions and 2 replicas in the ideal state.</p> 
+  <div class="source"> 
+   <pre><code>{
+  "id" : "MyResource",
+  "simpleFields" : {
+    "REBALANCE_MODE" : "FULL_AUTO",
+    "NUM_PARTITIONS" : "3",
+    "REPLICAS" : "2",
+    "STATE_MODEL_DEF_REF" : "LeaderStandby",
+  }
+  "listFields" : {
+    "MyResource_0" : [],
+    "MyResource_1" : [],
+    "MyResource_2" : []
+  },
+  "mapFields" : {
+  }
+}
+</code></pre> 
+  </div> 
+  <p>If there are 3 nodes in the cluster, then Helix will balance the leaders 
and standbys equally. The ideal state is therefore:</p> 
+  <div class="source"> 
+   <pre><code>{
+  "id" : "MyResource",
+  "simpleFields" : {
+    "NUM_PARTITIONS" : "3",
+    "REPLICAS" : "2",
+    "STATE_MODEL_DEF_REF" : "LeaderStandby",
+  },
+  "mapFields" : {
+    "MyResource_0" : {
+      "N1" : "LEADER",
+      "N2" : "STANDBY",
+    },
+    "MyResource_1" : {
+      "N2" : "LEADER",
+      "N3" : "STANDBY",
+    },
+    "MyResource_2" : {
+      "N3" : "LEADER",
+      "N1" : "STANDBY",
+    }
+  }
+}
+</code></pre> 
+  </div> 
+  <p>Another typical example is evenly distributing a group of tasks among the 
currently healthy processes. For example, if there are 60 tasks and 4 nodes, 
Helix assigns 15 tasks to each node. When one node fails, Helix redistributes 
its 15 tasks to the remaining 3 nodes, resulting in a balanced 20 tasks per 
node. Similarly, if a node is added, Helix re-allocates 3 tasks from each of 
the 4 nodes to the 5th node, resulting in a balanced distribution of 12 tasks 
per node..</p> 
+ </section> 
+ <section> 
+  <h3 id="SEMI_AUTO">SEMI_AUTO</h3> 
+  <p>When the application needs to control the placement of the replicas, use 
the SEMI_AUTO rebalance mode.</p> 
+  <p>Example: In the ideal state below, the partition 'MyResource_0' is 
constrained to be placed only on node1 or node2. The choice of <i>state</i> is 
still controlled by Helix. That means MyResource_0.LEADER could be on node1 and 
MyResource_0.STANDBY on node2, or vice-versa but neither would be placed on 
node3.</p> 
+  <div class="source"> 
+   <pre><code>{
+  "id" : "MyResource",
+  "simpleFields" : {
+    "REBALANCE_MODE" : "SEMI_AUTO",
+    "NUM_PARTITIONS" : "3",
+    "REPLICAS" : "2",
+    "STATE_MODEL_DEF_REF" : "LeaderStandby",
+  }
+  "listFields" : {
+    "MyResource_0" : [node1, node2],
+    "MyResource_1" : [node2, node3],
+    "MyResource_2" : [node3, node1]
+  },
+  "mapFields" : {
+  }
+}
+</code></pre> 
+  </div> 
+  <p>The LeaderStandby state model requires that a partition has exactly one 
LEADER at all times, and the other replicas should be STANDBYs. In this simple 
example with 2 replicas per partition, there would be one LEADER and one 
STANDBY. Upon failover, a STANDBY has to assume leadership, and a new STANDBY 
will be generated.</p> 
+  <p>In this mode when node1 fails, unlike in FULL_AUTO mode the partition is 
<i>not</i> moved from node1 to node3. Instead, Helix will decide to change the 
state of MyResource_0 on node2 from STANDBY to LEADER, based on the system 
constraints.</p> 
+ </section> 
+ <section> 
+  <h3 id="CUSTOMIZED">CUSTOMIZED</h3> 
+  <p>Helix offers a third mode called CUSTOMIZED, in which the application 
controls the placement <i>and</i> state of each replica. The application needs 
to implement a callback interface that Helix invokes when the cluster state 
changes. Within this callback, the application can recompute the idealstate. 
Helix will then issue appropriate transitions such that <i>Idealstate</i> and 
<i>Currentstate</i> converges.</p> 
+  <p>Here's an example, again with 3 partitions, 2 replicas per partition, and 
the LeaderStandby state model:</p> 
+  <div class="source"> 
+   <pre><code>{
+  "id" : "MyResource",
+  "simpleFields" : {
+    "REBALANCE_MODE" : "CUSTOMIZED",
+    "NUM_PARTITIONS" : "3",
+    "REPLICAS" : "2",
+    "STATE_MODEL_DEF_REF" : "LeaderStandby",
+  },
+  "mapFields" : {
+    "MyResource_0" : {
+      "N1" : "LEADER",
+      "N2" : "STANDBY",
+    },
+    "MyResource_1" : {
+      "N2" : "LEADER",
+      "N3" : "STANDBY",
+    },
+    "MyResource_2" : {
+      "N3" : "LEADER",
+      "N1" : "STANDBY",
+    }
+  }
+}
+</code></pre> 
+  </div> 
+  <p>Suppose the current state of the system is ‘MyResource_0’ -&gt; 
{N1:LEADER, N2:STANDBY} and the application changes the ideal state to 
‘MyResource_0’ -&gt; {N1:STANDBY,N2:LEADER}. While the application decides 
which node is LEADER and which is STANDBY, Helix will not blindly issue 
LEADER--&gt;STANDBY to N1 and STANDBY--&gt;LEADER to N2 in parallel, since that 
might result in a transient state where both N1 and N2 are leaders, which 
violates the LeaderStandby constraint that there is exactly one LEADER at a 
time. Helix will first issue LEADER--&gt;STANDBY to N1 and after it is 
completed, it will issue STANDBY--&gt;LEADER to N2.</p> 
+ </section> 
+ <section> 
+  <h3 id="USER_DEFINED">USER_DEFINED</h3> 
+  <p>For maximum flexibility, Helix exposes an interface that can allow 
applications to plug in custom rebalancing logic. By providing the name of a 
class that implements the Rebalancer interface, Helix will automatically call 
the contained method whenever there is a change to the live participants in the 
cluster. For more, see <a 
href="./tutorial_user_def_rebalancer.html">User-Defined Rebalancer</a>.</p> 
+ </section> 
+ <section> 
+  <h3 id="Backwards_Compatibility">Backwards Compatibility</h3> 
+  <p>In previous versions, FULL_AUTO was called AUTO_REBALANCE and SEMI_AUTO 
was called AUTO. Furthermore, they were presented as the IDEAL_STATE_MODE. 
Helix supports both IDEAL_STATE_MODE and REBALANCE_MODE, but IDEAL_STATE_MODE 
is now deprecated and may be phased out in future versions.</p> 
+ </section> 
+</section>
+                       </div>
+               </div>
+       </div>
+       </div>
+
+       </div><!-- /container -->
+
+       <!-- Footer
+       ================================================== -->
+       <footer class="well">
+               <div class="container">
+                       <div class="row">
+                               <div class="span3 bottom-nav">
+                                       <ul class="nav nav-list">
+                                               <li class="nav-header">Get 
Helix</li>
+                                               <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-1.4.1.html" 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>
+                                               <li >
+                                                       <a href="Tutorial.html" 
title="Tutorial">Tutorial</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="../javadocs/1.4.1" 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="recipes/lock_manager.html" title="Distributed lock manager">Distributed 
lock manager</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rabbitmq_consumer_group.html" title="Rabbit MQ consumer 
group">Rabbit MQ consumer group</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/rsync_replicated_file_store.html" title="Rsync replicated file 
store">Rsync replicated file store</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/service_discovery.html" title="Service discovery">Service 
discovery</a>
+                                               </li>
+                                               <li >
+                                                       <a 
href="recipes/task_dag_execution.html" title="Distributed task DAG 
execution">Distributed task DAG execution</a>
+                                               </li>
+                                       </ul>
+                               </div>
+                       </div>
+               </div>
+       </footer>
+
+       <div class="container subfooter">
+               <div class="row">
+                       <div class="span12">
+                               <p class="pull-right"><a href="#">Back to 
top</a></p>
+                               <p class="copyright">Copyright &copy;2024 <a 
href="http://www.apache.org";>Apache Software Foundation</a>. All Rights 
Reserved.</p>
+                               <p><a 
href="https://github.com/olamy/reflow-maven-skin"; title="Reflow Maven 
skin">Reflow Maven skin</a> maintained by <a href="https://twitter.com/olamy"; 
target="_blank" title="Olivier Lamy">Olivier Lamy</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="https://helix.apache.org/1.4.1-docs/privacy-policy.html";>Privacy 
Policy</a>
+      </div>
+                       </div>
+               </div>
+       </div>
+
+       <!-- Le javascript
+       ================================================== -->
+       <!-- Placed at the end of the document so the pages load faster -->
+       <script src="./js/jquery.min.js"></script>
+
+       <script src="./js/bootstrap.min.js"></script>
+       <script src="./js/lightbox.min.js"></script>
+       <script src="./js/reflow-scroll.js"></script>
+
+       <script src="./js/reflow-skin.js"></script>
+
+       </body>
+</html>
\ No newline at end of file


Reply via email to