RMContainerAllocator extends RMContainerRequestor implements ContainerAllocator { void handleJobPriorityChange(AllocateResponse response) { Priority applicationPriority = response.getApplicationPriority(); if (null != applicationPriority) { Priority priorityFromResponse = Priority .newInstance(applicationPriority.getPriority()); getJob().setJobPriority(priorityFromResponse); } } RMContainerAllocator(ClientService clientService, AppContext context,
      AMPreemptionPolicy preemptionPolicy); boolean getIsReduceStarted(); void setIsReduceStarted(boolean reduceStarted); @Override void handle(ContainerAllocatorEvent event); @Private void scheduleReduces(
      int totalMaps, int completedMaps,
      int scheduledMaps, int scheduledReduces,
      int assignedMaps, int assignedReduces,
      Resource mapResourceReqt, Resource reduceResourceReqt,
      int numPendingReduces,
      float maxReduceRampupLimit, float reduceSlowStart); @Private void scheduleAllReduces(); @Private void rampUpReduces(int rampUp); @Private void rampDownReduces(int rampDown); @VisibleForTesting TaskAttemptEvent createContainerFinishedEvent(ContainerStatus cont,
      TaskAttemptId attemptId); @Private Resource getResourceLimit(); static final float DEFAULT_COMPLETED_MAPS_PERCENT_FOR_REDUCE_SLOWSTART; @VisibleForTesting
  static final String RAMPDOWN_DIAGNOSTIC; }
@Test public void testIfApplicationPriorityIsNotSet() { Job mockJob = mock(Job.class); RMCommunicator communicator = mock(RMCommunicator.class); ClientService service = mock(ClientService.class); AppContext context = mock(AppContext.class); AMPreemptionPolicy policy = mock(AMPreemptionPolicy.class); when(communicator.getJob()).thenReturn(mockJob); RMContainerAllocator allocator = new RMContainerAllocator(service, context, policy); AllocateResponse response = Records.newRecord(AllocateResponse.class); allocator.handleJobPriorityChange(response); }