Tabnine Logo
TaskAttemptStatusUpdateEvent.getTaskAttemptStatusRef
Code IndexAdd Tabnine to your IDE (free)

How to use
getTaskAttemptStatusRef
method
in
org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptStatusUpdateEvent

Best Java code snippets using org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptStatusUpdateEvent.getTaskAttemptStatusRef (Showing top 3 results out of 315)

origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Test
public void testSingleStatusUpdate()
  throws IOException, InterruptedException {
 configureMocks();
 startListener(true);
 listener.statusUpdate(attemptID, firstReduceStatus);
 verify(ea).handle(eventCaptor.capture());
 TaskAttemptStatusUpdateEvent updateEvent =
   (TaskAttemptStatusUpdateEvent) eventCaptor.getValue();
 TaskAttemptStatus status = updateEvent.getTaskAttemptStatusRef().get();
 assertTrue(status.fetchFailedMaps.contains(TASKATTEMPTID1));
 assertEquals(1, status.fetchFailedMaps.size());
 assertEquals(Phase.SHUFFLE, status.phase);
}
origin: org.apache.hadoop/hadoop-mapreduce-client-app

 @SuppressWarnings("unchecked")
 @Override
 public void transition(TaskAttemptImpl taskAttempt, 
   TaskAttemptEvent event) {
  TaskAttemptStatusUpdateEvent statusEvent =
    ((TaskAttemptStatusUpdateEvent)event);
  AtomicReference<TaskAttemptStatus> taskAttemptStatusRef =
    statusEvent.getTaskAttemptStatusRef();
  TaskAttemptStatus newReportedStatus =
    taskAttemptStatusRef.getAndSet(null);
  // Now switch the information in the reportedStatus
  taskAttempt.reportedStatus = newReportedStatus;
  taskAttempt.reportedStatus.taskState = taskAttempt.getState();
  // send event to speculator about the reported status
  taskAttempt.eventHandler.handle
    (new SpeculatorEvent
      (taskAttempt.reportedStatus, taskAttempt.clock.getTime()));
  taskAttempt.updateProgressSplits();
  //if fetch failures are present, send the fetch failure event to job
  //this only will happen in reduce attempt type
  if (taskAttempt.reportedStatus.fetchFailedMaps != null &&
    taskAttempt.reportedStatus.fetchFailedMaps.size() > 0) {
   String hostname = taskAttempt.container == null ? "UNKNOWN"
     : taskAttempt.container.getNodeId().getHost();
   taskAttempt.eventHandler.handle(new JobTaskAttemptFetchFailureEvent(
     taskAttempt.attemptId, taskAttempt.reportedStatus.fetchFailedMaps,
       hostname));
  }
 }
}
origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Test
public void testCoalescedStatusUpdatesCleared()
  throws IOException, InterruptedException {
 // First two events are coalesced, the third is not
 configureMocks();
 startListener(true);
 listener.statusUpdate(attemptID, firstReduceStatus);
 listener.statusUpdate(attemptID, secondReduceStatus);
 ConcurrentMap<TaskAttemptId,
   AtomicReference<TaskAttemptStatus>> attemptIdToStatus =
   listener.getAttemptIdToStatus();
 attemptIdToStatus.get(attemptId).set(null);
 listener.statusUpdate(attemptID, thirdReduceStatus);
 verify(ea, times(2)).handle(eventCaptor.capture());
 TaskAttemptStatusUpdateEvent updateEvent =
   (TaskAttemptStatusUpdateEvent) eventCaptor.getValue();
 TaskAttemptStatus status = updateEvent.getTaskAttemptStatusRef().get();
 assertNull(status.fetchFailedMaps);
 assertEquals(Phase.REDUCE, status.phase);
}
org.apache.hadoop.mapreduce.v2.app.job.eventTaskAttemptStatusUpdateEventgetTaskAttemptStatusRef

Popular methods of TaskAttemptStatusUpdateEvent

  • <init>
  • getReportedTaskAttemptStatus

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Kernel (java.awt.image)
  • Path (java.nio.file)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ImageIO (javax.imageio)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now