[
https://issues.apache.org/jira/browse/QPID-8666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17814674#comment-17814674
]
ASF GitHub Bot commented on QPID-8666:
--------------------------------------
dakirily commented on code in PR #239:
URL: https://github.com/apache/qpid-broker-j/pull/239#discussion_r1479388677
##########
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:
Variable name were renamed appropriately.
The upgrader code was changed to make logic for BONECP old type and "Broker"
entity the same.
> [Broker-J] Broker plugin jdbc-provider-bone replacement
> -------------------------------------------------------
>
> Key: QPID-8666
> URL: https://issues.apache.org/jira/browse/QPID-8666
> Project: Qpid
> Issue Type: Improvement
> Components: Broker-J
> Affects Versions: qpid-java-broker-9.1.0
> Reporter: Daniil Kirilyuk
> Priority: Major
> Fix For: qpid-java-broker-9.2.0
>
>
> Broker plugin jdbc-provider-bone relies on JDBC connection pooling library
> bonecp, which is no longer developed or updated. The [github project
> page|https://github.com/wwadge/bonecp] states:
> "BoneCP is a Java JDBC connection pool implementation that is tuned for high
> performance by minimizing lock contention to give greater throughput for your
> applications. It beats older connection pools such as C3P0 and DBCP but
> should now be considered deprecated in favour of HikariCP".
> Plugin jdbc-provider-bone should be replaced with the new one
> jdbc-provider-hikaricp based on
> [HikariCP|https://github.com/brettwooldridge/HikariCP] library. Both
> libraries use Apache-2.0 license.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]