alcor icon indicating copy to clipboard operation
alcor copied to clipboard

[DPM] GS Manager Major Refactor

Open xieus opened this issue 5 years ago • 1 comments

Context

GS Manager has two major issues that require fix as soon as possible.

  • Global variable usage throughput the class, which could break basic functionality of DPM when two tenants use the same DPM, or two subsequent requests uses the same DPM.
  private Map<String, String> ipPortIdMap;
  private Map<String, String> ipMacMap;
  private Map<String, String> ipSubnetIdMap;
  private Map<String, String> ipHostIpMap;
  private Map<String, Set<String>> hostIpFixedIpsMap;
  private Map<String, Set<String>> hostIpSubnetIdsMap;
  private Map<String, InternalSubnetEntity> subnetIdSubnetsMap;
  private Map<String, InternalPortEntity> portIdPortMap;
  private Map<String, NeighborInfo> portIdNeighborInfoMap;
  • transformNorthToSouth is more than 500+ lines of codes. This needs major refactor to improve code readability and reduce potential risk of NPE (tracking by Issue #431)

xieus avatar Oct 26 '20 23:10 xieus

The first issue should be resolved by d2afb65 (#418) by getting rid of DPM global variable, and keeping them local on a message level.

xieus avatar Oct 27 '20 19:10 xieus