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

Package org.apache.hadoop.hdfs.qjournal.server

# Class JournalNode

java.lang.Object
org.apache.hadoop.hdfs.qjournal.server.JournalNode

All Implemented Interfaces:
  `org.apache.hadoop.conf.Configurable`, `JournalNodeMXBean`, `org.apache.hadoop.util.Tool`

@Private public class JournalNode extends Object implements org.apache.hadoop.util.Tool, org.apache.hadoop.conf.Configurable, JournalNodeMXBean
The JournalNode is a daemon which allows namenodes using the QuorumJournalManager to log and retrieve edits stored remotely. It is a thin wrapper around a local edit log directory with the addition of facilities to participate in the quorum protocol.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final org.slf4j.Logger`
  `LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JournalNode()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `canRollBack(String journalId, StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion, String nameServiceId)`
  `void`
  `discardSegments(String journalId, long startTxId, String nameServiceId)`
  `void`
  `doFinalize(String journalId, String nameServiceId)`
  `void`
  `doPreUpgrade(String journalId)`
  `void`
  `doRollback(String journalId, String nameServiceId)`
  `void`
  `doUpgrade(String journalId, StorageInfo sInfo)`
  `InetSocketAddress`
  `getBoundHttpAddress()`
  `InetSocketAddress`
  `getBoundIpcAddress()`
  `List<String>`
  `getClusterIds()`
  Get list of the clusters of JournalNode's journals as one JournalNode may support multiple clusters.
  `org.apache.hadoop.conf.Configuration`
  `getConf()`
  `String`
  `getHostAndPort()`
  Get host and port of JournalNode.
  `InetSocketAddress`
  `getHttpAddress()`
  `static InetSocketAddress`
  `getHttpAddress(org.apache.hadoop.conf.Configuration conf)`
  `InetSocketAddress`
  `getHttpsAddress()`
  `protected InetSocketAddress`
  `getHttpServerBindAddress(org.apache.hadoop.conf.Configuration configuration)`
  `String`
  `getHttpServerURI()`
  `long`
  `getJNStartedTimeInMillis()`
  Get the start time of the JournalNode.
  `Journal`
  `getJournal(String jid)`
  `Long`
  `getJournalCTime(String journalId, String nameServiceId)`
  `String`
  `getJournalsStatus()`
  Get status information (e.g., whether formatted) of JournalNode's journals.
  `JournalNodeSyncer`
  `getJournalSyncer(String jid)`
  `boolean`
  `getJournalSyncerStatus(String jid)`
  `Journal`
  `getOrCreateJournal(String jid)`
  `Journal`
  `getOrCreateJournal(String jid, String nameServiceId)`
  `JournalNodeRpcServer`
  `getRpcServer()`
  `List<String>`
  `getStorageInfos()`
  Get the list of the storage infos of JournalNode's journals.
  `String`
  `getVersion()`
  Gets the version of Hadoop.
  `boolean`
  `isStarted()`
  `static void`
  `main(String[] args)`
  `int`
  `run(String[] args)`
  `void`
  `setConf(org.apache.hadoop.conf.Configuration conf)`
  `void`
  `start()`
  Start listening for edits via RPC.
  `void`
  `stop(int rc)`
  Stop the daemon with the given status code
  `void`
  `stopAndJoin(int rc)`

  ### 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

- ## Constructor Details

  - ### JournalNode

    public JournalNode()

