-
Notifications
You must be signed in to change notification settings - Fork 34
[Vpc/Subnet Manager] API Standardization, and Segment APIs #181
Conversation
Replace Redis with Apache Ignite for in memory cache and db (futurewei-cloud#129)
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 feedback for the new iteration.
...s/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/SegmentController.java
Outdated
Show resolved
Hide resolved
..._manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/SegmentRangeController.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/NetworkSegmentRangeWebRequestJson.java
Show resolved
Hide resolved
@JsonProperty("mtu") | ||
private String mtu; | ||
|
||
@JsonProperty("vlan_id") |
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 class is for VxLan, so the id should be "vxlan_id", instead of "vlan_id" :-)
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 think this property is used to store the vlan_id related to vxlan ~ let us talk about it
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 don't think we discussed this before.
We still need to fix the UT failure. |
.../vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/DebugVpcController.java
Outdated
Show resolved
Hide resolved
.../vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/DebugVpcController.java
Outdated
Show resolved
Hide resolved
.../vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/DebugVpcController.java
Outdated
Show resolved
Hide resolved
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.
Left a few more comments. Vlan allocation looks better!
lib/src/main/java/com/futurewei/alcor/common/constants/NetworkType.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/futurewei/alcor/common/exception/InternalDbOperationException.java
Outdated
Show resolved
Hide resolved
if (NetworkTypeEnum.VXLAN.getNetworkType().equals(networkType)) { | ||
key = segmentService.addVxlanEntity(segmentWebRequestObject.getId()); | ||
} else if (NetworkTypeEnum.VLAN.getNetworkType().equals(networkType)) { | ||
key = segmentService.addVlanEntity(segmentWebRequestObject.getId(), networkTypeId, networkType); |
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.
Do we need the parameter of networkType in the addVlanEntity method?
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.
Yes
public VlanKeyRequest allocateVlan(VlanKeyRequest request) throws Exception; | ||
public VlanKeyRequest releaseVlan(String networkType, String rangeId, Long key) throws Exception; | ||
public VlanKeyRequest getVlan(String networkType, String rangeId, Long key) throws Exception; | ||
public NetworkVlanRangeRequest createRange(NetworkVlanRangeRequest request) throws Exception; |
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.
Ideally, the Segment Service could have a generic method name like addEntity(segmentId, segmentationId, networkType) so that it could have different implementation for various network types.
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.
Yeah it looks better in structure ~ but if we have that in SegmentService, we maybe not implement three different implementations in SegmentServiceImpl
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.
Three implementation would look fantastic. why not? :-)
web/src/main/java/com/futurewei/alcor/web/entity/NetworkVlanRange.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/NetworkVlanRangeRequest.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/SegmentWebResponseObject.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/VlanKeyAlloc.java
Outdated
Show resolved
Hide resolved
# Conflicts: # docs/design/vpc_manager.adoc
…o futurewei-cloud-master
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.
A few more comments, most of them are minor. There is one issue we need to pay attention to: NetworkVlanRange/NetworkVxlanRange shouldn't include segment id. The schema appears not right.
lib/src/main/java/com/futurewei/alcor/common/config/MockIgniteConfiguration.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/futurewei/alcor/common/exception/NetworkKeyAllocNotFoundException.java
Outdated
Show resolved
Hide resolved
services/api_gateway/src/main/java/com/futurewei/alcor/apigateway/vpc/VpcWebConfiguration.java
Show resolved
Hide resolved
...s/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/controller/SegmentController.java
Outdated
Show resolved
Hide resolved
|
||
import java.util.Map; | ||
|
||
public interface SegmentDatabaseService { |
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.
There is another service interface called "SegmentService" but it also deals with database access, right? In this case, we should use names that match what it is exactly?
A renaming suggestion:
(1) SegmentDatabaseService => SegmentManagementService
(2) SegmentService => SegmentKeyManagementService
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.
Let's talk about it
...es/vpc_manager/src/main/java/com/futurewei/alcor/vpcmanager/utils/RestPreconditionsUtil.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/NetworkVlanRange.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/NetworkVlanType.java
Outdated
Show resolved
Hide resolved
web/src/main/java/com/futurewei/alcor/web/entity/NetworkVxlanRange.java
Outdated
Show resolved
Hide resolved
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.
LGTM. Thanks for the point-to-point response to the comments.
Code refactor and new features included in this PR: