private static void mergeAMWithUAM(AppInfo am, AppInfo uam) { am.setPreemptedResourceMB( am.getPreemptedResourceMB() + uam.getPreemptedResourceMB()); am.setPreemptedResourceVCores( am.getPreemptedResourceVCores() + uam.getPreemptedResourceVCores()); am.setNumNonAMContainerPreempted(am.getNumNonAMContainerPreempted() + uam.getNumNonAMContainerPreempted()); am.setNumAMContainerPreempted( am.getNumAMContainerPreempted() + uam.getNumAMContainerPreempted()); am.setPreemptedMemorySeconds( am.getPreemptedMemorySeconds() + uam.getPreemptedMemorySeconds()); am.setPreemptedVcoreSeconds( am.getPreemptedVcoreSeconds() + uam.getPreemptedVcoreSeconds()); if (am.getState() == YarnApplicationState.RUNNING && uam.getState() == am.getState()) { am.getResourceRequests().addAll(uam.getResourceRequests()); am.setAllocatedMB(am.getAllocatedMB() + uam.getAllocatedMB()); am.setAllocatedVCores(am.getAllocatedVCores() + uam.getAllocatedVCores()); am.setReservedMB(am.getReservedMB() + uam.getReservedMB()); am.setReservedVCores(am.getReservedVCores() + uam.getReservedMB()); am.setRunningContainers( am.getRunningContainers() + uam.getRunningContainers()); am.setMemorySeconds(am.getMemorySeconds() + uam.getMemorySeconds()); am.setVcoreSeconds(am.getVcoreSeconds() + uam.getVcoreSeconds()); } }