ActiveState (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode.ha, class: ActiveState

Package org.apache.hadoop.hdfs.server.namenode.ha

# Class ActiveState

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.ha.HAState
org.apache.hadoop.hdfs.server.namenode.ha.ActiveState

@Private public class ActiveState extends HAState
Active state of the namenode. In this state, namenode provides the namenode service and handles operations of type `NameNode.OperationCategory.WRITE` and `NameNode.OperationCategory.READ`.

- ## Field Summary

  ### Fields inherited from class org.apache.hadoop.hdfs.server.namenode.ha.HAState

  `state`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ActiveState()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkOperation(HAContext context, NameNode.OperationCategory op)`
  Check if an operation is supported in a given state.
  `void`
  `enterState(HAContext context)`
  Method to be overridden by subclasses to perform steps necessary for entering a state.
  `void`
  `exitState(HAContext context)`
  Method to be overridden by subclasses to perform steps necessary for exiting a state.
  `void`
  `setState(HAContext context, HAState s)`
  Move from the existing state to a new state
  `boolean`
  `shouldPopulateReplQueues()`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.namenode.ha.HAState

  `getLastHATransitionTime, getServiceState, prepareToEnterState, prepareToExitState, setStateInternal, toString`

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

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

- ## Constructor Details

  - ### ActiveState

    public ActiveState()

- ## Method Details

  - ### checkOperation

    public void checkOperation(HAContext context, NameNode.OperationCategory op)
    Description copied from class: `HAState`
    Check if an operation is supported in a given state.
    Specified by:
      `checkOperation` in class `HAState`
    Parameters:
      `context` - HA context
      `op` - Type of the operation.

  - ### shouldPopulateReplQueues

    public boolean shouldPopulateReplQueues()
    Specified by:
      `shouldPopulateReplQueues` in class `HAState`

  - ### setState

    public void setState(HAContext context, HAState s) throws org.apache.hadoop.ha.ServiceFailedException
    Description copied from class: `HAState`
    Move from the existing state to a new state
    Overrides:
      `setState` in class `HAState`
    Parameters:
      `context` - HA context
      `s` - new state
    Throws:
      `org.apache.hadoop.ha.ServiceFailedException` - on failure to transition to new state.

  - ### enterState

    public void enterState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
    Description copied from class: `HAState`
    Method to be overridden by subclasses to perform steps necessary for entering a state.
    Specified by:
      `enterState` in class `HAState`
    Parameters:
      `context` - HA context
    Throws:
      `org.apache.hadoop.ha.ServiceFailedException` - on failure to enter the state.

  - ### exitState

    public void exitState(HAContext context) throws org.apache.hadoop.ha.ServiceFailedException
    Description copied from class: `HAState`
    Method to be overridden by subclasses to perform steps necessary for exiting a state.
    Specified by:
      `exitState` in class `HAState`
    Parameters:
      `context` - HA context
    Throws:
      `org.apache.hadoop.ha.ServiceFailedException` - on failure to enter the state.