Affects Version/s: None
Fix Version/s: None
We've some discussion about the Shipper interface.
it seems not an elegant ways...for example:
1. we want to keep the previous cell in the scanner, we must deep clone the kv before an shipping, otherwise the ship will free all the ByteBuffers, the prevCell will point to an unknown area.
2. when switch from PREAD to STREAM in a long scan, we also have accomplish this in shipped() method. if not , once we close the PREAD scanner, the un-shipped cell will also point to an unknown memory area, because the scanner closing free all ByteBuffes.
If we change to use refCnt to manage the RPC memory release or retain, we can just call prevCell.retain.. then it memory won't be free unless the prevCell reach the end of life and call prevCell#release. I mean we can replace all the shipper logic by using cell#release and cell#retain.
One concern is about the API, actually the ExtendCell is an pure server side type, we can make the ExtendCell extend the Netty's ReferenceCounted interface , and provide an retain() and release() methods. we won't maitain an refCnt in ExtendCell, the refCnt is still in HFileBlock. Once we encoded an ExtendCell to CellScanner, we can release the extendCell, and it will release its blocks backend... so in theory, will have no performance loss...
Anyway, that would be a big change, so maybe need to create another new feature branch to address this.