@InterfaceAudience.Private public class MobCell extends Object implements Closeable
Cell and a StoreFileScanner inside. Now, the mob cell
is backend by NIO ByteBuffers which are allocated from ByteBuffAllocator, so we cannot just read
the cell and close the MOB file scanner because the MOB file scanner closing will deallocate the
NIO ByteBuffers, which resulting memory leak.
Actually, the right solution is:
1. Read the normal cell;
2. Parse the value of normal cell and get MOB fileName,offset,length;
3. Open scanner to read the mob value;
4. Construct the response cell whose key is from the normal cell and value is from the mob cell.
5. Ship the response cell to HBase client.
6. Release both normal cell's block and mob cell's block.
For mob cell, the block releasing just means closing the the mob scanner, so here we need to keep
the StoreFileScanner inside and close only when we're ensure that the MobCell has been
shipped to RPC client.
| Constructor and Description |
|---|
MobCell(Cell cell) |
MobCell(Cell cell,
StoreFileScanner sfScanner) |
public MobCell(Cell cell)
public MobCell(Cell cell, StoreFileScanner sfScanner)
public Cell getCell()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.