List of usage examples for org.apache.hadoop.yarn.server.resourcemanager.scheduler SchedulerApplicationAttempt getRMContainer
public RMContainer getRMContainer(ContainerId id)
From source file:org.apache.myriad.scheduler.yarn.interceptor.CompositeInterceptor.java
License:Apache License
@Override public void beforeReleaseContainers(List<ContainerId> containers, SchedulerApplicationAttempt attempt) { if (containers != null && attempt != null) { for (YarnSchedulerInterceptor interceptor : interceptors.values()) { List<ContainerId> filteredContainers = new ArrayList<>(); for (ContainerId containerId : containers) { NodeId nodeId = attempt.getRMContainer(containerId).getContainer().getNodeId(); if ((nodeId != null && interceptor.getCallBackFilter().allowCallBacksForNode(nodeId))) { filteredContainers.add(containerId); }/*from w w w .j av a 2s .c o m*/ } if (!filteredContainers.isEmpty()) { interceptor.beforeReleaseContainers(filteredContainers, attempt); } } } }