You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ka...@apache.org on 2013/11/23 08:11:30 UTC

svn commit: r1544749 [18/23] - in /incubator/helix/site-content: ./ apidocs/reference/org/apache/helix/manager/zk/ helix-admin-webapp/ helix-agent/ helix-core/ helix-examples/ images/ involved/ recipes/ recipes/distributed-lock-manager/ recipes/rabbitm...

Added: incubator/helix/site-content/tutorial_admin.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/tutorial_admin.html?rev=1544749&view=auto
==============================================================================
--- incubator/helix/site-content/tutorial_admin.html (added)
+++ incubator/helix/site-content/tutorial_admin.html Sat Nov 23 07:11:13 2013
@@ -0,0 +1,1010 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2013-11-07
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20131107" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Helix -   Tutorial - Admin Operations</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<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="topBarEnabled">
+          
+                        
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                                  <div class="container"><div class="nav-collapse">
+            
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Helix <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="Concepts.html"  title="Core concepts">Core concepts</a>
+</li>
+                  
+                      <li>      <a href="Architecture.html"  title="Architecture">Architecture</a>
+</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="releasenotes/release-0.6.1-incubating.html"  title="release 0.6.1-incubating">release 0.6.1-incubating</a>
+</li>
+                  
+                      <li>      <a href="download.html"  title="Download">Download</a>
+</li>
+                  
+                      <li>      <a href="IRC.html"  title="IRC">IRC</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>
+                  
+                      <li>      <a href="recipes/user_def_rebalancer.html"  title="User-Defined Rebalancer Example">User-Defined Rebalancer Example</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracking.html"  title="Issues">Issues</a>
+</li>
+                  
+                      <li>      <a href="team-list.html"  title="Team">Team</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Sources">Sources</a>
+</li>
+                  
+                      <li>      <a href="integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="involved/building.html"  title="Building Guide">Building Guide</a>
+</li>
+                  
+                      <li>      <a href="releasing.html"  title="Release Guide">Release Guide</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+                      <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+    
+  <input value="helix.incubator.apache.org" name="sitesearch" type="hidden"/>
+  <input class="search-query" name="q" id="query" type="text" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
+          
+                                                    
+        
+        
+        <ul class="nav pull-right"><li>
+    
+    <a href="https://twitter.com/ApacheHelix" class="twitter-follow-button" data-show-count="false" data-align="right" data-size="large" data-show-screen-name="true" data-lang="en">Follow ApacheHelix</a>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
+        </li></ul>
+                
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="./" id="bannerLeft">
+                                                                                                <img src="images/helix-logo.jpg" />
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                        <img src="http://incubator.apache.org/images/egg-logo.png" />
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="projectVersion">Version: 0.6.2-incubating-SNAPSHOT</li>
+                  |             <li class="">
+                    <a href="./" title="Apache Helix">
+        Apache Helix</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">  Tutorial - Admin Operations</li>
+                
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2013-11-07</li> 
+            
+                            </ul>
+      </div>
+
+      
+                
+        <div id="bodyColumn" >
+                                  
+            <!-- -
+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. --><p></p>
+<h1><a href="./Tutorial.html">Helix Tutorial</a>: Admin Operations</h1>
+<p>Helix provides a set of admin api for cluster management operations. They are supported via:</p>
+
+<ul>
+  
+<li><i>Java API</i></li>
+  
+<li><i>Commandline interface</i></li>
+  
+<li><i>REST interface via helix-admin-webapp</i></li>
+</ul>
+<div class="section">
+<div class="section">
+<h3>Java API<a name="Java_API"></a></h3>
+<p>See interface <a href="./apidocs/reference/org/apache/helix/HelixAdmin.html"><i>org.apache.helix.HelixAdmin</i></a></p></div>
+<div class="section">
+<h3>Command-line interface<a name="Command-line_interface"></a></h3>
+<p>The command-line tool comes with helix-core package:</p>
+<p>Get the command-line tool:</p>
+
+<div class="source">
+<pre>  - git clone https://git-wip-us.apache.org/repos/asf/incubator-helix.git
+  - cd incubator-helix
+  - ./build
+  - cd helix-core/target/helix-core-pkg/bin
+  - chmod +x *.sh
+</pre></div>
+<p>Get help:</p>
+
+<div class="source">
+<pre>  - ./helix-admin.sh --help
+</pre></div>
+<p>All other commands have this form:</p>
+
+<div class="source">
+<pre>  ./helix-admin.sh --zkSvr &lt;ZookeeperServerAddress&gt; &lt;command&gt; &lt;parameters&gt;
+</pre></div>
+<p>Admin commands and brief description:</p>
+
+<table border="0" class="table table-striped">
+  <thead>
+    
+<tr class="a">
+      
+<th>Command syntax </th>
+      
+<th>Description </th>
+    </tr>
+  </thead>
+  <tbody>
+    
+<tr class="b">
+      
+<td><i>--activateCluster &lt;clusterName controllerCluster true/false&gt;</i> </td>
+      
+<td>Enable/disable a cluster in distributed controller mode </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--addCluster &lt;clusterName&gt;</i> </td>
+      
+<td>Add a new cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--addIdealState &lt;clusterName resourceName fileName.json&gt;</i> </td>
+      
+<td>Add an ideal state to a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--addInstanceTag &lt;clusterName instanceName tag&gt;</i> </td>
+      
+<td>Add a tag to an instance </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--addNode &lt;clusterName instanceId&gt;</i> </td>
+      
+<td>Add an instance to a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--addResource &lt;clusterName resourceName partitionNumber stateModelName&gt;</i> </td>
+      
+<td>Add a new resource to a cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--addResourceProperty &lt;clusterName resourceName propertyName propertyValue&gt;</i> </td>
+      
+<td>Add a resource property </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--addStateModelDef &lt;clusterName fileName.json&gt;</i> </td>
+      
+<td>Add a State model definition to a cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--dropCluster &lt;clusterName&gt;</i> </td>
+      
+<td>Delete a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--dropNode &lt;clusterName instanceId&gt;</i> </td>
+      
+<td>Remove a node from a cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--dropResource &lt;clusterName resourceName&gt;</i> </td>
+      
+<td>Remove an existing resource from a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--enableCluster &lt;clusterName true/false&gt;</i> </td>
+      
+<td>Enable/disable a cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--enableInstance &lt;clusterName instanceId true/false&gt;</i> </td>
+      
+<td>Enable/disable an instance </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--enablePartition &lt;true/false clusterName nodeId resourceName partitionName&gt;</i> </td>
+      
+<td>Enable/disable a partition </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--getConfig &lt;configScope configScopeArgs configKeys&gt;</i> </td>
+      
+<td>Get user configs </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--getConstraints &lt;clusterName constraintType&gt;</i> </td>
+      
+<td>Get constraints </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--help</i> </td>
+      
+<td>print help information </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--instanceGroupTag &lt;instanceTag&gt;</i> </td>
+      
+<td>Specify instance group tag, used with rebalance command </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--listClusterInfo &lt;clusterName&gt;</i> </td>
+      
+<td>Show information of a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--listClusters</i> </td>
+      
+<td>List all clusters </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--listInstanceInfo &lt;clusterName instanceId&gt;</i> </td>
+      
+<td>Show information of an instance </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--listInstances &lt;clusterName&gt;</i> </td>
+      
+<td>List all instances in a cluster </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--listPartitionInfo &lt;clusterName resourceName partitionName&gt;</i> </td>
+      
+<td>Show information of a partition </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--listResourceInfo &lt;clusterName resourceName&gt;</i> </td>
+      
+<td>Show information of a resource </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--listResources &lt;clusterName&gt;</i> </td>
+      
+<td>List all resources in a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--listStateModel &lt;clusterName stateModelName&gt;</i> </td>
+      
+<td>Show information of a state model </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--listStateModels &lt;clusterName&gt;</i> </td>
+      
+<td>List all state models in a cluster </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--maxPartitionsPerNode &lt;maxPartitionsPerNode&gt;</i> </td>
+      
+<td>Specify the max partitions per instance, used with addResourceGroup command </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--rebalance &lt;clusterName resourceName replicas&gt;</i> </td>
+      
+<td>Rebalance a resource </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--removeConfig &lt;configScope configScopeArgs configKeys&gt;</i> </td>
+      
+<td>Remove user configs </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--removeConstraint &lt;clusterName constraintType constraintId&gt;</i> </td>
+      
+<td>Remove a constraint </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--removeInstanceTag &lt;clusterName instanceId tag&gt;</i> </td>
+      
+<td>Remove a tag from an instance </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--removeResourceProperty &lt;clusterName resourceName propertyName&gt;</i> </td>
+      
+<td>Remove a resource property </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--resetInstance &lt;clusterName instanceId&gt;</i> </td>
+      
+<td>Reset all erroneous partitions on an instance </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--resetPartition &lt;clusterName instanceId resourceName partitionName&gt;</i> </td>
+      
+<td>Reset an erroneous partition </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--resetResource &lt;clusterName resourceName&gt;</i> </td>
+      
+<td>Reset all erroneous partitions of a resource </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--setConfig &lt;configScope configScopeArgs configKeyValueMap&gt;</i> </td>
+      
+<td>Set user configs </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--setConstraint &lt;clusterName constraintType constraintId constraintKeyValueMap&gt;</i> </td>
+      
+<td>Set a constraint </td>
+    </tr>
+    
+<tr class="b">
+      
+<td><i>--swapInstance &lt;clusterName oldInstance newInstance&gt;</i> </td>
+      
+<td>Swap an old instance with a new instance </td>
+    </tr>
+    
+<tr class="a">
+      
+<td><i>--zkSvr &lt;ZookeeperServerAddress&gt;</i> </td>
+      
+<td>Provide zookeeper address </td>
+    </tr>
+  </tbody>
+</table></div>
+<div class="section">
+<h3>REST interface<a name="REST_interface"></a></h3>
+<p>The REST interface comes wit helix-admin-webapp package:</p>
+
+<div class="source">
+<pre>  - git clone https://git-wip-us.apache.org/repos/asf/incubator-helix.git
+  - cd incubator-helix 
+  - ./build
+  - cd helix-admin-webapp/target/helix-admin-webapp-pkg/bin
+  - chmod +x *.sh
+  - ./run-rest-admin.sh --zkSvr &lt;zookeeperAddress&gt; --port &lt;port&gt; // make sure zookeeper is running
+</pre></div>
+<div class="section">
+<h4>URL and support methods<a name="URL_and_support_methods"></a></h4>
+
+<ul>
+  
+<li>
+<p><i>/clusters</i></p>
+  
+<ul>
+    
+<li>List all clusters</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters
+</pre></div>
+  
+<ul>
+    
+<li>Add a cluster</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;addCluster&quot;,&quot;clusterName&quot;:&quot;MyCluster&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}</i></p>
+  
+<ul>
+    
+<li>List cluster information</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster
+</pre></div>
+  
+<ul>
+    
+<li>Enable/disable a cluster in distributed controller mode</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;activateCluster&quot;,&quot;grandCluster&quot;:&quot;MyControllerCluster&quot;,&quot;enabled&quot;:&quot;true&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster
+</pre></div>
+  
+<ul>
+    
+<li>Remove a cluster</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -X DELETE http://localhost:8100/clusters/MyCluster
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/resourceGroups</i></p>
+  
+<ul>
+    
+<li>List all resources in a cluster</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/resourceGroups
+</pre></div>
+  
+<ul>
+    
+<li>Add a resource to cluster</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;addResource&quot;,&quot;resourceGroupName&quot;:&quot;MyDB&quot;,&quot;partitions&quot;:&quot;8&quot;,&quot;stateModelDefRef&quot;:&quot;MasterSlave&quot; }' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/resourceGroups
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/resourceGroups/{resourceName}</i></p>
+  
+<ul>
+    
+<li>List resource information</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</pre></div>
+  
+<ul>
+    
+<li>Drop a resource</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -X DELETE http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</pre></div>
+  
+<ul>
+    
+<li>Reset all erroneous partitions of a resource</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;resetResource&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/resourceGroups/{resourceName}/idealState</i></p>
+  
+<ul>
+    
+<li>Rebalance a resource</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;rebalance&quot;,&quot;replicas&quot;:&quot;3&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</pre></div>
+  
+<ul>
+    
+<li>Add an ideal state</li>
+  </ul>
+  
+<div class="source">
+<pre>echo jsonParameters={
+&quot;command&quot;:&quot;addIdealState&quot;
+   }&amp;newIdealState={
+  &quot;id&quot; : &quot;MyDB&quot;,
+  &quot;simpleFields&quot; : {
+    &quot;IDEAL_STATE_MODE&quot; : &quot;AUTO&quot;,
+    &quot;NUM_PARTITIONS&quot; : &quot;8&quot;,
+    &quot;REBALANCE_MODE&quot; : &quot;SEMI_AUTO&quot;,
+    &quot;REPLICAS&quot; : &quot;0&quot;,
+    &quot;STATE_MODEL_DEF_REF&quot; : &quot;MasterSlave&quot;,
+    &quot;STATE_MODEL_FACTORY_NAME&quot; : &quot;DEFAULT&quot;
+  },
+  &quot;listFields&quot; : {
+  },
+  &quot;mapFields&quot; : {
+    &quot;MyDB_0&quot; : {
+      &quot;localhost_1001&quot; : &quot;MASTER&quot;,
+      &quot;localhost_1002&quot; : &quot;SLAVE&quot;
+    }
+  }
+}
+&gt; newIdealState.json
+curl -d @'./newIdealState.json' -H 'Content-Type: application/json' http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</pre></div>
+  
+<ul>
+    
+<li>Add resource property</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;addResourceProperty&quot;,&quot;REBALANCE_TIMER_PERIOD&quot;:&quot;500&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/resourceGroups/{resourceName}/externalView</i></p>
+  
+<ul>
+    
+<li>Show resource external view</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/externalView
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/instances</i></p>
+  
+<ul>
+    
+<li>List all instances</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/instances
+</pre></div>
+  
+<ul>
+    
+<li>Add an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>curl -d 'jsonParameters={&quot;command&quot;:&quot;addInstance&quot;,&quot;instanceNames&quot;:&quot;localhost_1001&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances
+</pre></div>
+  
+<ul>
+    
+<li>Swap an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;swapInstance&quot;,&quot;oldInstance&quot;:&quot;localhost_1001&quot;, &quot;newInstance&quot;:&quot;localhost_1002&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/instances/{instanceName}</i></p>
+  
+<ul>
+    
+<li>Show instance information</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Enable/disable an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;enableInstance&quot;,&quot;enabled&quot;:&quot;false&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Drop an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -X DELETE http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Disable/enable partitions on an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;enablePartition&quot;,&quot;resource&quot;: &quot;MyDB&quot;,&quot;partition&quot;:&quot;MyDB_0&quot;,  &quot;enabled&quot; : &quot;false&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Reset an erroneous partition on an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;resetPartition&quot;,&quot;resource&quot;: &quot;MyDB&quot;,&quot;partition&quot;:&quot;MyDB_0&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Reset all erroneous partitions on an instance</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;resetInstance&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/configs</i></p>
+  
+<ul>
+    
+<li>Get user cluster level config</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/configs/cluster
+</pre></div>
+  
+<ul>
+    
+<li>Set user cluster level config</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;setConfig&quot;,&quot;configs&quot;:&quot;key1=value1,key2=value2&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/configs/cluster
+</pre></div>
+  
+<ul>
+    
+<li>Remove user cluster level config</li>
+  </ul>
+  
+<div class="source">
+<pre>curl -d 'jsonParameters={&quot;command&quot;:&quot;removeConfig&quot;,&quot;configs&quot;:&quot;key1,key2&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/configs/cluster
+</pre></div>
+  
+<ul>
+    
+<li>Get/set/remove user participant level config</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;setConfig&quot;,&quot;configs&quot;:&quot;key1=value1,key2=value2&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/configs/participant/localhost_1001
+</pre></div>
+  
+<ul>
+    
+<li>Get/set/remove resource level config</li>
+  </ul>
+  
+<div class="source">
+<pre>curl -d 'jsonParameters={&quot;command&quot;:&quot;setConfig&quot;,&quot;configs&quot;:&quot;key1=value1,key2=value2&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/configs/resource/MyDB
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/controller</i></p>
+  
+<ul>
+    
+<li>Show controller information</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/Controller
+</pre></div>
+  
+<ul>
+    
+<li>Enable/disable cluster</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -d 'jsonParameters={&quot;command&quot;:&quot;enableCluster&quot;,&quot;enabled&quot;:&quot;false&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/Controller
+</pre></div></li>
+  
+<li>
+<p><i>/zkPath/{path}</i></p>
+  
+<ul>
+    
+<li>Get information for zookeeper path</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/zkPath/MyCluster
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/StateModelDefs</i></p>
+  
+<ul>
+    
+<li>Show all state model definitions</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/StateModelDefs
+</pre></div>
+  
+<ul>
+    
+<li>Add a state mdoel definition</li>
+  </ul>
+  
+<div class="source">
+<pre>  echo jsonParameters={
+    &quot;command&quot;:&quot;addStateModelDef&quot;
+   }&amp;newStateModelDef={
+      &quot;id&quot; : &quot;OnlineOffline&quot;,
+      &quot;simpleFields&quot; : {
+        &quot;INITIAL_STATE&quot; : &quot;OFFLINE&quot;
+      },
+      &quot;listFields&quot; : {
+        &quot;STATE_PRIORITY_LIST&quot; : [ &quot;ONLINE&quot;, &quot;OFFLINE&quot;, &quot;DROPPED&quot; ],
+        &quot;STATE_TRANSITION_PRIORITYLIST&quot; : [ &quot;OFFLINE-ONLINE&quot;, &quot;ONLINE-OFFLINE&quot;, &quot;OFFLINE-DROPPED&quot; ]
+      },
+      &quot;mapFields&quot; : {
+        &quot;DROPPED.meta&quot; : {
+          &quot;count&quot; : &quot;-1&quot;
+        },
+        &quot;OFFLINE.meta&quot; : {
+          &quot;count&quot; : &quot;-1&quot;
+        },
+        &quot;OFFLINE.next&quot; : {
+          &quot;DROPPED&quot; : &quot;DROPPED&quot;,
+          &quot;ONLINE&quot; : &quot;ONLINE&quot;
+        },
+        &quot;ONLINE.meta&quot; : {
+          &quot;count&quot; : &quot;R&quot;
+        },
+        &quot;ONLINE.next&quot; : {
+          &quot;DROPPED&quot; : &quot;OFFLINE&quot;,
+          &quot;OFFLINE&quot; : &quot;OFFLINE&quot;
+        }
+      }
+    }
+    &gt; newStateModelDef.json
+    curl -d @'./untitled.txt' -H 'Content-Type: application/json' http://localhost:8100/clusters/MyCluster/StateModelDefs
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/StateModelDefs/{stateModelDefName}</i></p>
+  
+<ul>
+    
+<li>Show a state model definition</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/StateModelDefs/OnlineOffline
+</pre></div></li>
+  
+<li>
+<p><i>/clusters/{clusterName}/constraints/{constraintType}</i></p>
+  
+<ul>
+    
+<li>Show all contraints</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT
+</pre></div>
+  
+<ul>
+    
+<li>Set a contraint</li>
+  </ul>
+  
+<div class="source">
+<pre>   curl -d 'jsonParameters={&quot;constraintAttributes&quot;:&quot;RESOURCE=MyDB,CONSTRAINT_VALUE=1&quot;}' -H &quot;Content-Type: application/json&quot; http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT/MyConstraint
+</pre></div>
+  
+<ul>
+    
+<li>Remove a constraint</li>
+  </ul>
+  
+<div class="source">
+<pre>  curl -X DELETE http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT/MyConstraint
+</pre></div></li>
+</ul></div></div></div>
+                  </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container">
+              <div class="row span12">Copyright &copy;                    2013
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<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.incubator.apache.org/privacy-policy.html">Privacy Policy</a>
+</div>
+                  
+                <p id="poweredBy" class="pull-right">
+                          <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+              </p>
+        
+                </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file

