helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kisho...@apache.org
Subject [3/3] git commit: [HELIX-224] Moving examples package to separate module helix-examples
Date Mon, 26 Aug 2013 16:31:29 GMT
[HELIX-224] Moving examples package to separate module helix-examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/e5f2ef7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/e5f2ef7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/e5f2ef7e

Branch: refs/heads/master
Commit: e5f2ef7efb88d6781ef3351c0aebbf155c760b01
Parents: d161a4e
Author: Kishore Gopalakrishna <g.kishore@gmail.com>
Authored: Mon Aug 26 08:14:50 2013 -0700
Committer: Kishore Gopalakrishna <g.kishore@gmail.com>
Committed: Mon Aug 26 08:14:50 2013 -0700

----------------------------------------------------------------------
 helix-core/pom.xml                              |   8 -
 .../apache/helix/examples/BootstrapHandler.java | 105 ------
 .../apache/helix/examples/BootstrapProcess.java | 332 -------------------
 .../apache/helix/examples/DummyParticipant.java | 128 -------
 .../apache/helix/examples/ExampleHelper.java    |  67 ----
 .../apache/helix/examples/ExampleProcess.java   | 237 -------------
 .../examples/IdealStateBuilderExample.java      | 146 --------
 .../helix/examples/IdealStateExample.java       | 162 ---------
 .../LeaderStandbyStateModelFactory.java         |  66 ----
 .../examples/MasterSlaveStateModelFactory.java  | 119 -------
 .../OnlineOfflineStateModelFactory.java         |  72 ----
 .../org/apache/helix/examples/Quickstart.java   | 262 ---------------
 .../org/apache/helix/examples/package-info.java |  23 --
 helix-examples/.gitignore                       |  16 +
 helix-examples/DISCLAIMER                       |  15 +
 helix-examples/LICENSE                          | 273 +++++++++++++++
 helix-examples/NOTICE                           |  30 ++
 helix-examples/pom.xml                          | 104 ++++++
 helix-examples/src/assemble/assembly.xml        |  60 ++++
 .../apache/helix/examples/BootstrapHandler.java | 105 ++++++
 .../apache/helix/examples/BootstrapProcess.java | 332 +++++++++++++++++++
 .../apache/helix/examples/DummyParticipant.java | 128 +++++++
 .../apache/helix/examples/ExampleHelper.java    |  67 ++++
 .../apache/helix/examples/ExampleProcess.java   | 237 +++++++++++++
 .../examples/IdealStateBuilderExample.java      | 146 ++++++++
 .../helix/examples/IdealStateExample.java       | 162 +++++++++
 .../LeaderStandbyStateModelFactory.java         |  66 ++++
 .../examples/MasterSlaveStateModelFactory.java  | 119 +++++++
 .../OnlineOfflineStateModelFactory.java         |  72 ++++
 .../org/apache/helix/examples/Quickstart.java   | 262 +++++++++++++++
 .../org/apache/helix/examples/package-info.java |  23 ++
 helix-examples/src/test/conf/testng.xml         |  27 ++
 pom.xml                                         |   1 +
 src/site/markdown/Quickstart.md                 |   1 +
 34 files changed, 2246 insertions(+), 1727 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/pom.xml
----------------------------------------------------------------------
diff --git a/helix-core/pom.xml b/helix-core/pom.xml
index e57c3ff..af04d85 100644
--- a/helix-core/pom.xml
+++ b/helix-core/pom.xml
@@ -202,10 +202,6 @@ under the License.
               <name>zk-log-csv-formatter</name>
             </program>
             <program>
-              <mainClass>org.apache.helix.examples.ExampleProcess</mainClass>
-              <name>start-helix-participant</name>
-            </program>
-            <program>
               <mainClass>org.apache.helix.tools.LocalZKServer</mainClass>
               <name>start-standalone-zookeeper</name>
             </program>
@@ -214,10 +210,6 @@ under the License.
               <name>zk-log-analyzer</name>
             </program>
             <program>
