-
Notifications
You must be signed in to change notification settings - Fork 34
[Microservice] Port Manager 2.0 Implementation #301
Conversation
451e09a to
d578881
Compare
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some early comments. I will continue to review the rest.
lib/src/main/java/com/futurewei/alcor/common/db/ignite/IgniteConfiguration.java
Show resolved
Hide resolved
| if (startTimes.containsKey(id)) { | ||
| startTime = startTimes.get(id); | ||
| } else { | ||
| startTime = endTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this give us some false positive information that the duration is zero? :-)
...manager/src/main/java/com/futurewei/alcor/portmanager/service/implement/PortServiceImpl.java
Show resolved
Hide resolved
services/port_manager/src/main/resources/application.properties
Outdated
Show resolved
Hide resolved
| @PostMapping("/ips") | ||
| @ResponseBody | ||
| @ResponseStatus(HttpStatus.CREATED) | ||
| @DurationStatistics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very good annotation. Consider to apply it to all other services as well 👍
13d5c8d to
f752478
Compare
|
After optimization, the performance data for creating a single port is as follows: Port configuration: |
34acc08 to
439252a
Compare
Codecov Report
@@ Coverage Diff @@
## master #301 +/- ##
============================================
- Coverage 37.55% 34.15% -3.41%
- Complexity 550 859 +309
============================================
Files 241 353 +112
Lines 5680 8869 +3189
Branches 575 1078 +503
============================================
+ Hits 2133 3029 +896
- Misses 3292 5438 +2146
- Partials 255 402 +147
Continue to review full report at Codecov.
|
|
@chenpiaoping Some code conflict due to PR #304 that got just merged. |
@chenpiaoping The result is outstanding. I will expedite the PR review and let us try to get the PR part of the release. Couple of questions:
Cheers! |
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chenpiaoping Some more comments, mostly minor.
I was wondering if we have a plan to recover IpAddrTest and IpRangeTest, which include good tests.
lib/src/main/java/com/futurewei/alcor/common/db/ignite/MockIgniteServer.java
Show resolved
Hide resolved
| */ | ||
| package com.futurewei.alcor.portmanager.processor; | ||
|
|
||
| import org.slf4j.Logger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Alcor logger or you need something special from slf4j?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought alcor would use slf4j directly.
| } | ||
|
|
||
| public String getVpcId() { | ||
| return vpcId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the @DaTa annotation not work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i know, @ Data is no longer recommended because it generates code during compilation and has Poor security and maintainability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks, let us remind the team of this annotation limit and start cleaning up the annotation when we see that.
services/security_group_manager/src/main/resources/application.properties
Show resolved
Hide resolved
| import static com.futurewei.alcor.securitygroup.utils.RestParameterValidator.*; | ||
|
|
||
| @RestController | ||
| @ComponentScan(value = "com.futurewei.alcor.common.stats") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chenpiaoping Can you test the SG APIs from API GW to see if anything is expected? Recently there is a minor change of List SG API introduced by PR ##304. The List SG contract was not fully compatible wit Neutron. Can you check others as well.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do it a separate/small PR if any change is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i will do that.
439252a to
89faca6
Compare
|
When we generate the test payload, do we automatically generate different configurations (uuid, ip address, mac address etc.) for different ports? This would impact performance as if we use the same configuration, we always hit the same record. |
ece36ae to
3197a81
Compare
|
@xieus |
c66982e to
8d593dc
Compare
|
@xieus This PR is ready to be reviewed. |
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xieus This PR is ready to be reviewed.
Thanks @chenpiaoping Somehow I missed this message. Let me do the review this afternoon.
| @@ -0,0 +1,9 @@ | |||
| package com.futurewei.alcor.portmanager.processor; | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line.
8d593dc to
f83279f
Compare
0f917a2 to
9019891
Compare
10515f2 to
5d034e9
Compare
5d034e9 to
0827dc5
Compare
xieus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have Port Manager 2.0 now 👍
@chenpiaoping It may be a good idea for you to give some high-level introduction of new Port Manager design and implementation in the open-source meeting. This is a pretty decent implementation.
| } | ||
|
|
||
| @Override | ||
| void createProcess(PortContext context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This createProcess only applies to port with binding host id. How about those without binding host id?
| import java.util.*; | ||
|
|
||
| @Component | ||
| public class ProcessorManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give some comments to ProcessManager, AbstractProcess, PortProcess, and other types of processes etc.?
| import java.util.concurrent.CompletableFuture; | ||
| import java.util.concurrent.CompletionException; | ||
|
|
||
| public class RequestManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make some comments to RequestManager, and some other important requests as well.


This PR includes the following features: