Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AFE2417936 for ; Fri, 20 Feb 2015 17:30:54 +0000 (UTC) Received: (qmail 49627 invoked by uid 500); 20 Feb 2015 17:30:54 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 49563 invoked by uid 500); 20 Feb 2015 17:30:54 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 49554 invoked by uid 99); 20 Feb 2015 17:30:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2015 17:30:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4515EE03EE; Fri, 20 Feb 2015 17:30:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: junping_du@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90. Contributed by Zhihai Xu (cherry picked from commit c33ae271c24f0770c9735ccd2086cafda4f4e0b2) Date: Fri, 20 Feb 2015 17:30:54 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2 3e8dfd129 -> 4a87a61fe YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90. Contributed by Zhihai Xu (cherry picked from commit c33ae271c24f0770c9735ccd2086cafda4f4e0b2) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4a87a61f Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4a87a61f Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4a87a61f Branch: refs/heads/branch-2 Commit: 4a87a61fe96e52e0f8e2afcdfd1c2c523c07db4f Parents: 3e8dfd1 Author: Junping Du Authored: Fri Feb 20 09:43:39 2015 -0800 Committer: Junping Du Committed: Fri Feb 20 09:44:31 2015 -0800 ---------------------------------------------------------------------- hadoop-yarn-project/CHANGES.txt | 3 +++ .../TestLogAggregationService.java | 25 +++----------------- 2 files changed, 6 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a87a61f/hadoop-yarn-project/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 36deb68..235043c 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -271,6 +271,9 @@ Release 2.7.0 - UNRELEASED YARN-3076. Add API/Implementation to YarnClient to retrieve label-to-node mapping. (Varun Saxena via wangda) + YARN-2799. Cleanup TestLogAggregationService based on the change in YARN-90. + (Zhihai Xu via junping_du) + OPTIMIZATIONS YARN-2990. FairScheduler's delay-scheduling always waits for node-local and http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a87a61f/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java index 7d911e9..901e45a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java @@ -248,7 +248,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { }; checkEvents(appEventHandler, expectedEvents, true, "getType", "getApplicationID"); - dispatcher.stop(); } @Test @@ -295,7 +294,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED) }; checkEvents(appEventHandler, expectedEvents, true, "getType", "getApplicationID"); - dispatcher.stop(); logAggregationService.close(); } @@ -308,10 +306,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest { this.remoteRootLogDir.getAbsolutePath()); String[] fileNames = new String[] { "stdout", "stderr", "syslog" }; - DrainDispatcher dispatcher = createDispatcher(); - EventHandler appEventHandler = mock(EventHandler.class); - dispatcher.register(ApplicationEventType.class, appEventHandler); - + LogAggregationService logAggregationService = new LogAggregationService(dispatcher, this.context, this.delSrvc, super.dirsHandler); @@ -441,7 +436,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED) }; checkEvents(appEventHandler, expectedFinishedEvents, false, "getType", "getApplicationID"); - dispatcher.stop(); } @Test @@ -518,8 +512,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest { File aNewFile = new File(String.valueOf("tmp"+System.currentTimeMillis())); this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR, aNewFile.getAbsolutePath()); - - DrainDispatcher dispatcher = createDispatcher(); + LogAggregationService logAggregationService = spy( new LogAggregationService(dispatcher, this.context, this.delSrvc, super.dirsHandler)); @@ -590,6 +583,7 @@ public class TestLogAggregationService extends BaseContainerManagerTest { verify(spyFs, never()).mkdirs(eq(appDir3), isA(FsPermission.class)); aggSvc.stop(); aggSvc.close(); + dispatcher.stop(); } @Test @@ -1122,10 +1116,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { this.conf.set(YarnConfiguration.NM_REMOTE_APP_LOG_DIR, this.remoteRootLogDir.getAbsolutePath()); - DrainDispatcher dispatcher = createDispatcher(); - EventHandler appEventHandler = mock(EventHandler.class); - dispatcher.register(ApplicationEventType.class, appEventHandler); - ApplicationId application1 = BuilderUtils.newApplicationId(1234, 1); ApplicationId application2 = BuilderUtils.newApplicationId(1234, 2); ApplicationId application3 = BuilderUtils.newApplicationId(1234, 3); @@ -1282,7 +1272,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED) }; checkEvents(appEventHandler, expectedFinishedEvents, false, "getType", "getApplicationID"); - dispatcher.stop(); } @Test (timeout = 50000) @@ -1319,10 +1308,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { // again in next cycle. this.conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 3600); - DrainDispatcher dispatcher = createDispatcher(); - EventHandler appEventHandler = mock(EventHandler.class); - dispatcher.register(ApplicationEventType.class, appEventHandler); - ApplicationId application = BuilderUtils.newApplicationId(123456, 1); ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(application, 1); @@ -1426,7 +1411,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { new ContainerId[] { container }, logFiles3, 3, true); logAggregationService.stop(); assertEquals(0, logAggregationService.getNumAggregators()); - dispatcher.stop(); } @@ -1436,8 +1420,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); - DrainDispatcher dispatcher = createDispatcher(); - dispatcher.register(ApplicationEventType.class, appEventHandler); ApplicationId application1 = BuilderUtils.newApplicationId(1234, 1); Application mockApp = mock(Application.class); @@ -1484,7 +1466,6 @@ public class TestLogAggregationService extends BaseContainerManagerTest { } }, 1000, 20000); logAggregationService.stop(); - dispatcher.stop(); } private int numOfLogsAvailable(LogAggregationService logAggregationService,