gpt4 book ai didi

org.apache.whirr.service.zookeeper.ZooKeeperCluster.getHosts()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 01:37:31 26 4
gpt4 key购买 nike

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

ZooKeeperCluster.getHosts介绍

暂无

代码示例

代码示例来源:origin: apache/attic-whirr

public static String getHosts(Cluster cluster) {
  return getHosts(cluster, false);
 }
}

代码示例来源:origin: org.apache.whirr/whirr-zookeeper

public static String getHosts(Cluster cluster) {
  return getHosts(cluster, false);
 }
}

代码示例来源:origin: apache/attic-whirr

static Configuration buildHBaseSiteConfiguration(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults)
  throws ConfigurationException, IOException {
 Configuration config = build(clusterSpec, cluster, defaults, "hbase-site");
 Cluster.Instance master = cluster.getInstanceMatching(
  role(HBaseMasterClusterActionHandler.ROLE));
 String masterHostName = master.getPublicHostName();
 config.setProperty("hbase.rootdir", String.format("hdfs://%s:8020/hbase", masterHostName));
 config.setProperty("hbase.zookeeper.quorum", ZooKeeperCluster.getHosts(cluster));
 return config;
}

代码示例来源:origin: apache/attic-whirr

@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
 Instance instance = cluster.getInstanceMatching(role(ROLE));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 LOG.info("BSPMaster web UI available at http://{}:{}", masterPublicAddress
   .getHostName(), MASTER_WEB_UI_PORT);
 String quorum = ZooKeeperCluster.getHosts(cluster);
 Properties config = createClientSideProperties(masterPublicAddress, quorum);
 createClientSideHadoopSiteFile(clusterSpec, config);
 createProxyScript(clusterSpec, cluster);
 event.setCluster(new Cluster(cluster.getInstances(), config));
}

代码示例来源:origin: org.apache.whirr/whirr-hama

@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
 Instance instance = cluster.getInstanceMatching(role(ROLE));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 LOG.info("BSPMaster web UI available at http://{}:{}", masterPublicAddress
   .getHostName(), MASTER_WEB_UI_PORT);
 String quorum = ZooKeeperCluster.getHosts(cluster);
 Properties config = createClientSideProperties(masterPublicAddress, quorum);
 createClientSideHadoopSiteFile(clusterSpec, config);
 createProxyScript(clusterSpec, cluster);
 event.setCluster(new Cluster(cluster.getInstances(), config));
}

代码示例来源:origin: apache/attic-whirr

@Override
protected void afterConfigure(ClusterActionEvent event) throws IOException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 // TODO: wait for regionservers to come up?
 LOG.info("Completed configuration of {}", clusterSpec.getClusterName());
 Instance instance = cluster.getInstanceMatching(role(ROLE));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 LOG.info("Web UI available at http://{}", masterPublicAddress.getHostName());
 String quorum = ZooKeeperCluster.getHosts(cluster);
 Properties config = createClientSideProperties(masterPublicAddress, quorum);
 createClientSideHadoopSiteFile(clusterSpec, config);
 createProxyScript(clusterSpec, cluster);
 event.setCluster(new Cluster(cluster.getInstances(), config));
}

代码示例来源:origin: apache/attic-whirr

@Before
public void setUp() throws Exception {
 CompositeConfiguration config = new CompositeConfiguration();
 if (System.getProperty("config") != null) {
  config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
 }
 config.addConfiguration(new PropertiesConfiguration("whirr-zookeeper-cdh-test.properties"));
 clusterSpec = ClusterSpec.withTemporaryKeys(config);
 controller = new ClusterController();
 
 cluster = controller.launchCluster(clusterSpec);
 hosts = ZooKeeperCluster.getHosts(cluster);
}

代码示例来源:origin: apache/attic-whirr

String quorum = ZooKeeperCluster.getHosts(cluster);

代码示例来源:origin: apache/attic-whirr

String quorum = ZooKeeperCluster.getHosts(cluster);

代码示例来源:origin: apache/attic-whirr

@Before
public void setUp() throws Exception {
 CompositeConfiguration config = new CompositeConfiguration();
 if (System.getProperty("config") != null) {
  config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
 }
 config.addConfiguration(new PropertiesConfiguration("whirr-zookeeper-test.properties"));
 clusterSpec = ClusterSpec.withTemporaryKeys(config);
 controller = new ClusterControllerFactory().create(clusterSpec.getServiceName());
 
 cluster = controller.launchCluster(clusterSpec);
 hosts = ZooKeeperCluster.getHosts(cluster);
}

代码示例来源:origin: org.apache.whirr/whirr-druid

String quorum = ZooKeeperCluster.getHosts(cluster, true);
LOG.info("ZookeeperCluster.getHosts(cluster): " + quorum);

代码示例来源:origin: apache/attic-whirr

