src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/top")
  @Produces(MediaType.APPLICATION_JSON)
  public Response top() {
    try {
      final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
      before();
      String strLimit = request.getParameter("limit");
      Integer limit;
      if (strLimit == null) {
        limit = 10;
      } else {
        limit = Integer.parseInt(strLimit);
      }
      return Response.ok(
              nnLoader.getSuggestionsEngine().getIssuesAsJson(limit, false),
              MediaType.APPLICATION_JSON)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/** TOP endpoint is an admin-level endpoint meant to dump the cached set of top issues by NNA. */
TOP endpoint is an admin-level endpoint meant to dump the cached set of top issues by NNA.
TOP endpoint is an admin - level endpoint meant to dump the cached set of top issues by NNA .
@GET
  @Path("/top")
  @Produces(MediaType.APPLICATION_JSON)
  public Response top() {
    try {
      final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
      before();
      String strLimit = request.getParameter("limit");
      Integer limit;
      if (strLimit == null) {
        limit = 10;
      } else {
        limit = Integer.parseInt(strLimit);
      }
      return Response.ok(
              nnLoader.getSuggestionsEngine().getIssuesAsJson(limit, false),
              MediaType.APPLICATION_JSON)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/top" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response top ( ) { try { final NameNodeLoader nnLoader = ( NameNodeLoader ) context . getAttribute ( NNA_NN_LOADER ) ; before ( ) ; String strLimit = request . getParameter ( "limit" ) ; Integer limit ; if ( strLimit == null ) { limit = 10 ; } else { limit = Integer . parseInt ( strLimit ) ; } return Response . ok ( nnLoader . getSuggestionsEngine ( ) . getIssuesAsJson ( limit , false ) , MediaType . APPLICATION_JSON ) . build ( ) ; } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
TOP endpoint is an admin-level endpoint meant to dump the cached set of top issues by NNA.
TOP endpoint is an admin - level endpoint meant to dump the cached set of top issues by NNA .