Added: incubator/helix/site-content/tutorial_controller.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/tutorial_controller.html?rev=1544749&view=auto
==============================================================================
--- incubator/helix/site-content/tutorial_controller.html (added)
+++ incubator/helix/site-content/tutorial_controller.html Sat Nov 23 07:11:13 2013
@@ -0,0 +1,304 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2013-11-07
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20131107" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Helix -   Tutorial - Controller</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<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="topBarEnabled">
+          
+                        
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                                  <div class="container"><div class="nav-collapse">
+            
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Helix <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="Concepts.html"  title="Core concepts">Core concepts</a>
+</li>
+                  
+                      <li>      <a href="Architecture.html"  title="Architecture">Architecture</a>
+</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="releasenotes/release-0.6.1-incubating.html"  title="release 0.6.1-incubating">release 0.6.1-incubating</a>
+</li>
+                  
+                      <li>      <a href="download.html"  title="Download">Download</a>
+</li>
+                  
+                      <li>      <a href="IRC.html"  title="IRC">IRC</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>
+                  
+                      <li>      <a href="recipes/user_def_rebalancer.html"  title="User-Defined Rebalancer Example">User-Defined Rebalancer Example</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracking.html"  title="Issues">Issues</a>
+</li>
+                  
+                      <li>      <a href="team-list.html"  title="Team">Team</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Sources">Sources</a>
+</li>
+                  
+                      <li>      <a href="integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="involved/building.html"  title="Building Guide">Building Guide</a>
+</li>
+                  
+                      <li>      <a href="releasing.html"  title="Release Guide">Release Guide</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+                      <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+    
+  <input value="helix.incubator.apache.org" name="sitesearch" type="hidden"/>
+  <input class="search-query" name="q" id="query" type="text" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
+          
+                                                    
+        
+        
+        <ul class="nav pull-right"><li>
+    
+    <a href="https://twitter.com/ApacheHelix" class="twitter-follow-button" data-show-count="false" data-align="right" data-size="large" data-show-screen-name="true" data-lang="en">Follow ApacheHelix</a>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
+        </li></ul>
+                
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="./" id="bannerLeft">
+                                                                                                <img src="images/helix-logo.jpg" />
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                        <img src="http://incubator.apache.org/images/egg-logo.png" />
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="projectVersion">Version: 0.6.2-incubating-SNAPSHOT</li>
+                  |             <li class="">
+                    <a href="./" title="Apache Helix">
+        Apache Helix</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">  Tutorial - Controller</li>
+                
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2013-11-07</li> 
+            
+                            </ul>
+      </div>
+
+      
+                
+        <div id="bodyColumn" >
+                                  
+            <!-- -
+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. --><p></p>
+<h1><a href="./Tutorial.html">Helix Tutorial</a>: Controller</h1>
+<p>Next, let's implement the controller. This is the brain of the cluster. Helix makes sure there is exactly one active controller running the cluster.</p>
+<div class="section">
+<div class="section">
+<h3>Start the Helix agent<a name="Start_the_Helix_agent"></a></h3>
+<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 CONTROLLER:
+  
+<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>
+
+<div class="source">
+<pre>      manager = HelixManagerFactory.getZKHelixManager(clusterName,
+                                                      instanceName,
+                                                      instanceType,
+                                                      zkConnectString);
+</pre></div></div>
+<div class="section">
+<h3>Controller Code<a name="Controller_Code"></a></h3>
+<p>The Controller needs to know about all changes in the cluster. Helix takes care of this with the default implementation. If you need additional functionality, see GenericHelixController on how to configure the pipeline.</p>
+
+<div class="source">
+<pre>      manager = HelixManagerFactory.getZKHelixManager(clusterName,
+                                                          instanceName,
+                                                          InstanceType.CONTROLLER,
+                                                          zkConnectString);
+     manager.connect();
+     GenericHelixController controller = new GenericHelixController();
+     manager.addConfigChangeListener(controller);
+     manager.addLiveInstanceChangeListener(controller);
+     manager.addIdealStateChangeListener(controller);
+     manager.addExternalViewChangeListener(controller);
+     manager.addControllerListener(controller);
+</pre></div>
+<p>The snippet above shows how the controller is started. You can also start the controller using command line interface.</p>
+
+<div class="source">
+<pre>cd helix/helix-core/target/helix-core-pkg/bin
+./run-helix-controller.sh --zkSvr &lt;Zookeeper ServerAddress (Required)&gt;  --cluster &lt;Cluster name (Required)&gt;
+</pre></div></div>
+<div class="section">
+<h3>Controller deployment modes<a name="Controller_deployment_modes"></a></h3>
+<p>Helix provides multiple options to deploy the controller.</p>
+<div class="section">
+<h4>STANDALONE<a name="STANDALONE"></a></h4>
+<p>The Controller can be started as a separate process to manage a cluster. This is the recommended approach. However, since one controller can be a single point of failure, multiple controller processes are required for reliability. Even if multiple controllers are running, only one will be actively managing the cluster at any time and is decided by a leader-election process. If the leader fails, another leader will take over managing the cluster.</p>
+<p>Even though we recommend this method of deployment, it has the drawback of having to manage an additional service for each cluster. See Controller As a Service option.</p></div>
+<div class="section">
+<h4>EMBEDDED<a name="EMBEDDED"></a></h4>
+<p>If setting up a separate controller process is not viable, then it is possible to embed the controller as a library in each of the participants.</p></div>
+<div class="section">
+<h4>CONTROLLER AS A SERVICE<a name="CONTROLLER_AS_A_SERVICE"></a></h4>
+<p>One of the cool features we added in Helix is to use a set of controllers to manage a large number of clusters. </p>
+<p>For example if you have X clusters to be managed, instead of deploying X*3 (3 controllers for fault tolerance) controllers for each cluster, one can deploy just 3 controllers. Each controller can manage X/3 clusters. If any controller fails, the remaining two will manage X/2 clusters.</p></div></div></div>
+                  </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container">
+              <div class="row span12">Copyright &copy;                    2013
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<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.incubator.apache.org/privacy-policy.html">Privacy Policy</a>
+</div>
+                  
+                <p id="poweredBy" class="pull-right">
+                          <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+              </p>
+        
+                </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file

