Hi,

I am preparing a patch for https://issues.apache.org/jira/browse/BOOKKEEPER-827 
, in which try to turn maxOutstandingRequests from "by entries" to "by bytes".  
while reading the part of comments at the front of 
setCompactionMaxOutstandingRequests(), it makes me a little confusing:
"A higher value for this parameter means  more memory will be used for offsets" 
 
<=== here, I thought the memory should mainly be occupied by the entries that 
added into  "FileChannel",  but not flushed.  right?

bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
 : line 1231
 ------------------------ 
/**
     * Set the maximum number of entries which can be compacted without 
flushing.
     *
     * When compacting, the entries are written to the entrylog and the new 
offsets
     * are cached in memory. Once the entrylog is flushed the index is updated 
with
     * the new offsets. This parameter controls the number of entries added to 
the
     * entrylog before a flush is forced. A higher value for this parameter 
means
     * more memory will be used for offsets. Each offset consists of 3 longs.
     *
     * This parameter should _not_ be modified unless you know what you're 
doing.
     * The default is 100,000.
     *
     * @param maxOutstandingRequests number of entries to compact before 
flushing
     *
     * @return ServerConfiguration
     */
    public ServerConfiguration setCompactionMaxOutstandingRequests(int 
maxOutstandingRequests) {
        setProperty(COMPACTION_MAX_OUTSTANDING_REQUESTS, 
maxOutstandingRequests);
        return this;
    }
 ------------------------ 

Thanks a lot.
-Jia

Reply via email to