lordcheng10 commented on a change in pull request #3061:
URL: https://github.com/apache/bookkeeper/pull/3061#discussion_r810524933
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java
##########
@@ -220,22 +329,36 @@ public void forEach(BiConsumerLongPair processor) {
}
// A section is a portion of the hash map that is covered by a single
+ @Setter
@SuppressWarnings("serial")
private static final class Section extends StampedLock {
// Keys and values are stored interleaved in the table array
private volatile long[] table;
private volatile int capacity;
private volatile int size;
- private int usedBuckets;
- private int resizeThreshold;
-
- Section(int capacity) {
+ private volatile int usedBuckets;
+ private int resizeThresholdUp;
+ private int resizeThresholdBelow;
+ private volatile float mapFillFactor;
Review comment:
> I think it would be a bit tricky to auto-adjust at runtime.
1. Similar to other dynamic configurations of pulsar, the configuration can
be adjusted without restarting the broker.
> For now we could just leave it to configure at creation time. I agree that
for cases like pending acks we need to be aggressive in reclaiming space but I
don't see how to change that based on load.
2. For example, through the size() and capacity() methods, you can calculate
the memory usage percentage usePercent=size()/capacity(), so as to determine
whether the configuration parameters need to be adjusted;
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]