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

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

# Class ImageServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.hadoop.hdfs.server.namenode.ImageServlet

All Implemented Interfaces:
  `Serializable`, `javax.servlet.Servlet`, `javax.servlet.ServletConfig`

@Private public class ImageServlet extends javax.servlet.http.HttpServlet
This class is used in Namesystem's jetty to retrieve/upload a file Typically used by the Secondary NameNode to retrieve image and edit file for periodic checkpointing in Non-HA deployments. Standby NameNode uses to upload checkpoints in HA deployments.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONTENT_DISPOSITION`
  `static final String`
  `HADOOP_IMAGE_EDITS_HEADER`
  `static final String`
  `PATH_SPEC`
  `static final String`
  `RECENT_IMAGE_CHECK_ENABLED`
  `static final boolean`
  `RECENT_IMAGE_CHECK_ENABLED_DEFAULT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ImageServlet()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
  `protected void`
  `doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
  `static DataTransferThrottler`
  `getThrottler(org.apache.hadoop.conf.Configuration conf)`
  Construct a throttler from conf
  `static DataTransferThrottler`
  `getThrottlerForBootstrapStandby(org.apache.hadoop.conf.Configuration conf)`
  `static void`
  `setFileNameHeaders(javax.servlet.http.HttpServletResponse response, File file)`
  `static void`
  `setVerificationHeadersForGet(javax.servlet.http.HttpServletResponse response, File file)`
  Set headers for content length, and, if available, md5.

  ### Methods inherited from class javax.servlet.http.HttpServlet

  `doDelete, doHead, doOptions, doPost, doTrace, getLastModified, service, service`

  ### Methods inherited from class javax.servlet.GenericServlet

  `destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log`

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

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

- ## Field Details

  - ### PATH_SPEC

    public static final String PATH_SPEC
    See Also:
      - Constant Field Values

  - ### CONTENT_DISPOSITION

    public static final String CONTENT_DISPOSITION
    See Also:
      - Constant Field Values

  - ### HADOOP_IMAGE_EDITS_HEADER

    public static final String HADOOP_IMAGE_EDITS_HEADER
    See Also:
      - Constant Field Values

  - ### RECENT_IMAGE_CHECK_ENABLED

    public static final String RECENT_IMAGE_CHECK_ENABLED
    See Also:
      - Constant Field Values

  - ### RECENT_IMAGE_CHECK_ENABLED_DEFAULT

    public static final boolean RECENT_IMAGE_CHECK_ENABLED_DEFAULT
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ImageServlet

    public ImageServlet()

- ## Method Details

  - ### doGet

    public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
    Overrides:
      `doGet` in class `javax.servlet.http.HttpServlet`
    Throws:
      `javax.servlet.ServletException`
      `IOException`

  - ### setFileNameHeaders

    public static void setFileNameHeaders(javax.servlet.http.HttpServletResponse response, File file)

  - ### getThrottler

    public static DataTransferThrottler getThrottler(org.apache.hadoop.conf.Configuration conf)
    Construct a throttler from conf
    Parameters:
      `conf` - configuration
    Returns:
      a data transfer throttler

  - ### getThrottlerForBootstrapStandby

    public static DataTransferThrottler getThrottlerForBootstrapStandby(org.apache.hadoop.conf.Configuration conf)

  - ### setVerificationHeadersForGet

    public static void setVerificationHeadersForGet(javax.servlet.http.HttpServletResponse response, File file) throws IOException
    Set headers for content length, and, if available, md5.
    Throws:
      `IOException`

  - ### doPut

    protected void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
    Overrides:
      `doPut` in class `javax.servlet.http.HttpServlet`
    Throws:
      `javax.servlet.ServletException`
      `IOException`