ramkrish86 commented on a change in pull request #757: HBASE-23196 The
IndexChunkPool’s percentage is hard code to 0.1
URL: https://github.com/apache/hbase/pull/757#discussion_r338917839
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ChunkCreator.java
##########
@@ -193,34 +197,19 @@ Chunk getChunk(CompactingMemStore.IndexType
chunkIndexType, ChunkType chunkType)
* @param size the size of the chunk to be allocated, in bytes
*/
Chunk getChunk(CompactingMemStore.IndexType chunkIndexType, int size) {
- Chunk chunk = null;
- MemStoreChunkPool pool = null;
-
- // if the size is suitable for one of the pools
- if (dataChunksPool != null && size == dataChunksPool.getChunkSize()) {
- pool = dataChunksPool;
- } else if (indexChunksPool != null && size ==
indexChunksPool.getChunkSize()) {
- pool = indexChunksPool;
- }
-
- // if we have a pool
- if (pool != null) {
- // the pool creates the chunk internally. The chunk#init() call happens
here
- chunk = pool.getChunk();
- // the pool has run out of maxCount
- if (chunk == null) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The chunk pool is full. Reached maxCount= " +
pool.getMaxCount()
- + ". Creating chunk onheap.");
+ Optional<MemStoreChunkPool> pool =
+ size == this.indexChunkSize ? indexChunksPool : dataChunksPool;
+ Chunk chunk = pool.map(MemStoreChunkPool::getChunk).orElseGet(
+ new Supplier<Chunk>() {
Review comment:
Good.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services