Package org.apache.helix.manager.zk

Examples of org.apache.helix.manager.zk.ZKHelixAdmin.addInstance()


      List<String> nodes = admin.getInstancesInCluster(_clusterName);
      if (!nodes.contains(_instanceName)) {
        InstanceConfig config = new InstanceConfig(_instanceName);
        config.setHostName("localhost");
        config.setInstanceEnabled(true);
        admin.addInstance(_clusterName, config);
      }

      Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
View Full Code Here


      List<String> nodes = admin.getInstancesInCluster(_clusterName);
      if (!nodes.contains(_instanceName)) {
        InstanceConfig config = new InstanceConfig(_instanceName);
        config.setHostName("localhost");
        config.setInstanceEnabled(true);
        admin.addInstance(_clusterName, config);
      }


      Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
View Full Code Here

          int port = 12918 + i;
            InstanceConfig instanceConfig = new InstanceConfig("localhost_" + port);
            instanceConfig.setHostName("localhost");
            instanceConfig.setPort("" + port);
            instanceConfig.setInstanceEnabled(true);
            admin.addInstance(clusterName, instanceConfig);
            // System.out.println("\t Added participant: " + instanceConfig.getInstanceName());
        }

        // construct ideal-state manually
        IdealState idealState = new IdealState(db);
View Full Code Here

            configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
            Assert.fail("Except fail to set participant-config because participant: localhost_12918 is not added to cluster yet");
        } catch (HelixException e) {
            // OK
        }
        admin.addInstance(clusterName, new InstanceConfig("localhost_12918"));

        try {
            configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
        } catch (Exception e) {
            Assert.fail("Except succeed to set participant-config because participant: localhost_12918 has been added to cluster");
View Full Code Here

      String instance = "localhost_" + instances[i];
      InstanceConfig instanceConfig = new InstanceConfig(instance);
      instanceConfig.setHostName("localhost");
      instanceConfig.setPort("" + instances[i]);
      instanceConfig.setInstanceEnabled(true);
      admin.addInstance(clusterName, instanceConfig);
    }
  }

  protected void runPipeline(ClusterEvent event, Pipeline pipeline)
  {
View Full Code Here

          configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
          Assert.fail("Except fail to set participant-config because participant: localhost_12918 is not added to cluster yet");
      } catch (HelixException e) {
          // OK
      }
      admin.addInstance(clusterName, new InstanceConfig("localhost_12918"));

      try {
          configAccessor.set(participantScope, "participantConfigKey", "participantConfigValue");
      } catch (Exception e) {
          Assert.fail("Except succeed to set participant-config because participant: localhost_12918 has been added to cluster");
View Full Code Here

      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;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.