- ## Method Details

  - ### getJournalSyncer

    @VisibleForTesting public JournalNodeSyncer getJournalSyncer(String jid)

  - ### getJournalSyncerStatus

    @VisibleForTesting public boolean getJournalSyncerStatus(String jid)

  - ### getOrCreateJournal

    @VisibleForTesting public Journal getOrCreateJournal(String jid) throws IOException
    Throws:
      `IOException`

  - ### getOrCreateJournal

    public Journal getOrCreateJournal(String jid, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### setConf

    public void setConf(org.apache.hadoop.conf.Configuration conf)
    Specified by:
      `setConf` in interface `org.apache.hadoop.conf.Configurable`

  - ### getConf

    public org.apache.hadoop.conf.Configuration getConf()
    Specified by:
      `getConf` in interface `org.apache.hadoop.conf.Configurable`

  - ### run

    public int run(String[] args) throws Exception
    Specified by:
      `run` in interface `org.apache.hadoop.util.Tool`
    Throws:
      `Exception`

  - ### start

    public void start() throws IOException
    Start listening for edits via RPC.
    Throws:
      `IOException`

  - ### isStarted

    public boolean isStarted()

  - ### getBoundIpcAddress

    public InetSocketAddress getBoundIpcAddress()
    Returns:
      the address the IPC server is bound to

  - ### getHttpServerURI

    public String getHttpServerURI()

  - ### stop

    public void stop(int rc)
    Stop the daemon with the given status code
    Parameters:
      `rc` - the status code with which to exit (non-zero should indicate an error)

  - ### stopAndJoin

    public void stopAndJoin(int rc) throws InterruptedException
    Throws:
      `InterruptedException`

  - ### getJournalsStatus

    public String getJournalsStatus()
    Description copied from interface: `JournalNodeMXBean`
    Get status information (e.g., whether formatted) of JournalNode's journals.
    Specified by:
      `getJournalsStatus` in interface `JournalNodeMXBean`
    Returns:
      A string presenting status for each journal

  - ### getHostAndPort

    public String getHostAndPort()
    Description copied from interface: `JournalNodeMXBean`
    Get host and port of JournalNode.
    Specified by:
      `getHostAndPort` in interface `JournalNodeMXBean`
    Returns:
      colon separated host and port.

  - ### getClusterIds

    public List<String> getClusterIds()
    Description copied from interface: `JournalNodeMXBean`
    Get list of the clusters of JournalNode's journals as one JournalNode may support multiple clusters.
    Specified by:
      `getClusterIds` in interface `JournalNodeMXBean`
    Returns:
      list of clusters.

  - ### getVersion

    public String getVersion()
    Description copied from interface: `JournalNodeMXBean`
    Gets the version of Hadoop.
    Specified by:
      `getVersion` in interface `JournalNodeMXBean`
    Returns:
      the version of Hadoop.

  - ### getJNStartedTimeInMillis

    public long getJNStartedTimeInMillis()
    Description copied from interface: `JournalNodeMXBean`
    Get the start time of the JournalNode.
    Specified by:
      `getJNStartedTimeInMillis` in interface `JournalNodeMXBean`
    Returns:
      the start time of the JournalNode.

  - ### getStorageInfos

    public List<String> getStorageInfos()
    Description copied from interface: `JournalNodeMXBean`
    Get the list of the storage infos of JournalNode's journals. Storage infos include layout version, namespace id, cluster id and creation time of the File system state.
    Specified by:
      `getStorageInfos` in interface `JournalNodeMXBean`
    Returns:
      the list of storage infos associated with journals.

  - ### main

    public static void main(String[] args) throws Exception
    Throws:
      `Exception`

  - ### doPreUpgrade

    public void doPreUpgrade(String journalId) throws IOException
    Throws:
      `IOException`

  - ### doUpgrade

    public void doUpgrade(String journalId, StorageInfo sInfo) throws IOException
    Throws:
      `IOException`

  - ### doFinalize

    public void doFinalize(String journalId, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### canRollBack

    public Boolean canRollBack(String journalId, StorageInfo storage, StorageInfo prevStorage, int targetLayoutVersion, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### doRollback

    public void doRollback(String journalId, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### discardSegments

    public void discardSegments(String journalId, long startTxId, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### getJournalCTime

    public Long getJournalCTime(String journalId, String nameServiceId) throws IOException
    Throws:
      `IOException`

  - ### getJournal

    @VisibleForTesting public Journal getJournal(String jid)

  - ### getHttpAddress

    public static InetSocketAddress getHttpAddress(org.apache.hadoop.conf.Configuration conf)

  - ### getHttpServerBindAddress

    protected InetSocketAddress getHttpServerBindAddress(org.apache.hadoop.conf.Configuration configuration)

  - ### getRpcServer

    @VisibleForTesting public JournalNodeRpcServer getRpcServer()

  - ### getBoundHttpAddress

    public InetSocketAddress getBoundHttpAddress()
    Returns:
      the actual JournalNode HTTP/HTTPS address.

  - ### getHttpAddress

    public InetSocketAddress getHttpAddress()
    Returns:
      JournalNode HTTP address

  - ### getHttpsAddress

    public InetSocketAddress getHttpsAddress()
    Returns:
      JournalNode HTTPS address