Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.TaskAttemptID


    ArrayList<TaskCompletionEvent> tceList =
        new ArrayList<TaskCompletionEvent>(numEvents);
    for (int i = 0; i < numEvents; ++i) {
      int eventIdx = startIdx + i;
      TaskCompletionEvent tce = new TaskCompletionEvent(eventIdx,
          new TaskAttemptID("12345", 1, TaskType.MAP, eventIdx, 0),
          eventIdx, true, TaskCompletionEvent.Status.SUCCEEDED,
          "http://somehost:8888");
      tceList.add(tce);
    }
    TaskCompletionEvent[] events = {};
View Full Code Here


    }
    cmd.add(executable);
    // wrap the command in a stdout/stderr capture
    // we are starting map/reduce task of the pipes job. this is not a cleanup
    // attempt.
    TaskAttemptID taskid =
      TaskAttemptID.forName(conf.get(MRJobConfig.TASK_ATTEMPT_ID));
    File stdout = TaskLog.getTaskLogFile(taskid, false, TaskLog.LogName.STDOUT);
    File stderr = TaskLog.getTaskLogFile(taskid, false, TaskLog.LogName.STDERR);
    long logLength = TaskLog.getTaskLogLength(conf);
    cmd = TaskLog.captureOutAndError(null, cmd, stdout, stderr, logLength,
View Full Code Here

        File pearFile = new File(urlPEAR.getPath());

        // should check whether a different mapper has already unpacked it
        // but for now we just unpack in a different location for every mapper
        TaskAttemptID attempt = TaskAttemptID.forName(conf
                .get("mapred.task.id"));
        installDir = new File(pearFile.getParentFile(), attempt.toString());
        PackageBrowser instPear = PackageInstaller.installPackage(installDir,
                pearFile, true);

        // get the resources required for the AnalysisEngine
        org.apache.uima.resource.ResourceManager rsrcMgr = UIMAFramework
View Full Code Here

    String executable = DistributedCache.getLocalCacheFiles(conf)[0].toString();
    FileUtil.chmod(executable, "a+x");
    cmd.add(executable);
    // wrap the command in a stdout/stderr capture
    TaskAttemptID taskid = TaskAttemptID.forName(conf.get("mapred.task.id"));
    File stdout = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDOUT);
    File stderr = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.STDERR);
    long logLength = TaskLog.getTaskLogLength(conf);
    cmd = TaskLog.captureOutAndError(null, cmd, stdout, stderr, logLength,
        false);
View Full Code Here

                  cr.getLocation().getTaskAttemptId() + " from host: " +
                  cr.getHost());
              retryFetches.add(cr.getLocation());

              // note the failed-fetch
              TaskAttemptID mapTaskId = cr.getLocation().getTaskAttemptId();
              TaskID mapId = cr.getLocation().getTaskId();

              totalFailures++;
              Integer noFailedFetches =
                mapTaskToFailedFetchesMap.get(mapTaskId);
View Full Code Here

                              MapOutputLocation loc)
                              throws IOException, InterruptedException {
        // a temp filename. If this file gets created in ramfs, we're fine,
        // else, we will check the localFS to find a suitable final location
        // for this path
        TaskAttemptID reduceId = reduceTask.getTaskID();
        Path filename = new Path("/" + TaskTracker.getIntermediateOutputDir(
                                 reduceId.getJobID().toString(),
                                 reduceId.toString())
                                 + "/map_" +
                                 loc.getTaskId().getId() + ".out");

        // Copy the map output to a temp file whose name is unique to this attempt
        Path tmpMapOutput = new Path(filename+"-"+id);
        MapOutputStatus mapOutputStatus = getMapOutput(
            connection, input, loc, tmpMapOutput, reduceId.getTaskID().getId());
        loc.errorType = mapOutputStatus.errorType;
        if (loc.errorType == CopyOutputErrorType.NO_ERROR) {
          shuffleClientMetrics.successFetch();
        } else if (loc.errorType == CopyOutputErrorType.SERIOUS_ERROR) {
          shuffleClientMetrics.seriousFailureFetch();
View Full Code Here

                                           DataInputStream input,
                                           MapOutputLocation mapOutputLoc,
                                           Path filename, int reduce)
      throws IOException, InterruptedException {
        // Read the shuffle header and validate header
        TaskAttemptID mapId = null;
        long decompressedLength = -1;
        long compressedLength = -1;
        int forReduce = -1;
        boolean found = false;
        try {
          ShuffleHeader header = new ShuffleHeader();
          header.readFields(input);
          // Special case where the map output was not found
          if (header.found == false) {
            LOG.warn("getMapOutput: Header for " + mapOutputLoc + " indicates" +
                "the map output can't be found, indicating a serious error.");
            return new MapOutputStatus(null,
                CopyOutputErrorType.SERIOUS_ERROR,
                ErrorRootCause.DATA_CORRUPTION);
          }
          mapId = TaskAttemptID.forName(header.mapId);
          compressedLength = header.compressedLength;
          decompressedLength = header.uncompressedLength;
          forReduce = header.forReduce;
        } catch (IllegalArgumentException e) {
          LOG.warn(getName() + " Invalid map id (maybe protocol mismatch)", e);
          return new MapOutputStatus(null, CopyOutputErrorType.SERIOUS_ERROR,
            ErrorRootCause.DATA_CORRUPTION);
        }
        if (mapId == null) {
          LOG.warn("Missing header " + FROM_MAP_TASK + " in response for " +
            connection.getURL());
          return new MapOutputStatus(null, CopyOutputErrorType.SERIOUS_ERROR,
            ErrorRootCause.DATA_CORRUPTION);
        }
        TaskAttemptID expectedMapId = mapOutputLoc.getTaskAttemptId();
        if (!mapId.equals(expectedMapId)) {
          LOG.warn(getName() + " data from wrong map:" + mapId +
              " arrived to reduce task " + reduce +
              ", where as expected map output should be from " + expectedMapId);
          return new MapOutputStatus(null, CopyOutputErrorType.SERIOUS_ERROR,
View Full Code Here

          switch (event.getTaskStatus()) {
            case SUCCEEDED:
            {
              URI u = URI.create(event.getTaskTrackerHttp());
              String host = u.getHost();
              TaskAttemptID taskId = event.getTaskAttemptId();
              List<MapOutputLocation> loc = mapLocations.get(host);
              if (loc == null) {
                loc = Collections.synchronizedList
                  (new LinkedList<MapOutputLocation>());
                mapLocations.put(host, loc);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.TaskAttemptID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.