src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/fetchNamespace")
  @Produces({MediaType.TEXT_PLAIN})
  public Response fetchNamespace() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    StringWriter writer = new StringWriter();
    try {
      before();
      writer.write("Attempting to bootstrap namespace.<br />");
      try {
        TransferFsImageWrapper transferFsImage = new TransferFsImageWrapper(nnLoader);
        transferFsImage.downloadMostRecentImage();
        writer.write(
            "Done.<br />Please reload by going to `/reloadNamespace` "
                + "or by `service nn-analytics restart` on command line.");
      } catch (Throwable e) {
        writer.write("Bootstrap failed: " + e);
      }
      return Response.ok(writer.toString(), MediaType.TEXT_PLAIN).build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/**
   * FETCHNAMESPACE endpoint is an admin-level endpoint meant to fetch a fresh, up-to-date, FSImage
   * from the active cluster.
   */
FETCHNAMESPACE endpoint is an admin-level endpoint meant to fetch a fresh, up-to-date, FSImage
from the active cluster.
FETCHNAMESPACE endpoint is an admin - level endpoint meant to fetch a fresh up - to - date FSImage from the active cluster .
@GET
  @Path("/fetchNamespace")
  @Produces({MediaType.TEXT_PLAIN})
  public Response fetchNamespace() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    StringWriter writer = new StringWriter();
    try {
      before();
      writer.write("Attempting to bootstrap namespace.<br />");
      try {
        TransferFsImageWrapper transferFsImage = new TransferFsImageWrapper(nnLoader);
        transferFsImage.downloadMostRecentImage();
        writer.write(
            "Done.<br />Please reload by going to `/reloadNamespace` "
                + "or by `service nn-analytics restart` on command line.");
      } catch (Throwable e) {
        writer.write("Bootstrap failed: " + e);
      }
      return Response.ok(writer.toString(), MediaType.TEXT_PLAIN).build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/fetchNamespace" ) @ Produces ( { MediaType . TEXT_PLAIN } ) public Response fetchNamespace ( ) { final NameNodeLoader nnLoader = ( NameNodeLoader ) context . getAttribute ( NNA_NN_LOADER ) ; StringWriter writer = new StringWriter ( ) ; try { before ( ) ; writer . write ( "Attempting to bootstrap namespace.<br />" ) ; try { TransferFsImageWrapper transferFsImage = new TransferFsImageWrapper ( nnLoader ) ; transferFsImage . downloadMostRecentImage ( ) ; writer . write ( "Done.<br />Please reload by going to `/reloadNamespace` " + "or by `service nn-analytics restart` on command line." ) ; } catch ( Throwable e ) { writer . write ( "Bootstrap failed: " + e ) ; } return Response . ok ( writer . toString ( ) , MediaType . TEXT_PLAIN ) . build ( ) ; } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
FETCHNAMESPACE endpoint is an admin-level endpoint meant to fetch a fresh, up-to-date, FSImage
 from the active cluster.
FETCHNAMESPACE endpoint is an admin - level endpoint meant to fetch a fresh up - to - date FSImage from the active cluster .