Added: helix/site-content/1.2.0-docs/tutorial_admin.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.2.0-docs/tutorial_admin.html?rev=1909461&view=auto
==============================================================================
--- helix/site-content/1.2.0-docs/tutorial_admin.html (added)
+++ helix/site-content/1.2.0-docs/tutorial_admin.html Thu Apr 27 23:08:36 2023
@@ -0,0 +1,808 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2023-04-27  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 - Admin Operations</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_admin project-120-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.2.0">Helix 1.2.0</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.2.0.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.2.0" 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.2.0">Release 
1.2.0</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Admin Operations</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2023-04-27</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:_Admin_Operations"><a href="./Tutorial.html">Helix 
Tutorial</a>: Admin Operations</h2>
+ </div> 
+ <p>Helix provides a set of admin APIs for cluster management operations. They 
are supported via:</p> 
+ <ul> 
+  <li>Java API</li> 
+  <li>Command Line Interface</li> 
+  <li>REST Interface via helix-admin-webapp</li> 
+ </ul> 
+ <section> 
+  <h3 id="Java_API">Java API</h3> 
+  <p>See interface <a class="externalLink" 
href="http://helix.apache.org/javadocs/1.2.0/reference/org/apache/helix/HelixAdmin.html";><i>org.apache.helix.HelixAdmin</i></a></p>
 
