src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/truncate")
  @Produces({MediaType.TEXT_PLAIN})
  public Response truncate() {
    try {
      final HsqlDriver hsqlDriver = (HsqlDriver) context.getAttribute(NNA_HSQL_DRIVER);
      before();
      String table = request.getParameter("table");
      Integer limit = Integer.parseInt(request.getParameter("limit"));
      hsqlDriver.truncateTable(table, limit);

      return Response.ok(
              "Successfully truncated table: " + table + ", to last: " + limit + " days.",
              MediaType.TEXT_PLAIN)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/**
   * TRUNCATE endpoint is an admin-level endpoint meant to truncate the history of embedded DB
   * tables.
   */
TRUNCATE endpoint is an admin-level endpoint meant to truncate the history of embedded DB
tables.
TRUNCATE endpoint is an admin - level endpoint meant to truncate the history of embedded DB tables .
@GET
  @Path("/truncate")
  @Produces({MediaType.TEXT_PLAIN})
  public Response truncate() {
    try {
      final HsqlDriver hsqlDriver = (HsqlDriver) context.getAttribute(NNA_HSQL_DRIVER);
      before();
      String table = request.getParameter("table");
      Integer limit = Integer.parseInt(request.getParameter("limit"));
      hsqlDriver.truncateTable(table, limit);
      return Response.ok(
              "Successfully truncated table: " + table + ", to last: " + limit + " days.",
              MediaType.TEXT_PLAIN)
          .build();
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/truncate" ) @ Produces ( { MediaType . TEXT_PLAIN } ) public Response truncate ( ) { try { final HsqlDriver hsqlDriver = ( HsqlDriver ) context . getAttribute ( NNA_HSQL_DRIVER ) ; before ( ) ; String table = request . getParameter ( "table" ) ; Integer limit = Integer . parseInt ( request . getParameter ( "limit" ) ) ; hsqlDriver . truncateTable ( table , limit ) ; return Response . ok ( "Successfully truncated table: " + table + ", to last: " + limit + " days." , MediaType . TEXT_PLAIN ) . build ( ) ; } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
TRUNCATE endpoint is an admin-level endpoint meant to truncate the history of embedded DB
 tables.
TRUNCATE endpoint is an admin - level endpoint meant to truncate the history of embedded DB tables .