-              <mainClass>org.apache.helix.examples.Quickstart</mainClass>
-              <name>quickstart</name>
-            </program>
-            <program>
               <mainClass>org.apache.helix.tools.JmxDumper</mainClass>
               <name>JmxDumper</name>
             </program>

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/BootstrapHandler.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/BootstrapHandler.java b/helix-core/src/main/java/org/apache/helix/examples/BootstrapHandler.java
deleted file mode 100644
index f1b37fc..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/BootstrapHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import java.util.UUID;
-
-import org.apache.helix.ClusterMessagingService;
-import org.apache.helix.Criteria;
-import org.apache.helix.HelixManager;
-import org.apache.helix.InstanceType;
-import org.apache.helix.NotificationContext;
-import org.apache.helix.model.Message;
-import org.apache.helix.model.Message.MessageState;
-import org.apache.helix.model.Message.MessageType;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-import org.apache.helix.participant.statemachine.StateModelInfo;
-import org.apache.helix.participant.statemachine.Transition;
-
-public class BootstrapHandler extends StateModelFactory<StateModel> {
-
-  @Override
-  public StateModel createNewStateModel(String stateUnitKey) {
-    return new BootstrapStateModel(stateUnitKey);
-  }
-
-  @StateModelInfo(initialState = "OFFLINE", states = "{'OFFLINE','SLAVE','MASTER'}")
-  public static class BootstrapStateModel extends StateModel {
-
-    private final String _stateUnitKey;
-
-    public BootstrapStateModel(String stateUnitKey) {
-      _stateUnitKey = stateUnitKey;
-
-    }
-
-    @Transition(from = "MASTER", to = "SLAVE")
-    public void masterToSlave(Message message, NotificationContext context) {
-
-    }
-
-    @Transition(from = "OFFLINE", to = "SLAVE")
-    public void offlineToSlave(Message message, NotificationContext context) {
-      System.out.println("BootstrapProcess.BootstrapStateModel.offlineToSlave()");
-      HelixManager manager = context.getManager();
-      ClusterMessagingService messagingService = manager.getMessagingService();
-      Message requestBackupUriRequest =
-          new Message(MessageType.USER_DEFINE_MSG, UUID.randomUUID().toString());
-      requestBackupUriRequest.setMsgSubType(BootstrapProcess.REQUEST_BOOTSTRAP_URL);
-      requestBackupUriRequest.setMsgState(MessageState.NEW);
-      Criteria recipientCriteria = new Criteria();
-      recipientCriteria.setInstanceName("*");
-      recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
-      recipientCriteria.setResource(message.getResourceName());
-      recipientCriteria.setPartition(message.getPartitionName());
-      recipientCriteria.setSessionSpecific(true);
-      // wait for 30 seconds
-      int timeout = 30000;
-      BootstrapReplyHandler responseHandler = new BootstrapReplyHandler();
-
-      int sentMessageCount =
-          messagingService.sendAndWait(recipientCriteria, requestBackupUriRequest, responseHandler,
-              timeout);
-      if (sentMessageCount == 0) {
-        // could not find any other node hosting the partition
-      } else if (responseHandler.getBootstrapUrl() != null) {
-        System.out.println("Got bootstrap url:" + responseHandler.getBootstrapUrl());
-        System.out.println("Got backup time:" + responseHandler.getBootstrapTime());
-        // Got the url fetch it
-      } else {
-        // Either go to error state
-        // throw new Exception("Cant find backup/bootstrap data");
-        // Request some node to start backup process
-      }
-    }
-
-    @Transition(from = "SLAVE", to = "OFFLINE")
-    public void slaveToOffline(Message message, NotificationContext context) {
-      System.out.println("BootstrapProcess.BootstrapStateModel.slaveToOffline()");
-    }
-
-    @Transition(from = "SLAVE", to = "MASTER")
-    public void slaveToMaster(Message message, NotificationContext context) {
-      System.out.println("BootstrapProcess.BootstrapStateModel.slaveToMaster()");
-    }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/BootstrapProcess.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/BootstrapProcess.java b/helix-core/src/main/java/org/apache/helix/examples/BootstrapProcess.java
deleted file mode 100644
index 73f1175..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/BootstrapProcess.java
+++ /dev/null
@@ -1,332 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-import java.io.File;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Date;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.OptionGroup;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.helix.HelixManager;
-import org.apache.helix.HelixManagerFactory;
-import org.apache.helix.InstanceType;
-import org.apache.helix.NotificationContext;
-import org.apache.helix.messaging.AsyncCallback;
-import org.apache.helix.messaging.handling.HelixTaskResult;
-import org.apache.helix.messaging.handling.MessageHandler;
-import org.apache.helix.messaging.handling.MessageHandlerFactory;
-import org.apache.helix.model.Message;
-import org.apache.helix.model.Message.MessageType;
-import org.apache.helix.participant.StateMachineEngine;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-import org.apache.helix.tools.ClusterStateVerifier;
-
-/**
- * This process does little more than handling the state transition messages.
- * This is generally the case when the server needs to bootstrap when it comes
- * up.<br>
- * Flow for a typical Master-slave state model<br>
- * <ul>
- * <li>Gets OFFLINE-SLAVE transition</li>
- * <li>Figure out if it has any data and how old it is for the SLAVE partition</li>
- * <li>If the data is fresh enough it can probably catch up from the replication stream of the
- * master</li>
- * <li>If not, then it can use the messaging service provided by cluster manager to talk other nodes
- * to figure out if they have any backup</li> </li>
- * <li>Once it gets a response from other nodes in the cluster the process can decide which back up
- * it wants to use to bootstrap</li>
- * </ul>
- */
-public class BootstrapProcess {
-  static final String REQUEST_BOOTSTRAP_URL = "REQUEST_BOOTSTRAP_URL";
-  public static final String zkServer = "zkSvr";
-  public static final String cluster = "cluster";
-  public static final String hostAddress = "host";
-  public static final String hostPort = "port";
-  public static final String relayCluster = "relayCluster";
-  public static final String help = "help";
-  public static final String configFile = "configFile";
-  public static final String stateModel = "stateModelType";
-  public static final String transDelay = "transDelay";
-
-  private final String zkConnectString;
-  private final String clusterName;
-  private final String instanceName;
-  private final String stateModelType;
-  private HelixManager manager;
-
-  // private StateMachineEngine genericStateMachineHandler;
-
-  private String _file = null;
-  private StateModelFactory<StateModel> stateModelFactory;
-  private final int delay;
-
-  public BootstrapProcess(String zkConnectString, String clusterName, String instanceName,
-      String stateModel, int delay) {
-    this.zkConnectString = zkConnectString;
-    this.clusterName = clusterName;
-    this.instanceName = instanceName;
-    stateModelType = stateModel;
-    this.delay = delay;
-  }
-
-  public void start() throws Exception {
-    manager =
-        HelixManagerFactory.getZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT,
-            zkConnectString);
-
-    stateModelFactory = new BootstrapHandler();
-    // genericStateMachineHandler = new StateMachineEngine();
-    // genericStateMachineHandler.registerStateModelFactory("MasterSlave", stateModelFactory);
-
-    StateMachineEngine stateMach = manager.getStateMachineEngine();
-    stateMach.registerStateModelFactory("MasterSlave", stateModelFactory);
-
-    manager.getMessagingService().registerMessageHandlerFactory(
-        MessageType.STATE_TRANSITION.toString(), stateMach);
-    manager.getMessagingService().registerMessageHandlerFactory(
-        MessageType.USER_DEFINE_MSG.toString(), new CustomMessageHandlerFactory());
-    manager.connect();
-  }
-
-  public static class CustomMessageHandlerFactory implements MessageHandlerFactory {
-
-    @Override
-    public MessageHandler createHandler(Message message, NotificationContext context) {
-
-      return new CustomMessageHandler(message, context);
-    }
-
-    @Override
-    public String getMessageType() {
-      return MessageType.USER_DEFINE_MSG.toString();
-    }
-
-    @Override
-    public void reset() {
-
-    }
-
-    static class CustomMessageHandler extends MessageHandler {
-
-      public CustomMessageHandler(Message message, NotificationContext context) {
-        super(message, context);
-        // TODO Auto-generated constructor stub
-      }
-
-      @Override
-      public HelixTaskResult handleMessage() throws InterruptedException {
-        String hostName;
-        HelixTaskResult result = new HelixTaskResult();
-        try {
-          hostName = InetAddress.getLocalHost().getCanonicalHostName();
-        } catch (UnknownHostException e) {
-          hostName = "UNKNOWN";
-        }
-        String port = "2134";
-        String msgSubType = _message.getMsgSubType();
-        if (msgSubType.equals(REQUEST_BOOTSTRAP_URL)) {
-          result.getTaskResultMap().put(
-              "BOOTSTRAP_URL",
-              "http://" + hostName + ":" + port + "/getFile?path=/data/bootstrap/"
-                  + _message.getResourceName() + "/" + _message.getPartitionName() + ".tar");
-
-          result.getTaskResultMap().put("BOOTSTRAP_TIME", "" + new Date().getTime());
-        }
-
-        result.setSuccess(true);
-        return result;
-      }
-
-      @Override
-      public void onError(Exception e, ErrorCode code, ErrorType type) {
-        e.printStackTrace();
-      }
-    }
-  }
-
-  @SuppressWarnings("static-access")
-  private static Options constructCommandLineOptions() {
-    Option helpOption =
-        OptionBuilder.withLongOpt(help).withDescription("Prints command-line options info")
-            .create();
-
-    Option zkServerOption =
-        OptionBuilder.withLongOpt(zkServer).withDescription("Provide zookeeper address").create();
-    zkServerOption.setArgs(1);
-    zkServerOption.setRequired(true);
-    zkServerOption.setArgName("ZookeeperServerAddress(Required)");
-
-    Option clusterOption =
-        OptionBuilder.withLongOpt(cluster).withDescription("Provide cluster name").create();
-    clusterOption.setArgs(1);
-    clusterOption.setRequired(true);
-    clusterOption.setArgName("Cluster name (Required)");
-
-    Option hostOption =
-        OptionBuilder.withLongOpt(hostAddress).withDescription("Provide host name").create();
-    hostOption.setArgs(1);
-    hostOption.setRequired(true);
-    hostOption.setArgName("Host name (Required)");
-
-    Option portOption =
-        OptionBuilder.withLongOpt(hostPort).withDescription("Provide host port").create();
-    portOption.setArgs(1);
-    portOption.setRequired(true);
-    portOption.setArgName("Host port (Required)");
-
-    Option stateModelOption =
-        OptionBuilder.withLongOpt(stateModel).withDescription("StateModel Type").create();
-    stateModelOption.setArgs(1);
-    stateModelOption.setRequired(true);
-    stateModelOption.setArgName("StateModel Type (Required)");
-
-    // add an option group including either --zkSvr or --configFile
-    Option fileOption =
-        OptionBuilder.withLongOpt(configFile)
-            .withDescription("Provide file to read states/messages").create();
-    fileOption.setArgs(1);
-    fileOption.setRequired(true);
-    fileOption.setArgName("File to read states/messages (Optional)");
-
-    Option transDelayOption =
-        OptionBuilder.withLongOpt(transDelay).withDescription("Provide state trans delay").create();
-    transDelayOption.setArgs(1);
-    transDelayOption.setRequired(false);
-    transDelayOption.setArgName("Delay time in state transition, in MS");
-
-    OptionGroup optionGroup = new OptionGroup();
-    optionGroup.addOption(zkServerOption);
-    optionGroup.addOption(fileOption);
-
-    Options options = new Options();
-    options.addOption(helpOption);
-    // options.addOption(zkServerOption);
-    options.addOption(clusterOption);
-    options.addOption(hostOption);
-    options.addOption(portOption);
-    options.addOption(stateModelOption);
-    options.addOption(transDelayOption);
-
-    options.addOptionGroup(optionGroup);
-
-    return options;
-  }
-
-  public static void printUsage(Options cliOptions) {
-    HelpFormatter helpFormatter = new HelpFormatter();
-    helpFormatter.printHelp("java " + BootstrapProcess.class.getName(), cliOptions);
-  }
-
-  public static CommandLine processCommandLineArgs(String[] cliArgs) throws Exception {
-    CommandLineParser cliParser = new GnuParser();
-    Options cliOptions = constructCommandLineOptions();
-    try {
-      return cliParser.parse(cliOptions, cliArgs);
-    } catch (ParseException pe) {
-      System.err.println("CommandLineClient: failed to parse command-line options: "
-          + pe.toString());
-      printUsage(cliOptions);
-      System.exit(1);
-    }
-    return null;
-  }
-
-  public static void main(String[] args) throws Exception {
-    String zkConnectString = "localhost:2181";
-    String clusterName = "storage-integration-cluster";
-    String instanceName = "localhost_8905";
-    String stateModelValue = "MasterSlave";
-    int delay = 0;
-    boolean skipZeroArgs = true;// false is for dev testing
-    if (!skipZeroArgs || args.length > 0) {
-      CommandLine cmd = processCommandLineArgs(args);
-      zkConnectString = cmd.getOptionValue(zkServer);
-      clusterName = cmd.getOptionValue(cluster);
-
-      String host = cmd.getOptionValue(hostAddress);
-      String portString = cmd.getOptionValue(hostPort);
-      int port = Integer.parseInt(portString);
-      instanceName = host + "_" + port;
-
-      stateModelValue = cmd.getOptionValue(stateModel);
-      if (cmd.hasOption(transDelay)) {
-        try {
-          delay = Integer.parseInt(cmd.getOptionValue(transDelay));
-          if (delay < 0) {
-            throw new Exception("delay must be positive");
-          }
-        } catch (Exception e) {
-          e.printStackTrace();
-          delay = 0;
-        }
-      }
-    }
-    // Espresso_driver.py will consume this
-    System.out.println("Starting Process with ZK:" + zkConnectString);
-
-    BootstrapProcess process =
-        new BootstrapProcess(zkConnectString, clusterName, instanceName, stateModelValue, delay);
-
-    process.start();
-    Thread.currentThread().join();
-  }
-}
-
-class BootstrapReplyHandler extends AsyncCallback {
-
-  public BootstrapReplyHandler() {
-  }
-
-  private String bootstrapUrl;
-  private String bootstrapTime;
-
-  @Override
-  public void onTimeOut() {
-    System.out.println("Timed out");
-  }
-
-  public String getBootstrapUrl() {
-    return bootstrapUrl;
-  }
-
-  public String getBootstrapTime() {
-    return bootstrapTime;
-  }
-
-  @Override
-  public void onReplyMessage(Message message) {
-    String time = message.getResultMap().get("BOOTSTRAP_TIME");
-    if (bootstrapTime == null || time.compareTo(bootstrapTime) > -1) {
-      bootstrapTime = message.getResultMap().get("BOOTSTRAP_TIME");
-      bootstrapUrl = message.getResultMap().get("BOOTSTRAP_URL");
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/DummyParticipant.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/DummyParticipant.java b/helix-core/src/main/java/org/apache/helix/examples/DummyParticipant.java
deleted file mode 100644
index 52a3696..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/DummyParticipant.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.HelixManager;
-import org.apache.helix.HelixManagerFactory;
-import org.apache.helix.InstanceType;
-import org.apache.helix.NotificationContext;
-import org.apache.helix.model.Message;
-import org.apache.helix.participant.StateMachineEngine;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-import org.apache.helix.participant.statemachine.StateModelInfo;
-import org.apache.helix.participant.statemachine.Transition;
-
-public class DummyParticipant {
-  // dummy master-slave state model
-  @StateModelInfo(initialState = "OFFLINE", states = {
-      "MASTER", "SLAVE", "ERROR"
-  })
-  public static class DummyMSStateModel extends StateModel {
-    @Transition(to = "SLAVE", from = "OFFLINE")
-    public void onBecomeSlaveFromOffline(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes SLAVE from OFFLINE for " + partitionName);
-    }
-
-    @Transition(to = "MASTER", from = "SLAVE")
-    public void onBecomeMasterFromSlave(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes MASTER from SLAVE for " + partitionName);
-    }
-
-    @Transition(to = "SLAVE", from = "MASTER")
-    public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes SLAVE from MASTER for " + partitionName);
-    }
-
-    @Transition(to = "OFFLINE", from = "SLAVE")
-    public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes OFFLINE from SLAVE for " + partitionName);
-    }
-
-    @Transition(to = "DROPPED", from = "OFFLINE")
-    public void onBecomeDroppedFromOffline(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes DROPPED from OFFLINE for " + partitionName);
-    }
-
-    @Transition(to = "OFFLINE", from = "ERROR")
-    public void onBecomeOfflineFromError(Message message, NotificationContext context) {
-      String partitionName = message.getPartitionName();
-      String instanceName = message.getTgtName();
-      System.out.println(instanceName + " becomes OFFLINE from ERROR for " + partitionName);
-    }
-
-    @Override
-    public void reset() {
-      System.out.println("Default MockMSStateModel.reset() invoked");
-    }
-  }
-
-  // dummy master slave state model factory
-  public static class DummyMSModelFactory extends StateModelFactory<DummyMSStateModel> {
-    @Override
-    public DummyMSStateModel createNewStateModel(String partitionName) {
-      DummyMSStateModel model = new DummyMSStateModel();
-      return model;
-    }
-  }
-
-  public static void main(String[] args) {
-    if (args.length < 3) {
-      System.err.println("USAGE: DummyParticipant zkAddress clusterName instanceName");
-      System.exit(1);
-    }
-
-    String zkAddr = args[0];
-    String clusterName = args[1];
-    String instanceName = args[2];
-
-    HelixManager manager = null;
-    try {
-      manager =
-          HelixManagerFactory.getZKHelixManager(clusterName, instanceName,
-              InstanceType.PARTICIPANT, zkAddr);
-
-      StateMachineEngine stateMach = manager.getStateMachineEngine();
-      DummyMSModelFactory msModelFactory = new DummyMSModelFactory();
-      stateMach.registerStateModelFactory("MasterSlave", msModelFactory);
-
-      manager.connect();
-
-      Thread.currentThread().join();
-    } catch (Exception e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    } finally {
-      if (manager != null) {
-        manager.disconnect();
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/ExampleHelper.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/ExampleHelper.java b/helix-core/src/main/java/org/apache/helix/examples/ExampleHelper.java
deleted file mode 100644
index 44ee1e5..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/ExampleHelper.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import java.io.File;
-import java.io.IOException;
-
-import org.I0Itec.zkclient.IDefaultNameSpace;
-import org.I0Itec.zkclient.ZkServer;
-import org.apache.commons.io.FileUtils;
-
-public class ExampleHelper {
-
-  public static ZkServer startZkServer(String zkAddr) {
-    System.out.println("Start zookeeper at " + zkAddr + " in thread "
-        + Thread.currentThread().getName());
-
-    String zkDir = zkAddr.replace(':', '_');
-    final String logDir = "/tmp/" + zkDir + "/logs";
-    final String dataDir = "/tmp/" + zkDir + "/dataDir";
-    try {
-      FileUtils.deleteDirectory(new File(dataDir));
-      FileUtils.deleteDirectory(new File(logDir));
-    } catch (IOException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-
-    IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
-      @Override
-      public void createDefaultNameSpace(org.I0Itec.zkclient.ZkClient zkClient) {
-        // do nothing
-      }
-    };
-
-    int port = Integer.parseInt(zkAddr.substring(zkAddr.lastIndexOf(':') + 1));
-    ZkServer zkServer = new ZkServer(dataDir, logDir, defaultNameSpace, port);
-    zkServer.start();
-
-    return zkServer;
-  }
-
-  public static void stopZkServer(ZkServer zkServer) {
-    if (zkServer != null) {
-      zkServer.shutdown();
-      System.out.println("Shut down zookeeper at port " + zkServer.getPort() + " in thread "
-          + Thread.currentThread().getName());
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/ExampleProcess.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/ExampleProcess.java b/helix-core/src/main/java/org/apache/helix/examples/ExampleProcess.java
deleted file mode 100644
index 34a13e5..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/ExampleProcess.java
+++ /dev/null
@@ -1,237 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import java.io.File;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.OptionGroup;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.helix.HelixManager;
-import org.apache.helix.HelixManagerFactory;
-import org.apache.helix.InstanceType;
-import org.apache.helix.model.Message.MessageType;
-import org.apache.helix.participant.StateMachineEngine;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-import org.apache.helix.tools.ClusterStateVerifier;
-
-public class ExampleProcess {
-
-  public static final String zkServer = "zkSvr";
-  public static final String cluster = "cluster";
-  public static final String hostAddress = "host";
-  public static final String hostPort = "port";
-  public static final String relayCluster = "relayCluster";
-  public static final String help = "help";
-  public static final String configFile = "configFile";
-  public static final String stateModel = "stateModelType";
-  public static final String transDelay = "transDelay";
-
-  private final String zkConnectString;
-  private final String clusterName;
-  private final String instanceName;
-  private final String stateModelType;
-  private HelixManager manager;
-
-  // private StateMachineEngine genericStateMachineHandler;
-
-  private StateModelFactory<StateModel> stateModelFactory;
-  private final int delay;
-
-  public ExampleProcess(String zkConnectString, String clusterName, String instanceName,
-      String file, String stateModel, int delay) {
-    this.zkConnectString = zkConnectString;
-    this.clusterName = clusterName;
-    this.instanceName = instanceName;
-    stateModelType = stateModel;
-    this.delay = delay;
-  }
-
-  public void start() throws Exception {
-    manager =
-        HelixManagerFactory.getZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT,
-            zkConnectString);
-
-    if ("MasterSlave".equalsIgnoreCase(stateModelType)) {
-      stateModelFactory = new MasterSlaveStateModelFactory(delay);
-    } else if ("OnlineOffline".equalsIgnoreCase(stateModelType)) {
-      stateModelFactory = new OnlineOfflineStateModelFactory(delay);
-    } else if ("LeaderStandby".equalsIgnoreCase(stateModelType)) {
-      stateModelFactory = new LeaderStandbyStateModelFactory(delay);
-    }
-    // genericStateMachineHandler = new StateMachineEngine();
-    // genericStateMachineHandler.registerStateModelFactory(stateModelType,
-    // stateModelFactory);
-
-    StateMachineEngine stateMach = manager.getStateMachineEngine();
-    stateMach.registerStateModelFactory(stateModelType, stateModelFactory);
-    manager.connect();
-    manager.getMessagingService().registerMessageHandlerFactory(
-        MessageType.STATE_TRANSITION.toString(), stateMach);
-  }
-
-  public void stop() {
-    manager.disconnect();
-  }
-
-  @SuppressWarnings("static-access")
-  private static Options constructCommandLineOptions() {
-    Option helpOption =
-        OptionBuilder.withLongOpt(help).withDescription("Prints command-line options info")
-            .create();
-
-    Option zkServerOption =
-        OptionBuilder.withLongOpt(zkServer).withDescription("Provide zookeeper address").create();
-    zkServerOption.setArgs(1);
-    zkServerOption.setRequired(true);
-    zkServerOption.setArgName("ZookeeperServerAddress(Required)");
-
-    Option clusterOption =
-        OptionBuilder.withLongOpt(cluster).withDescription("Provide cluster name").create();
-    clusterOption.setArgs(1);
-    clusterOption.setRequired(true);
-    clusterOption.setArgName("Cluster name (Required)");
-
-    Option hostOption =
-        OptionBuilder.withLongOpt(hostAddress).withDescription("Provide host name").create();
-    hostOption.setArgs(1);
-    hostOption.setRequired(true);
-    hostOption.setArgName("Host name (Required)");
-
-    Option portOption =
-        OptionBuilder.withLongOpt(hostPort).withDescription("Provide host port").create();
-    portOption.setArgs(1);
-    portOption.setRequired(true);
-    portOption.setArgName("Host port (Required)");
-
-    Option stateModelOption =
-        OptionBuilder.withLongOpt(stateModel).withDescription("StateModel Type").create();
-    stateModelOption.setArgs(1);
-    stateModelOption.setRequired(true);
-    stateModelOption.setArgName("StateModel Type (Required)");
-
-    // add an option group including either --zkSvr or --configFile
-    Option fileOption =
-        OptionBuilder.withLongOpt(configFile)
-            .withDescription("Provide file to read states/messages").create();
-    fileOption.setArgs(1);
-    fileOption.setRequired(true);
-    fileOption.setArgName("File to read states/messages (Optional)");
-
-    Option transDelayOption =
-        OptionBuilder.withLongOpt(transDelay).withDescription("Provide state trans delay").create();
-    transDelayOption.setArgs(1);
-    transDelayOption.setRequired(false);
-    transDelayOption.setArgName("Delay time in state transition, in MS");
-
-    OptionGroup optionGroup = new OptionGroup();
-    optionGroup.addOption(zkServerOption);
-    optionGroup.addOption(fileOption);
-
-    Options options = new Options();
-    options.addOption(helpOption);
-    // options.addOption(zkServerOption);
-    options.addOption(clusterOption);
-    options.addOption(hostOption);
-    options.addOption(portOption);
-    options.addOption(stateModelOption);
-    options.addOption(transDelayOption);
-
-    options.addOptionGroup(optionGroup);
-
-    return options;
-  }
-
-  public static void printUsage(Options cliOptions) {
-    HelpFormatter helpFormatter = new HelpFormatter();
-    helpFormatter.printHelp("java " + ExampleProcess.class.getName(), cliOptions);
-  }
-
-  public static CommandLine processCommandLineArgs(String[] cliArgs) throws Exception {
-    CommandLineParser cliParser = new GnuParser();
-    Options cliOptions = constructCommandLineOptions();
-    try {
-      return cliParser.parse(cliOptions, cliArgs);
-    } catch (ParseException pe) {
-      System.err.println("CommandLineClient: failed to parse command-line options: "
-          + pe.toString());
-      printUsage(cliOptions);
-      System.exit(1);
-    }
-    return null;
-  }
-
-  public static void main(String[] args) throws Exception {
-    String zkConnectString = "localhost:2181";
-    String clusterName = "storage-integration-cluster";
-    String instanceName = "localhost_8905";
-    String file = null;
-    String stateModelValue = "MasterSlave";
-    int delay = 0;
-    boolean skipZeroArgs = true;// false is for dev testing
-    if (!skipZeroArgs || args.length > 0) {
-      CommandLine cmd = processCommandLineArgs(args);
-      zkConnectString = cmd.getOptionValue(zkServer);
-      clusterName = cmd.getOptionValue(cluster);
-
-      String host = cmd.getOptionValue(hostAddress);
-      String portString = cmd.getOptionValue(hostPort);
-      int port = Integer.parseInt(portString);
-      instanceName = host + "_" + port;
-
-      file = cmd.getOptionValue(configFile);
-      if (file != null) {
-        File f = new File(file);
-        if (!f.exists()) {
-          System.err.println("static config file doesn't exist");
-          System.exit(1);
-        }
-      }
-
-      stateModelValue = cmd.getOptionValue(stateModel);
-      if (cmd.hasOption(transDelay)) {
-        try {
-          delay = Integer.parseInt(cmd.getOptionValue(transDelay));
-          if (delay < 0) {
-            throw new Exception("delay must be positive");
-          }
-        } catch (Exception e) {
-          e.printStackTrace();
-          delay = 0;
-        }
-      }
-    }
-    // Espresso_driver.py will consume this
-    System.out.println("Starting Process with ZK:" + zkConnectString);
-
-    ExampleProcess process =
-        new ExampleProcess(zkConnectString, clusterName, instanceName, file, stateModelValue, delay);
-
-    process.start();
-    Thread.currentThread().join();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/IdealStateBuilderExample.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/IdealStateBuilderExample.java b/helix-core/src/main/java/org/apache/helix/examples/IdealStateBuilderExample.java
deleted file mode 100644
index 4f76352..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/IdealStateBuilderExample.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.controller.HelixControllerMain;
-import org.apache.helix.manager.zk.ZKHelixAdmin;
-import org.apache.helix.manager.zk.ZNRecordSerializer;
-import org.apache.helix.manager.zk.ZkClient;
-import org.apache.helix.model.IdealState;
-import org.apache.helix.model.IdealState.RebalanceMode;
-import org.apache.helix.model.InstanceConfig;
-import org.apache.helix.model.StateModelDefinition;
-import org.apache.helix.model.builder.AutoModeISBuilder;
-import org.apache.helix.model.builder.AutoRebalanceModeISBuilder;
-import org.apache.helix.model.builder.CustomModeISBuilder;
-import org.apache.helix.tools.StateModelConfigGenerator;
-
-public class IdealStateBuilderExample {
-
-  private static String buildPartitionName(String resourceName, int partitionNum) {
-    return resourceName + "_" + partitionNum;
-  }
-
-  public static void main(String[] args) {
-
-    if (args.length < 3) {
-      System.err
-          .println("USAGE: java IdealStateBuilderExample zkAddress clusterName idealStateMode"
-              + " (FULL_AUTO, SEMI_AUTO, CUSTOMIZED, or USER_DEFINED)");
-      System.exit(1);
-    }
-
-    final String zkAddr = args[0];
-    final String clusterName = args[1];
-    RebalanceMode idealStateMode = RebalanceMode.valueOf(args[2].toUpperCase());
-
-    ZkClient zkclient =
-        new ZkClient(zkAddr, ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT,
-            new ZNRecordSerializer());
-    ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);
-
-    // add cluster
-    admin.addCluster(clusterName, true);
-
-    // add MasterSlave state model definition
-    admin.addStateModelDef(clusterName, "MasterSlave", new StateModelDefinition(
-        StateModelConfigGenerator.generateConfigForMasterSlave()));
-
-    // add 2 participants: "localhost:{12918, 12919}"
-    int n = 2;
-    for (int i = 0; i < n; i++) {
-      int port = 12918 + i;
-      InstanceConfig config = new InstanceConfig("localhost_" + port);
-      config.setHostName("localhost");
-      config.setPort(Integer.toString(port));
-      config.setInstanceEnabled(true);
-      admin.addInstance(clusterName, config);
-    }
-
-    // add ideal-state according to ideal-state-mode
-    String resourceName = "TestDB";
-    IdealState idealState = null;
-    switch (idealStateMode) {
-    case SEMI_AUTO: {
-      AutoModeISBuilder builder = new AutoModeISBuilder(resourceName);
-      builder.setStateModel("MasterSlave").setNumPartitions(2).setNumReplica(2);
-      builder.assignPreferenceList(buildPartitionName(resourceName, 0), "localhost_12918",
-          "localhost_12919").assignPreferenceList(buildPartitionName(resourceName, 1),
-          "localhost_12919", "localhost_12918");
-
-      idealState = builder.build();
-      break;
-    }
-    case FULL_AUTO: {
-      AutoRebalanceModeISBuilder builder = new AutoRebalanceModeISBuilder(resourceName);
-      builder.setStateModel("MasterSlave").setNumPartitions(2).setNumReplica(2)
-          .setMaxPartitionsPerNode(2);
-      builder.add(buildPartitionName(resourceName, 0)).add(buildPartitionName(resourceName, 1));
-
-      idealState = builder.build();
-      break;
-    }
-    case CUSTOMIZED: {
-      CustomModeISBuilder builder = new CustomModeISBuilder(resourceName);
-      builder.setStateModel("MasterSlave").setNumPartitions(2).setNumReplica(2);
-      builder
-          .assignInstanceAndState(buildPartitionName(resourceName, 0), "localhost_12918", "MASTER")
-          .assignInstanceAndState(buildPartitionName(resourceName, 0), "localhost_12919", "SLAVE")
-          .assignInstanceAndState(buildPartitionName(resourceName, 1), "localhost_12918", "SLAVE")
-          .assignInstanceAndState(buildPartitionName(resourceName, 1), "localhost_12919", "MASTER");
-      idealState = builder.build();
-      break;
-    }
-    default:
-      break;
-    }
-
-    admin.addResource(clusterName, resourceName, idealState);
-
-    // start helix controller
-    new Thread(new Runnable() {
-      @Override
-      public void run() {
-        try {
-          HelixControllerMain.main(new String[] {
-              "--zkSvr", zkAddr, "--cluster", clusterName
-          });
-        } catch (Exception e) {
-          // TODO Auto-generated catch block
-          e.printStackTrace();
-        }
-      }
-    }).start();
-
-    // start dummy participants
-    for (int i = 0; i < n; i++) {
-      int port = 12918 + i;
-      final String instanceName = "localhost_" + port;
-      new Thread(new Runnable() {
-        @Override
-        public void run() {
-          DummyParticipant.main(new String[] {
-              zkAddr, clusterName, instanceName
-          });
-        }
-      }).start();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/IdealStateExample.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/IdealStateExample.java b/helix-core/src/main/java/org/apache/helix/examples/IdealStateExample.java
deleted file mode 100644
index 7c5192d..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/IdealStateExample.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.controller.HelixControllerMain;
-import org.apache.helix.manager.zk.ZKHelixAdmin;
-import org.apache.helix.manager.zk.ZNRecordSerializer;
-import org.apache.helix.manager.zk.ZkClient;
-import org.apache.helix.model.IdealState.RebalanceMode;
-import org.apache.helix.model.InstanceConfig;
-import org.apache.helix.model.StateModelDefinition;
-import org.apache.helix.tools.StateModelConfigGenerator;
-
-/**
- * Ideal state json format file used in this example for CUSTOMIZED ideal state mode
- * <p>
- * 
- * <pre>
- * {
- * "id" : "TestDB",
- * "mapFields" : {
- *   "TestDB_0" : {
- *     "localhost_12918" : "MASTER",
- *     "localhost_12919" : "SLAVE",
- *     "localhost_12920" : "SLAVE"
- *   },
- *   "TestDB_1" : {
- *     "localhost_12918" : "MASTER",
- *     "localhost_12919" : "SLAVE",
- *     "localhost_12920" : "SLAVE"
- *   },
- *   "TestDB_2" : {
- *     "localhost_12918" : "MASTER",
- *     "localhost_12919" : "SLAVE",
- *     "localhost_12920" : "SLAVE"
- *   },
- *   "TestDB_3" : {
- *     "localhost_12918" : "MASTER",
- *     "localhost_12919" : "SLAVE",
- *     "localhost_12920" : "SLAVE"
- *   }
- * },
- * "listFields" : {
- * },
- * "simpleFields" : {
- *   "IDEAL_STATE_MODE" : "CUSTOMIZED",
- *   "NUM_PARTITIONS" : "4",
- *   "REPLICAS" : "3",
- *   "STATE_MODEL_DEF_REF" : "MasterSlave",
- *   "STATE_MODEL_FACTORY_NAME" : "DEFAULT"
- * }
- * }
- * </pre>
- */
-
-public class IdealStateExample {
-
-  public static void main(String[] args) throws Exception {
-    if (args.length < 3) {
-      System.err
-          .println("USAGE: IdealStateExample zkAddress clusterName idealStateMode (FULL_AUTO, SEMI_AUTO, or CUSTOMIZED) idealStateJsonFile (required for CUSTOMIZED mode)");
-      System.exit(1);
-    }
-
-    final String zkAddr = args[0];
-    final String clusterName = args[1];
-    final String idealStateRebalancerModeStr = args[2].toUpperCase();
-    String idealStateJsonFile = null;
-    RebalanceMode idealStateRebalancerMode = RebalanceMode.valueOf(idealStateRebalancerModeStr);
-    if (idealStateRebalancerMode == RebalanceMode.CUSTOMIZED) {
-      if (args.length < 4) {
-        System.err.println("Missng idealStateJsonFile for CUSTOMIZED ideal state mode");
-        System.exit(1);
-      }
-      idealStateJsonFile = args[3];
-    }
-
-    // add cluster {clusterName}
-    ZkClient zkclient =
-        new ZkClient(zkAddr, ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT,
-            new ZNRecordSerializer());
-    ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);
-    admin.addCluster(clusterName, true);
-
-    // add MasterSlave state mode definition
-    StateModelConfigGenerator generator = new StateModelConfigGenerator();
-    admin.addStateModelDef(clusterName, "MasterSlave",
-        new StateModelDefinition(generator.generateConfigForMasterSlave()));
-
-    // add 3 participants: "localhost:{12918, 12919, 12920}"
-    for (int i = 0; i < 3; i++) {
-      int port = 12918 + i;
-      InstanceConfig config = new InstanceConfig("localhost_" + port);
-      config.setHostName("localhost");
-      config.setPort(Integer.toString(port));
-      config.setInstanceEnabled(true);
-      admin.addInstance(clusterName, config);
-    }
-
-    // add resource "TestDB" which has 4 partitions and uses MasterSlave state model
-    String resourceName = "TestDB";
-    if (idealStateRebalancerMode == RebalanceMode.SEMI_AUTO
-        || idealStateRebalancerMode == RebalanceMode.FULL_AUTO) {
-      admin.addResource(clusterName, resourceName, 4, "MasterSlave", idealStateRebalancerModeStr);
-
-      // rebalance resource "TestDB" using 3 replicas
-      admin.rebalance(clusterName, resourceName, 3);
-    } else if (idealStateRebalancerMode == RebalanceMode.CUSTOMIZED) {
-      admin.addIdealState(clusterName, resourceName, idealStateJsonFile);
-    }
-
-    // start helix controller
-    new Thread(new Runnable() {
-
-      @Override
-      public void run() {
-        try {
-          HelixControllerMain.main(new String[] {
-              "--zkSvr", zkAddr, "--cluster", clusterName
-          });
-        } catch (Exception e) {
-          // TODO Auto-generated catch block
-          e.printStackTrace();
-        }
-      }
-
-    }).start();
-
-    // start 3 dummy participants
-    for (int i = 0; i < 3; i++) {
-      int port = 12918 + i;
-      final String instanceName = "localhost_" + port;
-      new Thread(new Runnable() {
-
-        @Override
-        public void run() {
-          DummyParticipant.main(new String[] {
-              zkAddr, clusterName, instanceName
-          });
-        }
-      }).start();
-    }
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/LeaderStandbyStateModelFactory.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/LeaderStandbyStateModelFactory.java b/helix-core/src/main/java/org/apache/helix/examples/LeaderStandbyStateModelFactory.java
deleted file mode 100644
index 43ac5de..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/LeaderStandbyStateModelFactory.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.NotificationContext;
-import org.apache.helix.model.Message;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-
-public class LeaderStandbyStateModelFactory extends StateModelFactory<StateModel> {
-  int _delay;
-
-  public LeaderStandbyStateModelFactory(int delay) {
-    _delay = delay;
-  }
-
-  @Override
-  public StateModel createNewStateModel(String stateUnitKey) {
-    LeaderStandbyStateModel stateModel = new LeaderStandbyStateModel();
-    stateModel.setDelay(_delay);
-    return stateModel;
-  }
-
-  public static class LeaderStandbyStateModel extends StateModel {
-    int _transDelay = 0;
-
-    public void setDelay(int delay) {
-      _transDelay = delay > 0 ? delay : 0;
-    }
-
-    public void onBecomeLeaderFromStandby(Message message, NotificationContext context) {
-      System.out.println("LeaderStandbyStateModel.onBecomeLeaderFromStandby()");
-      sleep();
-    }
-
-    public void onBecomeStandbyFromLeader(Message message, NotificationContext context) {
-      System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromLeader()");
-      sleep();
-    }
-
-    private void sleep() {
-      try {
-        Thread.sleep(_transDelay);
-      } catch (Exception e) {
-        e.printStackTrace();
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/MasterSlaveStateModelFactory.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/MasterSlaveStateModelFactory.java b/helix-core/src/main/java/org/apache/helix/examples/MasterSlaveStateModelFactory.java
deleted file mode 100644
index affbea8..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/MasterSlaveStateModelFactory.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.NotificationContext;
-import org.apache.helix.model.Message;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-
-@SuppressWarnings("rawtypes")
-public class MasterSlaveStateModelFactory extends StateModelFactory<StateModel> {
-  int _delay;
-
-  String _instanceName = "";
-
-  public MasterSlaveStateModelFactory(int delay) {
-    _delay = delay;
-  }
-
-  public MasterSlaveStateModelFactory(String instanceName) {
-    _instanceName = instanceName;
-    _delay = 10;
-  }
-
-  public MasterSlaveStateModelFactory() {
-    this(10);
-  }
-
-  @Override
-  public StateModel createNewStateModel(String partitionName) {
-    MasterSlaveStateModel stateModel = new MasterSlaveStateModel();
-    stateModel.setInstanceName(_instanceName);
-    stateModel.setDelay(_delay);
-    stateModel.setPartitionName(partitionName);
-    return stateModel;
-  }
-
-  public static class MasterSlaveStateModel extends StateModel {
-    int _transDelay = 0;
-    String partitionName;
-    String _instanceName = "";
-
-    public String getPartitionName() {
-      return partitionName;
-    }
-
-    public void setPartitionName(String partitionName) {
-      this.partitionName = partitionName;
-    }
-
-    public void setDelay(int delay) {
-      _transDelay = delay > 0 ? delay : 0;
-    }
-
-    public void setInstanceName(String instanceName) {
-      _instanceName = instanceName;
-    }
-
-    public void onBecomeSlaveFromOffline(Message message, NotificationContext context) {
-
-      System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
-          + message.getToState() + " for " + partitionName);
-      sleep();
-    }
-
-    private void sleep() {
-      try {
-        Thread.sleep(_transDelay);
-      } catch (Exception e) {
-        e.printStackTrace();
-      }
-    }
-
-    public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
-      System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
-          + message.getToState() + " for " + partitionName);
-      sleep();
-
-    }
-
-    public void onBecomeMasterFromSlave(Message message, NotificationContext context) {
-      System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
-          + message.getToState() + " for " + partitionName);
-      sleep();
-
-    }
-
-    public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
-      System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
-          + message.getToState() + " for " + partitionName);
-      sleep();
-
-    }
-
-    public void onBecomeDroppedFromOffline(Message message, NotificationContext context) {
-      System.out.println(_instanceName + " Dropping partition " + partitionName);
-      sleep();
-
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/OnlineOfflineStateModelFactory.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/OnlineOfflineStateModelFactory.java b/helix-core/src/main/java/org/apache/helix/examples/OnlineOfflineStateModelFactory.java
deleted file mode 100644
index daf03a9..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/OnlineOfflineStateModelFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import org.apache.helix.NotificationContext;
-import org.apache.helix.model.Message;
-import org.apache.helix.participant.statemachine.StateModel;
-import org.apache.helix.participant.statemachine.StateModelFactory;
-
-public class OnlineOfflineStateModelFactory extends StateModelFactory<StateModel> {
-  int _delay;
-
-  public OnlineOfflineStateModelFactory(int delay) {
-    _delay = delay;
-  }
-
-  @Override
-  public StateModel createNewStateModel(String stateUnitKey) {
-    OnlineOfflineStateModel stateModel = new OnlineOfflineStateModel();
-    stateModel.setDelay(_delay);
-    return stateModel;
-  }
-
-  public static class OnlineOfflineStateModel extends StateModel {
-    int _transDelay = 0;
-
-    public void setDelay(int delay) {
-      _transDelay = delay > 0 ? delay : 0;
-    }
-
-    public void onBecomeOnlineFromOffline(Message message, NotificationContext context) {
-      System.out.println("OnlineOfflineStateModel.onBecomeOnlineFromOffline()");
-      sleep();
-    }
-
-    public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
-      System.out.println("OnlineOfflineStateModel.onBecomeOfflineFromOnline()");
-      sleep();
-    }
-
-    public void onBecomeDroppedFromOffline(Message message, NotificationContext context) {
-      System.out.println("OnlineOfflineStateModel.onBecomeDroppedFromOffline()");
-      sleep();
-
-    }
-
-    private void sleep() {
-      try {
-        Thread.sleep(_transDelay);
-      } catch (Exception e) {
-        e.printStackTrace();
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/Quickstart.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/Quickstart.java b/helix-core/src/main/java/org/apache/helix/examples/Quickstart.java
deleted file mode 100644
index b80d458..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/Quickstart.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package org.apache.helix.examples;
-
-/*
- * 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.
- */
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeSet;
-
-import org.I0Itec.zkclient.IDefaultNameSpace;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.ZkServer;
-import org.apache.helix.HelixAdmin;
-import org.apache.helix.HelixManager;
-import org.apache.helix.HelixManagerFactory;
-import org.apache.helix.InstanceType;
-import org.apache.helix.controller.HelixControllerMain;
-import org.apache.helix.manager.zk.ZKHelixAdmin;
-import org.apache.helix.manager.zk.ZNRecordSerializer;
-import org.apache.helix.model.ExternalView;
-import org.apache.helix.model.InstanceConfig;
-import org.apache.helix.model.StateModelDefinition;
-import org.apache.helix.participant.StateMachineEngine;
-
-public class Quickstart {
-
-  private static String ZK_ADDRESS = "localhost:2199";
-  private static String CLUSTER_NAME = "HELIX_QUICKSTART";
-  private static int NUM_NODES = 2;
-  private static final String RESOURCE_NAME = "MyResource";
-  private static final int NUM_PARTITIONS = 6;
-  private static final int NUM_REPLICAS = 2;
-
-  private static final String STATE_MODEL_NAME = "MyStateModel";
-
-  // states
-  private static final String SLAVE = "SLAVE";
-  private static final String OFFLINE = "OFFLINE";
-  private static final String MASTER = "MASTER";
-  private static final String DROPPED = "DROPPED";
-
-  private static List<InstanceConfig> INSTANCE_CONFIG_LIST;
-  private static List<MyProcess> PROCESS_LIST;
-  private static HelixAdmin admin;
-  static {
-    INSTANCE_CONFIG_LIST = new ArrayList<InstanceConfig>();
-    PROCESS_LIST = new ArrayList<Quickstart.MyProcess>();
-    for (int i = 0; i < NUM_NODES; i++) {
-      int port = 12000 + i;
-      InstanceConfig instanceConfig = new InstanceConfig("localhost_" + port);
-      instanceConfig.setHostName("localhost");
-      instanceConfig.setPort("" + port);
-      instanceConfig.setInstanceEnabled(true);
-      INSTANCE_CONFIG_LIST.add(instanceConfig);
-    }
-
-  }
-
-  public static void setup() {
-    admin = new ZKHelixAdmin(ZK_ADDRESS);
-    // create cluster
-    echo("Creating cluster: " + CLUSTER_NAME);
-    admin.addCluster(CLUSTER_NAME, true);
-
-    // Add nodes to the cluster
-    echo("Adding " + NUM_NODES + " participants to the cluster");
-    for (int i = 0; i < NUM_NODES; i++) {
-      admin.addInstance(CLUSTER_NAME, INSTANCE_CONFIG_LIST.get(i));
-      echo("\t Added participant: " + INSTANCE_CONFIG_LIST.get(i).getInstanceName());
-    }
-
-    // Add a state model
-    StateModelDefinition myStateModel = defineStateModel();
-    echo("Configuring StateModel: " + "MyStateModel  with 1 Master and 1 Slave");
-    admin.addStateModelDef(CLUSTER_NAME, STATE_MODEL_NAME, myStateModel);
-
-    // Add a resource with 6 partitions and 2 replicas
-    echo("Adding a resource MyResource: " + "with 6 partitions and 2 replicas");
-    admin.addResource(CLUSTER_NAME, RESOURCE_NAME, NUM_PARTITIONS, STATE_MODEL_NAME, "AUTO");
-    // this will set up the ideal state, it calculates the preference list for
-    // each partition similar to consistent hashing
-    admin.rebalance(CLUSTER_NAME, RESOURCE_NAME, NUM_REPLICAS);
-  }
-
-  private static StateModelDefinition defineStateModel() {
-    StateModelDefinition.Builder builder = new StateModelDefinition.Builder(STATE_MODEL_NAME);
-    // Add states and their rank to indicate priority. Lower the rank higher the
-    // priority
-    builder.addState(MASTER, 1);
-    builder.addState(SLAVE, 2);
-    builder.addState(OFFLINE);
-    builder.addState(DROPPED);
-    // Set the initial state when the node starts
-    builder.initialState(OFFLINE);
-
-    // Add transitions between the states.
-    builder.addTransition(OFFLINE, SLAVE);
-    builder.addTransition(SLAVE, OFFLINE);
-    builder.addTransition(SLAVE, MASTER);
-    builder.addTransition(MASTER, SLAVE);
-    builder.addTransition(OFFLINE, DROPPED);
-
-    // set constraints on states.
-    // static constraint
-    builder.upperBound(MASTER, 1);
-    // dynamic constraint, R means it should be derived based on the replication
-    // factor.
-    builder.dynamicUpperBound(SLAVE, "R");
-
-    StateModelDefinition statemodelDefinition = builder.build();
-    return statemodelDefinition;
-  }
-
-  public static void startController() {
-    // start controller
-    echo("Starting Helix Controller");
-    HelixControllerMain.startHelixController(ZK_ADDRESS, CLUSTER_NAME, "localhost_9100",
-        HelixControllerMain.STANDALONE);
-  }
-
-  public static void startNodes() throws Exception {
-    echo("Starting Participants");
-    for (int i = 0; i < NUM_NODES; i++) {
-      MyProcess process = new MyProcess(INSTANCE_CONFIG_LIST.get(i).getId());
-      PROCESS_LIST.add(process);
-      process.start();
-      echo("\t Started Participant: " + INSTANCE_CONFIG_LIST.get(i).getId());
-    }
-  }
-
-  public static void startZookeeper() {
-    echo("STARTING Zookeeper at " + ZK_ADDRESS);
-    IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
-      @Override
-      public void createDefaultNameSpace(ZkClient zkClient) {
-      }
-    };
-    new File("/tmp/helix-quickstart").mkdirs();
-    // start zookeeper
-    ZkServer server =
-        new ZkServer("/tmp/helix-quickstart/dataDir", "/tmp/helix-quickstart/logDir",
-            defaultNameSpace, 2199);
-    server.start();
-  }
-
-  public static void echo(Object obj) {
-    System.out.println(obj);
-  }
-
-  public static void main(String[] args) throws Exception {
-    startZookeeper();
-    setup();
-    startNodes();
-    startController();
-    Thread.sleep(5000);
-    printState("After starting 2 nodes");
-    addNode();
-    Thread.sleep(5000);
-    printState("After adding a third node");
-    stopNode();
-    Thread.sleep(5000);
-    printState("After the 3rd node stops/crashes");
-    Thread.currentThread().join();
-    System.exit(0);
-  }
-
-  private static void addNode() throws Exception {
-
-    NUM_NODES = NUM_NODES + 1;
-    int port = 12000 + NUM_NODES - 1;
-    InstanceConfig instanceConfig = new InstanceConfig("localhost_" + port);
-    instanceConfig.setHostName("localhost");
-    instanceConfig.setPort("" + port);
-    instanceConfig.setInstanceEnabled(true);
-    echo("ADDING NEW NODE :" + instanceConfig.getInstanceName()
-        + ". Partitions will move from old nodes to the new node.");
-    admin.addInstance(CLUSTER_NAME, instanceConfig);
-    INSTANCE_CONFIG_LIST.add(instanceConfig);
-    MyProcess process = new MyProcess(instanceConfig.getInstanceName());
-    PROCESS_LIST.add(process);
-    admin.rebalance(CLUSTER_NAME, RESOURCE_NAME, 3);
-    process.start();
-  }
-
-  private static void stopNode() {
-    int nodeId = NUM_NODES - 1;
-    echo("STOPPING " + INSTANCE_CONFIG_LIST.get(nodeId).getInstanceName()
-        + ". Mastership will be transferred to the remaining nodes");
-    PROCESS_LIST.get(nodeId).stop();
-  }
-
-  private static void printState(String msg) {
-    System.out.println("CLUSTER STATE: " + msg);
-    ExternalView resourceExternalView = admin.getResourceExternalView(CLUSTER_NAME, RESOURCE_NAME);
-    TreeSet<String> sortedSet = new TreeSet<String>(resourceExternalView.getPartitionSet());
-    StringBuilder sb = new StringBuilder("\t\t");
-    for (int i = 0; i < NUM_NODES; i++) {
-      sb.append(INSTANCE_CONFIG_LIST.get(i).getInstanceName()).append("\t");
-    }
-    System.out.println(sb);
-    for (String partitionName : sortedSet) {
-      sb.delete(0, sb.length() - 1);
-      sb.append(partitionName).append("\t");
-      for (int i = 0; i < NUM_NODES; i++) {
-        Map<String, String> stateMap = resourceExternalView.getStateMap(partitionName);
-        if (stateMap != null && stateMap.containsKey(INSTANCE_CONFIG_LIST.get(i).getInstanceName())) {
-          sb.append(stateMap.get(INSTANCE_CONFIG_LIST.get(i).getInstanceName()).charAt(0)).append(
-              "\t\t");
-        } else {
-          sb.append("-").append("\t\t");
-        }
-      }
-      System.out.println(sb);
-    }
-    System.out.println("###################################################################");
-  }
-
-  static final class MyProcess {
-    private final String instanceName;
-    private HelixManager manager;
-
-    public MyProcess(String instanceName) {
-      this.instanceName = instanceName;
-    }
-
-    public void start() throws Exception {
-      manager =
-          HelixManagerFactory.getZKHelixManager(CLUSTER_NAME, instanceName,
-              InstanceType.PARTICIPANT, ZK_ADDRESS);
-
-      MasterSlaveStateModelFactory stateModelFactory =
-          new MasterSlaveStateModelFactory(instanceName);
-
-      StateMachineEngine stateMach = manager.getStateMachineEngine();
-      stateMach.registerStateModelFactory(STATE_MODEL_NAME, stateModelFactory);
-      manager.connect();
-    }
-
-    public void stop() {
-      manager.disconnect();
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-core/src/main/java/org/apache/helix/examples/package-info.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/examples/package-info.java b/helix-core/src/main/java/org/apache/helix/examples/package-info.java
deleted file mode 100644
index 6714341..0000000
--- a/helix-core/src/main/java/org/apache/helix/examples/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- */
-/**
- * Examples of using Helix cluster manager
- * 
- */
-package org.apache.helix.examples;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-examples/.gitignore
----------------------------------------------------------------------
diff --git a/helix-examples/.gitignore b/helix-examples/.gitignore
new file mode 100644
index 0000000..2411bd8
--- /dev/null
+++ b/helix-examples/.gitignore
@@ -0,0 +1,16 @@
+/target
+/.project
+/.classpath
+/.settings
+/zkdata
+/test-output
+/src/main/scripts/integration-test/var
+#/src/test/java/com/linkedin/dds/
+#/src/main/scripts/integration-test/config
+/src/main/scripts/target/
+/src/main/scripts/integration-test/script/.metadata_infra
+#/src/main/scripts/integration-test/script/dds_driver.py
+#/src/main/scripts/integration-test/script/pexpect.py
+#/src/main/scripts/integration-test/script/utility.py
+*.pyc
+/bin

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/e5f2ef7e/helix-examples/DISCLAIMER
----------------------------------------------------------------------
diff --git a/helix-examples/DISCLAIMER b/helix-examples/DISCLAIMER
new file mode 100644
index 0000000..2001d31
--- /dev/null
+++ b/helix-examples/DISCLAIMER
@@ -0,0 +1,15 @@
+Apache Helix is an effort undergoing incubation at the Apache Software 
+Foundation (ASF), sponsored by the Apache Incubator PMC. 
+
+Incubation is required of all newly accepted projects until a further review 
+indicates that the infrastructure, communications, and decision making process 
+have stabilized in a manner consistent with other successful ASF projects. 
+
+While incubation status is not necessarily a reflection of the completeness 
+or stability of the code, it does indicate that the project has yet to be 
+fully endorsed by the ASF.
+
+For more information about the incubation status of the Apache Helix project you
+can go to the following page:
+
+http://incubator.apache.org/projects/helix.html


Mime
View raw message