public void renameDatasetVersion(int accountId, int containerId, String accountName, String containerName,
      String datasetName, String sourceVersion, String targetVersion) throws SQLException, AccountServiceException {
    long startTimeMs = System.currentTimeMillis();
    try {
      Dataset dataset = getDatasetHelper(accountId, containerId, accountName, containerName, datasetName, true);
      if (!SEMANTIC_LONG.equals(dataset.getVersionSchema())) {
        throw new IllegalArgumentException("Rename API only supported for SEMANTIC_LONG schema");
      }
      if (isAutoIncrVersion(sourceVersion) || isAutoIncrVersion(targetVersion)) {
        throw new IllegalArgumentException("Rename API can't rename from/to auto incr version");
      }
      renameDatasetVersionHelper(accountId, containerId, datasetName, dataset.getVersionSchema(), sourceVersion,
          targetVersion);
      dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs);
    } catch (SQLException | AccountServiceException e) {
      dataAccessor.onException(e, Write);
      throw e;
    }
  }
Rename a dataset version of {@link Dataset}
@param accountId the id for the parent account.
@param containerId the id of the container.
@param accountName the name for the parent account.
@param containerName the name for the container.
@param datasetName the name of the dataset.
@param sourceVersion the source version to rename.
@param targetVersion the target version to rename.
@throws SQLException
@throws AccountServiceException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java