You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/01 14:02:27 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #14515: Optimize memory usage: support to shrink for pendingAcks map

eolivelli commented on a change in pull request #14515:
URL: https://github.com/apache/pulsar/pull/14515#discussion_r816793595



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -704,6 +704,12 @@
     )
     private boolean isAllowAutoUpdateSchemaEnabled = true;
 
+    @FieldContext(
+            category = CATEGORY_SERVER,
+            doc = "Whether ConcurrentLongLongPairHashMap supports automatic shrinking," +
+                    "the default is false, which means automatic shrinking is not supported.")
+    private boolean autoShrink = false;

Review comment:
       we shouldn't add this knob.
   and if we really want the name should be more narrow and point exactly to the thing that we are changing

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Topic.java
##########
@@ -161,8 +161,17 @@ default boolean isChunked() {
      * @param option
      * @return
      */
+    @Deprecated
     CompletableFuture<Consumer> subscribe(SubscriptionOption option);
 
+    /**
+     * Subscribe a topic.
+     *
+     * @param autoShrink whether ConcurrentLongLongPairHashMap supports automatic shrinking.
+     * @return
+     */
+    CompletableFuture<Consumer> subscribe(SubscriptionOption option, boolean autoShrink);

Review comment:
       I believe that adding a new method for "autoShrink" is not necessary.
   also the variable name should be more meaningful.




-- 
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: commits-unsubscribe@pulsar.apache.org

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