azkaban.utils.Props.getStringListFromCluster()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(72)

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

Props.getStringListFromCluster介绍

[英]Returns a list of clusters with the comma as the separator of the value e.g., for input string: "thrift://hcat1:port,thrift://hcat2:port;thrift://hcat3:port,thrift://hcat4:port;" we will get ["thrift://hcat1:port,thrift://hcat2:port", "thrift://hcat3:port,thrift://hcat4:port"] as output
[中]返回以逗号作为值分隔符的群集列表,例如,用于输入字符串:thrift://hcat1:port,thrift://hcat2:port;thrift://hcat3:port,thrift://hcat4:port;“我们会thrift://hcat1:port,thrift://hcat2:port", "thrift://hcat3:port,thrift://hcat4:port“]作为输出

代码示例

代码示例来源:origin: azkaban/azkaban

@Test
 public void testSplit1() {
  String s1 = "thrift://hcat1:port,thrift://hcat2:port;thrift://hcat3:port,thrift://hcat4:port;";
  p.put(EXTRA_HCAT_CLUSTERS, s1);
  List<String> s2 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port");
  Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s2));

  String s3 = "thrift://hcat1:port,thrift://hcat2:port     ;      thrift://hcat3:port,thrift://hcat4:port;";
  p.put(EXTRA_HCAT_CLUSTERS, s3);
  List<String> s4 = Arrays.asList( "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port");
  Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s4));

  String s5 = "thrift://hcat1:port,thrift://hcat2:port";
  p.put(EXTRA_HCAT_CLUSTERS, s5);
  List<String> s6 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port");
  Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s6));
 }
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-hadoop-security-plugin

final List<String> extraHcatClusters = props.getStringListFromCluster(EXTRA_HCAT_CLUSTERS);
if (Collections.EMPTY_LIST != extraHcatClusters) {
 logger.info("Need to pre-fetch extra metaStore tokens from extra hive clusters.");

相关文章