You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2019/01/03 07:04:55 UTC
[GitHub] shaofengshi closed pull request #427: KYLIN-3752 Increase
broadcaster's concurrency to avoid exceptions
shaofengshi closed pull request #427: KYLIN-3752 Increase broadcaster's concurrency to avoid exceptions
URL: https://github.com/apache/kylin/pull/427
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java b/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
index b9c03b62ff..834401ca09 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/cachesync/Broadcaster.java
@@ -91,14 +91,17 @@ private Broadcaster(final KylinConfig config) {
this.config = config;
this.syncErrorHandler = getSyncErrorHandler(config);
this.announceMainLoop = Executors.newSingleThreadExecutor(new DaemonThreadFactory());
- this.announceThreadPool = new ThreadPoolExecutor(1, 10, 60L, TimeUnit.SECONDS,
- new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory());
-
+
final String[] nodes = config.getRestServers();
if (nodes == null || nodes.length < 1) {
logger.warn("There is no available rest server; check the 'kylin.server.cluster-servers' config");
}
logger.debug("{} nodes in the cluster: {}", (nodes == null ? 0 : nodes.length), Arrays.toString(nodes));
+
+ int corePoolSize = (nodes == null || nodes.length < 1)? 1 : nodes.length;
+ int maximumPoolSize = (nodes == null || nodes.length < 1)? 10 : nodes.length * 2;
+ this.announceThreadPool = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, 60L, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory());
announceMainLoop.execute(new Runnable() {
@Override
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services