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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected voiddoPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) static DataTransferThrottlergetThrottler(org.apache.hadoop.conf.Configuration conf) Construct a throttler from confstatic DataTransferThrottlergetThrottlerForBootstrapStandby(org.apache.hadoop.conf.Configuration conf) static voidsetFileNameHeaders(javax.servlet.http.HttpServletResponse response, File file) static voidsetVerificationHeadersForGet(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, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Field Details
-
PATH_SPEC
- See Also:
-
CONTENT_DISPOSITION
- See Also:
-
HADOOP_IMAGE_EDITS_HEADER
- See Also:
-
RECENT_IMAGE_CHECK_ENABLED
- See Also:
-
RECENT_IMAGE_CHECK_ENABLED_DEFAULT
public static final boolean RECENT_IMAGE_CHECK_ENABLED_DEFAULT- See Also:
-
-
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:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
setFileNameHeaders
-
getThrottler
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:
doPutin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-