org.apache.hadoop.hbase.master
Class RegionPlan

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

@InterfaceAudience.LimitedPrivate(value="Coprocessors")
@InterfaceStability.Evolving
public class RegionPlan
extends Object
implements Comparable<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.


Nested Class Summary
static class RegionPlan.RegionPlanComparator
           
 
Constructor Summary
RegionPlan(HRegionInfo hri, ServerName source, ServerName 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(RegionPlan o)
          Compare the region info.
 boolean equals(Object obj)
           
 ServerName 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.
 ServerName getSource()
          Get the source server for the plan for this region.
 void setDestination(ServerName dest)
          Set the destination server for the plan for this region.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegionPlan

public RegionPlan(HRegionInfo hri,
                  ServerName source,
                  ServerName 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(ServerName).

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(ServerName dest)
Set the destination server for the plan for this region.


getSource

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

Returns:
server info for source

getDestination

public ServerName 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(RegionPlan o)
Compare the region info.

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


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