String quorum = ZooKeeperCluster.getHosts(cluster, true);
LOG.info("ZookeeperCluster.getHosts(cluster): " + quorum);

代码示例来源:origin: org.apache.whirr/whirr-hama

@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException,
  InterruptedException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 LOG.info("Authorizing firewall");
 Instance instance = cluster.getInstanceMatching(role(ROLE));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 event.getFirewallManager().addRules(
   Rule.create().destination(instance).ports(MASTER_WEB_UI_PORT),
   Rule.create().destination(instance).ports(MASTER_PORT));
 handleFirewallRules(event);
 
 String hamaConfigureFunction = getConfiguration(clusterSpec).getString(
   HamaConstants.KEY_CONFIGURE_FUNCTION,
   HamaConstants.FUNCTION_POST_CONFIGURE);
 String master = masterPublicAddress.getHostName();
 String quorum = ZooKeeperCluster.getHosts(cluster);
 String tarurl = prepareRemoteFileUrl(event, getConfiguration(clusterSpec)
   .getString(HamaConstants.KEY_TARBALL_URL));
 addStatement(event, call("retry_helpers"));
 addStatement(event, call(hamaConfigureFunction, ROLE,
   HamaConstants.PARAM_MASTER, master, HamaConstants.PARAM_QUORUM, quorum,
   HamaConstants.PARAM_TARBALL_URL, tarurl));
 String hamaStartFunction = getConfiguration(clusterSpec).getString(
   HamaConstants.KEY_START_FUNCTION, HamaConstants.FUNCTION_START);
 addStatement(event, call(hamaStartFunction, ROLE,
   HamaConstants.PARAM_TARBALL_URL, tarurl));
}

代码示例来源:origin: org.apache.whirr/whirr-hama

String quorum = ZooKeeperCluster.getHosts(cluster);

代码示例来源:origin: apache/attic-whirr

@Override
protected void beforeConfigure(ClusterActionEvent event)
  throws IOException, InterruptedException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 int port = defaultPort;
 if (configKeyPort != null) {
  port = getConfiguration(clusterSpec).getInt(configKeyPort, defaultPort);
 }
 Cluster.Instance instance = cluster.getInstanceMatching(role(role));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 event.getFirewallManager().addRule(
  Rule.create().destination(instance).port(port)
 );
 handleFirewallRules(event);
 
 String master = masterPublicAddress.getHostName();
 String quorum = ZooKeeperCluster.getHosts(cluster);
 String tarurl = prepareRemoteFileUrl(event,
  getConfiguration(clusterSpec).getString(HBaseConstants.KEY_TARBALL_URL));
 addStatement(event, call("retry_helpers"));
 addStatement(event, call(
  getConfigureFunction(getConfiguration(clusterSpec)),
  role,
  HBaseConstants.PARAM_MASTER, master,
  HBaseConstants.PARAM_QUORUM, quorum,
  HBaseConstants.PARAM_PORT, Integer.toString(port),
  HBaseConstants.PARAM_TARBALL_URL, tarurl)
 );
}

代码示例来源:origin: apache/attic-whirr

@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException,
  InterruptedException {
 ClusterSpec clusterSpec = event.getClusterSpec();
 Cluster cluster = event.getCluster();
 LOG.info("Authorizing firewall");
 Instance instance = cluster.getInstanceMatching(role(ROLE));
 InetAddress masterPublicAddress = instance.getPublicAddress();
 event.getFirewallManager().addRules(
   Rule.create().destination(instance).ports(MASTER_WEB_UI_PORT),
   Rule.create().destination(instance).ports(MASTER_PORT));
 handleFirewallRules(event);
 
 String hamaConfigureFunction = getConfiguration(clusterSpec).getString(
   HamaConstants.KEY_CONFIGURE_FUNCTION,
   HamaConstants.FUNCTION_POST_CONFIGURE);
 String master = masterPublicAddress.getHostName();
 String quorum = ZooKeeperCluster.getHosts(cluster);
 String tarurl = prepareRemoteFileUrl(event, getConfiguration(clusterSpec)
   .getString(HamaConstants.KEY_TARBALL_URL));
 addStatement(event, call("retry_helpers"));
 addStatement(event, call(hamaConfigureFunction, ROLE,
   HamaConstants.PARAM_MASTER, master, HamaConstants.PARAM_QUORUM, quorum,
   HamaConstants.PARAM_TARBALL_URL, tarurl));
 String hamaStartFunction = getConfiguration(clusterSpec).getString(
   HamaConstants.KEY_START_FUNCTION, HamaConstants.FUNCTION_START);
 addStatement(event, call(hamaStartFunction, ROLE,
   HamaConstants.PARAM_TARBALL_URL, tarurl));
}

代码示例来源:origin: apache/attic-whirr

String quorum = ZooKeeperCluster.getHosts(cluster);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com