ServerCommand (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.protocol, class: ServerCommand

Package org.apache.hadoop.hdfs.server.protocol

# Class ServerCommand

java.lang.Object
org.apache.hadoop.hdfs.server.protocol.ServerCommand

Direct Known Subclasses:
  `DatanodeCommand`, `NamenodeCommand`

@Private @Evolving public abstract class ServerCommand extends Object
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

  Constructors
  Constructor
  Description
  `ServerCommand(int action)`
  Create a command for the specified action.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAction()`
  Get server command action.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ServerCommand

    public ServerCommand(int action)
    Create a command for the specified action. Actions are protocol specific.
    Parameters:
      `action` - protocol specific action
    See Also:
      - `DatanodeProtocol`
      - `NamenodeProtocol`

- ## Method Details

  - ### getAction

    public int getAction()
    Get server command action.
    Returns:
      action code.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`