reef icon indicating copy to clipboard operation
reef copied to clipboard

[REEF-362] Implement a Wake Transport using HTTP

Open nhne opened this issue 7 years ago • 32 comments

Additional implementation for Wake via HTTP

  • ~new package org.apache.reef.wake.remote.transport.netty.http~
  • no new package created.
  • followed default implementation of netty
  • Added TransportHttpTest
  • currently tested only for HTTP

JIRA: REEF-362

Pull Request This closes #1341

nhne avatar Jul 23 '17 09:07 nhne

@nhne How about adding tests on RemoteManager using HttpMessagingTransportFactory?

DifferentSC avatar Jul 25 '17 04:07 DifferentSC

Added one Test on RemoteManager with HttpMessagingTransportFactory.

nhne avatar Jul 25 '17 05:07 nhne

@nhne I've skimmed through this PR, but it looks like it has a bunch of duplicated codes. Can't we minimize the duplicated codes? Maybe we need to refactor the original code to do this.

taegeonum avatar Aug 08 '17 01:08 taegeonum

I implmeneted in this way to avoid modify the original code. I just worried I can insert err code into original code and compatibility issues. I think refactoring the original code can be eliminate many duplicated code since It does not have much difference. What Do you think would be better?

nhne avatar Aug 08 '17 03:08 nhne

@DifferentSC Thank you for reviewing my work! I'll check the things you reviewed.

nhne avatar Aug 17 '17 09:08 nhne

@motus I appreciate for your kind and precise review! I'll check out all about these. thanks a lot!

nhne avatar Aug 21 '17 02:08 nhne

Thanks a lot for your detailed comments, @motus! We have decided to split this issue into two, by making a new JIRA issue for refactoring and changing styles of Transport. @nhne will work on implementing HTTP transport after the refactoring is done. Thanks!

DifferentSC avatar Aug 21 '17 08:08 DifferentSC

@taegeonum Thanks for sharing detailed review! I'll check all you mentioned above. Thank you.

nhne avatar Aug 23 '17 02:08 nhne

@taegeonum I just pushed a commit reflexing your review. Thank you for your kind review!

nhne avatar Aug 24 '17 09:08 nhne

@taegeonum Sorry for late response. I was busy for work about GSoC and reserve force traing(예비군 훈련). I'll check your review now. Thank you for review!

Thank you for good suggestion! We have discussed the using enum in parameter issue with @DifferentSC and @taegeonum. Unfortunately, current REEF Tang does not support enum correctly by now.

I tested the suggestion but it raises tang exception that 'could not resolve the enum value`.

So for now, I implemented in the way that interface uses enum but, uses string internally. I'll check about other reviews now. Thanks a lot @motus !

nhne avatar Aug 31 '17 03:08 nhne

This is error when I tried to apply enum as Tang parameter.

Caused by: org.apache.reef.tang.exceptions.NameResolutionException: Could not resolve TCP.  Search ended at prefix TCP This can happen due to typos in class names that are passed as strings, or because Tang is configured to use a classloader other than the one that generated the class reference (check your classpath and the code that instantiated Tang)
at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.getAlreadyBoundNode(ClassHierarchyImpl.java:274)
	at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.getNode(ClassHierarchyImpl.java:261)
	at org.apache.reef.tang.implementation.java.ClassHierarchyImpl.parse(ClassHierarchyImpl.java:171)
	... 35 more

nhne avatar Aug 31 '17 09:08 nhne

Oh, that's very unfortunate. I was sure that Tang has support for enums by now! Luckily, this is easy to fix: here's my pull request #1370 - I hope it will help to make your code a few lines shorter 😄

motus avatar Sep 01 '17 01:09 motus

Great work @motus ! I'll fix this after pulling the master. Thanks you very much!

nhne avatar Sep 01 '17 03:09 nhne

@nhne Did you test this code on a YARN cluster? If not, please do so.

bgchun avatar Sep 02 '17 05:09 bgchun

I have ran tests on a YARN clutser with pulling most recent master branch. It passed 36 tests successfully. I will keep testing on Yarn by commits.

nhne avatar Sep 04 '17 08:09 nhne

I think it's better to refactor the tests in this PR.

bgchun avatar Sep 06 '17 05:09 bgchun

@bgchun Either way is fine with me :) so @nhne, could you please refactor the tests?

taegeonum avatar Sep 06 '17 05:09 taegeonum

I have changed implementation of TransportFactory to use Tang for choosing protocols.

And I also merged TransportHttpTest into TransportTest. It was hard to avoid using duplicated codes in separated test because JUnit didn't allowed multiple constructor for any test class and I thought that "changing tpFactory by a set method in instance of a test class" is not a good idea.

@taegeonum I would be grateful if you share your idea! Thank you.

nhne avatar Sep 06 '17 09:09 nhne

@nhne I think you could do the same refactoring on RemoteManagerTest.java, as you did on TransportTest :)

taegeonum avatar Sep 14 '17 02:09 taegeonum

I did merged Http tests into TransportTest and RemoteManagerTest repectly.

nhne avatar Sep 14 '17 05:09 nhne

Thanks for your review! @taegeonum. I'll reconsider the structure of Http Channels considering your review.

nhne avatar Nov 06 '17 02:11 nhne

@taegeonum Sorry for very late commit! I have addressed the review. Would you please have a look?

nhne avatar Nov 23 '17 08:11 nhne

My former implementation need buf as global variable, but now we don't have to keep it global, so I converted it into local. Also I fixed misusing of codec in NettyChannelInitializer and sync in NettyHttpLink. @taegeonum Thank you for your review!

nhne avatar Nov 24 '17 06:11 nhne

Sorry for late check. I have committed about your review. Thank you very much! @taegeonum

nhne avatar Dec 05 '17 07:12 nhne

I thought about this somewhile... If any listener expect any response without any parameter, intetionally empty request can be sent. Then, this check would be erroneous. So I removed the if statements.

Thank you! @taegeonum

nhne avatar Dec 06 '17 06:12 nhne

@taegeonum I have changed copiedBuffer into wrappedBuffer. Also I commented about sync upper. Thank you for your review!

nhne avatar Dec 07 '17 14:12 nhne

@taegeonum Thank you for sharing your idea for sync(). I have removed it from NettyHttpLink. Thank you!

nhne avatar Jan 04 '18 05:01 nhne

@taegeonum fixed the LOG check. Thank you!

nhne avatar Jan 05 '18 05:01 nhne

@taegeonum I have fixed hostAddress into host. also I found URI.create can cause an IllegalArgumentException on invalid address, so I added RemoteRuntimeException about this invalid URI. Thank you for finding this error!

nhne avatar Feb 11 '18 15:02 nhne

@nhne LGTM except for the last comment :)

taegeonum avatar Mar 02 '18 00:03 taegeonum