当前位置: 首页>>代码示例>>Java>>正文


Java HadoopUsersConfTestHelper.getBaseConf方法代码示例

本文整理汇总了Java中org.apache.hadoop.test.HadoopUsersConfTestHelper.getBaseConf方法的典型用法代码示例。如果您正苦于以下问题:Java HadoopUsersConfTestHelper.getBaseConf方法的具体用法?Java HadoopUsersConfTestHelper.getBaseConf怎么用?Java HadoopUsersConfTestHelper.getBaseConf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.test.HadoopUsersConfTestHelper的用法示例。


在下文中一共展示了HadoopUsersConfTestHelper.getBaseConf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startMiniDFS

import org.apache.hadoop.test.HadoopUsersConfTestHelper; //导入方法依赖的package包/类
/**
 * Fire up our own hand-rolled MiniDFSCluster.  We do this here instead
 * of relying on TestHdfsHelper because we don't want to turn on ACL
 * support.
 *
 * @throws Exception
 */
private void startMiniDFS() throws Exception {

  File testDirRoot = TestDirHelper.getTestDir();

  if (System.getProperty("hadoop.log.dir") == null) {
    System.setProperty("hadoop.log.dir",
            new File(testDirRoot, "hadoop-log").getAbsolutePath());
  }
  if (System.getProperty("test.build.data") == null) {
    System.setProperty("test.build.data",
            new File(testDirRoot, "hadoop-data").getAbsolutePath());
  }

  Configuration conf = HadoopUsersConfTestHelper.getBaseConf();
  HadoopUsersConfTestHelper.addUserConf(conf);
  conf.set("fs.hdfs.impl.disable.cache", "true");
  conf.set("dfs.block.access.token.enable", "false");
  conf.set("dfs.permissions", "true");
  conf.set("hadoop.security.authentication", "simple");

  // Explicitly turn off ACL support
  conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, false);

  MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf);
  builder.numDataNodes(2);
  miniDfs = builder.build();
  nnConf = miniDfs.getConfiguration(0);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:36,代码来源:TestHttpFSServerNoACLs.java

示例2: startMiniDFS

import org.apache.hadoop.test.HadoopUsersConfTestHelper; //导入方法依赖的package包/类
/**
 * Fire up our own hand-rolled MiniDFSCluster.  We do this here instead
 * of relying on TestHdfsHelper because we don't want to turn on XAttr
 * support.
 *
 * @throws Exception
 */
private void startMiniDFS() throws Exception {

  File testDirRoot = TestDirHelper.getTestDir();

  if (System.getProperty("hadoop.log.dir") == null) {
    System.setProperty("hadoop.log.dir",
            new File(testDirRoot, "hadoop-log").getAbsolutePath());
  }
  if (System.getProperty("test.build.data") == null) {
    System.setProperty("test.build.data",
            new File(testDirRoot, "hadoop-data").getAbsolutePath());
  }

  Configuration conf = HadoopUsersConfTestHelper.getBaseConf();
  HadoopUsersConfTestHelper.addUserConf(conf);
  conf.set("fs.hdfs.impl.disable.cache", "true");
  conf.set("dfs.block.access.token.enable", "false");
  conf.set("dfs.permissions", "true");
  conf.set("hadoop.security.authentication", "simple");

  // Explicitly turn off XAttr support
  conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_XATTRS_ENABLED_KEY, false);

  MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf);
  builder.numDataNodes(2);
  miniDfs = builder.build();
  nnConf = miniDfs.getConfiguration(0);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:36,代码来源:TestHttpFSServerNoXAttrs.java


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