You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Manu Kranth Chary <ma...@gmail.com> on 2013/04/13 01:17:43 UTC

What is the necessity of having a private ThreadLocal in FSReaderV2

I was trying to investigate the scenarios in which we perform a seek back
of 24 bytes(Header size) while we do a HFileBlock read. In the process I
stumbled upon this issue. In order to avoid the seek back problem, what we
do is to store the header of the next block in a class named
PrefetchedHeader. This prefetched header is stored as a private ThreadLocal
object in the FSReaderV2 class. I was wondering why we would be needing a
ThreadLocalc when each FSReader object has its own PrefetchedHeader object
and moreover if its private. Can anybody familiar with this part of the
code tell me what was the design decision that was taken at that time?

Thanks,
Manukranth Kolloju