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 CALL_SERVER_STARTUP
           
static HMsg[] EMPTY_HMSG_ARRAY
           
static HMsg REGIONSERVER_QUIESCE
           
static HMsg REGIONSERVER_STOP
           
static HMsg REPORT_EXITING
           
static HMsg REPORT_QUIESCED
           
 
Constructor Summary
HMsg()
          Default constructor.
HMsg(HMsg.Type type)
          Construct a message with the specified message and 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, org.apache.hadoop.io.Text msg)
          Deprecated. Use byte [] overload instead
 
Method Summary
 boolean equals(Object obj)
           
 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

REPORT_EXITING

public static final HMsg REPORT_EXITING

REPORT_QUIESCED

public static final HMsg REPORT_QUIESCED

REGIONSERVER_QUIESCE

public static final HMsg REGIONSERVER_QUIESCE

REGIONSERVER_STOP

public static final HMsg REGIONSERVER_STOP

CALL_SERVER_STARTUP

public static final HMsg CALL_SERVER_STARTUP

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 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,
            org.apache.hadoop.io.Text msg)
Deprecated. Use byte [] overload instead

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)
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.)
Method Detail

getRegionInfo

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

getType

public HMsg.Type getType()

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()

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