pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat closed pull request #2460: Add backlog quota retention policy to server config.
Date Tue, 28 Aug 2018 17:39:57 GMT
merlimat closed pull request #2460: Add backlog quota retention policy to server config.
URL: https://github.com/apache/incubator-pulsar/pull/2460
 
 
   

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/conf/broker.conf b/conf/broker.conf
index 427d848264..22d8a24c70 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -64,6 +64,12 @@ backlogQuotaCheckIntervalInSeconds=60
 # Default per-topic backlog quota limit
 backlogQuotaDefaultLimitGB=10
 
+# Default backlog quota retention policy. Default is producer_request_hold
+# 'producer_request_hold' Policy which holds producer's send request until the resource becomes
available (or holding times out)
+# 'producer_exception' Policy which throws javax.jms.ResourceAllocationException to the producer
+# 'consumer_backlog_eviction' Policy which evicts the oldest message from the slowest consumer's
backlog
+backlogQuotaDefaultRetentionPolicy=producer_request_hold
+
 # Enable the deletion of inactive topics
 brokerDeleteInactiveTopicsEnabled=true
 
diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
index c18ec2d3cd..1cd50bce3f 100644
--- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
@@ -31,6 +31,7 @@
 import org.apache.pulsar.common.configuration.PulsarConfiguration;
 
 import com.google.common.collect.Sets;
+import org.apache.pulsar.common.policies.data.BacklogQuota;
 
 /**
  * Pulsar service configuration object.
@@ -86,6 +87,11 @@
     private int backlogQuotaCheckIntervalInSeconds = 60;
     // Default per-topic backlog quota limit
     private long backlogQuotaDefaultLimitGB = 50;
+    //Default backlog quota retention policy. Default is producer_request_hold
+    //'producer_request_hold' Policy which holds producer's send request until the resource
becomes available (or holding times out)
+    //'producer_exception' Policy which throws javax.jms.ResourceAllocationException to the
producer
+    //'consumer_backlog_eviction' Policy which evicts the oldest message from the slowest
consumer's backlog
+    private BacklogQuota.RetentionPolicy backlogQuotaDefaultRetentionPolicy = BacklogQuota.RetentionPolicy.producer_request_hold;
     // Enable the deletion of inactive topics
     private boolean brokerDeleteInactiveTopicsEnabled = true;
     // How often to check for inactive topics
@@ -1808,4 +1814,12 @@ public void setBrokerServiceCompactionMonitorIntervalInSeconds(int
interval) {
     public int getBrokerServiceCompactionMonitorIntervalInSeconds() {
         return this.brokerServiceCompactionMonitorIntervalInSeconds;
     }
+
+    public BacklogQuota.RetentionPolicy getBacklogQuotaDefaultRetentionPolicy() {
+        return backlogQuotaDefaultRetentionPolicy;
+    }
+
+    public void setBacklogQuotaDefaultRetentionPolicy(BacklogQuota.RetentionPolicy backlogQuotaDefaultRetentionPolicy)
{
+        this.backlogQuotaDefaultRetentionPolicy = backlogQuotaDefaultRetentionPolicy;
+    }
 }
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
index e7e38dd2d4..7d607cdcb9 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java
@@ -50,7 +50,7 @@
     public BacklogQuotaManager(PulsarService pulsar) {
         this.defaultQuota = new BacklogQuota(
                 pulsar.getConfiguration().getBacklogQuotaDefaultLimitGB() * 1024 * 1024 *
1024,
-                RetentionPolicy.producer_request_hold);
+                pulsar.getConfiguration().getBacklogQuotaDefaultRetentionPolicy());
         this.zkCache = pulsar.getConfigurationCache().policiesCache();
     }
 


 

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

Mime
View raw message