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


Java DistCpUtils.getInt方法代码示例

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


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

示例1: getSplits

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
/**
 * Implementation of InputFormat::getSplits(). Returns a list of InputSplits,
 * such that the number of bytes to be copied for all the splits are
 * approximately equal.
 * @param context JobContext for the job.
 * @return The list of uniformly-distributed input-splits.
 * @throws IOException
 * @throws InterruptedException
 */
@Override
public List<InputSplit> getSplits(JobContext context)
                    throws IOException, InterruptedException {
  Configuration configuration = context.getConfiguration();
  int numSplits = DistCpUtils.getInt(configuration,
                                     JobContext.NUM_MAPS);

  if (numSplits == 0) return new ArrayList<InputSplit>();

  return getSplits(configuration, numSplits,
                   DistCpUtils.getLong(configuration,
                        DistCpConstants.CONF_LABEL_TOTAL_BYTES_TO_BE_COPIED));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:UniformSizeInputFormat.java

示例2: getSplits

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
/**
 * Implementation of InputFormat::getSplits(). Returns a list of InputSplits,
 * such that the number of bytes to be copied for all the splits are
 * approximately equal.
 * @param context JobContext for the job.
 * @return The list of uniformly-distributed input-splits.
 * @throws IOException: On failure.
 * @throws InterruptedException
 */
@Override
public List<InputSplit> getSplits(JobContext context)
                    throws IOException, InterruptedException {
  Configuration configuration = context.getConfiguration();
  int numSplits = DistCpUtils.getInt(configuration,
                                     JobContext.NUM_MAPS);

  if (numSplits == 0) return new ArrayList<InputSplit>();

  return getSplits(configuration, numSplits,
                   DistCpUtils.getLong(configuration,
                        DistCpConstants.CONF_LABEL_TOTAL_BYTES_TO_BE_COPIED));
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:23,代码来源:UniformSizeInputFormat.java

示例3: getNumberOfRecords

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
private static int getNumberOfRecords(Configuration configuration) {
  return DistCpUtils.getInt(configuration,
                            DistCpConstants.CONF_LABEL_TOTAL_NUMBER_OF_RECORDS);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DynamicInputFormat.java

示例4: getNumMapTasks

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
private static int getNumMapTasks(Configuration configuration) {
  return DistCpUtils.getInt(configuration,
                            JobContext.NUM_MAPS);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DynamicInputFormat.java

示例5: getNumEntriesPerChunk

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
static int getNumEntriesPerChunk(Configuration configuration) {
  return DistCpUtils.getInt(configuration,
                            CONF_LABEL_NUM_ENTRIES_PER_CHUNK);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DynamicInputFormat.java

示例6: getTotalNumRecords

import org.apache.hadoop.tools.util.DistCpUtils; //导入方法依赖的package包/类
private int getTotalNumRecords() {
  return DistCpUtils.getInt(configuration,
                            DistCpConstants.CONF_LABEL_TOTAL_NUMBER_OF_RECORDS);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DynamicRecordReader.java


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