Refine the code.
merge from hbase-11339-core-compaction