[Master] Rebalance primaries across all regionservers

Author: adela

Summary:
Check if the RS where tertiary is placed has less regions
assigned - if that is the case switch primary with tertiary

Test Plan:
ran it on production without updating assignment plan (just printing how it will look like if we update the plan:

odsbase006:
average number of primaries per machine should be : 17
BEFORE (#regions -> #machines)
{15=10, 16=70, 17=20, 18=18, 19=12, 20=4}
AFTER (#regions -> #machines
{16=36, 17=98}

odsbase005:
average number of primaries per machine should be : 18
BEFORE (#regions -> #machines)
{11=1, 12=20, 13=13, 14=4, 15=1, 17=1, 18=20, 19=26, 20=44}
AFTER (#regions -> #machines
{17=98, 18=32}

Reviewers: rshroff, aaiyer, manukranthk, gauravm, fan

Reviewed By: manukranthk

CC: hbase-eng@, san, mbm, paultuckfield

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

Task ID: 3007914

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584848 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9704] Un-tag TestFromClientSide.testResultLimits()

Author: adela

Summary:
this test is consistently passing for me and I cannot see it
in unstable jenkins report

Test Plan: N/A

Reviewers: manukranthk, daviddeng

Reviewed By: manukranthk

CC: hbase-eng@

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

Task ID: 3925054

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584849 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10901] Fix TestHRegionClose unstable bug

Author: daviddeng

Summary:
The bug was introduced by `HBaseTestingUtility.createMultiRegions` and his friends. Use `createTable` with multi regions to replace it.

Merge `TestHRegionClose` and `TestHRegionDoubleClose`

Test Plan: `TestHRegionClose`

Reviewers: manukranthk, gauravm, liyintang

Reviewed By: manukranthk

CC: hbase-eng@

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

Task ID: 3863945

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584850 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10901] Remove usage of createMultiRegions

Author: daviddeng

Summary: Remove usage of `createMultiRegions`, call `createTable` with `startKeys` version to create the table with multiple regions directly.

Test Plan: Run tests

Reviewers: manukranthk, liyintang, gauravm

Reviewed By: liyintang

CC: hbase-eng@

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

Task ID: 3789093, 3297517, 3864238, 3269413, 3977473, 3925117, 2015426, 3762458

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584851 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10904] Add Shell command to create table on a set number of region servers.

Author: elliott

Summary:
* Changed the printing of HTD with server set.
* Added ability to create pinned tables from the ruby shell.
* Added the ability to alter tables to pin them from the ruby shell

Test Plan:
* Unit test for printing.
* Tested creation and altering on local instance.
* Tested re-creating a table from the printed HTD from master web page.

Reviewers: adela, liyintang

Reviewed By: liyintang

CC: hbase-eng@

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

Task ID: 4057650

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584852 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9930] Closing the connections in few missed cases in the HBaseToThriftAdapter

Author: manukranthk

Summary: This diff attempts to close all the ThriftClientManager and Thrift client objects on the client side.

Test Plan: Minor change.

Reviewers: gauravm, adela, fan, elliott

Reviewed By: elliott

CC: hbase-eng@, elliott, ehwang

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

Task ID: 4024967

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584853 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9704] Handle Call object properly on serverside

Author: adela

Summary:
Initially we implemented this to work only for profiling but there is one more usage
and that is quota remaining when doing scan on serverside. So now
- if client doesn't want profiling he is not sending call object (at least we are still saving on network here)
- if profiling is not required we anyway create call object on serverside
Also fixed the assertion on testResultLimits since it was completely ignored when I was running the test locally

Test Plan:
ran
- TestFromClientSide.testResultLimits
- TestHeaderSendReceive
- TestPerRequestProfiling

Reviewers: manukranthk, gauravm, fan

Reviewed By: manukranthk

CC: hbase-eng@

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

Task ID: 4065193

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584854 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-10907] Stabilize TestRegionPlacement

Author: elliott

Summary: Each test case in TestRegionPlacement wanted to be run in isolation but it wasn't.

Test Plan: mvn clean test -Dtest=TestRegionPlacement

Reviewers: liyintang, daviddeng, adela

Reviewed By: adela

CC: hbase-eng@

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

Task ID: 2747703

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584855 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9143] update memstore flush threads in online fashion

Author: khadkevich

Summary: the number of flush thread (hbase.regionserver.flusher.count) can be updated in an online fashion

Test Plan: Run org.apache.hadoop.hbase.regionserver.TestRegionServerOnlineConfigChange::testNumMemstoreFlushThreadsOnlineChange() testcase.

Reviewers: rshroff, gauravm, liyintang

Reviewed By: gauravm

CC: sameet, ming, hbase-eng@, aaiyer

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

Task ID: 2637178

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584856 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9815] Provide a batch API to retrieve Histograms for a list of regions in a regionserver.

Author: manukranthk

Summary: This diff attempts to add a HRegionServer API which gets a list of histograms for the given list of regions.

Test Plan: Modified the unit test TestHFileHistogramE2E to add checks to compare the return from the batch function with the previous one.

Reviewers: liyintang, aaiyer

Reviewed By: liyintang

CC: hbase-eng@, andrewcox

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

Task ID: 3875260

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1584857 13f79535-47bb-0310-9956-ffa450edef68
[HBASE-9930] Add back the metascan functions which take byte[] as input.

Author: manukranthk

Summary: This diff adds metascan functions in MetaScanner which are similar to the original functions.

Test Plan: Simple change.

Reviewers: daviddeng

Reviewed By: daviddeng

CC: hbase-eng@

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

Task ID: 3540638

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