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:
  • Field Details

  • 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