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
 
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, boolean safeMode)
          Constructor used by master to inform region servers if we are still in safe mode.
HMsg(HMsg.Type type, HRegionInfo hri, byte[] msg)
          Construct a message with the specified message and HRegionInfo
HMsg(HMsg.Type type, HRegionInfo hri, byte[] msg, boolean safemode)
          Used by the master to inform region servers if we are still in safe mode
 
Method Summary
 boolean equals(Object obj)
           
 byte[] getMessage()
           
 HRegionInfo getRegionInfo()
           
 HMsg.Type getType()
           
 int hashCode()
           
 boolean isInSafeMode()
           
 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
 

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,
            boolean safeMode)
Constructor used by master to inform region servers if we are still in safe mode.

Parameters:
type -
hri -
safeMode -

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,
            byte[] msg,
            boolean safemode)
Used by the master to inform region servers if we are still in safe mode

Parameters:
type -
hri -
msg -
safemode -
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

isInSafeMode

public boolean isInSafeMode()
Returns:
safe mode

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

write

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

readFields

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


Copyright © 2008 The Apache Software Foundation