public List<DatasetVersionRecord> getAllValidVersionForDatasetDeletion(short accountId,
      short containerId, String datasetName) throws SQLException, AccountServiceException {
    try {
      long startTimeMs = System.currentTimeMillis();
      PreparedStatement getVersionSchemaStatement = dataAccessor.getPreparedStatement(getVersionSchemaSql, false);
      Dataset.VersionSchema versionSchema =
          executeGetVersionSchema(getVersionSchemaStatement, accountId, containerId, datasetName);
      PreparedStatement listAllValidVersionForDatasetDeletionStatement =
          dataAccessor.getPreparedStatement(listValidVersionForDatasetDeletionSql, false);
      List<DatasetVersionRecord> datasetVersionRecords =
          executeListAllValidVersionForDatasetDeletionStatement(listAllValidVersionForDatasetDeletionStatement,
              accountId, containerId, datasetName, versionSchema);
      dataAccessor.onSuccess(Read, System.currentTimeMillis() - startTimeMs);
      return datasetVersionRecords;
    } catch (SQLException | AccountServiceException e) {
      dataAccessor.onException(e, Read);
      throw e;
    }
  }
Get a list of dataset versions which is not expired or been deleted which belongs to the related dataset.
Since this is used for delete all version under a dataset, we should list all version including the in_progress states.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param datasetName the name of the dataset.
@return a list of dataset versions which is not expired or been deleted.
@throws SQLException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java