+ </section> 
+ <section> 
+  <h3 id="Command_Line_Interface">Command Line Interface</h3> 
+  <p>The command line tool comes with helix-core package:</p> 
+  <p>Get the command line tool:</p> 
+  <div class="source"> 
+   <pre><code>git clone https://git-wip-us.apache.org/repos/asf/helix.git
+cd helix
+git checkout tags/helix-1.2.0
+./build
+cd helix-core/target/helix-core-pkg/bin
+chmod +x *.sh
+</code></pre> 
+  </div> 
+  <p>Get help:</p> 
+  <div class="source"> 
+   <pre><code>./helix-admin.sh --help
+</code></pre> 
+  </div> 
+  <p>All other commands have this form:</p> 
+  <div class="source"> 
+   <pre><code>./helix-admin.sh --zkSvr &lt;ZookeeperServerAddress&gt; 
&lt;command&gt; &lt;parameters&gt;
+</code></pre> 
+  </div> 
+  <section> 
+   <h4 id="Supported_Commands">Supported Commands</h4> 
+   <table border="0" class="bodyTable table table-striped table-hover"> 
+    <thead> 
+     <tr class="a"> 
+      <th>Command Syntax</th> 
+      <th>Description</th> 
+     </tr> 
+    </thead> 
+    <tbody> 
+     <tr class="b"> 
+      <td align="left"><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 align="left"><i>--addCluster &lt;clusterName&gt;</i></td> 
+      <td>Add a new cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--addIdealState &lt;clusterName resourceName 
fileName.json&gt;</i></td> 
+      <td>Add an ideal state to a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--addInstanceTag &lt;clusterName instanceName 
tag&gt;</i></td> 
+      <td>Add a tag to an instance</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--addNode &lt;clusterName instanceId&gt;</i></td> 
+      <td>Add an instance to a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--addResource &lt;clusterName resourceName 
partitionNumber stateModelName&gt;</i></td> 
+      <td>Add a new resource to a cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--addResourceProperty &lt;clusterName resourceName 
propertyName propertyValue&gt;</i></td> 
+      <td>Add a resource property</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--addStateModelDef &lt;clusterName 
fileName.json&gt;</i></td> 
+      <td>Add a State model definition to a cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--dropCluster &lt;clusterName&gt;</i></td> 
+      <td>Delete a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--dropNode &lt;clusterName instanceId&gt;</i></td> 
+      <td>Remove a node from a cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--dropResource &lt;clusterName 
resourceName&gt;</i></td> 
+      <td>Remove an existing resource from a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--enableCluster &lt;clusterName 
true/false&gt;</i></td> 
+      <td>Enable/disable a cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--enableInstance &lt;clusterName instanceId 
true/false&gt;</i></td> 
+      <td>Enable/disable an instance</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--enablePartition &lt;true/false clusterName nodeId 
resourceName partitionName&gt;</i></td> 
+      <td>Enable/disable a partition</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--getConfig &lt;configScope configScopeArgs 
configKeys&gt;</i></td> 
+      <td>Get user configs</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--getConstraints &lt;clusterName 
constraintType&gt;</i></td> 
+      <td>Get constraints</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--help</i></td> 
+      <td>print help information</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--instanceGroupTag &lt;instanceTag&gt;</i></td> 
+      <td>Specify instance group tag, used with rebalance command</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--listClusterInfo &lt;clusterName&gt;</i></td> 
+      <td>Show information of a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--listClusters</i></td> 
+      <td>List all clusters</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--listInstanceInfo &lt;clusterName 
instanceId&gt;</i></td> 
+      <td>Show information of an instance</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--listInstances &lt;clusterName&gt;</i></td> 
+      <td>List all instances in a cluster</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--listPartitionInfo &lt;clusterName resourceName 
partitionName&gt;</i></td> 
+      <td>Show information of a partition</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--listResourceInfo &lt;clusterName 
resourceName&gt;</i></td> 
+      <td>Show information of a resource</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--listResources &lt;clusterName&gt;</i></td> 
+      <td>List all resources in a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--listStateModel &lt;clusterName 
stateModelName&gt;</i></td> 
+      <td>Show information of a state model</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--listStateModels &lt;clusterName&gt;</i></td> 
+      <td>List all state models in a cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--maxPartitionsPerNode 
&lt;maxPartitionsPerNode&gt;</i></td> 
+      <td>Specify the max partitions per instance, used with addResourceGroup 
command</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--rebalance &lt;clusterName resourceName 
replicas&gt;</i></td> 
+      <td>Rebalance a resource</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--removeConfig &lt;configScope configScopeArgs 
configKeys&gt;</i></td> 
+      <td>Remove user configs</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--removeConstraint &lt;clusterName constraintType 
constraintId&gt;</i></td> 
+      <td>Remove a constraint</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--removeInstanceTag &lt;clusterName instanceId 
tag&gt;</i></td> 
+      <td>Remove a tag from an instance</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--removeResourceProperty &lt;clusterName 
resourceName propertyName&gt;</i></td> 
+      <td>Remove a resource property</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--resetInstance &lt;clusterName 
instanceId&gt;</i></td> 
+      <td>Reset all erroneous partitions on an instance</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--resetPartition &lt;clusterName instanceId 
resourceName partitionName&gt;</i></td> 
+      <td>Reset an erroneous partition</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--resetResource &lt;clusterName 
resourceName&gt;</i></td> 
+      <td>Reset all erroneous partitions of a resource</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--setConfig &lt;configScope configScopeArgs 
configKeyValueMap&gt;</i></td> 
+      <td>Set user configs</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--setConstraint &lt;clusterName constraintType 
constraintId constraintKeyValueMap&gt;</i></td> 
+      <td>Set a constraint</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left"><i>--swapInstance &lt;clusterName oldInstance 
newInstance&gt;</i></td> 
+      <td>Swap an old instance with a new instance</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left"><i>--zkSvr &lt;ZookeeperServerAddress&gt;</i></td> 
+      <td>Provide zookeeper address</td> 
+     </tr> 
+    </tbody> 
+   </table> 
+  </section> 
+ </section> 
+ <section> 
+  <h3 id="REST_Interface">REST Interface</h3> 
+  <p>The REST interface comes wit helix-admin-webapp package:</p> 
+  <div class="source"> 
+   <pre><code>git clone https://git-wip-us.apache.org/repos/asf/helix.git
+cd helix
+git checkout tags/helix-1.2.0
+./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
+</code></pre> 
+  </div> 
+  <section> 
+   <h4 id="URL_and_support_methods">URL and support methods</h4> 
+   <ul> 
+    <li> <p><i>/clusters</i></p> 
+     <ul> 
+      <li>List all clusters</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add a cluster</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"addCluster","clusterName":"MyCluster"}' -H 
"Content-Type: application/json" http://localhost:8100/clusters
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}</i></p> 
+     <ul> 
+      <li>List cluster information</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters/MyCluster
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Enable/disable a cluster in distributed controller mode</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"activateCluster","grandCluster":"MyControllerCluster","enabled":"true"}'
 -H "Content-Type: application/json" http://localhost:8100/clusters/MyCluster
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Remove a cluster</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -X DELETE http://localhost:8100/clusters/MyCluster
+</code></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><code>curl http://localhost:8100/clusters/MyCluster/resourceGroups
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add a resource to cluster</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"addResource","resourceGroupName":"MyDB","partitions":"8","stateModelDefRef":"LeaderStandby"
 }' -H "Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/resourceGroups
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/resourceGroups/{resourceName}</i></p> 
+     <ul> 
+      <li>List resource information</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Drop a resource</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -X DELETE 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Reset all erroneous partitions of a resource</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 'jsonParameters={"command":"resetResource"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB
+</code></pre> 
+     </div> </li> 
+    <li> 
<p><i>/clusters/{clusterName}/resourceGroups/{resourceName}/idealState</i></p> 
+     <ul> 
+      <li>Rebalance a resource</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"rebalance","replicas":"3"}' -H "Content-Type: 
application/json" 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add an ideal state</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>echo jsonParameters={
+"command":"addIdealState"
+   }&amp;newIdealState={
+  "id" : "MyDB",
+  "simpleFields" : {
+    "IDEAL_STATE_MODE" : "AUTO",
+    "NUM_PARTITIONS" : "8",
+    "REBALANCE_MODE" : "SEMI_AUTO",
+    "REPLICAS" : "0",
+    "STATE_MODEL_DEF_REF" : "LeaderStandby",
+    "STATE_MODEL_FACTORY_NAME" : "DEFAULT"
+  },
+  "listFields" : {
+  },
+  "mapFields" : {
+    "MyDB_0" : {
+      "localhost_1001" : "LEADER",
+      "localhost_1002" : "STANDBY"
+    }
+  }
+}
+&gt; newIdealState.json
+curl -d @'./newIdealState.json' -H 'Content-Type: application/json' 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add resource property</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"addResourceProperty","REBALANCE_TIMER_PERIOD":"500"}'
 -H "Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/idealState
