cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafaelweingartner <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1878: CLOUDSTACK-9717: [VMware] RVRs have mismatchi...
Date Mon, 13 Mar 2017 14:57:06 GMT
Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1878#discussion_r105676576
  
    --- Diff: engine/schema/src/com/cloud/vm/dao/NicDaoImpl.java ---
    @@ -302,4 +309,17 @@ public int countNicsForStartingVms(long networkId) {
             List<Integer> results = customSearch(sc, null);
             return results.get(0);
         }
    +
    +    @Override
    +    public Long getPeerRouterId(String publicMacAddress, final long routerId) {
    +        final SearchCriteria<NicVO> sc = PeerRouterSearch.create();
    +        sc.setParameters("instanceId", routerId);
    +        sc.setParameters("macAddress", publicMacAddress);
    +        sc.setParameters("vmType", VirtualMachine.Type.DomainRouter);
    +        NicVO nicVo = findOneBy(sc);
    +        if (nicVo != null) {
    +            return (new Long(nicVo.getInstanceId()));
    --- End diff --
    
    Let the auto-boxing and auto-unboxing do this for you.
    When you do this manually the pool of String/numbers of java will not be used.
    You just need to return `nicVo.getInstanceId()`


---
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