Example #1
0
 /// <exception cref="Javax.Servlet.ServletException"/>
 /// <exception cref="System.IO.IOException"/>
 protected override void DoPut(HttpServletRequest request, HttpServletResponse response
                               )
 {
     try
     {
         ServletContext context = GetServletContext();
         FSImage        nnImage = NameNodeHttpServer.GetFsImageFromContext(context);
         Configuration  conf    = (Configuration)GetServletContext().GetAttribute(JspHelper.CurrentConf
                                                                                  );
         ImageServlet.PutImageParams parsedParams = new ImageServlet.PutImageParams(request
                                                                                    , response, conf);
         NameNodeMetrics metrics = NameNode.GetNameNodeMetrics();
         ValidateRequest(context, conf, request, response, nnImage, parsedParams.GetStorageInfoString
                             ());
         UserGroupInformation.GetCurrentUser().DoAs(new _PrivilegedExceptionAction_458(parsedParams
                                                                                       , nnImage, response, request, conf, metrics));
     }
     catch (Exception t)
     {
         // Metrics non-null only when used inside name node
         // Now that we have a new checkpoint, we might be able to
         // remove some old ones.
         string errMsg = "PutImage failed. " + StringUtils.StringifyException(t);
         response.SendError(HttpServletResponse.ScGone, errMsg);
         throw new IOException(errMsg);
     }
 }
Example #2
0
 public _PrivilegedExceptionAction_458(ImageServlet.PutImageParams parsedParams, FSImage
                                       nnImage, HttpServletResponse response, HttpServletRequest request, Configuration
                                       conf, NameNodeMetrics metrics)
 {
     this.parsedParams = parsedParams;
     this.nnImage      = nnImage;
     this.response     = response;
     this.request      = request;
     this.conf         = conf;
     this.metrics      = metrics;
 }