HBASE-8119. Optimize StochasticLoadBalancer. Addendum patch for javadoc fixes

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1467484 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Enis Soztutar 2013-04-12 21:46:26 +00:00
parent 3f2eb3ae16
commit 089e876398

View File

@ -262,8 +262,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Create all of the RegionPlan's needed to move from the initial cluster state to the desired * Create all of the RegionPlan's needed to move from the initial cluster state to the desired
* state. * state.
* *
* @param initialRegionMapping Initial mapping of Region to Server * @param cluster The state of the cluster
* @param clusterState The desired mapping of ServerName to Regions
* @return List of RegionPlan's that represent the moves needed to get to desired final state. * @return List of RegionPlan's that represent the moves needed to get to desired final state.
*/ */
private List<RegionPlan> createRegionPlans(Cluster cluster) { private List<RegionPlan> createRegionPlans(Cluster cluster) {
@ -325,7 +324,8 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* {@link StochasticLoadBalancer#balanceCluster(Map)} recognize as signal to try a region move * {@link StochasticLoadBalancer#balanceCluster(Map)} recognize as signal to try a region move
* rather than swap. * rather than swap.
* *
* @param regions list of regions. * @param cluster The state of the cluster
* @param server index of the server
* @param chanceOfNoSwap Chance that this will decide to try a move rather * @param chanceOfNoSwap Chance that this will decide to try a move rather
* than a swap. * than a swap.
* @return a random {@link HRegionInfo} or null if an asymmetrical move is * @return a random {@link HRegionInfo} or null if an asymmetrical move is
@ -346,8 +346,8 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Given a server we will want to switch regions with another server. This * Given a server we will want to switch regions with another server. This
* function picks a random server from the list. * function picks a random server from the list.
* *
* @param server Current Server. This server will never be the return value. * @param serverIndex Current Server. This server will never be the return value.
* @param allServers list of all server from which to pick * @param cluster The state of the cluster
* @return random server. Null if no other servers were found. * @return random server. Null if no other servers were found.
*/ */
private int pickOtherServer(int serverIndex, Cluster cluster) { private int pickOtherServer(int serverIndex, Cluster cluster) {
@ -366,8 +366,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* This is the main cost function. It will compute a cost associated with a proposed cluster * This is the main cost function. It will compute a cost associated with a proposed cluster
* state. All different costs will be combined with their multipliers to produce a double cost. * state. All different costs will be combined with their multipliers to produce a double cost.
* *
* @param initialRegionMapping Map of where the regions started. * @param cluster The state of the cluster
* @param clusterState Map of ServerName to list of regions.
* @return a double of a cost associated with the proposed * @return a double of a cost associated with the proposed
*/ */
protected double computeCost(Cluster cluster) { protected double computeCost(Cluster cluster) {
@ -410,8 +409,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Given the starting state of the regions and a potential ending state * Given the starting state of the regions and a potential ending state
* compute cost based upon the number of regions that have moved. * compute cost based upon the number of regions that have moved.
* *
* @param initialRegionMapping The starting location of regions. * @param cluster The state of the cluster
* @param clusterState The potential new cluster state.
* @return The cost. Between 0 and 1. * @return The cost. Between 0 and 1.
*/ */
double computeMoveCost(Cluster cluster) { double computeMoveCost(Cluster cluster) {
@ -435,7 +433,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Compute the cost of a potential cluster state from skew in number of * Compute the cost of a potential cluster state from skew in number of
* regions on a cluster * regions on a cluster
* *
* @param clusterState The proposed cluster state * @param cluster The state of the cluster
* @return The cost of region load imbalance. * @return The cost of region load imbalance.
*/ */
double computeSkewLoadCost(Cluster cluster) { double computeSkewLoadCost(Cluster cluster) {
@ -450,7 +448,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Compute the cost of a potential cluster configuration based upon how evenly * Compute the cost of a potential cluster configuration based upon how evenly
* distributed tables are. * distributed tables are.
* *
* @param clusterState Proposed cluster state. * @param cluster The state of the cluster
* @return Cost of imbalance in table. * @return Cost of imbalance in table.
*/ */
double computeTableSkewLoadCost(Cluster cluster) { double computeTableSkewLoadCost(Cluster cluster) {
@ -469,8 +467,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
* Compute a cost of a potential cluster configuration based upon where * Compute a cost of a potential cluster configuration based upon where
* {@link org.apache.hadoop.hbase.regionserver.StoreFile}s are located. * {@link org.apache.hadoop.hbase.regionserver.StoreFile}s are located.
* *
* @param initialRegionMapping - not used * @param cluster The state of the cluster
* @param clusterState The state of the cluster
* @return A cost between 0 and 1. 0 Means all regions are on the sever with * @return A cost between 0 and 1. 0 Means all regions are on the sever with
* the most local store files. * the most local store files.
*/ */
@ -518,7 +515,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
/** /**
* Compute the cost of the current cluster state due to some RegionLoadCost type * Compute the cost of the current cluster state due to some RegionLoadCost type
* *
* @param clusterState the cluster * @param cluster The state of the cluster
* @param costType what type of cost to consider * @param costType what type of cost to consider
* @return the scaled cost. * @return the scaled cost.
*/ */