[HBASE-10808] Forward porting Leases and Histogram bug fixes to trunk.

Author: manukranthk

Summary: This diff attempts to forward port the Leases and Histogram bug fixes back to trunk.

Test Plan: Run existing unit tests.

Reviewers: liyintang, daviddeng

Reviewed By: liyintang

CC: hbase-eng@

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584170 13f79535-47bb-0310-9956-ffa450edef68
[master] Mark some testcases as unstable.

Author: daviddeng

Summary:
`TestFullLogReconstruction`
`TestSplitLogManager`
`TestHLog`

Test Plan: Run testcases

Reviewers: liyintang, manukranthk, fan

Reviewed By: fan

CC: hbase-eng@

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

Task ID: 3789093, 3297526, 3296253, 3862247, 3977473, 3376834

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584171 13f79535-47bb-0310-9956-ffa450edef68
[master] Fix the problem of sunfire xml file

Author: daviddeng

Summary:
Some log was output by calling `Bytes.toString` instead of `Bytes.toStringBinary`, the former generates unpritable chars, which failed the Jenkins.

The diff change many (not all) usage of `toString` in `LOG` and `Exception` message composing.

Test Plan:
`TestHTable` and `TestFastFail` should pass after submitting.
Other testcase.

Reviewers: liyintang, manukranthk, fan

Reviewed By: manukranthk

CC: hbase-eng@, andrewcox

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

Task ID: 3789093

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584172 13f79535-47bb-0310-9956-ffa450edef68
[master] Make ThriftResultSerializer use the correct library

Author: daviddeng

Summary:
Add `CuttingClassLoader` which allow cutting paths for loading clases
Add `ThriftResultSerializer` which loads

Test Plan: TestThriftResultSerializer

Reviewers: rshroff, manukranthk, liyintang, aaiyer, adela

Reviewed By: rshroff

CC: hbase-eng@, arice, chaoyc

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

Task ID: 3547474, 3948196

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584173 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10843] Update multiple versions and prepare for java 8

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584178 13f79535-47bb-0310-9956-ffa450edef68
[master] First commit of Endpoint implementation.

Author: daviddeng

Summary:
An endpoint is a method running on the server. Some aggregation work can be done on the server and only final results are returned back to the client.

Current endpoints have the following restrictions, may be removed later:

An example of aggregation is shown in `TestEndpoint`

Test Plan: `TestEndpoint`

Reviewers: adela, manukranthk, aaiyer, fan, liyintang, gauravm

Reviewed By: adela

CC: hbase-eng@, andrewcox

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584179 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10865] Store per table server assignment preference

Author: elliott

Summary:
* Allow user to add server perference in HTableDescriptor
* Honor that preference when creating the table.
* Add tests for ser/deser of server lists in HTD.

Test Plan:
* Wrote unit tests for HTD ser/deser
* Changed previous test that creates table on servers

iloveunittests

Reviewers: adela

Reviewed By: adela

CC: hbase-eng@

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

Task ID: 4023938

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584180 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10776] Extract location cache function out as MetaCache

Author: daviddeng

Summary: Add `MetaCache` class

Test Plan: Testcase

Reviewers: manukranthk, fan, liyintang, gauravm

Reviewed By: liyintang

CC: hbase-eng@

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584181 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10869] Add FS_TYPE in HBaseTestingUtility configuration

Author: daviddeng

Summary:
Motivation of doing this is two-folded:

1. local file system is more stable than `MiniDFSCluster`, so for cases only testing on HBase logic, using this may avoid unstable problems caused by DFS unstable problem.
1. Starting of local file systme is much faster.

Currently only a few of the testcases is switch to LFS mode for testing. Some other diff may switch more.

Implementaiton

For `FS_TYPE_DFS`, same as before.
For `FS_TYPE_LFS`, use `LocalFileSystem`

Test Plan:
`TestHBCpp`
`TestHTableClientScanner`

Reviewers: liyintang, manukranthk, fan, aaiyer, gauravm

Reviewed By: gauravm

