hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: YARN-4630. Remove useless boxing/unboxing code. Contributed by Kousuke Saruta.
Date Mon, 11 Apr 2016 05:56:10 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 07920acc1 -> 1ff27f9d1


YARN-4630. Remove useless boxing/unboxing code. Contributed by Kousuke Saruta.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1ff27f9d
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1ff27f9d
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1ff27f9d

Branch: refs/heads/trunk
Commit: 1ff27f9d12e8124c1b9a722708264c5b07fd0fde
Parents: 07920ac
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Mon Apr 11 14:52:27 2016 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Mon Apr 11 14:55:03 2016 +0900

----------------------------------------------------------------------
 .../apache/hadoop/yarn/api/records/ContainerId.java   | 11 +++++------
 .../org/apache/hadoop/yarn/client/cli/TopCLI.java     | 10 +++++-----
 .../hadoop/yarn/conf/TestYarnConfiguration.java       |  8 ++++----
 .../hadoop/yarn/nodelabels/NodeLabelTestBase.java     |  2 +-
 .../org/apache/hadoop/yarn/util/TestFSDownload.java   |  2 +-
 .../registry/client/impl/zk/RegistrySecurity.java     |  4 ++--
 .../containermanager/launcher/ContainerLaunch.java    |  2 +-
 .../server/nodemanager/util/ProcessIdFileReader.java  |  2 +-
 .../scheduler/policy/FairOrderingPolicy.java          |  3 ++-
 .../TestProportionalCapacityPreemptionPolicy.java     |  6 +++---
 ...onalCapacityPreemptionPolicyForNodePartitions.java | 14 +++++++-------
 .../yarn/server/webproxy/WebAppProxyServlet.java      |  4 ++--
 12 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java
