org.apache.helix.manager.zk.ZKHelixManager.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.helix.manager.zk.ZKHelixManager.<init>()方法的一些代码示例,展示了ZKHelixManager.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKHelixManager.<init>()方法的具体详情如下:
包路径:org.apache.helix.manager.zk.ZKHelixManager
类名称:ZKHelixManager
方法名:<init>

ZKHelixManager.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-pinot

public MinionStarter(String zkAddress, String helixClusterName, Configuration config)
  throws Exception {
 _helixClusterName = helixClusterName;
 _config = config;
 _instanceId = config.getString(CommonConstants.Helix.Instance.INSTANCE_ID_KEY,
   CommonConstants.Minion.INSTANCE_PREFIX + NetUtil.getHostAddress() + "_"
     + CommonConstants.Minion.DEFAULT_HELIX_PORT);
 _helixManager = new ZKHelixManager(_helixClusterName, _instanceId, InstanceType.PARTICIPANT, zkAddress);
 _taskExecutorFactoryRegistry = new TaskExecutorFactoryRegistry();
 _eventObserverFactoryRegistry = new EventObserverFactoryRegistry();
}

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Construct a zk-based cluster manager that enforces all types (PARTICIPANT, CONTROLLER, and
 * SPECTATOR) to have a name
 * @param clusterName
 * @param instanceName
 * @param type
 * @param zkAddr
 * @return a HelixManager backed by Zookeeper
 */
public static HelixManager getZKHelixManager(String clusterName, String instanceName,
  InstanceType type, String zkAddr) {
 return new ZKHelixManager(clusterName, instanceName, type, zkAddr);
}

代码示例来源:origin: apache/helix

/**
 * Construct a zk-based cluster manager that enforces all types (PARTICIPANT, CONTROLLER, and
 * SPECTATOR) to have a name
 * @param clusterName
 * @param instanceName
 * @param type
 * @param zkAddr
 * @return a HelixManager backed by Zookeeper
 */
public static HelixManager getZKHelixManager(String clusterName, String instanceName,
  InstanceType type, String zkAddr) {
 return new ZKHelixManager(clusterName, instanceName, type, zkAddr);
}

代码示例来源:origin: org.apache.helix/helix-core

/**
 * Construct a zk-based cluster manager that enforces all types (PARTICIPANT, CONTROLLER, and
 * SPECTATOR) to have a name
 * @param clusterName
 * @param instanceName
 * @param type
 * @param zkAddr
 * @param stateListener
 * @return a HelixManager backed by Zookeeper
 */
public static HelixManager getZKHelixManager(String clusterName, String instanceName,
  InstanceType type, String zkAddr, HelixManagerStateListener stateListener) {
 return new ZKHelixManager(clusterName, instanceName, type, zkAddr, stateListener);
}

代码示例来源:origin: apache/helix

/**
 * Construct a zk-based cluster manager that enforces all types (PARTICIPANT, CONTROLLER, and
 * SPECTATOR) to have a name
 * @param clusterName
 * @param instanceName
 * @param type
 * @param zkAddr
 * @param stateListener
 * @return a HelixManager backed by Zookeeper
 */
public static HelixManager getZKHelixManager(String clusterName, String instanceName,
  InstanceType type, String zkAddr, HelixManagerStateListener stateListener) {
 return new ZKHelixManager(clusterName, instanceName, type, zkAddr, stateListener);
}

代码示例来源:origin: apache/helix

public static void main(String[] args) throws Exception {
  CommandLine cmd = processCommandLineArgs(args);
  String zkAddress = cmd.getOptionValue(zkAddr);
  String clusterName = cmd.getOptionValue(cluster);
  String instance = cmd.getOptionValue(instanceName);
  String stateModelName = cmd.getOptionValue(stateModel);

  HelixManager manager =
    new ZKHelixManager(clusterName, instance, InstanceType.PARTICIPANT, zkAddress);

  StateMachineEngine stateMach = manager.getStateMachineEngine();
  stateMach.registerStateModelFactory(stateModelName, new AgentStateModelFactory());

  Runtime.getRuntime().addShutdownHook(new HelixAgentShutdownHook(manager));

  try {
   manager.connect();
   Thread.currentThread().join();
  } catch (Exception e) {
   LOG.error(e.toString());
  } finally {
   if (manager != null && manager.isConnected()) {
    manager.disconnect();
   }
  }
 }
}

