English 中文(简体)
Hadoop:如何找出分部分 缩略语
原标题:Hadoop: How to find out the partition_Id in reduce step using Context object

在Hadoop AP ver 0.20和超过背景标语时,采用了“工作合同”。

我需要利用背景物体:

  1. B. 分配——目前减少

  2. 产出倍数

Using obsoleted JobConf I can find B. 分配——目前减少by this:

public void configure(JobConf conf){
  int  current_partition = conf.getInt("mapred.task.partition",-1);
}

我认为,利用背景目标,我需要在方法内这样做。

public void setup(Context c)

但情况如何? 产出的名称是什么?

问题回答

如果你想要获得分治,你可以使用环境。 这项任务由分配额制设立。 http://www.grepcode.com


public TaskImpl(JobId jobId, TaskType taskType, int partition,
    EventHandler eventHandler, Path remoteJobConfFile, JobConf conf,
    TaskAttemptListener taskAttemptListener, OutputCommitter committer,
    Token jobToken,
    Credentials credentials, Clock clock,
    Map completedTasksFromPreviousRun, int startCount,
    MRAppMetrics metrics, AppContext appContext) {
  this.conf = conf;
  this.clock = clock;
  this.jobFile = remoteJobConfFile;
  ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
  readLock = readWriteLock.readLock();
  writeLock = readWriteLock.writeLock();
  this.attempts = Collections.emptyMap();
  maxAttempts = getMaxAttempts();
  taskId = MRBuilderUtils.newTaskId(jobId, partition, taskType);
  this.partition = partition;
  ...
}

public static TaskId newTaskId(JobId jobId, int id, TaskType taskType) {
  TaskId taskId = Records.newRecord(TaskId.class);
  taskId.setJobId(jobId);
  taskId.setId(id);
  taskId.setTaskType(taskType);
  return taskId;
}

你可以尝试在即将获得的数据的第一关键方面执行你的分治班,而你最终会有一些目前的减员。

“材料夹”不是出租人的财产。 严格说来,它拥有的是外层空间财产,除此以外,任何人都不知道它是否“产出夹”——例如,它可能以某种形式向RDBMS输出。 简而言之,基于民共体的产出,它拥有整个地图缩减工作的财产,因此通常可以从《工作背景》中找到,即从《工作背景》中获取。

c.getConfiguration().get("mapred.output.dir")

很可能使你获得你产出目录的URL。





相关问题
Hadoop - namenode is not starting up

I am trying to run hadoop as a root user, i executed namenode format command hadoop namenode -format when the Hadoop file system is running. After this, when i try to start the name node server, it ...

What default reducers are available in Elastic MapReduce?

I hope I m asking this in the right way. I m learning my way around Elastic MapReduce and I ve seen numerous references to the "Aggregate" reducer that can be used with "Streaming" job flows. In ...

Establishing Eclipse project environment for HadoopDB

I have checked-out a project from SourceForge named HadoopDB. It uses some class in another project named Hive. I have used Eclipse Java build path setting to link source to the Hive project root ...

Hadoop: intervals and JOIN

I m very new to Hadoop and I m currently trying to join two sources of data where the key is an interval (say [date-begin/date-end]). For example: input1: 20091001-20091002 A 20091011-20091104 ...

hadoop- determine if a file is being written to

Is there a way to determine if a file in hadoop is being written to? eg- I have a process that puts logs into hdfs. I have another process that monitors for the existence of new logs in hdfs, but I ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn t match expected Content Length for http://...

热门标签