Added: incubator/helix/site-content/tutorial_health.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/tutorial_health.html?rev=1544749&view=auto
==============================================================================
--- incubator/helix/site-content/tutorial_health.html (added)
+++ incubator/helix/site-content/tutorial_health.html Sat Nov 23 07:11:13 2013
@@ -0,0 +1,253 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2013-11-07
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20131107" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Helix -   Tutorial - Customizing Heath Checks</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<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="topBarEnabled">
+          
+                        
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                                  <div class="container"><div class="nav-collapse">
+            
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Helix <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="Concepts.html"  title="Core concepts">Core concepts</a>
+</li>
+                  
+                      <li>      <a href="Architecture.html"  title="Architecture">Architecture</a>
+</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="releasenotes/release-0.6.1-incubating.html"  title="release 0.6.1-incubating">release 0.6.1-incubating</a>
+</li>
+                  
+                      <li>      <a href="download.html"  title="Download">Download</a>
+</li>
+                  
+                      <li>      <a href="IRC.html"  title="IRC">IRC</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>
+                  
+                      <li>      <a href="recipes/user_def_rebalancer.html"  title="User-Defined Rebalancer Example">User-Defined Rebalancer Example</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracking.html"  title="Issues">Issues</a>
+</li>
+                  
+                      <li>      <a href="team-list.html"  title="Team">Team</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Sources">Sources</a>
+</li>
+                  
+                      <li>      <a href="integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="involved/building.html"  title="Building Guide">Building Guide</a>
+</li>
+                  
+                      <li>      <a href="releasing.html"  title="Release Guide">Release Guide</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+                      <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+    
+  <input value="helix.incubator.apache.org" name="sitesearch" type="hidden"/>
+  <input class="search-query" name="q" id="query" type="text" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
+          
+                                                    
+        
+        
+        <ul class="nav pull-right"><li>
+    
+    <a href="https://twitter.com/ApacheHelix" class="twitter-follow-button" data-show-count="false" data-align="right" data-size="large" data-show-screen-name="true" data-lang="en">Follow ApacheHelix</a>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
+        </li></ul>
+                
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="./" id="bannerLeft">
+                                                                                                <img src="images/helix-logo.jpg" />
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                        <img src="http://incubator.apache.org/images/egg-logo.png" />
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="projectVersion">Version: 0.6.2-incubating-SNAPSHOT</li>
+                  |             <li class="">
+                    <a href="./" title="Apache Helix">
+        Apache Helix</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">  Tutorial - Customizing Heath Checks</li>
+                
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2013-11-07</li> 
+            
+                            </ul>
+      </div>
+
+      
+                
+        <div id="bodyColumn" >
+                                  
+            <!-- -
+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. --><p></p>
+<h1><a href="./Tutorial.html">Helix Tutorial</a>: Customizing Health Checks</h1>
+<p>In this chapter, we'll learn how to customize the health check, based on metrics of your distributed system. </p>
+<div class="section">
+<div class="section">
+<h3>Health Checks<a name="Health_Checks"></a></h3>
+<p>Note: <i>this in currently in development mode, not yet ready for production.</i></p>
+<p>Helix provides the ability for each node in the system to report health metrics on a periodic basis. </p>
+<p>Helix supports multiple ways to aggregate these metrics:</p>
+
+<ul>
+  
+<li>SUM</li>
+  
+<li>AVG</li>
+  
+<li>EXPONENTIAL DECAY</li>
+  
+<li>WINDOW</li>
+</ul>
+<p>Helix persists the aggregated value only.</p>
+<p>Applications can define a threshold on the aggregate values according to the SLAs, and when the SLA is violated Helix will fire an alert. Currently Helix only fires an alert, but in a future release we plan to use these metrics to either mark the node dead or load balance the partitions. This feature will be valuable for distributed systems that support multi-tenancy and have a large variation in work load patterns. In addition, this can be used to detect skewed partitions (hotspots) and rebalance the cluster.</p></div></div>
+                  </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container">
+              <div class="row span12">Copyright &copy;                    2013
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<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.incubator.apache.org/privacy-policy.html">Privacy Policy</a>
+</div>
+                  
+                <p id="poweredBy" class="pull-right">
+                          <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+              </p>
+        
+                </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file