+</code></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><code>curl 
http://localhost:8100/clusters/MyCluster/resourceGroups/MyDB/externalView
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/instances</i></p> 
+     <ul> 
+      <li>List all instances</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters/MyCluster/instances
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"addInstance","instanceNames":"localhost_1001"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/instances
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Swap an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"swapInstance","oldInstance":"localhost_1001", 
"newInstance":"localhost_1002"}' -H "Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/instances
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/instances/{instanceName}</i></p> 
+     <ul> 
+      <li>Show instance information</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Enable/disable an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"enableInstance","enabled":"false"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Drop an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -X DELETE 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Disable/enable partitions on an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"enablePartition","resource": 
"MyDB","partition":"MyDB_0",  "enabled" : "false"}' -H "Content-Type: 
application/json" 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Reset an erroneous partition on an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"resetPartition","resource": 
"MyDB","partition":"MyDB_0"}' -H "Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Reset all erroneous partitions on an instance</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 'jsonParameters={"command":"resetInstance"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/instances/localhost_1001
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/configs</i></p> 
+     <ul> 
+      <li>Get user cluster level config</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters/MyCluster/configs/cluster
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Set user cluster level config</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"setConfig","configs":"key1=value1,key2=value2"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/configs/cluster
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Remove user cluster level config</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"removeConfig","configs":"key1,key2"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/configs/cluster
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Get/set/remove user participant level config</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"setConfig","configs":"key1=value1,key2=value2"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/configs/participant/localhost_1001
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Get/set/remove resource level config</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"setConfig","configs":"key1=value1,key2=value2"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/configs/resource/MyDB
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/controller</i></p> 
+     <ul> 
+      <li>Show controller information</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters/MyCluster/Controller
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Enable/disable cluster</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"command":"enableCluster","enabled":"false"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/Controller
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/zkPath/{path}</i></p> 
+     <ul> 
+      <li>Get information for zookeeper path</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/zkPath/MyCluster
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/StateModelDefs</i></p> 
+     <ul> 
+      <li>Show all state model definitions</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl http://localhost:8100/clusters/MyCluster/StateModelDefs
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Add a state mdoel definition</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>echo jsonParameters={
+  "command":"addStateModelDef"
+}&amp;newStateModelDef={
+  "id" : "OnlineOffline",
+  "simpleFields" : {
+    "INITIAL_STATE" : "OFFLINE"
+  },
+  "listFields" : {
+    "STATE_PRIORITY_LIST" : [ "ONLINE", "OFFLINE", "DROPPED" ],
+    "STATE_TRANSITION_PRIORITYLIST" : [ "OFFLINE-ONLINE", "ONLINE-OFFLINE", 
"OFFLINE-DROPPED" ]
+  },
+  "mapFields" : {
+    "DROPPED.meta" : {
+      "count" : "-1"
+    },
+    "OFFLINE.meta" : {
+      "count" : "-1"
+    },
+    "OFFLINE.next" : {
+      "DROPPED" : "DROPPED",
+      "ONLINE" : "ONLINE"
+    },
+    "ONLINE.meta" : {
+      "count" : "R"
+    },
+    "ONLINE.next" : {
+      "DROPPED" : "OFFLINE",
+      "OFFLINE" : "OFFLINE"
+    }
+  }
+}
+&gt; newStateModelDef.json
+curl -d @'./untitled.txt' -H 'Content-Type: application/json' 
http://localhost:8100/clusters/MyCluster/StateModelDefs
+</code></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><code>curl 
http://localhost:8100/clusters/MyCluster/StateModelDefs/OnlineOffline
+</code></pre> 
+     </div> </li> 
+    <li> <p><i>/clusters/{clusterName}/constraints/{constraintType}</i></p> 
+     <ul> 
+      <li>Show all contraints</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl 
http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Set a contraint</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -d 
'jsonParameters={"constraintAttributes":"RESOURCE=MyDB,CONSTRAINT_VALUE=1"}' -H 
"Content-Type: application/json" 
http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT/MyConstraint
+</code></pre> 
+     </div> 
+     <ul> 
+      <li>Remove a constraint</li> 
+     </ul> 
+     <div class="source"> 
+      <pre><code>curl -X DELETE 
http://localhost:8100/clusters/MyCluster/constraints/MESSAGE_CONSTRAINT/MyConstraint
+</code></pre> 
+     </div> </li> 
+   </ul> 
+  </section> 
+ </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.2.0.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.2.0" 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;2023 <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.2.0-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.2.0-docs/tutorial_agent.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.2.0-docs/tutorial_agent.html?rev=1909461&view=auto
==============================================================================
--- helix/site-content/1.2.0-docs/tutorial_agent.html (added)
+++ helix/site-content/1.2.0-docs/tutorial_agent.html Thu Apr 27 23:08:36 2023
@@ -0,0 +1,395 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2023-04-27  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 - Helix Agent</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_agent project-120-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.2.0">Helix 1.2.0</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.2.0.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.2.0" 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.2.0">Release 
1.2.0</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Helix Agent</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2023-04-27</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:_Helix_Agent_.28for_non-JVM_systems.29"><a 
href="./Tutorial.html">Helix Tutorial</a>: Helix Agent (for non-JVM 
systems)</h2>
+ </div> 
+ <p>Not every distributed system is written on the JVM, but many systems would 
benefit from the cluster management features that Helix provides. To make a 
non-JVM system work with Helix, you can use the Helix Agent module.</p> 
+ <section> 
+  <h3 id="What_is_Helix_Agent.3F">What is Helix Agent?</h3> 
+  <p>Helix is built on the following assumption: if your distributed resource 
is modeled by a finite state machine, then Helix can tell participants when 
they should transition between states. In the Java API, this means implementing 
transition callbacks. In the Helix agent API, this means providing commands 
than can run for each transition.</p> 
+  <p>These commands could do anything behind the scenes; Helix only requires 
that they exit once the state transition is complete.</p> 
+ </section> 
+ <section> 
+  <h3 id="Configuring_Transition_Commands">Configuring Transition 
Commands</h3> 
+  <p>Here's how to tell Helix which commands to run on state transitions:</p> 
+  <section> 
+   <h4 id="Java">Java</h4> 
+   <p>Using the Java API, first get a configuration scope (the Helix agent 
supports both cluster and resource scopes, picking resource first if it is 
available):</p> 
+   <div class="source"> 
+    <pre><code>// Cluster scope
+HelixConfigScope scope =
+    new 
HelixConfigScopeBuilder(ConfigScopeProperty.CLUSTER).forCluster(clusterName).build();
+
+// Resource scope
+HelixConfigScope scope =
+    new 
HelixConfigScopeBuilder(ConfigScopeProperty.RESOURCE).forCluster(clusterName).forResource(resourceName).build();
+</code></pre> 
+   </div> 
+   <p>Then, specify the command to run for each state transition:</p> 
+   <div class="source"> 
+    <pre><code>// Get the configuration accessor
+ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient);
+
+// Specify the script for OFFLINE --&gt; ONLINE
+CommandConfig.Builder builder = new CommandConfig.Builder();
+CommandConfig cmdConfig =
+    builder.setTransition("OFFLINE", "ONLINE").setCommand("simpleHttpClient.py 
OFFLINE-ONLINE")
+        .setCommandWorkingDir(workingDir)
+        .setCommandTimeout("5000L") // optional: ms to wait before failing
+        .setPidFile(pidFile) // optional: for daemon-like systems that will 
write the process id to a file
+        .build();
+configAccessor.set(scope, cmdConfig.toKeyValueMap());
+
+// Specify the script for ONLINE --&gt; OFFLINE
+builder = new CommandConfig.Builder();
+cmdConfig =
+    builder.setTransition("ONLINE", "OFFLINE").setCommand("simpleHttpClient.py 
ONLINE-OFFLINE")
+        .setCommandWorkingDir(workingDir)
+        .build();
+configAccessor.set(scope, cmdConfig.toKeyValueMap());
+
+// Specify NOP for OFFLINE --&gt; DROPPED
+builder = new CommandConfig.Builder();
+cmdConfig =
+    builder.setTransition("OFFLINE", "DROPPED")
+        .setCommand(CommandAttribute.NOP.getName())
+        .build();
+configAccessor.set(scope, cmdConfig.toKeyValueMap());
+</code></pre> 
+   </div> 
+   <p>In this example, we have a program called simpleHttpClient.py that we 
call for all transitions, only changing the arguments that are passed in. 
However, there is no requirement that each transition invoke the same program; 
this API allows running arbitrary commands in arbitrary directories with 
arbitrary arguments.</p> 
+   <p>Notice that that for the OFFLINE --&gt; DROPPED transition, we do not 
run any command (specifically, we specify the NOP command). This just tells 
Helix that the system doesn't care about when things are dropped, and it can 
consider the transition already done.</p> 
+  </section> 
+  <section> 
+   <h4 id="Command_Line">Command Line</h4> 
+   <p>It is also possible to configure everything directly from the command 
line. Here's how that would look for cluster-wide configuration:</p> 
+   <div class="source"> 
+    <pre><code># Specify the script for OFFLINE --&gt; ONLINE
+/helix-admin.sh --zkSvr localhost:2181 --setConfig CLUSTER clusterName 
OFFLINE-ONLINE.command="simpleHttpClient.py 
OFFLINE-ONLINE",OFFLINE-ONLINE.command.workingDir="/path/to/script", 
OFFLINE-ONLINE.command.pidfile="/path/to/pidfile"
+
+# Specify the script for ONLINE --&gt; OFFLINE
+/helix-admin.sh --zkSvr localhost:2181 --setConfig CLUSTER clusterName 
ONLINE-OFFLINE.command="simpleHttpClient.py 
ONLINE-OFFLINE",ONLINE-OFFLINE.workingDir="/path/to/script", 
OFFLINE-ONLINE.command.pidfile="/path/to/pidfile"
+
+# Specify NOP for OFFLINE --&gt; DROPPED
+/helix-admin.sh --zkSvr localhost:2181 --setConfig CLUSTER clusterName 
ONLINE-OFFLINE.command="nop"
+</code></pre> 
+   </div> 
+   <p>Like in the Java configuration, it is also possible to specify a 
resource scope instead of a cluster scope:</p> 
+   <div class="source"> 
+    <pre><code># Specify the script for OFFLINE --&gt; ONLINE
+/helix-admin.sh --zkSvr localhost:2181 --setConfig RESOURCE 
clusterName,resourceName OFFLINE-ONLINE.command="simpleHttpClient.py 
OFFLINE-ONLINE",OFFLINE-ONLINE.command.workingDir="/path/to/script", 
OFFLINE-ONLINE.command.pidfile="/path/to/pidfile"
+</code></pre> 
+   </div> 
+  </section> 
+ </section> 
+ <section> 
+  <h3 id="Starting_the_Agent">Starting the Agent</h3> 
+  <p>There should be an agent running for every participant you have running. 
Ideally, its lifecycle should match that of the participant. Here, we have a 
simple long-running participant called simpleHttpServer.py. Its only purpose is 
to record state transitions.</p> 
+  <p>Here are some ways that you can start the Helix agent:</p> 
+  <section> 
+   <h4 id="Java">Java</h4> 
+   <div class="source"> 
+    <pre><code>// Start your application process
+ExternalCommand serverCmd = ExternalCommand.start(workingDir + 
"/simpleHttpServer.py");
+
+// Start the agent
+Thread agentThread = new Thread() {
+  @Override
+  public void run() {
+    while(!isInterrupted()) {
+      try {
+        HelixAgentMain.main(new String[] {
+            "--zkSvr", zkAddr, "--cluster", clusterName, "--instanceName", 
instanceName,
+            "--stateModel", "OnlineOffline"
+        });
+      } catch (InterruptedException e) {
+        LOG.info("Agent thread interrupted", e);
+        interrupt();
+      } catch (Exception e) {
+        LOG.error("Exception start helix-agent", e);
+      }
+    }
+  }
+};
+agentThread.start();
+
+// Wait for the process to terminate (either intentionally or unintentionally)
+serverCmd.waitFor();
+
+// Kill the agent
+agentThread.interrupt();
+</code></pre> 
+   </div> 
+  </section> 
+  <section> 
+   <h4 id="Command_Line">Command Line</h4> 
+   <div class="source"> 
+    <pre><code># Build Helix and start the agent
+mvn clean install -DskipTests
+chmod +x helix-agent/target/helix-agent-pkg/bin/*
+helix-agent/target/helix-agent-pkg/bin/start-helix-agent.sh --zkSvr 
zkAddr1,zkAddr2 --cluster clusterName --instanceName instanceName --stateModel 
OnlineOffline
+
+# Here, you can define your own logic to terminate this agent when your 
process terminates
+...
+</code></pre> 
+   </div> 
+  </section> 
+ </section> 
+ <section> 
+  <h3 id="Example">Example</h3> 
+  <p><a class="externalLink" 
href="https://git-wip-us.apache.org/repos/asf?p=helix.git;a=blob;f=helix-agent/src/test/java/org/apache/helix/agent/TestHelixAgent.java;h=ccf64ce5544207c7e48261682ea69945b71da7f1;hb=refs/heads/master";>Here</a>
 is a basic system that uses the Helix agent package.</p> 
+ </section> 
+ <section> 
+  <h3 id="Notes">Notes</h3> 
+  <p>As you may have noticed from the examples, the participant program and 
the state transition program are two different programs. The former is a 
<i>long-running</i> process that is directly tied to the Helix agent. The 
latter is a process that only exists while a state transition is underway. 
Despite this, these two processes should be intertwined. The transition command 
will need to communicate to the participant to actually complete the state 
transition and the participant will need to communicate whether or not this was 
successful. The implementation of this protocol is the responsibility of the 
system.</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.2.0.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.2.0" 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;2023 <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.2.0-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.2.0-docs/tutorial_cloud_support.html
URL: 
http://svn.apache.org/viewvc/helix/site-content/1.2.0-docs/tutorial_cloud_support.html?rev=1909461&view=auto
==============================================================================
--- helix/site-content/1.2.0-docs/tutorial_cloud_support.html (added)
+++ helix/site-content/1.2.0-docs/tutorial_cloud_support.html Thu Apr 27 
23:08:36 2023
@@ -0,0 +1,482 @@
+
+<!DOCTYPE html>
+
+
+
+
+
+
+<!--
+ Generated by Apache Maven Doxia at 2023-04-27  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 - Cloud Support</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_cloud_support project-120-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.2.0">Helix 1.2.0</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.2.0.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.2.0" 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.2.0">Release 
1.2.0</a></li>
+                               <li class="divider">/</li>
+                               <li>Tutorial - Cloud Support</li>
+                               <li class="publishDate version-date 
pull-right">Last Published: 2023-04-27</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:_Cloud_Support"><a href="./Tutorial.html">Helix 
Tutorial</a>: Cloud Support</h2>
+ </div> 
+ <p>There are emerging cases to use Helix in a cloud environment, especially 
in those well-known public cloud, e.g. Azure, AWS, GCP, etc. Compared to 
previous on premise use cases, Helix has faced both challenges and 
opportunities in providing cloud related support.</p> 
+ <p>As a first step, Helix implemented the support for participant auto 
registration in a cloud environment, which leverages the common feature of 
public cloud and facilitates Helix users when they need to create a cluster and 
register the participants to the cluster.</p> 
+ <p>After a Helix cluster is created, there are two ways to add instances (or 
participants, we will use them interchangeably in this tutorial) to the 
cluster. One is manual add, where users call their own scripts to add instance 
config to the cluster for each participant; and the other is auto join, where 
users set the auto join config of the cluster to be true, and each participant 
populates its own hostname, port number, and other information in instance 
config during connection. However, in an on premise environment, the auto join 
only works perfectly when users use Helix in a non rack-aware environment, 
meaning there is no fault domain concept. For a rack-aware environment, users 
still need to manually input the domain information to the instance config as 
it is hard for each participant to get its own fault domain information. 
Considering most users would use Helix in a rack-aware environment, it means 
manual work is still required.</p> 
+ <p>In a cloud environment, there is a good opportunity to achieve full 
automation as public cloud providers give domain information to each individual 
instance through a metadata endpoint. All of the above mentioned public cloud 
providers use a unique non-routable IP address (169.254.169.254) for this 
purpose. It can be accessed only from within the instance to retrieve the 
instance metadata information, which you can use to configure or manage the 
running instance.</p> 
+ <p>More specifically, in AWS, Azure, and GCP, the query to the fixed IP 
address <a class="externalLink" 
href="http://169.254.169.254/";>http://169.254.169.254/</a> inside each instance 
will return its metadata information that contains domain information. In AWS, 
the field is named as “placement”; in Azure, the field is named as 
“PlatformUpdateDomain”; and in GCP, the field is named as “zone”. It is 
usually just an integer denoting which fault domain the instance belongs to. 
This particular feature of public cloud is leveraged by Helix in cluster 
creation and partition registration process.</p> 
+ <section> 
+  <h3 id="What_Helix_Provides_for_Cloud_Environment">What Helix Provides for 
Cloud Environment</h3> 
+  <ul> 
+   <li>Provide definition of Helix cloud configs at cluster level and 
participant level</li> 
+   <li>Provide enhanced REST and Java APIs for cluster creation and cloud 
config update</li> 
+   <li>Provide generic interface for fetching and parsing cloud instance 
information</li> 
+   <li>Provide the implementation of Azure cloud instance information 
processor</li> 
+   <li>Provide the implementation of participant auto registration logic</li> 
+  </ul> 
+ </section> 
+ <section> 
+  <h3 id="How_to_Use_Cloud_Support">How to Use Cloud Support</h3> 
+  <p>First of all, you need to make sure that your environment is indeed a 
cloud environment. Otherwise, all the assumptions in this support will not 
hold. Then depending on what kind of cloud environment you are in, you will 
need to perform some or all of the following steps.</p> 
+  <section> 
+   <h4 id="Define_Cloud_config_at_Cluster_Level">Define Cloud config at 
Cluster Level</h4> 
+   <p>Helix provides cloud configs at two different levels, one is at cluster 
level, and the other is at participant level. We describe them separately.</p> 
+   <p>At cluster level, we have a new Znode called CloudConfig. It has a few 
fields that store the relatively static cloud information for the whole 
cluster. Similar to other existing configs, Helix provides cloud config 
builder, validation, get/set functions. As the following table shows, the first 
two fields are required, and the last three fields are optional.</p> 
+   <p><code>CLOUD_ENABLED</code> must be set to true if the user would like to 
use Helix cloud support. <code>CLOUD_PROVIDER</code> is the type of the cloud 
environment. Besides the few well-known public cloud providers, the user can 
also define his/her cloud environment as “CUSTOMIZED”. 
<code>CLOUD_ID</code> is an optional field. It can be used to record any 
specific metadata information the user would like to record, e.g. the ID for 
the particular cluster inside a cloud environment, etc. If the user chooses to 
use the provider that already has default implementations in Helix, e.g., 
Azure, he does not need to provide the last two fields, as Helix already 
provides the default value for these two fields in system property, which is 
considered as a bundle with Azure implementation that would be discussed later. 
If the user uses customized providers, or chooses some other cloud environment 
that has not been implemented in Helix yet, the user needs to provide the last 
two fie
 lds and/or <code>CLOUD_ID</code> depending on his/her usage.</p> 
+   <table border="0" class="bodyTable table table-striped table-hover"> 
+    <thead> 
+     <tr class="a"> 
+      <th>Field</th> 
+      <th>Meaning</th> 
+     </tr> 
+    </thead> 
+    <tbody> 
+     <tr class="b"> 
+      <td align="left">CLOUD_ENABLED</td> 
+      <td>determine whether the cluster is inside cloud environment and use 
Helix cloud support</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left">CLOUD_PROVIDER</td> 
+      <td>denote what kind of cloud environment the cluster is in, e.g. Azure, 
AWS, GCP, or CUSTOMIZED</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left">CLOUD_ID</td> 
+      <td>the specific id in cloud environment that belongs to this 
cluster</td> 
+     </tr> 
+     <tr class="a"> 
+      <td align="left">CLOUD_INFO_SOURCE</td> 
+      <td>the source for retrieving the cloud information.</td> 
+     </tr> 
+     <tr class="b"> 
+      <td align="left">CLOUD_INFO_PROCESSOR_NAME</td> 
+      <td>the name of the function that processes the fetching and parsing of 
cloud information</td> 
+     </tr> 
+    </tbody> 
+   </table> 
+   <p>Users could use either REST API or Java API to set these configs.</p> 
+   <section> 
+    <h5 id="REST_API_Examples">REST API Examples</h5> 
+    <p>Helix enhanced current cluster creation REST API as well as Java API 
with extra fields that represent cloud related input. For example, in the 
following modified <code>createCluster</code> API, <code>addCloudConfig</code> 
is a Boolean value denotes whether to create with cloud config, and the 
<code>cloudConfigManifest</code> is the cloud config string, which will be 
converted to a Znode record.</p> 
+    <div class="source"> 
+     <pre><code>@PUT
+  @Path("{clusterId}")
+  public Response createCluster(@PathParam("clusterId") String clusterId, 
@DefaultValue("false") @QueryParam("recreate") String recreate,
+      @DefaultValue("false") @QueryParam("addCloudConfig") String 
addCloudConfig, String cloudConfigManifest)
+</code></pre> 
+    </div> 
+    <p>Besides the enhanced cluster creation API, Helix also provides a set of 
cloud specific APIs in Java and REST that handles the get/add/update of cloud 
config.</p> 
+    <ul> 
+     <li>Create cluster and add meanwhile cloud config related information to 
ZK.</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X PUT -H "Content-Type: application/json" 
http://localhost:1234/admin/v2/clusters/myCluster?addCloudConfig=true -d '
+{
+    "simpleFields" : 
+    {
+        "CLOUD_ENABLED" : "true",
+        "CLOUD_PROVIDER": "AWS",
+        "CLOUD_ID" : "12345"
+        "CLOUD_INFO_SOURCE": {"http://169.254.169.254/"}
+        "CLOUD_INFO_PROCESSOR_NAME": "AWSCloudInformationProcesser"
+    }
+}'
+</code></pre> 
+    </div> 
+    <ul> 
+     <li>Add cloud config to an existing cluster</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X PUT -H "Content-Type: application/json" 
http://localhost:1234/admin/v2/clusters/myCluster/cloudconfig -d '
+{
+    "simpleFields" : 
+    {
+        "CLOUD_ENABLED" : "true",
+        "CLOUD_PROVIDER": "AWS",
+        "CLOUD_ID" : "12345"
+        "CLOUD_INFO_SOURCE": {"http://169.254.169.254/"}
+        "CLOUD_INFO_PROCESSOR_NAME": "AWSCloudInformationProcesser"
+    }
+}'
+</code></pre> 
+    </div> 
+    <ul> 
+     <li>Delete the cloud config of a cluster</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X DELETE 
http://localhost:1234/admin/v2/clusters/myCluster/cloudconfig
+</code></pre> 
+    </div> 
+    <ul> 
+     <li>Get the cloud config of a cluster</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X GET 
http://localhost:1234/admin/v2/clusters/myCluster/cloudconfig
+</code></pre> 
+    </div> 
+    <ul> 
+     <li>Update the cloud config of a cluster</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X POST -H "Content-Type: application/json"  
http://localhost:1234/admin/v2/clusters/myCluster/cloudconfig?command=update -d 
'
+{
+    "simpleFields" : {
+        "CLOUD_ID" : "12345"
+    }
+}'
+</code></pre> 
+    </div> 
+    <ul> 
+     <li>Delete some of the fields in the cloud config</li> 
+    </ul> 
+    <div class="source"> 
+     <pre><code>$ curl -X POST -H "Content-Type: application/json" 
http://localhost:1234/admin/v2/clusters/myCluster/cloudconfig?command=delete -d 
'
+{
+    "simpleFields" : {
+        "CLOUD_ID" : "12345"
+    }
+}'
+</code></pre> 
+    </div> 
+   </section> 
+  </section> 
+  <section> 
+   <h4 id="Define_Cloud_Configs_at_Participant_Level">Define Cloud Configs at 
Participant Level</h4> 
+   <p>At participant level, Helix allows users to provide detailed cloud 
properties, which is more related to the participant’s actions. For default 
value, Helix provides <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/resources/azure-cloud.properties";>Azure
 cloud properties</a>, including not only the default cluster level config 
values for Azure, like <code>CLOUD_INFO_SOURCE</code> and 
<code>CLOUD_INFO_PROCESSOR_NAME</code>, but also some participant specific 
values, such as http timeout when querying AIMS (Azure Instance Metadata 
Service) in Azure, max retry times, etc.</p> 
+   <div class="source"> 
+    
<pre><code>cloud_info_source=http://169.254.169.254/metadata/instance?api-version=2019-06-04
+cloud_info_processor_name=AzureCloudInstanceInformationProcessor
+cloud_max_retry=5
+connection_timeout_ms=5000
+request_timeout_ms=5000
+</code></pre> 
+   </div> 
+   <p>If users would like to use their customized config for participants, 
they can input the specific properties through <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/HelixManagerProperty.java";>Helix
 Manager Property</a> when composing <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java";>Zk
 Helix Manager</a>, which is passed into participants. <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/HelixManagerProperty.java";>Helix
 Manager Property</a> includes <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/HelixCloudProperty.java";>Helix
 Cloud Property</a> which includes commonly used cloud properties and also any 
kind of user defined cloud properties.</p> 
+   <div class="source"> 
+    <pre><code>public ZKHelixManager(String clusterName, String instanceName, 
InstanceType instanceType,
+    String zkAddress, HelixManagerStateListener stateListener, 
HelixManagerProperty helixManagerProperty)
+</code></pre> 
+   </div> 
+  </section> 
+  <section> 
+   <h4 id="Implement_Cloud_Instance_Information_.28if_necessary.29">Implement 
Cloud Instance Information (if necessary)</h4> 
+   <p>Helix has predefined a few fields in the interface of <a 
class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/api/cloud/CloudInstanceInformation.java";>CloudInstanceInformation</a>
 that are commonly used in participant. Users are free to define other fields 
in the instance metadata that they think are useful.</p> 
+   <div class="source"> 
+    <pre><code>public interface CloudInstanceInformation {
+  /**
+   * Get the the value of a specific cloud instance field by name
+   * @return the value of the field
+   */
+  String get(String key);
+
+  /**
+   * The enum contains all the required cloud instance field in Helix
+   */
+  enum CloudInstanceField {
+    INSTANCE_NAME,
+    FAULT_DOMAIN,
+    INSTANCE_SET_NAME
+  }
+}
+</code></pre> 
+   </div> 
+  </section> 
+  <section> 
+   <h4 
id="Implement_Cloud_Instance_Information_Processor_.28if_necessary.29">Implement
 Cloud Instance Information Processor (if necessary)</h4> 
+   <p>Helix provides an interface to fetch and parse cloud instance 
information as follows. Helix makes the interface generic enough so that users 
may implement their own fetching and parsing logic with maximum freedom.</p> 
+   <div class="source"> 
+    <pre><code>/**
+ * Generic interface to fetch and parse cloud instance information
+ */
+public interface CloudInstanceInformationProcessor&lt;T extends Object&gt; {
+
+  /**
+   * Get the raw cloud instance information
+   * @return raw cloud instance information
+   */
+  List&lt;T&gt; fetchCloudInstanceInformation();
+
+  /**
+   * Parse the raw cloud instance information in responses and compose 
required cloud instance information
+   * @return required cloud instance information
+   */
+  CloudInstanceInformation parseCloudInstanceInformation(List&lt;T&gt; 
responses);
+}
+</code></pre> 
+   </div> 
+   <p>Helix also implements an example processor for Azure in <a 
class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/cloud/azure/AzureCloudInstanceInformationProcessor.java";>AzureCloudInstanceInformationProcessor</a>.
 The implementation includes fetching and parsing Azure cloud instance 
information. The fetching function retrieves instance information from Azure 
AIMS, and the parsing function validates the response, and selects the fields 
needed for participant auto registration. If users would like to use Helix in 
an Azure environment, they do not need to implement it by themselves.</p> 
+   <p>If users need to use Helix in another cloud environment, they can 
implement their own information processor. The implementation would be similar 
to Azure implementation, and the main difference would be in how to parse the 
response and retrieve interested fields.</p> 
+  </section> 
+  <section> 
+   <h4 id="Config_Properly_for_Participant_Auto_Registration_to_Work">Config 
Properly for Participant Auto Registration to Work</h4> 
+   <p>To make the participant auto registration work, users would need to make 
sure their cluster config is set properly. The most important one is the 
<code>allowParticipantAutoJoin</code> field in cluster config.</p> 
+   <div class="source"> 
+    <pre><code>{
+    "id": "clusterName",
+    "listFields": {},
+    "mapFields": {},
+    "simpleFields": {
+        ......
+        "allowParticipantAutoJoin": "true"
+        ......
+    }
+}
+</code></pre> 
+   </div> 
+   <p>This field is used in participant manager logic as a prerequisite for 
participants to do auto registration. The detailed logic is shown in the 
following flow chart. The related code is in <a class="externalLink" 
href="https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/manager/zk/ParticipantManager.java";>Participant
 Manager</a>.</p> 
+   <p><img src="./images/ParticipantAutoRegistrationLogic.png" 
alt="Participant Auto Registration Logic"></p> 
+   <p>If the participant decides that it should do auto registration based on 
the config, it will first query cloud config and decide what environment it is 
in. Based on this information, the participant will call the corresponding 
cloud instance information processor. Then with all the information, especially 
the domain information, the participant can auto register to the cluster 
without any manual effort.</p> 
+  </section> 
+ </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.2.0.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.2.0" 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;2023 <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.2.0-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