• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HelixControllerMain类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.helix.controller.HelixControllerMain的典型用法代码示例。如果您正苦于以下问题:Java HelixControllerMain类的具体用法?Java HelixControllerMain怎么用?Java HelixControllerMain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HelixControllerMain类属于org.apache.helix.controller包,在下文中一共展示了HelixControllerMain类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: beforeMethod

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
@BeforeMethod
public void beforeMethod() throws Exception {
  // Set up helix cluster
  ClusterSetup clusterSetup = new ClusterSetup(zkAddress);
  clusterSetup.addCluster(clusterName, true);

  // Start Helix controller
  helixController = HelixControllerMain.startHelixController(zkAddress, clusterName, "CONTROLLER", "STANDALONE");

  // Service discoverer
  serviceDiscoverer = new HelixServiceDiscoverer(zkAddress, clusterName);
  serviceDiscoverer.start();
}
 
开发者ID:brandtg,项目名称:dropwizard-helix,代码行数:14,代码来源:TestHelixServiceDiscoveryBundle.java


示例2: startController

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
void startController() throws Exception {
  // start helixController
  System.out.println(String.format("Starting Controller{Cluster:%s, Port:%s, Zookeeper:%s}",
      clusterName, 12000, ZK_ADDR));
  HelixManager helixController =
      HelixControllerMain.startHelixController(ZK_ADDR, clusterName, "localhost_" + 12000,
          HelixControllerMain.STANDALONE);

  StatusPrinter statusPrinter = new StatusPrinter();
  statusPrinter.registerWith(helixController);
}
 
开发者ID:apache,项目名称:helix,代码行数:12,代码来源:TestMessageThrottle2.java


示例3: main

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
public static void main(String[] args) {
  if (args.length < 1) {
    System.err.println("USAGE: java StartClusterManager zookeeperAddress (e.g. localhost:2181)");
    System.exit(1);
  }

  final String clusterName = SetupConsumerCluster.DEFAULT_CLUSTER_NAME;
  final String zkAddr = args[0];

  try {
    final HelixManager manager =
        HelixControllerMain.startHelixController(zkAddr, clusterName, null,
            HelixControllerMain.STANDALONE);

    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        System.out.println("Shutting down cluster manager: " + manager.getInstanceName());
        manager.disconnect();
      }
    });

    Thread.currentThread().join();
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
 
开发者ID:apache,项目名称:helix,代码行数:29,代码来源:StartClusterManager.java


示例4: startController

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
private static void startController(String zkAddr, String clusterName) throws Exception {
  final HelixManager manager =
      HelixControllerMain.startHelixController(zkAddr, clusterName, null,
          HelixControllerMain.STANDALONE);

  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    public void run() {
      System.out.println("Shutting down cluster manager: " + manager.getInstanceName());
      manager.disconnect();
    }
  });
}
 
开发者ID:apache,项目名称:helix,代码行数:14,代码来源:TaskExecutionDemo.java


示例5: main

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
public static void main(String[] args) {
  if (args.length < 1) {
    System.err.println("USAGE: java StartClusterManager zookeeperAddress (e.g. localhost:2181)");
    System.exit(1);
  }

  final String clusterName = SetupCluster.DEFAULT_CLUSTER_NAME;
  final String zkAddr = args[0];

  try {
    final HelixManager manager =
        HelixControllerMain.startHelixController(zkAddr, clusterName, null,
            HelixControllerMain.STANDALONE);

    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
      public void run() {
        System.out.println("Shutting down cluster manager: " + manager.getInstanceName());
        manager.disconnect();
      }
    });

    Thread.currentThread().join();
  } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}
 
开发者ID:apache,项目名称:helix,代码行数:29,代码来源:StartClusterManager.java


示例6: startHelixControllerInStandadloneMode

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
private static HelixManager startHelixControllerInStandadloneMode(String helixClusterName,
    String zkUrl, String controllerInstanceId) {
  LOGGER.info("Starting Helix Standalone Controller ... ");
  return HelixControllerMain.startHelixController(zkUrl, helixClusterName, controllerInstanceId,
      HelixControllerMain.STANDALONE);
}
 
开发者ID:uber,项目名称:uReplicator,代码行数:7,代码来源:HelixSetupUtils.java


