Refine the code according to Ram's patch.
Merge branch 'hbase-11339-core' of https://github.com/JingchengDu/hbase into hbase-11339-core