index c9b9618..f332651 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java
@@ -165,13 +165,12 @@ public abstract class ContainerId implements Comparable<ContainerId>{
 
   @Override
   public int compareTo(ContainerId other) {
-    if (this.getApplicationAttemptId().compareTo(
-        other.getApplicationAttemptId()) == 0) {
-      return Long.valueOf(getContainerId())
-          .compareTo(Long.valueOf(other.getContainerId()));
+    int result = this.getApplicationAttemptId().compareTo(
+        other.getApplicationAttemptId());
+    if (result == 0) {
+      return Long.compare(getContainerId(), other.getContainerId());
     } else {
-      return this.getApplicationAttemptId().compareTo(
-          other.getApplicationAttemptId());
+      return result;
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java
index 1c66475..211f5e8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java
@@ -241,7 +241,7 @@ public class TopCLI extends YarnCLI {
         @Override
         public int
             compare(ApplicationInformation a1, ApplicationInformation a2) {
-          return Long.valueOf(a1.usedMemory).compareTo(a2.usedMemory);
+          return Long.compare(a1.usedMemory, a2.usedMemory);
         }
       };
   public static final Comparator<ApplicationInformation> ReservedMemoryComparator =
@@ -249,7 +249,7 @@ public class TopCLI extends YarnCLI {
         @Override
         public int
             compare(ApplicationInformation a1, ApplicationInformation a2) {
-          return Long.valueOf(a1.reservedMemory).compareTo(a2.reservedMemory);
+          return Long.compare(a1.reservedMemory, a2.reservedMemory);
         }
       };
   public static final Comparator<ApplicationInformation> UsedVCoresComparator =
@@ -273,7 +273,7 @@ public class TopCLI extends YarnCLI {
         @Override
         public int
             compare(ApplicationInformation a1, ApplicationInformation a2) {
-          return Long.valueOf(a1.vcoreSeconds).compareTo(a2.vcoreSeconds);
+          return Long.compare(a1.vcoreSeconds, a2.vcoreSeconds);
         }
       };
   public static final Comparator<ApplicationInformation> MemorySecondsComparator =
@@ -281,7 +281,7 @@ public class TopCLI extends YarnCLI {
         @Override
         public int
             compare(ApplicationInformation a1, ApplicationInformation a2) {
-          return Long.valueOf(a1.memorySeconds).compareTo(a2.memorySeconds);
+          return Long.compare(a1.memorySeconds, a2.memorySeconds);
         }
       };
   public static final Comparator<ApplicationInformation> ProgressComparator =
@@ -297,7 +297,7 @@ public class TopCLI extends YarnCLI {
         @Override
         public int
             compare(ApplicationInformation a1, ApplicationInformation a2) {
-          return Long.valueOf(a1.runningTime).compareTo(a2.runningTime);
+          return Long.compare(a1.runningTime, a2.runningTime);
         }
       };
   public static final Comparator<ApplicationInformation> AppNameComparator =

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfiguration.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfiguration.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfiguration.java
index 1f10810..2e76865 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfiguration.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfiguration.java
@@ -54,7 +54,7 @@ public class TestYarnConfiguration {
     String rmWebUrl = WebAppUtils.getRMWebAppURLWithScheme(conf);
     String[] parts = rmWebUrl.split(":");
     Assert.assertEquals("RM Web URL Port is incrrect", 24543,
-        Integer.valueOf(parts[parts.length - 1]).intValue());
+        Integer.parseInt(parts[parts.length - 1]));
     Assert.assertNotSame(
         "RM Web Url not resolved correctly. Should not be rmtesting",
         "http://rmtesting:24543", rmWebUrl);
@@ -178,7 +178,7 @@ public class TestYarnConfiguration {
     conf.set(YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS, "yo.yo.yo");
     serverAddress = new InetSocketAddress(
         YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[0],
-        Integer.valueOf(YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[1]));
+        Integer.parseInt(YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[1]));
 
     resourceTrackerConnectAddress = conf.updateConnectAddr(
         YarnConfiguration.RM_BIND_HOST,
@@ -194,7 +194,7 @@ public class TestYarnConfiguration {
     conf.set(YarnConfiguration.RM_BIND_HOST, "0.0.0.0");
     serverAddress = new InetSocketAddress(
         YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[0],
-        Integer.valueOf(YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[1]));
+        Integer.parseInt(YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS.split(":")[1]));
 
     resourceTrackerConnectAddress = conf.updateConnectAddr(
         YarnConfiguration.RM_BIND_HOST,
@@ -213,7 +213,7 @@ public class TestYarnConfiguration {
 
     serverAddress = new InetSocketAddress(
         YarnConfiguration.DEFAULT_NM_LOCALIZER_ADDRESS.split(":")[0],
-        Integer.valueOf(YarnConfiguration.DEFAULT_NM_LOCALIZER_ADDRESS.split(":")[1]));
+        Integer.parseInt(YarnConfiguration.DEFAULT_NM_LOCALIZER_ADDRESS.split(":")[1]));
 
     InetSocketAddress localizerAddress = conf.updateConnectAddr(
         YarnConfiguration.NM_BIND_HOST,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/nodelabels/NodeLabelTestBase.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/nodelabels/NodeLabelTestBase.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/nodelabels/NodeLabelTestBase.java
index 1f64e50..28b9497 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/nodelabels/NodeLabelTestBase.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/nodelabels/NodeLabelTestBase.java
@@ -140,7 +140,7 @@ public class NodeLabelTestBase {
       int idx = str.indexOf(':');
       NodeId id =
           NodeId.newInstance(str.substring(0, idx),
-              Integer.valueOf(str.substring(idx + 1)));
+              Integer.parseInt(str.substring(idx + 1)));
       return id;
     } else {
       return NodeId.newInstance(str, CommonNodeLabelsManager.WILDCARD_PORT);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestFSDownload.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestFSDownload.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestFSDownload.java
index a2efb6b..376b27d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestFSDownload.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestFSDownload.java
@@ -431,7 +431,7 @@ public class TestFSDownload {
     try {
       for (Map.Entry<LocalResource,Future<Path>> p : pending.entrySet()) {
         Path localized = p.getValue().get();
-        assertEquals(sizes[Integer.valueOf(localized.getName())], p.getKey()
+        assertEquals(sizes[Integer.parseInt(localized.getName())], p.getKey()
             .getSize());
 
         FileStatus status = files.getFileStatus(localized.getParent());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
index 1c75e43..fc61460 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
@@ -772,7 +772,7 @@ public class RegistrySecurity extends AbstractService {
    * @return true if the SASL client system property is set.
    */
   public static boolean isClientSASLEnabled() {
-    return Boolean.valueOf(System.getProperty(
+    return Boolean.parseBoolean(System.getProperty(
         ZookeeperConfigOptions.PROP_ZK_ENABLE_SASL_CLIENT, "true"));
   }
 
@@ -862,7 +862,7 @@ public class RegistrySecurity extends AbstractService {
     String sasl =
         System.getProperty(PROP_ZK_ENABLE_SASL_CLIENT,
             DEFAULT_ZK_ENABLE_SASL_CLIENT);
-    boolean saslEnabled = Boolean.valueOf(sasl);
+    boolean saslEnabled = Boolean.parseBoolean(sasl);
     builder.append(describeProperty(PROP_ZK_ENABLE_SASL_CLIENT,
         DEFAULT_ZK_ENABLE_SASL_CLIENT));
     if (saslEnabled) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java
index 64689dd..76ee90e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java
@@ -1017,7 +1017,7 @@ public class ContainerLaunch implements Callable<Integer> {
         //variable can be set to indicate that distcache entries should come
         //first
 
-        boolean preferLocalizedJars = Boolean.valueOf(
+        boolean preferLocalizedJars = Boolean.parseBoolean(
           environment.get(Environment.CLASSPATH_PREPEND_DISTCACHE.name())
           );
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/ProcessIdFileReader.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/ProcessIdFileReader.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/ProcessIdFileReader.java
index 52fcdec..80d4db2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/ProcessIdFileReader.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/ProcessIdFileReader.java
@@ -79,7 +79,7 @@ public class ProcessIdFileReader {
             else {
               // Otherwise, find first line containing a numeric pid.
               try {
-                Long pid = Long.valueOf(temp);
+                long pid = Long.parseLong(temp);
                 if (pid > 0) {
                   processId = temp;
                   break;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/FairOrderingPolicy.java
----------------------------------------------------------------------
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/policy/FairOrderingPolicy.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/FairOrderingPolicy.java
index ea14b42..04cd53a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/FairOrderingPolicy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/policy/FairOrderingPolicy.java
@@ -89,7 +89,8 @@ public class FairOrderingPolicy<S extends SchedulableEntity> extends
AbstractCom
   @Override
   public void configure(Map<String, String> conf) {
     if (conf.containsKey(ENABLE_SIZE_BASED_WEIGHT)) {
-      sizeBasedWeight = Boolean.valueOf(conf.get(ENABLE_SIZE_BASED_WEIGHT));
+      sizeBasedWeight =
+        Boolean.parseBoolean(conf.get(ENABLE_SIZE_BASED_WEIGHT));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
index 3db4782..499a3d0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java
@@ -1032,10 +1032,10 @@ public class TestProportionalCapacityPreemptionPolicy {
     for (int i = 0; i < resData.length; i++) {
       String[] resource = resData[i].split(":");
       if (resource.length == 1) {
-        resourceList.add(Resource.newInstance(Integer.valueOf(resource[0]), 0));
+        resourceList.add(Resource.newInstance(Integer.parseInt(resource[0]), 0));
       } else {
-        resourceList.add(Resource.newInstance(Integer.valueOf(resource[0]),
-            Integer.valueOf(resource[1])));
+        resourceList.add(Resource.newInstance(Integer.parseInt(resource[0]),
+            Integer.parseInt(resource[1])));
       }
     }
     return resourceList.toArray(new Resource[resourceList.size()]);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyForNodePartitions.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyForNodePartitions.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyForNodePartitions.java
index b266665..5ffae6e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyForNodePartitions.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicyForNodePartitions.java
@@ -929,12 +929,12 @@ public class TestProportionalCapacityPreemptionPolicyForNodePartitions
{
         throw new IllegalArgumentException("Format to define container is:"
             + "(priority,resource,host,expression,repeat,reserved)");
       }
-      Priority pri = Priority.newInstance(Integer.valueOf(values[0]));
+      Priority pri = Priority.newInstance(Integer.parseInt(values[0]));
       Resource res = parseResourceFromString(values[1]);
       NodeId host = NodeId.newInstance(values[2], 1);
       String exp = values[3];
-      int repeat = Integer.valueOf(values[4]);
-      boolean reserved = Boolean.valueOf(values[5]);
+      int repeat = Integer.parseInt(values[4]);
+      boolean reserved = Boolean.parseBoolean(values[5]);
 
       for (int i = 0; i < repeat; i++) {
         Container c = mock(Container.class);
@@ -1068,7 +1068,7 @@ public class TestProportionalCapacityPreemptionPolicyForNodePartitions
{
       Resource res = parseResourceFromString(p.substring(p.indexOf("=") + 1,
           p.indexOf(",")));
      boolean exclusivity =
-          Boolean.valueOf(p.substring(p.indexOf(",") + 1, p.length()));
+          Boolean.parseBoolean(p.substring(p.indexOf(",") + 1, p.length()));
       when(nlm.getResourceByLabel(eq(partitionName), any(Resource.class)))
           .thenReturn(res);
       when(nlm.isExclusiveNodeLabel(eq(partitionName))).thenReturn(exclusivity);
@@ -1088,10 +1088,10 @@ public class TestProportionalCapacityPreemptionPolicyForNodePartitions
{
     String[] resource = p.split(":");
     Resource res = Resources.createResource(0);
     if (resource.length == 1) {
-      res = Resources.createResource(Integer.valueOf(resource[0]));
+      res = Resources.createResource(Integer.parseInt(resource[0]));
     } else {
-      res = Resources.createResource(Integer.valueOf(resource[0]),
-          Integer.valueOf(resource[1]));
+      res = Resources.createResource(Integer.parseInt(resource[0]),
+          Integer.parseInt(resource[1]));
     }
     return res;
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1ff27f9d/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
index ab4b295..9d64667 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
@@ -310,7 +310,7 @@ public class WebAppProxyServlet extends HttpServlet {
       String userApprovedParamS = 
         req.getParameter(ProxyUriUtils.PROXY_APPROVAL_PARAM);
       boolean userWasWarned = false;
-      boolean userApproved = Boolean.valueOf(userApprovedParamS);
+      boolean userApproved = Boolean.parseBoolean(userApprovedParamS);
       boolean securityEnabled = isSecurityEnabled();
       final String remoteUser = req.getRemoteUser();
       final String pathInfo = req.getPathInfo();
@@ -342,7 +342,7 @@ public class WebAppProxyServlet extends HttpServlet {
           for (Cookie c : cookies) {
             if (cookieName.equals(c.getName())) {
               userWasWarned = true;
-              userApproved = userApproved || Boolean.valueOf(c.getValue());
+              userApproved = userApproved || Boolean.parseBoolean(c.getValue());
               break;
             }
           }


Mime
View raw message