private DatasetVersionRecord addDatasetVersionHelper(int accountId, int containerId, Dataset dataset, String version,
      long timeToLiveInSeconds, long creationTimeInMs, boolean datasetVersionTtlEnabled, long versionNumber,
      DatasetVersionState datasetVersionState)
      throws SQLException, AccountServiceException {
    PreparedStatement insertDatasetVersionStatement = dataAccessor.getPreparedStatement(insertDatasetVersionSql, true);
    long newExpirationTimeMs = executeAddDatasetVersionStatement(insertDatasetVersionStatement, accountId, containerId,
        dataset.getDatasetName(), versionNumber, timeToLiveInSeconds, creationTimeInMs, dataset,
        datasetVersionTtlEnabled, datasetVersionState);
    return new DatasetVersionRecord(accountId, containerId, dataset.getDatasetName(), version, newExpirationTimeMs,
        null);
  }
Helper function to support add dataset verison.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param dataset the {@link Dataset}
@param version the version of the dataset.
@param timeToLiveInSeconds The dataset version level ttl.
@param creationTimeInMs the creation time of the dataset.
@param datasetVersionTtlEnabled set to true if dataset version ttl want to override the dataset level default ttl.
@param datasetVersionState the {@link DatasetVersionState}
@return the {@link DatasetVersionRecord} and the latest version.
@throws SQLException
@throws AccountServiceException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java