From ce0cdc50d9700118139e7907dede274d2db93fda Mon Sep 17 00:00:00 2001 From: Daniel Templeton Date: Fri, 11 Aug 2017 14:50:46 -0700 Subject: [PATCH] YARN-6882. AllocationFileLoaderService.reloadAllocations() should use the diamond operator (Contributed by Larry Lo via Daniel Templeton) (cherry picked from commit 0996acde6c325667aa19ae0740eb6b40bf4a682a) --- .../scheduler/fair/AllocationFileLoaderService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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/AllocationFileLoaderService.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/AllocationFileLoaderService.java index a142d378a87..5696a97d30c 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/AllocationFileLoaderService.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/AllocationFileLoaderService.java @@ -267,7 +267,7 @@ public synchronized void reloadAllocations() throws IOException, Map> configuredQueues = new HashMap<>(); for (FSQueueType queueType : FSQueueType.values()) { - configuredQueues.put(queueType, new HashSet()); + configuredQueues.put(queueType, new HashSet<>()); } // Read and parse the allocations file. @@ -281,7 +281,7 @@ public synchronized void reloadAllocations() throws IOException, throw new AllocationConfigurationException("Bad fair scheduler config " + "file: top-level element not "); NodeList elements = root.getChildNodes(); - List queueElements = new ArrayList(); + List queueElements = new ArrayList<>(); Element placementPolicyElement = null; for (int i = 0; i < elements.getLength(); i++) { Node node = elements.item(i);