[ 
https://issues.apache.org/jira/browse/HBASE-14921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15221489#comment-15221489
 ] 

Anoop Sam John commented on HBASE-14921:
----------------------------------------

On CellBlock we have
CellBlock createCellBlocks(Comparator<? super Cell> comparator, int min,
              int max, boolean descending);
This is for making a sub set of original block.  Can we have a better name pls?

getCellFromIndex(int i) -> getCell (int index) Is this enough?

getValidIndex -> Name looks diff to understand what it does.  Pls add some 
comments.. Other places wherever necessary

HeapMemStoreLAB memStoreLAB -> WHy need the impl type here?  We have MSLAB 
interface now. 
HeapMemStoreLAB.Chunk[] chunks  -> Do we need to keep Chunk refs?  byte[] refs 
is enough?
Or is this for return back to MSLAB pool after the DISK flush?

{code}
if(chunkPool != null) {
199             c = chunkPool.getChunk();
200           } else {
201             c = new Chunk(chunkSize, 5);
202             c.init();
203           }
{code}
Why this move of init to here immediately after the new Chunk is made? When 
multiple threads are at this point, there is a chance that more than one will 
do this init call make make byte[]. If it is after compareAndSet, it is sure 
abt the concurrency solution.

{code}
Chunk translateIdToChunk(int id) {
225         return chunkPool.translateIdToChunk(id);
226       }
{code}
What if chunk pool is null?

allocateChunk - Why is it needed when we have getOrMakeChunk? Who will 
guarantee thread safety here?

//org.junit.Assert.assertTrue("\n\n inside chunk initialization 3", false);
pls remove commented code.. Some other cases also.

-reclaimedChunks.add(chunk);    
I can not see where we will be adding it as per the patch?  The initial created 
chunks were added here.  


> Memory optimizations
> --------------------
>
>                 Key: HBASE-14921
>                 URL: https://issues.apache.org/jira/browse/HBASE-14921
>             Project: HBase
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Eshcar Hillel
>            Assignee: Anastasia Braginsky
>         Attachments: CellBlocksSegmentInMemStore.pdf, 
> CellBlocksSegmentinthecontextofMemStore(1).pdf, HBASE-14921-V01.patch, 
> HBASE-14921-V02.patch
>
>
> Memory optimizations including compressed format representation and offheap 
> allocations



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to