Return-Path: X-Original-To: apmail-reef-dev-archive@minotaur.apache.org Delivered-To: apmail-reef-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 307D6181BD for ; Thu, 7 Jan 2016 23:36:40 +0000 (UTC) Received: (qmail 82970 invoked by uid 500); 7 Jan 2016 23:36:40 -0000 Delivered-To: apmail-reef-dev-archive@reef.apache.org Received: (qmail 82931 invoked by uid 500); 7 Jan 2016 23:36:40 -0000 Mailing-List: contact dev-help@reef.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@reef.apache.org Delivered-To: mailing list dev@reef.apache.org Received: (qmail 82914 invoked by uid 99); 7 Jan 2016 23:36:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2016 23:36:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CC8072C1F57 for ; Thu, 7 Jan 2016 23:36:39 +0000 (UTC) Date: Thu, 7 Jan 2016 23:36:39 +0000 (UTC) From: "Mariia Mykhailova (JIRA)" To: dev@reef.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (REEF-703) Make NameLookupClient injectable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/REEF-703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15088387#comment-15088387 ] Mariia Mykhailova commented on REEF-703: ---------------------------------------- I took a look at REEF-1124 which continues this work, and I have two issues with it: 1. I can't inject NameLookupClient when used in NamingTest. The list of parameters in injectable constructor is the same as in NameClient, so injection should be similar to what {{testNameClient}} does (use {{NameResolverConfiguration}}). But the following change makes {{testNamingLookup}} fail {noformat} - try (final NameLookupClient client = new NameLookupClient(localAddress, this.port, - 10000, this.factory, RETRY_COUNT, RETRY_TIMEOUT, new NameCache(this.TTL), this.localAddressProvider)) { + final Configuration nameResolverConf = NameResolverConfiguration.CONF + .set(NameResolverConfiguration.NAME_SERVER_HOSTNAME, localAddress) + .set(NameResolverConfiguration.NAME_SERVICE_PORT, this.port) + .set(NameResolverConfiguration.CACHE_TIMEOUT, 10000) + .set(NameResolverConfiguration.RETRY_TIMEOUT, RETRY_TIMEOUT) + .set(NameResolverConfiguration.RETRY_COUNT, RETRY_COUNT) + .build(); + try (final NameLookupClient client = + Tang.Factory.getTang().newInjector(nameResolverConf).getInstance(NameLookupClient.class)) { {noformat} The error message is {noformat} testNamingLookup(org.apache.reef.io.network.naming.NamingTest) Time elapsed: 0.118 sec <<< ERROR! org.apache.reef.tang.exceptions.ClassHierarchyException: private org.apache.reef.io.network.naming.NameLookupClient(java .lang.String,int,long,org.apache.reef.wake.IdentifierFactory,int,int,org.apache.reef.wake.remote.address.LocalAddressPro vider,org.apache.reef.wake.remote.transport.TransportFactory) is not injectable, but it has an @Parameter annotation. at org.apache.reef.tang.implementation.java.JavaNodeFactory.createConstructorDef(JavaNodeFactory.java:327) at org.apache.reef.tang.implementation.java.JavaNodeFactory.createClassNode(JavaNodeFactory.java:100) at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.buildPathToNode(ClassHierarchyImpl.java:210) at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.registerClass(ClassHierarchyImpl.java:387) at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.register(ClassHierarchyImpl.java:331) at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.getNode(ClassHierarchyImpl.java:257) at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.getNode(ClassHierarchyImpl.java:248) at org.apache.reef.tang.implementation.java.InjectorImpl.getInstance(InjectorImpl.java:533) at org.apache.reef.io.network.naming.NamingTest.testNamingLookup(NamingTest.java:111) {noformat} I've tried multiple variants, including removing all parameters from the constructor and replacing their values with constants, but never had any luck. 2. What's the plan for sharing {{replyLookupQueue}} between {{NameLookupClient}} and {{NameRegistryClient}}? > Make NameLookupClient injectable > -------------------------------- > > Key: REEF-703 > URL: https://issues.apache.org/jira/browse/REEF-703 > Project: REEF > Issue Type: Task > Components: REEF-IO > Reporter: Mariia Mykhailova > Priority: Minor > Fix For: 0.13 > > > `org/apache/reef/io/network/naming/NameLookupClient.java` should be injectable, with one constructor (and others deprecated). -- This message was sent by Atlassian JIRA (v6.3.4#6332)