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


Java Configuration.setEnum方法代码示例

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


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

示例1: setCompressionStrategy

import org.apache.hadoop.conf.Configuration; //导入方法依赖的package包/类
public static void setCompressionStrategy(Configuration conf,
    CompressionStrategy strategy) {
  conf.setEnum("zlib.compress.strategy", strategy);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:5,代码来源:ZlibFactory.java

示例2: setCompressionLevel

import org.apache.hadoop.conf.Configuration; //导入方法依赖的package包/类
public static void setCompressionLevel(Configuration conf,
    CompressionLevel level) {
  conf.setEnum("zlib.compress.level", level);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:5,代码来源:ZlibFactory.java

示例3: doSubmission

import org.apache.hadoop.conf.Configuration; //导入方法依赖的package包/类
protected void doSubmission(String jobCreatorName, boolean defaultOutputPath)
        throws Exception {
  final Path in = new Path("foo").makeQualified(
          GridmixTestUtils.dfs.getUri(),
          GridmixTestUtils.dfs.getWorkingDirectory());
  final Path out = GridmixTestUtils.DEST.makeQualified(
          GridmixTestUtils.dfs.getUri(),
          GridmixTestUtils.dfs.getWorkingDirectory());
  final Path root = new Path(workspace.getName()).makeQualified(
      GridmixTestUtils.dfs.getUri(), GridmixTestUtils.dfs.getWorkingDirectory());
  if (!workspace.exists()) {
    assertTrue(workspace.mkdirs());
  }
  Configuration conf = null;

  try {
    ArrayList<String> argsList = new ArrayList<String>();

    argsList.add("-D" + FilePool.GRIDMIX_MIN_FILE + "=0");
    argsList.add("-D" + Gridmix.GRIDMIX_USR_RSV + "="
            + EchoUserResolver.class.getName());
    if (jobCreatorName != null) {
      argsList.add("-D" + JobCreator.GRIDMIX_JOB_TYPE + "=" + jobCreatorName);
    }

    // Set the config property gridmix.output.directory only if
    // defaultOutputPath is false. If defaultOutputPath is true, then
    // let us allow gridmix to use the path foo/gridmix/ as output dir.
    if (!defaultOutputPath) {
      argsList.add("-D" + Gridmix.GRIDMIX_OUT_DIR + "=" + out);
    }
    argsList.add("-generate");
    argsList.add(String.valueOf(GENDATA) + "m");
    argsList.add(in.toString());
    argsList.add("-"); // ignored by DebugGridmix

    String[] argv = argsList.toArray(new String[argsList.size()]);

    DebugGridmix client = new DebugGridmix();
    conf = GridmixTestUtils.mrvl.getConfig();

    CompressionEmulationUtil.setCompressionEmulationEnabled(conf, true);
    conf.setEnum(GridmixJobSubmissionPolicy.JOB_SUBMISSION_POLICY, policy);

    conf.setBoolean(GridmixJob.GRIDMIX_USE_QUEUE_IN_TRACE, true);
    UserGroupInformation ugi = UserGroupInformation.getLoginUser();
    conf.set(MRJobConfig.USER_NAME, ugi.getUserName());

    // allow synthetic users to create home directories
    GridmixTestUtils.dfs.mkdirs(root, new FsPermission((short) 777));
    GridmixTestUtils.dfs.setPermission(root, new FsPermission((short) 777));

    int res = ToolRunner.run(conf, client, argv);
    assertEquals("Client exited with nonzero status", 0, res);
    client.checkMonitor();
  } catch (Exception e) {
    e.printStackTrace();
  } finally {
    in.getFileSystem(conf).delete(in, true);
    out.getFileSystem(conf).delete(out, true);
    root.getFileSystem(conf).delete(root, true);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:64,代码来源:CommonJobTest.java


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