From a2c57bb70d719f72d59413f33ae67781b583b9f8 Mon Sep 17 00:00:00 2001 From: Daniel Templeton Date: Wed, 5 Apr 2017 16:06:00 -0700 Subject: [PATCH] YARN-6381. FSAppAttempt has several variables that should be final (Contributed by Ameet Zaveri via Daniel Templeton) --- .../resourcemanager/scheduler/fair/FSAppAttempt.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java index ccfcffb83d7..e0dfb73f13c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java @@ -74,11 +74,11 @@ public class FSAppAttempt extends SchedulerApplicationAttempt private static final DefaultResourceCalculator RESOURCE_CALCULATOR = new DefaultResourceCalculator(); - private long startTime; - private Priority appPriority; - private ResourceWeights resourceWeights; + private final long startTime; + private final Priority appPriority; + private final ResourceWeights resourceWeights; private Resource demand = Resources.createResource(0); - private FairScheduler scheduler; + private final FairScheduler scheduler; private FSQueue fsQueue; private Resource fairShare = Resources.createResource(0, 0); @@ -96,9 +96,9 @@ public class FSAppAttempt extends SchedulerApplicationAttempt // Used to record node reservation by an app. // Key = RackName, Value = Set of Nodes reserved by app on rack - private Map> reservations = new HashMap<>(); + private final Map> reservations = new HashMap<>(); - private List blacklistNodeIds = new ArrayList<>(); + private final List blacklistNodeIds = new ArrayList<>(); /** * Delay scheduling: We often want to prioritize scheduling of node-local * containers over rack-local or off-switch containers. To achieve this