YARN-8969. AbstractYarnScheduler#getNodeTracker should return generic type to avoid type casting. Contributed by Wanqiang Ji.

(cherry picked from commit c7fcca0d7e)
This commit is contained in:
Weiwei Yang 2018-11-06 13:14:57 +08:00
parent 4b47daa640
commit c3a0f07db0
2 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ public abstract class AbstractYarnScheduler
}
@VisibleForTesting
public ClusterNodeTracker getNodeTracker() {
public ClusterNodeTracker<N> getNodeTracker() {
return nodeTracker;
}

View File

@ -208,7 +208,7 @@ class FSPreemptionThread extends Thread {
private void trackPreemptionsAgainstNode(List<RMContainer> containers,
FSAppAttempt app) {
FSSchedulerNode node = (FSSchedulerNode) scheduler.getNodeTracker()
FSSchedulerNode node = scheduler.getNodeTracker()
.getNode(containers.get(0).getNodeId());
node.addContainersForPreemption(containers, app);
}