Added: incubator/helix/site-content/tutorial_messaging.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/tutorial_messaging.html?rev=1544749&view=auto
==============================================================================
--- incubator/helix/site-content/tutorial_messaging.html (added)
+++ incubator/helix/site-content/tutorial_messaging.html Sat Nov 23 07:11:13 2013
@@ -0,0 +1,273 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2013-11-07
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20131107" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Helix -   Tutorial - Messaging</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<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="topBarEnabled">
+          
+                        
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                                  <div class="container"><div class="nav-collapse">
+            
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Helix <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="Concepts.html"  title="Core concepts">Core concepts</a>
+</li>
+                  
+                      <li>      <a href="Architecture.html"  title="Architecture">Architecture</a>
+</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="releasenotes/release-0.6.1-incubating.html"  title="release 0.6.1-incubating">release 0.6.1-incubating</a>
+</li>
+                  
+                      <li>      <a href="download.html"  title="Download">Download</a>
+</li>
+                  
+                      <li>      <a href="IRC.html"  title="IRC">IRC</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>
+                  
+                      <li>      <a href="recipes/user_def_rebalancer.html"  title="User-Defined Rebalancer Example">User-Defined Rebalancer Example</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracking.html"  title="Issues">Issues</a>
+</li>
+                  
+                      <li>      <a href="team-list.html"  title="Team">Team</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Sources">Sources</a>
+</li>
+                  
+                      <li>      <a href="integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="involved/building.html"  title="Building Guide">Building Guide</a>
+</li>
+                  
+                      <li>      <a href="releasing.html"  title="Release Guide">Release Guide</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+                      <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+    
+  <input value="helix.incubator.apache.org" name="sitesearch" type="hidden"/>
+  <input class="search-query" name="q" id="query" type="text" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
+          
+                                                    
+        
+        
+        <ul class="nav pull-right"><li>
+    
+    <a href="https://twitter.com/ApacheHelix" class="twitter-follow-button" data-show-count="false" data-align="right" data-size="large" data-show-screen-name="true" data-lang="en">Follow ApacheHelix</a>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
+        </li></ul>
+                
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="./" id="bannerLeft">
+                                                                                                <img src="images/helix-logo.jpg" />
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                        <img src="http://incubator.apache.org/images/egg-logo.png" />
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="projectVersion">Version: 0.6.2-incubating-SNAPSHOT</li>
+                  |             <li class="">
+                    <a href="./" title="Apache Helix">
+        Apache Helix</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">  Tutorial - Messaging</li>
+                
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2013-11-07</li> 
+            
+                            </ul>
+      </div>
+
+      
+                
+        <div id="bodyColumn" >
+                                  
+            <!-- -
+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. --><p></p>
+<h1><a href="./Tutorial.html">Helix Tutorial</a>: Messaging</h1>
+<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 which is quite useful in practice. It is common that nodes in a distributed system require a mechanism to interact with each other. </p>
+<div class="section">
+<div class="section">
+<h3>Example: Bootstrapping a Replica<a name="Example:_Bootstrapping_a_Replica"></a></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. Helix 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 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>      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(&quot;%&quot;);
+      recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
+      recipientCriteria.setResource(&quot;MyDB&quot;);
+      recipientCriteria.setPartition(&quot;&quot;);
+
+      // 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);
+</pre></div>
+<p>See HelixManager.DefaultMessagingService in <a href="./apidocs/reference/org/apache/helix/messaging/DefaultMessagingService.html">Javadocs</a> for more info.</p></div></div>
+                  </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container">
+              <div class="row span12">Copyright &copy;                    2013
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<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.incubator.apache.org/privacy-policy.html">Privacy Policy</a>
+</div>
+                  
+                <p id="poweredBy" class="pull-right">
+                          <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+              </p>
+        
+                </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file

