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 D231E1759E for ; Wed, 18 Mar 2015 03:34:12 +0000 (UTC) Received: (qmail 99964 invoked by uid 500); 18 Mar 2015 03:34:01 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 99773 invoked by uid 500); 18 Mar 2015 03:34:01 -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 89973 invoked by uid 99); 18 Mar 2015 03:33: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; Wed, 18 Mar 2015 03:33:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AA1BFE18BE; Wed, 18 Mar 2015 03:33:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zjshen@apache.org To: common-commits@hadoop.apache.org Date: Wed, 18 Mar 2015 03:34:40 -0000 Message-Id: <1f70c575ddce4e5dbf47b23652a0fc0b@git.apache.org> In-Reply-To: <325bc1d993444655ac6a57376101f5d3@git.apache.org> References: <325bc1d993444655ac6a57376101f5d3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] hadoop git commit: YARN-3039. Implemented the app-level timeline aggregator discovery service. Contributed by Junping Du. http://git-wip-us.apache.org/repos/asf/hadoop/blob/8a637914/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/aggregator/TestTimelineAggregatorsCollection.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/aggregator/TestTimelineAggregatorsCollection.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/aggregator/TestTimelineAggregatorsCollection.java index cec1d71..dd64629 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/aggregator/TestTimelineAggregatorsCollection.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/aggregator/TestTimelineAggregatorsCollection.java @@ -32,6 +32,7 @@ import java.util.concurrent.Future; import com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.api.records.ApplicationId; import org.junit.Test; public class TestTimelineAggregatorsCollection { @@ -45,11 +46,11 @@ public class TestTimelineAggregatorsCollection { final int NUM_APPS = 5; List> tasks = new ArrayList>(); for (int i = 0; i < NUM_APPS; i++) { - final String appId = String.valueOf(i); + final ApplicationId appId = ApplicationId.newInstance(0L, i); Callable task = new Callable() { public Boolean call() { AppLevelTimelineAggregator aggregator = - new AppLevelTimelineAggregator(appId); + new AppLevelTimelineAggregator(appId.toString()); return (aggregatorCollection.putIfAbsent(appId, aggregator) == aggregator); } }; @@ -79,14 +80,14 @@ public class TestTimelineAggregatorsCollection { final int NUM_APPS = 5; List> tasks = new ArrayList>(); for (int i = 0; i < NUM_APPS; i++) { - final String appId = String.valueOf(i); + final ApplicationId appId = ApplicationId.newInstance(0L, i); Callable task = new Callable() { public Boolean call() { AppLevelTimelineAggregator aggregator = - new AppLevelTimelineAggregator(appId); + new AppLevelTimelineAggregator(appId.toString()); boolean successPut = (aggregatorCollection.putIfAbsent(appId, aggregator) == aggregator); - return successPut && aggregatorCollection.remove(appId); + return successPut && aggregatorCollection.remove(appId.toString()); } }; tasks.add(task);