[HBASE-8194] Fixing the non deterministic failure of TestHFileOutputFormat.

Author: manukranthk

Summary:
The test creates regions in the meta region and waits for the master to allot them to regionservers. When the favored nodes were set, the timout was not completely reliable to say that they will be set.
Instead setting the favored nodes while creating the regions directly in the starting would ensure that the master creates the regions assigning selected favored nodes.

Test Plan: Unit Tests

Reviewers: liyintang, rshroff, adela

Reviewed By: rshroff

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D728493

Task ID: 2138207

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1461253 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-5263] Auto Cache hot blocks on compaction v1

Author: rshroff

Summary:
This change will try to cache blocks which are hot on compaction.
The design is same as mentioned in the JIRA.
The implementation is very simple as of now:
1. Adds a boolean in the scan part to fetch the information, whether the KV was
obtained from a block present in cache or not.
2. The same information is relayed down to the writer during compaction.
3. The writer keeps a track of % of KV's obtained from cache and then
when it dumps a block, it will use that and compare it with the caching
threshold for compaction and cache the block if it meets the criteria.
4. It also adds knobs to enable/disable this feature and change the
caching threshold used during compaction.

I was planning to further improve upon the feature in the following
areas:
1. The cached block from which the KV was read might be a candidate for
next round of eviction. Hence, need to improve on that part, where we
can consider the probability whether or not the block is hot enough to
be cached after compaction, depending upon the number of times it was
accessed.
2. If recaching on compaction is trashing the cache, then we can limit
the number of blocks we should cache during compaction.

Wanted to get this diff out for review to get an early response of the
overall design and the change.

Test Plan:
Added 4 unit test cases to test the change. I will am also planning to
test this on dev cluster. Will update it with more results.

MR Unit test link:
http://hbasectrl056.ash3.facebook.com:50030/jobdetails.jsp?jobid=job_201209211223_44686

Reviewers: liyintang, aaiyer, manukranthk

Reviewed By: manukranthk

CC: hbase-eng@, manukranthk

Differential Revision: https://phabricator.fb.com/D686137

Task ID: 2016630

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1461255 13f79535-47bb-0310-9956-ffa450edef68