private Long switchTime()

in backend/src/main/java/org/apache/iotdb/admin/controller/IotDBController.java [1208:1239]


  private Long switchTime(String ttlUnit) throws BaseException {
    Long time;
    switch (ttlUnit) {
      case "millisecond":
        time = 1L;
        break;
      case "second":
        time = 1000L;
        break;
      case "minute":
        time = 60 * 1000L;
        break;
      case "hour":
        time = 60 * 60 * 1000L;
        break;
      case "day":
        time = 24 * 60 * 60 * 1000L;
        break;
      case "week":
        time = 7 * 24 * 60 * 60 * 1000L;
        break;
      case "month":
        time = 30 * 24 * 60 * 60 * 1000L;
        break;
      case "year":
        time = 12 * 30 * 24 * 60 * 60 * 1000L;
        break;
      default:
        throw new BaseException(ErrorCode.WRONG_DB_PARAM, ErrorCode.WRONG_DB_PARAM_MSG);
    }
    return time;
  }