org.apache.storm.Config.getBlobstoreHDFSPrincipal()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(116)

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

Config.getBlobstoreHDFSPrincipal介绍

暂无

代码示例

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

String principal = Config.getBlobstoreHDFSPrincipal(conf);
String keyTab = (String) conf.get(Config.BLOBSTORE_HDFS_KEYTAB);

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

@Test
  public void getBlobstoreHDFSPrincipal() throws UnknownHostException {
    Map<String, Object> conf = mockMap(Config.BLOBSTORE_HDFS_PRINCIPAL, "primary/_HOST@EXAMPLE.COM");
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), "primary/" +  Utils.localHostname() + "@EXAMPLE.COM");

    String principal = "primary/_HOST_HOST@EXAMPLE.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);

    principal = "primary/_HOST2@EXAMPLE.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);

    principal = "_HOST/instance@EXAMPLE.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);

    principal = "primary/instance@_HOST.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);

    principal = "_HOST@EXAMPLE.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);

    principal = "primary/instance@EXAMPLE.COM";
    conf.put(Config.BLOBSTORE_HDFS_PRINCIPAL, principal);
    Assert.assertEquals(Config.getBlobstoreHDFSPrincipal(conf), principal);
  }
}

相关文章