cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wilderrodrigues <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-8814 - Refactoring the configu...
Date Wed, 09 Sep 2015 12:07:06 GMT
Github user wilderrodrigues commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/788#discussion_r39034047
  
    --- Diff: server/src/com/cloud/network/router/NetworkHelperImpl.java ---
    @@ -610,20 +608,22 @@ protected HypervisorType getClusterToStartDomainRouterForOvm(final
long podId) {
             throw new CloudRuntimeException(errMsg);
         }
     
    -    @Override
    -    public LinkedHashMap<Network, List<? extends NicProfile>> configureDefaultNics(final
RouterDeploymentDefinition routerDeploymentDefinition) throws ConcurrentOperationException,
InsufficientAddressCapacityException {
    -
    -        final LinkedHashMap<Network, List<? extends NicProfile>> networks
= new LinkedHashMap<Network, List<? extends NicProfile>>(3);
    +    protected LinkedHashMap<Network, List<? extends NicProfile>> configureControlNic(final
RouterDeploymentDefinition routerDeploymentDefinition) {
    +        final LinkedHashMap<Network, List<? extends NicProfile>> controlConfig
= new LinkedHashMap<Network, List<? extends NicProfile>>(3);
     
    -        // 1) Control network
             s_logger.debug("Adding nic for Virtual Router in Control network ");
             final List<? extends NetworkOffering> offerings = _networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemControlNetwork);
             final NetworkOffering controlOffering = offerings.get(0);
    -        final Network controlConfig = _networkMgr.setupNetwork(s_systemAccount, controlOffering,
routerDeploymentDefinition.getPlan(), null, null, false).get(0);
    +        final Network controlNic = _networkMgr.setupNetwork(s_systemAccount, controlOffering,
routerDeploymentDefinition.getPlan(), null, null, false).get(0);
     
    -        networks.put(controlConfig, new ArrayList<NicProfile>());
    +        controlConfig.put(controlNic, new ArrayList<NicProfile>());
    +
    +        return controlConfig;
    +    }
    +
    +    protected LinkedHashMap<Network, List<? extends NicProfile>> configurePublicNic(final
RouterDeploymentDefinition routerDeploymentDefinition, final boolean hasGuestNic) {
    +        final LinkedHashMap<Network, List<? extends NicProfile>> publicConfig
= new LinkedHashMap<Network, List<? extends NicProfile>>(3);
    --- End diff --
    
    Hi @koushik-das ,
    
    I just refactored the code and did not bother about the initial size - it was there before.
It actually won't change anything in terms of performance.
    
    Cheers,
    Wilder


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message