org.apache.hadoop.hbase.master
Class LoadBalancer.RegionPlan

java.lang.Object
  extended by org.apache.hadoop.hbase.master.LoadBalancer.RegionPlan
All Implemented Interfaces:
Comparable<LoadBalancer.RegionPlan>
Enclosing class:
LoadBalancer

public static class LoadBalancer.RegionPlan
extends Object
implements Comparable<LoadBalancer.RegionPlan>

Stores the plan for the move of an individual region. Contains info for the region being moved, info for the server the region should be moved from, and info for the server the region should be moved to. The comparable implementation of this class compares only the region information and not the source/dest server info.


Constructor Summary
LoadBalancer.RegionPlan(HRegionInfo hri, HServerInfo source, HServerInfo dest)
          Instantiate a plan for a region move, moving the specified region from the specified source server to the specified destination server.
 
Method Summary
 int compareTo(LoadBalancer.RegionPlan o)
          Compare the region info.
 HServerInfo getDestination()
          Get the destination server for the plan for this region.
 HRegionInfo getRegionInfo()
           
 String getRegionName()
          Get the encoded region name for the region this plan is for.
 HServerInfo getSource()
          Get the source server for the plan for this region.
 void setDestination(HServerInfo dest)
          Set the destination server for the plan for this region.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoadBalancer.RegionPlan

public LoadBalancer.RegionPlan(HRegionInfo hri,
                               HServerInfo source,
                               HServerInfo dest)
Instantiate a plan for a region move, moving the specified region from the specified source server to the specified destination server. Destination server can be instantiated as null and later set with setDestination(HServerInfo).

Parameters:
hri - region to be moved
source - regionserver region should be moved from
dest - regionserver region should be moved to
Method Detail

setDestination

public void setDestination(HServerInfo dest)
Set the destination server for the plan for this region.


getSource

public HServerInfo getSource()
Get the source server for the plan for this region.

Returns:
server info for source

getDestination

public HServerInfo getDestination()
Get the destination server for the plan for this region.

Returns:
server info for destination

getRegionName

public String getRegionName()
Get the encoded region name for the region this plan is for.

Returns:
Encoded region name

getRegionInfo

public HRegionInfo getRegionInfo()

compareTo

public int compareTo(LoadBalancer.RegionPlan o)
Compare the region info.

Specified by:
compareTo in interface Comparable<LoadBalancer.RegionPlan>
Parameters:
o - region plan you are comparing against

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.