org.apache.hadoop.hbase
Class HMsg

java.lang.Object
  extended by org.apache.hadoop.hbase.HMsg
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class HMsg
extends Object
implements org.apache.hadoop.io.Writable

HMsg is for communicating instructions between the HMaster and the HRegionServers. Most of the time the messages are simple but some messages are accompanied by the region affected. HMsg may also carry optional message.


Nested Class Summary
static class HMsg.Type
          Message types sent between master and regionservers
 
Field Summary
static HMsg[] EMPTY_HMSG_ARRAY
           
static HMsg REGIONSERVER_QUIESCE
           
static HMsg REGIONSERVER_STOP
           
 
Constructor Summary
HMsg()
          Default constructor.
HMsg(HMsg.Type type)
          Construct a message with the specified message and empty HRegionInfo
HMsg(HMsg.Type type, HRegionInfo hri)
          Construct a message with the specified message and HRegionInfo
HMsg(HMsg.Type type, HRegionInfo hri, byte[] msg)
          Construct a message with the specified message and HRegionInfo
HMsg(HMsg.Type type, HRegionInfo hri, HRegionInfo daughterA, HRegionInfo daughterB, byte[] msg)
          Construct a message with the specified message and HRegionInfo
 
Method Summary
 boolean equals(Object obj)
           
 HRegionInfo getDaughterA()
           
 HRegionInfo getDaughterB()
           
 byte[] getMessage()
           
 HRegionInfo getRegionInfo()
           
 HMsg.Type getType()
           
 int hashCode()
           
 boolean isType(HMsg.Type other)
           
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REGIONSERVER_QUIESCE

public static final HMsg REGIONSERVER_QUIESCE

REGIONSERVER_STOP

public static final HMsg REGIONSERVER_STOP

EMPTY_HMSG_ARRAY

public static final HMsg[] EMPTY_HMSG_ARRAY
Constructor Detail

HMsg

public HMsg()
Default constructor. Used during deserialization


HMsg

public HMsg(HMsg.Type type)
Construct a message with the specified message and empty HRegionInfo

Parameters:
type - Message type

HMsg

public HMsg(HMsg.Type type,
            HRegionInfo hri)
Construct a message with the specified message and HRegionInfo

Parameters:
type - Message type
hri - Region to which message type applies

HMsg

public HMsg(HMsg.Type type,
            HRegionInfo hri,
            byte[] msg)
Construct a message with the specified message and HRegionInfo

Parameters:
type - Message type
hri - Region to which message type applies. Cannot be null. If no info associated, used other Constructor.
msg - Optional message (Stringified exception, etc.)

HMsg

public HMsg(HMsg.Type type,
            HRegionInfo hri,
            HRegionInfo daughterA,
            HRegionInfo daughterB,
            byte[] msg)
Construct a message with the specified message and HRegionInfo

Parameters:
type - Message type
hri - Region to which message type applies. Cannot be null. If no info associated, used other Constructor.
daughterA -
daughterB -
msg - Optional message (Stringified exception, etc.)
Method Detail

getRegionInfo

public HRegionInfo getRegionInfo()
Returns:
Region info or null if none associated with this message type.

getType

public HMsg.Type getType()
Returns:
the type of message

isType

public boolean isType(HMsg.Type other)
Parameters:
other - Message type to compare to
Returns:
True if we are of same message type as other

getMessage

public byte[] getMessage()
Returns:
the message type

getDaughterA

public HRegionInfo getDaughterA()
Returns:
First daughter if Type is MSG_REPORT_SPLIT_INCLUDES_DAUGHTERS else null

getDaughterB

public HRegionInfo getDaughterB()
Returns:
Second daughter if Type is MSG_REPORT_SPLIT_INCLUDES_DAUGHTERS else null

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException
See Also:
Writable.write(java.io.DataOutput)

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException
See Also:
Writable.readFields(java.io.DataInput)


Copyright © 2010 Apache Software Foundation. All Rights Reserved.