This is an automated email from the ASF dual-hosted git repository.
xxyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new 8e44f57 KYLIN-4653 Make the capacity for the LinkedBlockingQueue of
BlockingReservoir configurable
8e44f57 is described below
commit 8e44f573be5905fe85f10241f0f7a7844e48f5f0
Author: chuxiao <[email protected]>
AuthorDate: Wed Jul 22 23:53:35 2020 +0800
KYLIN-4653 Make the capacity for the LinkedBlockingQueue of
BlockingReservoir configurable
---
.../java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java | 6 +++++-
server/src/main/resources/kylinMetrics.xml | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git
a/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java
b/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java
index 4798e52..afa34a9 100644
---
a/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java
+++
b/core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java
@@ -60,6 +60,10 @@ public class BlockingReservoir extends
AbstractActiveReservoir {
}
public BlockingReservoir(int minReportSize, int maxReportSize, int
maxReportTime) {
+ this(minReportSize, maxReportSize, maxReportSize, MAX_QUEUE_SIZE);
+ }
+
+ public BlockingReservoir(int minReportSize, int maxReportSize, int
maxReportTime, int maxQueueSize) {
Preconditions.checkArgument(minReportSize > 0, "minReportSize should
be larger than 0");
Preconditions.checkArgument(maxReportSize >= minReportSize,
"maxReportSize should not be less than minBatchSize");
@@ -68,7 +72,7 @@ public class BlockingReservoir extends
AbstractActiveReservoir {
this.maxReportSize = maxReportSize;
this.maxReportTime = maxReportTime * 60 * 1000L;
- this.recordsQueue = new LinkedBlockingQueue<>(MAX_QUEUE_SIZE);
+ this.recordsQueue = new LinkedBlockingQueue<>(maxQueueSize);
this.listeners = Lists.newArrayList();
this.records = Lists.newArrayListWithExpectedSize(this.maxReportSize);
diff --git a/server/src/main/resources/kylinMetrics.xml
b/server/src/main/resources/kylinMetrics.xml
index 85c879f..a9d907a 100644
--- a/server/src/main/resources/kylinMetrics.xml
+++ b/server/src/main/resources/kylinMetrics.xml
@@ -34,10 +34,15 @@
<value>500</value>
</constructor-arg>
- <!-- minReportTime, min duration(in minute) between two report
action-->
+ <!-- maxReportTime, max duration(in minute) between two report
action-->
<constructor-arg index="2">
<value>10</value>
</constructor-arg>
+
+ <!-- maxQueueSize, max queue size of LinkedBlockingQueue-->
+ <constructor-arg index="3">
+ <value>50000</value>
+ </constructor-arg>
</bean>
<bean id="hiveSink"
class="org.apache.kylin.metrics.lib.impl.hive.HiveSink"/>