imbajin commented on code in PR #704:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/pull/704#discussion_r2704409171
##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java:
##########
@@ -406,9 +425,31 @@ public static LoadOptions parseOptions(String[] args) {
options.maxParseErrors = Constants.NO_LIMIT;
options.maxInsertErrors = Constants.NO_LIMIT;
}
+ if (options.batchInsertThreads != CPUS) {
+ adjustConnectionPoolIfDefault(options);
+ }
return options;
}
+ private static void adjustConnectionPoolIfDefault(LoadOptions options) {
+ int batchThreads = options.batchInsertThreads;
+ int maxConn = options.maxConnections;
+ int maxConnPerRoute = options.maxConnectionsPerRoute;
+ if (maxConn == DEFAULT_MAX_CONNECTIONS && maxConn < batchThreads * 4) {
+ options.maxConnections = batchThreads * 4;
+ LOG.info("Auto adjusted max-conn to {} based on " +
+ "batch-insert-threads({})",
Review Comment:
hit 100 chars?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]