CC: hbase-eng@

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

Task ID: 3789093

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584182 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9930] Fixing RegionServer OOM Bug.

Author: manukranthk

Summary: Serialization/Deserialization in the Get object missed the setFilter() function in the readFields.

Test Plan: Unit tests

Reviewers: gauravm, rshroff, elliott

Reviewed By: gauravm

CC: hbase-eng@, elliott

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584183 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10865] Fix TestHTableDescriptor unit test failure

Author: elliott

Summary: Fix the TestHTableDescriptor test failure due to added sanity checks.

Test Plan:
mvn test -Dtest=TestHTableDescriptor
Running org.apache.hadoop.hbase.TestHTableDescriptor
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.29 sec - in org.apache.hadoop.hbase.TestHTableDescriptor

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

Reviewers: adela

Reviewed By: adela

CC: hbase-eng@, adela

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584184 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10865] Fix test TestSwiftSerDe

Author: elliott

Summary: Fix TestSwiftSerDe after HTD changes

Test Plan:  mvn clean test -Dtest=TestSwiftSerDe

Reviewers: adela

Reviewed By: adela

CC: hbase-eng@, gauravm

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

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584186 13f79535-47bb-0310-9956-ffa450edef68
[master] Fix bug in TableServers.prefetchRegionCache that fails TestHTable

Author: daviddeng

Summary: In `getCachedHRegionLocations` a `null` is set to `row` because it doesn't care about the result. So add a check in `prefetchRegionCache`.

Test Plan: `TestHTable`

Reviewers: manukranthk, liyintang, fan, gauravm

Reviewed By: fan

CC: hbase-eng@

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

Task ID: 3296253

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584187 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10876] Remove avro connector

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584188 13f79535-47bb-0310-9956-ffa450edef68
[master] Create StringBytes class and use it as main type of table name.

Author: daviddeng

Summary: Create class `StringBytes` which is an immutable instance containing both byte array and String formats.

Test Plan: Run tests

Reviewers: liyintang, manukranthk, gauravm, elliott

Reviewed By: elliott

CC: hbase-eng@, elliott

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

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584189 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10891] Adding config option for SocksProxy on the thrift client config

Author: manukranthk

Summary: This exposes the socks proxy functionality via the configuration.

Test Plan: Unit test

Reviewers: liyintang, aaiyer

Reviewed By: liyintang

CC: hbase-eng@, andrewcox, nileema

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

Task ID: 4025730

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584190 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10893] Fixing critical bug in FastDiffDeltaEncoder

Author: manukranthk

Summary:
The bug arose due to the following :
  getCommonPrefix(buf1, offset1, length1, buf2, offset2, length2)
was called with the following..
  getCommonPrefix(buf1, buf1.offset, buf1.length, buf2, buf2.offset, buf2.length)

Test Plan: Adding unit test testZeroByte

Reviewers: liyintang, rshroff, adela

Reviewed By: liyintang

CC: hbase-eng@

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

Task ID: 4049110

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584191 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10425] Hook RegionPlacement up to stored HTableDesciptor serverSet.

Author: elliott

Summary: RegionPlacement runs will now take HTD server set into account when assigning regions.

Test Plan:
Deployed to HBASEDEV038-ASH3. Created a table pinned on three different servers. Ran RegionPlacement several times. The pinned table stayed on the three chosen servers.
Then I created 5 new tables and saw that creation was still successful and they weren't pinned to any servers. Then I ran RegionPlacement again and saw that the pinned tables were still on the selected servers.

Reviewers: adela, liyintang

Reviewed By: adela

CC: hbase-eng@

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

Task ID: 4039274

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584192 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9930] Change encoding/decoding header from hex to string64

Author: adela

Summary:
We can only send string in the header - so initially we were sending hexString,
changing it to string64 to be more performant

Test Plan:
ran
- TestPerRequestProfiling
- TestHeaderSendReceive

Reviewers: manukranthk, gauravm, fan

Reviewed By: manukranthk

CC: hbase-eng@

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

Task ID: 3548223

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