gobblin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject incubator-gobblin git commit: Delete the generated config files after the YarnAppLauncher test
Date Wed, 29 Nov 2017 21:34:00 GMT
Repository: incubator-gobblin
Updated Branches:
  refs/heads/master ab4ba6890 -> 178acbb47


Delete the generated config files after the YarnAppLauncher test

Also reorganized imports using the IDEA.

Closes #2176 from HappyRay/delete-generated-files-
after-yarn-launcher-test


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/178acbb4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/178acbb4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/178acbb4

Branch: refs/heads/master
Commit: 178acbb473828ea75c9e89ee9a27e7e124271155
Parents: ab4ba68
Author: Ray Yang <ruiguo@gmail.com>
Authored: Wed Nov 29 13:33:54 2017 -0800
Committer: Abhishek Tiwari <abhishektiwari.btech@gmail.com>
Committed: Wed Nov 29 13:33:54 2017 -0800

----------------------------------------------------------------------
 .../yarn/GobblinYarnAppLauncherTest.java        | 37 +++++++++++---------
 1 file changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/178acbb4/gobblin-yarn/src/test/java/org/apache/gobblin/yarn/GobblinYarnAppLauncherTest.java
----------------------------------------------------------------------
diff --git a/gobblin-yarn/src/test/java/org/apache/gobblin/yarn/GobblinYarnAppLauncherTest.java
b/gobblin-yarn/src/test/java/org/apache/gobblin/yarn/GobblinYarnAppLauncherTest.java
index 153e9bd..4f3c488 100644
--- a/gobblin-yarn/src/test/java/org/apache/gobblin/yarn/GobblinYarnAppLauncherTest.java
+++ b/gobblin-yarn/src/test/java/org/apache/gobblin/yarn/GobblinYarnAppLauncherTest.java
@@ -18,6 +18,10 @@
 package org.apache.gobblin.yarn;
 
 import com.google.common.base.Predicate;
+import com.google.common.io.Closer;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigValueFactory;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -25,11 +29,19 @@ import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.lang.reflect.Field;
 import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.Map;
 import java.util.concurrent.TimeoutException;
-
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.test.TestingServer;
+import org.apache.gobblin.cluster.GobblinClusterConfigurationKeys;
+import org.apache.gobblin.cluster.GobblinHelixConstants;
+import org.apache.gobblin.cluster.HelixMessageTestBase;
+import org.apache.gobblin.cluster.HelixUtils;
+import org.apache.gobblin.cluster.TestHelper;
+import org.apache.gobblin.cluster.TestShutdownMessageHandlerFactory;
+import org.apache.gobblin.testing.AssertWithBackoff;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.YarnApplicationState;
 import org.apache.hadoop.yarn.client.api.YarnClient;
@@ -46,19 +58,6 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-import com.google.common.io.Closer;
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
-import com.typesafe.config.ConfigValueFactory;
-
-import org.apache.gobblin.cluster.GobblinClusterConfigurationKeys;
-import org.apache.gobblin.cluster.GobblinHelixConstants;
-import org.apache.gobblin.cluster.HelixMessageTestBase;
-import org.apache.gobblin.cluster.HelixUtils;
-import org.apache.gobblin.cluster.TestHelper;
-import org.apache.gobblin.cluster.TestShutdownMessageHandlerFactory;
-import org.apache.gobblin.testing.AssertWithBackoff;
-
 
 /**
  * Unit tests for {@link GobblinYarnAppLauncher}.
@@ -75,6 +74,9 @@ import org.apache.gobblin.testing.AssertWithBackoff;
  */
 @Test(groups = { "gobblin.yarn" }, singleThreaded=true)
 public class GobblinYarnAppLauncherTest implements HelixMessageTestBase {
+
+  public static final String DYNAMIC_CONF_PATH = "dynamic.conf";
+  public static final String YARN_SITE_XML_PATH = "yarn-site.xml";
   final Logger LOG = LoggerFactory.getLogger(GobblinYarnAppLauncherTest.class);
 
   private YarnClient yarnClient;
@@ -133,7 +135,7 @@ public class GobblinYarnAppLauncherTest implements HelixMessageTestBase
{
     LOG.info("Testing ZK Server listening on: " + testingZKServer.getConnectString());
 
     // the zk port is dynamically configured
-    try (PrintWriter pw = new PrintWriter("dynamic.conf")) {
+    try (PrintWriter pw = new PrintWriter(DYNAMIC_CONF_PATH)) {
       File dir = new File("target/dummydir");
 
       // dummy directory specified in configuration
@@ -144,7 +146,7 @@ public class GobblinYarnAppLauncherTest implements HelixMessageTestBase
{
     }
 
     // YARN config is dynamic and needs to be passed to other processes
-    try (OutputStream os = new FileOutputStream(new File("yarn-site.xml"))) {
+    try (OutputStream os = new FileOutputStream(new File(YARN_SITE_XML_PATH))) {
       clusterConf.writeXml(os);
     }
 
@@ -251,6 +253,9 @@ public class GobblinYarnAppLauncherTest implements HelixMessageTestBase
{
   @AfterClass
   public void tearDown() throws IOException, TimeoutException {
     try {
+      Files.deleteIfExists(Paths.get(DYNAMIC_CONF_PATH));
+      Files.deleteIfExists(Paths.get(YARN_SITE_XML_PATH));
+
       this.gobblinYarnAppLauncher.stopYarnClient();
 
       if (this.helixManager.isConnected()) {


Mime
View raw message