hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From varunsax...@apache.org
Subject [33/50] [abbrv] hadoop git commit: Addendum for YARN-5648.
Date Wed, 30 Aug 2017 20:15:58 GMT
Addendum for YARN-5648.


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

Branch: refs/heads/YARN-5355_branch2
Commit: 58e6889e91bc70204727cbcb2c16447a05a72630
Parents: 3575b62
Author: Varun Saxena <varunsaxena@apache.org>
Authored: Tue Aug 1 19:04:09 2017 +0530
Committer: Varun Saxena <varunsaxena@apache.org>
Committed: Thu Aug 31 01:35:40 2017 +0530

----------------------------------------------------------------------
 .../yarn/client/api/impl/TimelineV2ClientImpl.java |  4 ++--
 .../hadoop/yarn/server/TestRMNMSecretKeys.java     | 17 +++++++++++++++--
 .../security/TestTimelineAuthFilterForV2.java      |  4 ++--
 3 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/58e6889e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
index cd30d98..ad869e3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
@@ -203,8 +203,8 @@ public class TimelineV2ClientImpl extends TimelineV2Client {
         .put(ClientResponse.class, obj);
   }
 
-  protected void putObjects(URI base, String path,
-      MultivaluedMap<String, String> params, Object obj)
+  protected void putObjects(final URI base, final String path,
+      final MultivaluedMap<String, String> params, final Object obj)
       throws IOException, YarnException {
     ClientResponse resp = null;
     try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/58e6889e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestRMNMSecretKeys.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestRMNMSecretKeys.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestRMNMSecretKeys.java
index ba14491..56872d3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestRMNMSecretKeys.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestRMNMSecretKeys.java
@@ -19,7 +19,11 @@
 package org.apache.hadoop.yarn.server;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.StandardCharsets;
 import java.util.UUID;
 
 import org.junit.AfterClass;
@@ -35,7 +39,6 @@ import org.apache.hadoop.yarn.server.api.protocolrecords.RegisterNodeManagerResp
 import org.apache.hadoop.yarn.server.api.records.MasterKey;
 import org.apache.hadoop.yarn.server.resourcemanager.MockNM;
 import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
-import org.apache.kerby.util.IOUtil;
 import org.junit.Test;
 
 public class TestRMNMSecretKeys {
@@ -59,10 +62,20 @@ public class TestRMNMSecretKeys {
         "        kdc = localhost:88\n}\n" +
         "[domain_realm]\n" +
         "    localhost = APACHE.ORG";
-    IOUtil.writeFile(content, krb5ConfFile);
+    writeFile(content, krb5ConfFile);
     System.setProperty(KRB5_CONF, krb5ConfFile.getAbsolutePath());
   }
 
+  private static void writeFile(String content, File file) throws IOException {
+      FileOutputStream outputStream = new FileOutputStream(file);
+      FileChannel fc = outputStream.getChannel();
+
+      ByteBuffer buffer =
+          ByteBuffer.wrap(content.getBytes(StandardCharsets.UTF_8));
+      fc.write(buffer);
+      outputStream.close();
+  }
+
   @AfterClass
   public static void tearDown() throws IOException {
     KRB5_CONF_ROOT_DIR.delete();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/58e6889e/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/security/TestTimelineAuthFilterForV2.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/security/TestTimelineAuthFilterForV2.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/security/TestTimelineAuthFilterForV2.java
index 608ef67..da76958 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/security/TestTimelineAuthFilterForV2.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/security/TestTimelineAuthFilterForV2.java
@@ -243,10 +243,10 @@ public class TestTimelineAuthFilterForV2 {
 
   @Test
   public void testPutTimelineEntities() throws Exception {
-    ApplicationId appId = ApplicationId.newInstance(0, 1);
+    final ApplicationId appId = ApplicationId.newInstance(0, 1);
     auxService.addApplication(appId);
     final String entityType = "dummy_type";
-    File entityTypeDir = new File(TEST_ROOT_DIR.getAbsolutePath() +
+    final File entityTypeDir = new File(TEST_ROOT_DIR.getAbsolutePath() +
         File.separator + "entities" + File.separator +
         YarnConfiguration.DEFAULT_RM_CLUSTER_ID + File.separator + "test_user" +
         File.separator + "test_flow_name" + File.separator +


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message