You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Mariia Mykhailova (JIRA)" <ji...@apache.org> on 2016/01/08 00:36:39 UTC
[jira] [Commented] (REEF-703) Make NameLookupClient injectable
[ 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)