示例7: startHelixControllerInStandadloneMode

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
private static HelixManager startHelixControllerInStandadloneMode(String helixClusterName, String zkUrl,
    String pinotControllerInstanceId) {
  LOGGER.info("Starting Helix Standalone Controller ... ");
  return HelixControllerMain.startHelixController(zkUrl, helixClusterName, pinotControllerInstanceId,
      HelixControllerMain.STANDALONE);
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:7,代码来源:HelixSetupUtils.java


示例8: startController

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
private static HelixManager startController(String zkAddr, String clusterName) {
  HelixManager helixControllerManager =
      HelixControllerMain.startHelixController(zkAddr, clusterName, "localhost_9100",
          HelixControllerMain.STANDALONE);
  return helixControllerManager;
}
 
开发者ID:kishoreg,项目名称:fullmatix,代码行数:7,代码来源:MysqlIntegrationTest.java


示例9: startController

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
public static void startController() {
  // start controller
  echo("Starting Helix Controller");
  HelixControllerMain.startHelixController(ZK_ADDRESS, CLUSTER_NAME, "localhost_9100",
      HelixControllerMain.STANDALONE);
}
 
开发者ID:apache,项目名称:helix,代码行数:7,代码来源:Quickstart.java


示例10: startController

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
private void startController() {
  controllerManager =
      HelixControllerMain.startHelixController(zkAddress, clusterName, "controller",
          HelixControllerMain.STANDALONE);
}
 
开发者ID:apache,项目名称:helix,代码行数:6,代码来源:LockProcess.java


示例11: main

import org.apache.helix.controller.HelixControllerMain; //导入依赖的package包/类
/**
 * LockManagerDemo clusterName, numInstances, lockGroupName, numLocks
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
  final String zkAddress = "localhost:2199";
  final String clusterName = "lock-manager-demo";
  final String lockGroupName = "lock-group";
  final int numInstances = 3;
  final int numPartitions = 12;
  final boolean startController = false;
  HelixManager controllerManager = null;
  Thread[] processArray;
  processArray = new Thread[numInstances];
  try {
    startLocalZookeeper(2199);
    HelixAdmin admin = new ZKHelixAdmin(zkAddress);
    admin.addCluster(clusterName, true);
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    admin.addStateModelDef(clusterName, "OnlineOffline",
        new StateModelDefinition(generator.generateConfigForOnlineOffline()));
    admin.addResource(clusterName, lockGroupName, numPartitions, "OnlineOffline",
        RebalanceMode.FULL_AUTO.toString());
    admin.rebalance(clusterName, lockGroupName, 1);
    for (int i = 0; i < numInstances; i++) {
      final String instanceName = "localhost_" + (12000 + i);
      processArray[i] = new Thread(new Runnable() {

        @Override
        public void run() {
          LockProcess lockProcess = null;

          try {
            lockProcess = new LockProcess(clusterName, zkAddress, instanceName, startController);
            lockProcess.start();
            Thread.currentThread().join();
          } catch (InterruptedException e) {
            System.out.println(instanceName + "Interrupted");
            if (lockProcess != null) {
              lockProcess.stop();
            }
          } catch (Exception e) {
            e.printStackTrace();
          }
        }

      });
      processArray[i].start();
    }
    Thread.sleep(3000);
    controllerManager =
        HelixControllerMain.startHelixController(zkAddress, clusterName, "controller",
            HelixControllerMain.STANDALONE);
    Thread.sleep(5000);
    printStatus(admin, clusterName, lockGroupName);
    System.out.println("Stopping localhost_12000");
    processArray[0].interrupt();
    Thread.sleep(3000);
    printStatus(admin, clusterName, lockGroupName);
    Thread.currentThread().join();
  } catch (Exception e) {
    e.printStackTrace();
  } finally {
    if (controllerManager != null) {
      controllerManager.disconnect();
    }
    for (Thread process : processArray) {
      if (process != null) {
        process.interrupt();
      }
    }
  }
}
 
开发者ID:apache,项目名称:helix,代码行数:75,代码来源:LockManagerDemo.java



注:本文中的org.apache.helix.controller.HelixControllerMain类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BeginIndexAnnotation类代码示例发布时间:2022-05-23
下一篇:
Java ParserFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap