src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/fileAge")
  @Produces(MediaType.APPLICATION_JSON)
  public Response fileAge() {
    try {
      final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);

      before();
      String sum = request.getParameter("sum");
      if (sum == null || sum.isEmpty()) {
        sum = "count";
      }
      return Response.ok(
              nnLoader.getSuggestionsEngine().getFileAgeAsJson(sum), MediaType.APPLICATION_JSON)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/**
   * FILEAGE endpoint is an reader-level endpoint meant to dump the cached file age analysis by NNA.
   */
FILEAGE endpoint is an reader-level endpoint meant to dump the cached file age analysis by NNA.
FILEAGE endpoint is an reader - level endpoint meant to dump the cached file age analysis by NNA .
@GET
  @Path("/fileAge")
  @Produces(MediaType.APPLICATION_JSON)
  public Response fileAge() {
    try {
      final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
      before();
      String sum = request.getParameter("sum");
      if (sum == null || sum.isEmpty()) {
        sum = "count";
      }
      return Response.ok(
              nnLoader.getSuggestionsEngine().getFileAgeAsJson(sum), MediaType.APPLICATION_JSON)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/fileAge" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response fileAge ( ) { try { final NameNodeLoader nnLoader = ( NameNodeLoader ) context . getAttribute ( NNA_NN_LOADER ) ; before ( ) ; String sum = request . getParameter ( "sum" ) ; if ( sum == null || sum . isEmpty ( ) ) { sum = "count" ; } return Response . ok ( nnLoader . getSuggestionsEngine ( ) . getFileAgeAsJson ( sum ) , MediaType . APPLICATION_JSON ) . build ( ) ; } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
FILEAGE endpoint is an reader-level endpoint meant to dump the cached file age analysis by NNA.
FILEAGE endpoint is an reader - level endpoint meant to dump the cached file age analysis by NNA .