src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/HsqlDriver.java
public void truncateTable(String table, Integer days) throws SQLException {
    if (days == null || days == 0) {
      throw new IllegalArgumentException("No days to keep limit set for truncate.");
    }
    switch (table) {
      case "HISTORY":
        PreparedStatement truncateStatement = buildSqlDeleteQuery(days);
        truncateStatement.execute();
        truncateStatement.close();
        return;
      default:
        throw new IllegalArgumentException(
            "No such truncate for table: " + table + " exists in embedded DB.");
    }
  }
/**
   * Truncate embedded tables to last X amount of days.
   *
   * @param table the table name to truncate on
   * @param days the X amount of days to retain
   * @throws SQLException error truncating table
   */
Truncate embedded tables to last X amount of days.
@param table the table name to truncate on
@param days the X amount of days to retain
@throws SQLException error truncating table
Truncate embedded tables to last X amount of days . @param table the table name to truncate on @param days the X amount of days to retain @throws SQLException error truncating table
public void truncateTable(String table, Integer days) throws SQLException {
    if (days == null || days == 0) {
      throw new IllegalArgumentException("No days to keep limit set for truncate.");
    }
    switch (table) {
      case "HISTORY":
        PreparedStatement truncateStatement = buildSqlDeleteQuery(days);
        truncateStatement.execute();
        truncateStatement.close();
        return;
      default:
        throw new IllegalArgumentException(
            "No such truncate for table: " + table + " exists in embedded DB.");
    }
  }
public void truncateTable ( String table , Integer days ) throws SQLException { if ( days == null || days == 0 ) { throw new IllegalArgumentException ( "No days to keep limit set for truncate." ) ; } switch ( table ) { case "HISTORY" : PreparedStatement truncateStatement = buildSqlDeleteQuery ( days ) ; truncateStatement . execute ( ) ; truncateStatement . close ( ) ; return ; default : throw new IllegalArgumentException ( "No such truncate for table: " + table + " exists in embedded DB." ) ; } }
Truncate embedded tables to last X amount of days.
Truncate embedded tables to last X amount of days .