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 4EAC718F8B for ; Thu, 10 Mar 2016 21:06:22 +0000 (UTC) Received: (qmail 72480 invoked by uid 500); 10 Mar 2016 21:06:22 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 72414 invoked by uid 500); 10 Mar 2016 21:06:22 -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 72404 invoked by uid 99); 10 Mar 2016 21:06:22 -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; Thu, 10 Mar 2016 21:06:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D5F74DFA6F; Thu, 10 Mar 2016 21:06:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtcarrera9@apache.org To: common-commits@hadoop.apache.org Message-Id: <6f9918bd64624d9498c17c6b7bbdfb8a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: YARN-4696. Improving EntityGroupFSTimelineStore on exception handling, test setup, and concurrency. Date: Thu, 10 Mar 2016 21:06:21 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2.8 8e89bb9d3 -> 92e86ff0c YARN-4696. Improving EntityGroupFSTimelineStore on exception handling, test setup, and concurrency. This commit amends commit d49cfb350454c2dfa2f3eb70f79b6d5030ce7bec with a missed test file. (cherry picked from commit 017d2c127b9cbd75d3e31467172ed832f27ef826) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/92e86ff0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/92e86ff0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/92e86ff0 Branch: refs/heads/branch-2.8 Commit: 92e86ff0cb2c8438553a318b6534fee5b9e634aa Parents: 8e89bb9 Author: Li Lu Authored: Thu Mar 10 13:02:28 2016 -0800 Committer: Li Lu Committed: Thu Mar 10 13:06:02 2016 -0800 ---------------------------------------------------------------------- .../TestOverrideTimelineStoreYarnClient.java | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/92e86ff0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestOverrideTimelineStoreYarnClient.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestOverrideTimelineStoreYarnClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestOverrideTimelineStoreYarnClient.java new file mode 100644 index 0000000..c190266 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestOverrideTimelineStoreYarnClient.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.server.timeline; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.client.api.YarnClient; +import org.apache.hadoop.yarn.conf.YarnConfiguration; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + +public class TestOverrideTimelineStoreYarnClient { + + @Test + public void testLifecycleAndOverride() throws Throwable { + YarnConfiguration conf = new YarnConfiguration(); + try(NoRMStore store = new NoRMStore()) { + store.init(conf); + store.start(); + Assert.assertEquals(EntityGroupFSTimelineStore.AppState.ACTIVE, + store.getAppState(ApplicationId.newInstance(1, 1))); + store.stop(); + } + } + + private static class NoRMStore extends EntityGroupFSTimelineStore { + @Override + protected YarnClient createAndInitYarnClient(Configuration conf) { + return null; + } + + @Override + protected AppState getAppState(ApplicationId appId) + throws IOException { + return AppState.ACTIVE; + } + } +}