sijie commented on a change in pull request #1755:  Configure Netty allocator 
in bookie and client 
URL: https://github.com/apache/bookkeeper/pull/1755#discussion_r228748412
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
 ##########
 @@ -3093,4 +3102,77 @@ public ServerConfiguration 
setEntryLogPerLedgerCounterLimitsMultFactor(
                 Integer.toString(entryLogPerLedgerCounterLimitsMultFactor));
         return this;
     }
+
+    /**
+     * Return the configured pooling policy for the allocator.
+     */
+    public PoolingPolicy getAllocatorPoolingPolicy() {
+        return PoolingPolicy.valueOf(this.getString(ALLOCATOR_POOLING_POLICY, 
PoolingPolicy.PooledDirect.toString()));
+    }
+
+    /**
+     * Define the memory pooling policy.
+     *
+     * <p>Default is {@link PoolingPolicy#PooledDirect}
+     */
+    public ServerConfiguration setAllocatorPoolingPolicy(PoolingPolicy 
poolingPolicy) {
+        this.setProperty(ALLOCATOR_POOLING_POLICY, poolingPolicy.toString());
+        return this;
+    }
+
+    /**
+     * Return the configured pooling concurrency for the allocator.
+     */
+    public int getAllocatorPoolingConcurrency() {
+        return this.getInteger(ALLOCATOR_POOLING_CONCURRENCY, 2 * 
Runtime.getRuntime().availableProcessors());
+    }
+
+    /**
+     * Controls the amount of concurrency for the memory pool.
+     *
+     * <p>Default is to have a number of allocator arenas equals to 2 * CPUS.
+     *
+     * <p>Decreasing this number will reduce the amount of memory overhead, at 
the
+     * expense of increased allocation contention.
+     */
+    public ServerConfiguration setAllocatorPoolingConcurrenncy(int 
concurrency) {
 
 Review comment:
   add `@param` and `@return`?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to