Added: incubator/helix/site-content/tutorial_participant.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/tutorial_participant.html?rev=1544749&view=auto
==============================================================================
--- incubator/helix/site-content/tutorial_participant.html (added)
+++ incubator/helix/site-content/tutorial_participant.html Sat Nov 23 07:11:13 2013
@@ -0,0 +1,325 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2013-11-07
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20131107" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Helix -   Tutorial - Participant</title>
+    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="./css/site.css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<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="topBarEnabled">
+          
+                        
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                                  <div class="container"><div class="nav-collapse">
+            
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Helix <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="index.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="Concepts.html"  title="Core concepts">Core concepts</a>
+</li>
+                  
+                      <li>      <a href="Architecture.html"  title="Architecture">Architecture</a>
+</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="releasenotes/release-0.6.1-incubating.html"  title="release 0.6.1-incubating">release 0.6.1-incubating</a>
+</li>
+                  
+                      <li>      <a href="download.html"  title="Download">Download</a>
+</li>
+                  
+                      <li>      <a href="IRC.html"  title="IRC">IRC</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>
+                  
+                      <li>      <a href="recipes/user_def_rebalancer.html"  title="User-Defined Rebalancer Example">User-Defined Rebalancer Example</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="issue-tracking.html"  title="Issues">Issues</a>
+</li>
+                  
+                      <li>      <a href="team-list.html"  title="Team">Team</a>
+</li>
+                  
+                      <li>      <a href="source-repository.html"  title="Sources">Sources</a>
+</li>
+                  
+                      <li>      <a href="integration.html"  title="Continuous Integration">Continuous Integration</a>
+</li>
+                  
+                      <li>      <a href="involved/building.html"  title="Building Guide">Building Guide</a>
+</li>
+                  
+                      <li>      <a href="releasing.html"  title="Release Guide">Release Guide</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+                      <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+    
+  <input value="helix.incubator.apache.org" name="sitesearch" type="hidden"/>
+  <input class="search-query" name="q" id="query" type="text" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
+          
+                                                    
+        
+        
+        <ul class="nav pull-right"><li>
+    
+    <a href="https://twitter.com/ApacheHelix" class="twitter-follow-button" data-show-count="false" data-align="right" data-size="large" data-show-screen-name="true" data-lang="en">Follow ApacheHelix</a>
+    <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
+        </li></ul>
+                
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="./" id="bannerLeft">
+                                                                                                <img src="images/helix-logo.jpg" />
+                </a>
+                      </div>
+        <div class="pull-right">                  <a href="http://incubator.apache.org/" id="bannerRight">
+                                                                                        <img src="http://incubator.apache.org/images/egg-logo.png" />
+                </a>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="projectVersion">Version: 0.6.2-incubating-SNAPSHOT</li>
+                  |             <li class="">
+                    <a href="./" title="Apache Helix">
+        Apache Helix</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">  Tutorial - Participant</li>
+                
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2013-11-07</li> 
+            
+                            </ul>
+      </div>
+
+      
+                
+        <div id="bodyColumn" >
+                                  
+            <!-- -
+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. --><p></p>
+<h1><a href="./Tutorial.html">Helix Tutorial</a>: Participant</h1>
+<p>In this chapter, we'll learn how to implement a Participant, which is a primary functional component of a distributed system.</p>
+<div class="section">
+<div class="section">
+<h3>Start the Helix agent<a name="Start_the_Helix_agent"></a></h3>
+<p>The Helix agent 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, 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&#x2019;ll use the OnlineOffline factory. Other options include:</p>
+
+<ul>
+  
+<li>MasterSlaveStateModelFactory</li>
+  
+<li>LeaderStandbyStateModelFactory</li>
+  
+<li>BootstrapHandler</li>
+  
+<li><i>An application defined state model factory</i></li>
+</ul>
+
+<div class="source">
+<pre>      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();
+</pre></div>
+<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>public class OnlineOfflineStateModelFactory extends
+        StateModelFactory&lt;StateModel&gt; {
+    @Override
+    public StateModel createNewStateModel(String stateUnitKey) {
+        OnlineOfflineStateModel stateModel = new OnlineOfflineStateModel();
+        return stateModel;
+    }
+    @StateModelInfo(states = &quot;{'OFFLINE','ONLINE'}&quot;, initialState = &quot;OFFINE&quot;)
+    public static class OnlineOfflineStateModel extends StateModel {
+
+        @Transition(from = &quot;OFFLINE&quot;, to = &quot;ONLINE&quot;)
+        public void onBecomeOnlineFromOffline(Message message,
+                NotificationContext context) {
+
+            System.out.println(&quot;OnlineOfflineStateModel.onBecomeOnlineFromOffline()&quot;);
+
+            ////////////////////////////////////////////////////////////////////////////////////////////////
+            // Application logic to handle transition                                                     //
+            // For example, you might start a service, run initialization, etc                            //
+            ////////////////////////////////////////////////////////////////////////////////////////////////
+        }
+
+        @Transition(from = &quot;ONLINE&quot;, to = &quot;OFFLINE&quot;)
+        public void onBecomeOfflineFromOnline(Message message,
+                NotificationContext context) {
+
+            System.out.println(&quot;OnlineOfflineStateModel.onBecomeOfflineFromOnline()&quot;);
+
+            ////////////////////////////////////////////////////////////////////////////////////////////////
+            // Application logic to handle transition                                                     //
+            // For example, you might shutdown a service, log this event, or change monitoring settings   //
+            ////////////////////////////////////////////////////////////////////////////////////////////////
+        }
+    }
+}
+</pre></div></div></div>
+                  </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container">
+              <div class="row span12">Copyright &copy;                    2013
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                                                                  <?xml version="1.0" encoding="UTF-8"?>
+<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.incubator.apache.org/privacy-policy.html">Privacy Policy</a>
+</div>
+                  
+                <p id="poweredBy" class="pull-right">
+                          <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+      </a>
+              </p>
+        
+                </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file