Class WebImageViewer

java.lang.Object
org.apache.hadoop.hdfs.tools.offlineImageViewer.WebImageViewer
All Implemented Interfaces:
Closeable, AutoCloseable

public class WebImageViewer extends Object implements Closeable
WebImageViewer loads a fsimage and exposes read-only WebHDFS API for its namespace.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • WebImageViewer

      public WebImageViewer(InetSocketAddress address)
    • WebImageViewer

      public WebImageViewer(InetSocketAddress address, org.apache.hadoop.conf.Configuration conf)
  • Method Details

    • start

      public void start(String fsimage) throws IOException
      Start WebImageViewer and wait until the thread is interrupted.
      Parameters:
      fsimage - the fsimage to load.
      Throws:
      IOException - if failed to load the fsimage.
      RuntimeException - if security is enabled in configuration.
    • initServer

      @VisibleForTesting public void initServer(String fsimage) throws IOException, InterruptedException
      Start WebImageViewer.
      Parameters:
      fsimage - the fsimage to load.
      Throws:
      IOException - if fail to load the fsimage.
      InterruptedException
    • getPort

      @VisibleForTesting public int getPort()
      Get the listening port.
      Returns:
      the port WebImageViewer is listening on
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable