gemmellr commented on code in PR #239: URL: https://github.com/apache/qpid-broker-j/pull/239#discussion_r1479641958
########## broker-core/src/main/java/org/apache/qpid/server/store/UpgraderHelper.java: ########## @@ -79,32 +80,45 @@ public static ConfiguredObjectRecord upgradeConnectionPool(final ConfiguredObjec { final Map<String, Object> attributes = record.getAttributes(); + final Map<String, Object> updatedAttributes = new HashMap<>(record.getAttributes()); + if (BONECP.equals(attributes.get(CP_TYPE))) + { + updatedAttributes.put(CP_TYPE, HIKARICP); + } + final Object contextObject = attributes.get(CONTEXT); if (contextObject instanceof Map) { final Map <String, String> context = (Map<String, String>) contextObject; final Map<String, String> newContext = UpgraderHelper.renameContextVariables(context, RENAME_MAPPING); + final int partitionCount = newContext.get(PARTITION_COUNT_PARAM) != null + ? Integer.parseInt(String.valueOf(newContext.remove(PARTITION_COUNT_PARAM))) : 0; + final int maximumPoolSize = newContext.get(MAX_POOL_SIZE_PARAM) != null && partitionCount != 0 + ? Integer.parseInt(String.valueOf(newContext.get(MAX_POOL_SIZE_PARAM))) * partitionCount : 40; + final int minIdle = newContext.get(MIN_IDLE_PARAM) != null && partitionCount != 0 + ? Integer.parseInt(String.valueOf(newContext.get(MIN_IDLE_PARAM))) * partitionCount : 20; + if (BONECP.equals(attributes.get(CP_TYPE))) { - final int partitionCount = newContext.get(PARTITION_COUNT_PARAM) != null - ? Integer.parseInt(newContext.remove(PARTITION_COUNT_PARAM)) : 0; - final int maximumPoolSize = newContext.get(MAX_POOL_SIZE_PARAM) != null && partitionCount != 0 - ? Integer.parseInt(newContext.get(MAX_POOL_SIZE_PARAM)) * partitionCount : 40; - final int minIdle = newContext.get(MIN_IDLE_PARAM) != null && partitionCount != 0 - ? Integer.parseInt(newContext.get(MIN_IDLE_PARAM)) * partitionCount : 20; newContext.put(MAX_POOL_SIZE_PARAM, String.valueOf(maximumPoolSize)); newContext.put(MIN_IDLE_PARAM, String.valueOf(minIdle)); } - final Map<String, Object> updatedAttributes = new HashMap<>(record.getAttributes()); - if (BONECP.equals(attributes.get(CP_TYPE))) + else if ("Broker".equals(record.getType())) Review Comment: looks good, merged -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org