代码示例来源:origin: apache/helix

private HelixManager createParticipant(String clusterName, String instanceName) {
 HelixManager participant =
   new ZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, ZK_ADDR);
 participant.getStateMachineEngine().registerStateModelFactory("OnlineOffline",
   new MockStateModelFactory());
 return participant;
}

代码示例来源:origin: apache/helix

public void start() throws Exception {
 helixManager =
   new ZKHelixManager(clusterName, instanceName, InstanceType.PARTICIPANT, ZK_ADDR);
 {
  // hack to set sessionTimeout
  Field sessionTimeout = ZKHelixManager.class.getDeclaredField("_sessionTimeout");
  sessionTimeout.setAccessible(true);
  sessionTimeout.setInt(helixManager, 1000);
 }
 StateMachineEngine stateMach = helixManager.getStateMachineEngine();
 stateMach.registerStateModelFactory("MasterSlave", new MyStateModelFactory(helixManager));
 helixManager.connect();
 StatusPrinter statusPrinter = new StatusPrinter();
 statusPrinter.registerWith(helixManager);
}

代码示例来源:origin: apache/helix

new ZKHelixManager(clusterName, null, InstanceType.ADMINISTRATOR, ZK_ADDR);

代码示例来源:origin: apache/helix

ZKHelixManager zkHelixManager = new ZKHelixManager(clusterName, "controllerMessageListener", InstanceType.CONTROLLER, ZK_ADDR);
zkHelixManager.connect();
MockMessageListener mockMessageListener = new MockMessageListener();

代码示例来源:origin: apache/helix

String controllerName = "controller_" + i;
ZKHelixManager manager =
  new ZKHelixManager(clusterName, controllerName, InstanceType.CONTROLLER, ZK_ADDR);
GenericHelixController controller0 = new GenericHelixController();
DistributedLeaderElection election =

代码示例来源:origin: uber/uReplicator

ZKHelixManager managerWorkerHelix = new ZKHelixManager(managerWorkerHelixName, instanceId,
  InstanceType.PARTICIPANT, zkServer);
StateMachineEngine stateMachineEngine = managerWorkerHelix.getStateMachineEngine();

代码示例来源:origin: apache/helix

int port = 12918 + i;
distributedControllers[i] =
  new ZKHelixManager(clusterName, "localhost_" + port, InstanceType.CONTROLLER_PARTICIPANT,
    ZK_ADDR);
distributedControllers[i].getStateMachineEngine().registerStateModelFactory("MasterSlave",

代码示例来源:origin: apache/helix

new ZKHelixManager(clusterName, "localhost_0", InstanceType.PARTICIPANT, ZK_ADDR);
manager.connect();
HelixDataAccessor accessor = manager.getHelixDataAccessor();
manager = new ZKHelixManager(clusterName, "localhost_1", InstanceType.PARTICIPANT, ZK_ADDR);
manager.setLiveInstanceInfoProvider(new provider(false));
manager = new ZKHelixManager(clusterName, "localhost_2", InstanceType.PARTICIPANT, ZK_ADDR);
manager.setLiveInstanceInfoProvider(new provider(true));

代码示例来源:origin: apache/helix

new ZKHelixManager(clusterName, "localhost_12918", InstanceType.PARTICIPANT, ZK_ADDR);
participant.getStateMachineEngine().registerStateModelFactory("MasterSlave",
  new MockMSModelFactory());
  new ZKHelixManager(clusterName, "controller_0", InstanceType.CONTROLLER, ZK_ADDR);
controller.connect();

代码示例来源:origin: apache/helix

new ZKHelixManager(clusterName, null, InstanceType.CONTROLLER, ZK_ADDR);

相关文章