Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EBAF2200C3A for ; Thu, 2 Mar 2017 19:41:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EA7A7160B7A; Thu, 2 Mar 2017 18:41:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D40A3160B6A for ; Thu, 2 Mar 2017 19:41:47 +0100 (CET) Received: (qmail 43419 invoked by uid 500); 2 Mar 2017 18:41:46 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 43035 invoked by uid 99); 2 Mar 2017 18:41:46 -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, 02 Mar 2017 18:41:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AA35DFF5D; Thu, 2 Mar 2017 18:41:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Thu, 02 Mar 2017 18:41:57 -0000 Message-Id: In-Reply-To: <7de9f343ac9540cb9ae8c48d73429abc@git.apache.org> References: <7de9f343ac9540cb9ae8c48d73429abc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/16] ambari git commit: AMBARI-20262 - Startup Annotation Scanning Takes Too Long (part2) (jonathanhurley) archived-at: Thu, 02 Mar 2017 18:41:49 -0000 AMBARI-20262 - Startup Annotation Scanning Takes Too Long (part2) (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f8fe522b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f8fe522b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f8fe522b Branch: refs/heads/branch-feature-AMBARI-12556 Commit: f8fe522b95166f18b93135a7b8cd7ff24d1f0fd9 Parents: 843c5f9 Author: Jonathan Hurley Authored: Thu Mar 2 11:49:21 2017 -0500 Committer: Jonathan Hurley Committed: Thu Mar 2 11:54:40 2017 -0500 ---------------------------------------------------------------------- .../funtest/server/orm/InMemoryDefaultTestModule.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f8fe522b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/orm/InMemoryDefaultTestModule.java ---------------------------------------------------------------------- diff --git a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/orm/InMemoryDefaultTestModule.java b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/orm/InMemoryDefaultTestModule.java index ed78ded..2932f93 100644 --- a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/orm/InMemoryDefaultTestModule.java +++ b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/orm/InMemoryDefaultTestModule.java @@ -26,7 +26,6 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.controller.ControllerModule; -import org.springframework.beans.factory.config.BeanDefinition; import com.google.inject.AbstractModule; @@ -41,17 +40,17 @@ public class InMemoryDefaultTestModule extends AbstractModule { private static class BeanDefinitionsCachingTestControllerModule extends ControllerModule { // Access should be synchronised to allow concurrent test runs. - private static final AtomicReference> foundBeanDefinitions - = new AtomicReference>(null); + private static final AtomicReference>> matchedAnnotationClasses = new AtomicReference<>( + null); public BeanDefinitionsCachingTestControllerModule(Properties properties) throws Exception { super(properties); } @Override - protected Set bindByAnnotation(Set beanDefinitions) { - Set newBeanDefinitions = super.bindByAnnotation(foundBeanDefinitions.get()); - foundBeanDefinitions.compareAndSet(null, Collections.unmodifiableSet(newBeanDefinitions)); + protected Set> bindByAnnotation(Set> matchedClasses) { + Set> newMatchedClasses = super.bindByAnnotation(matchedAnnotationClasses.get()); + matchedAnnotationClasses.compareAndSet(null, Collections.unmodifiableSet(newMatchedClasses)); return null; } }