|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.executor.RegionTransitionData
public class RegionTransitionData
Data serialized into ZooKeeper for region transitions.
Constructor Summary | |
---|---|
RegionTransitionData()
Writable constructor. |
|
RegionTransitionData(EventHandler.EventType eventType,
byte[] regionName)
Construct data for a new region transition event with the specified event type and region name. |
|
RegionTransitionData(EventHandler.EventType eventType,
byte[] regionName,
String serverName)
Construct data for a new region transition event with the specified event type, region name, and server name. |
Method Summary | |
---|---|
static RegionTransitionData |
fromBytes(byte[] bytes)
Get an instance from bytes. |
byte[] |
getBytes()
Get the bytes for this instance. |
EventHandler.EventType |
getEventType()
Gets the type of region transition event. |
byte[] |
getRegionName()
Gets the name of the region being transitioned. |
String |
getServerName()
Gets the server the event originated from. |
long |
getStamp()
Gets the timestamp when this event was created. |
void |
readFields(DataInput in)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegionTransitionData()
public RegionTransitionData(EventHandler.EventType eventType, byte[] regionName)
Used when the server name is not known (the master is setting it). This happens during cluster startup or during failure scenarios. When processing a failed regionserver, the master assigns the regions from that server to other servers though the region was never 'closed'. During master failover, the new master may have regions stuck in transition without a destination so may have to set regions offline and generate a new assignment.
Since only the master uses this constructor, the type should always be
EventHandler.EventType.M_ZK_REGION_OFFLINE
.
eventType
- type of eventregionName
- name of region as per HRegionInfo#getRegionName()
public RegionTransitionData(EventHandler.EventType eventType, byte[] regionName, String serverName)
Used when the server name is known (a regionserver is setting it).
Valid types for this constructor are EventHandler.EventType.RS_ZK_REGION_CLOSING
,
EventHandler.EventType.RS_ZK_REGION_CLOSED
, EventHandler.EventType.RS_ZK_REGION_OPENING
,
and EventHandler.EventType.RS_ZK_REGION_OPENED
.
eventType
- type of eventregionName
- name of region as per HRegionInfo#getRegionName()
serverName
- name of server setting dataMethod Detail |
---|
public EventHandler.EventType getEventType()
One of:
EventHandler.EventType.M_ZK_REGION_OFFLINE
EventHandler.EventType.RS_ZK_REGION_CLOSING
EventHandler.EventType.RS_ZK_REGION_CLOSED
EventHandler.EventType.RS_ZK_REGION_OPENING
EventHandler.EventType.RS_ZK_REGION_OPENED
public byte[] getRegionName()
Region name is required so this never returns null.
HRegionInfo#getRegionName()
public String getServerName()
public long getStamp()
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public byte[] getBytes()
RuntimeException
if
there is an error deserializing this instance because it represents a code
bug.
public static RegionTransitionData fromBytes(byte[] bytes)
RuntimeException
if
there is an error serializing this instance from bytes because it
represents a code bug.
bytes
- binary representation of this instance
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |