src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/suggestions")
  @Produces(MediaType.APPLICATION_JSON)
  public Response suggestions() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    try {
      before();
      boolean allJson = request.getParameterMap().containsKey("all");
      if (allJson) {
        return Response.ok(
                nnLoader.getSuggestionsEngine().getAllSuggestionsAsJson(),
                MediaType.APPLICATION_JSON)
            .build();
      } else {
        String username = request.getParameter("username");
        return Response.ok(
                nnLoader.getSuggestionsEngine().getSuggestionsAsJson(username),
                MediaType.APPLICATION_JSON)
            .build();
      }
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/** SUGGESTIONS endpoint is an admin-level endpoint meant to dump the cached analysis by NNA. */
SUGGESTIONS endpoint is an admin-level endpoint meant to dump the cached analysis by NNA.
SUGGESTIONS endpoint is an admin - level endpoint meant to dump the cached analysis by NNA .
@GET
  @Path("/suggestions")
  @Produces(MediaType.APPLICATION_JSON)
  public Response suggestions() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    try {
      before();
      boolean allJson = request.getParameterMap().containsKey("all");
      if (allJson) {
        return Response.ok(
                nnLoader.getSuggestionsEngine().getAllSuggestionsAsJson(),
                MediaType.APPLICATION_JSON)
            .build();
      } else {
        String username = request.getParameter("username");
        return Response.ok(
                nnLoader.getSuggestionsEngine().getSuggestionsAsJson(username),
                MediaType.APPLICATION_JSON)
            .build();
      }
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/suggestions" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response suggestions ( ) { final NameNodeLoader nnLoader = ( NameNodeLoader ) context . getAttribute ( NNA_NN_LOADER ) ; try { before ( ) ; boolean allJson = request . getParameterMap ( ) . containsKey ( "all" ) ; if ( allJson ) { return Response . ok ( nnLoader . getSuggestionsEngine ( ) . getAllSuggestionsAsJson ( ) , MediaType . APPLICATION_JSON ) . build ( ) ; } else { String username = request . getParameter ( "username" ) ; return Response . ok ( nnLoader . getSuggestionsEngine ( ) . getSuggestionsAsJson ( username ) , MediaType . APPLICATION_JSON ) . build ( ) ; } } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
SUGGESTIONS endpoint is an admin-level endpoint meant to dump the cached analysis by NNA.
SUGGESTIONS endpoint is an admin - level endpoint meant to dump the cached analysis by NNA .