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 2020/07/29 17:52:04 UTC

[GitHub] [kylin] kyotoYaho commented on a change in pull request #1334: KYLIN-4653 Make the capacity for the LinkedBlockingQueue

kyotoYaho commented on a change in pull request #1334:
URL: https://github.com/apache/kylin/pull/1334#discussion_r462406410



##########
File path: core-metrics/src/main/java/org/apache/kylin/metrics/lib/impl/BlockingReservoir.java
##########
@@ -60,14 +60,15 @@ public BlockingReservoir(int minReportSize, int maxReportSize) {
     }
 
     public BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime) {
-        this(minReportSize, maxReportSize, maxReportSize, MAX_QUEUE_SIZE);
+        this(minReportSize, maxReportSize, maxReportTime, 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");
         Preconditions.checkArgument(maxReportTime > 0, "maxReportTime should be larger than 0");
+        Preconditions.checkArgument(maxQueueSize > 0, "maxQueueSize should be larger than 0");

Review comment:
       How about making it possible to use unbounded LinkedBlockingQueue like following?
   
   this.recordsQueue = maxQueueSize <= 0 ? new LinkedBlockingQueue<>() : new LinkedBlockingQueue<>(maxQueueSize);
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org