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

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

# Class MetaRecoveryContext

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.MetaRecoveryContext

@Private @Evolving public final class MetaRecoveryContext extends Object
Context data for an ongoing NameNode metadata recovery process.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `MetaRecoveryContext.RequestStopException`
  Exception thrown when the user has requested processing to stop.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `FORCE_ALL`
  `static final int`
  `FORCE_FIRST_CHOICE`
  `static final int`
  `FORCE_NONE`
  `static final org.slf4j.Logger`
  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MetaRecoveryContext(int force)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `ask(String prompt, String firstChoice, String... choices)`
  Display a prompt to the user and get his or her choice.
  `static void`
  `editLogLoaderPrompt(String prompt, MetaRecoveryContext recovery, String contStr)`
  `int`
  `getForce()`
  `void`
  `quit()`
  Log a message and quit
  `void`
  `setForce(int force)`

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

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

- ## Field Details

  - ### LOG

    public static final org.slf4j.Logger LOG

  - ### FORCE_NONE

    public static final int FORCE_NONE
    See Also:
      - Constant Field Values

  - ### FORCE_FIRST_CHOICE

    public static final int FORCE_FIRST_CHOICE
    See Also:
      - Constant Field Values

  - ### FORCE_ALL

    public static final int FORCE_ALL
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MetaRecoveryContext

    public MetaRecoveryContext(int force)

- ## Method Details

  - ### ask

    public String ask(String prompt, String firstChoice, String... choices) throws IOException
    Display a prompt to the user and get his or her choice.
    Parameters:
      `prompt` - The prompt to display
      `firstChoice` - First choice (will be taken if autoChooseDefault is true)
      `choices` - Other choies
    Returns:
      The choice that was taken
    Throws:
      `IOException`

  - ### editLogLoaderPrompt

    public static void editLogLoaderPrompt(String prompt, MetaRecoveryContext recovery, String contStr) throws IOException, MetaRecoveryContext.RequestStopException
    Throws:
      `IOException`
      `MetaRecoveryContext.RequestStopException`

  - ### quit

    public void quit()
    Log a message and quit

  - ### getForce

    public int getForce()

  - ### setForce

    public void setForce(int force)