org.apache.hadoop.hdfs.server.protocol
Class ServerCommand

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.protocol.ServerCommand
All Implemented Interfaces:
org.apache.hadoop.io.Writable
Direct Known Subclasses:
DatanodeCommand, NamenodeCommand

@InterfaceAudience.Private
@InterfaceStability.Evolving
public abstract class ServerCommand
extends Object
implements org.apache.hadoop.io.Writable

Base class for a server command. Issued by the name-node to notify other servers what should be done. Commands are defined by actions defined in respective protocols.

See Also:
DatanodeProtocol, NamenodeProtocol

Constructor Summary
ServerCommand()
          Unknown server command constructor.
ServerCommand(int action)
          Create a command for the specified action.
 
Method Summary
 int getAction()
          Get server command action.
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerCommand

public ServerCommand()
Unknown server command constructor. Creates a command with action 0.

See Also:
NamenodeProtocol.ACT_UNKNOWN, DatanodeProtocol.DNA_UNKNOWN

ServerCommand

public ServerCommand(int action)
Create a command for the specified action. Actions are protocol specific.

Parameters:
action -
See Also:
DatanodeProtocol, NamenodeProtocol
Method Detail

getAction

public int getAction()
Get server command action.

Returns:
action code.

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 © 2009 The Apache Software Foundation