@Override
  public void renameDatasetVersion(String accountName, String containerName, String datasetName, String sourceVersion,
      String targetVersion) throws AccountServiceException {
    DatasetVersionRecord datasetVersionRecord =
        getDatasetVersion(accountName, containerName, datasetName, sourceVersion);
    deleteDatasetVersion(accountName, containerName, datasetName, sourceVersion);
    addDatasetVersion(accountName, containerName, datasetName, targetVersion,
        (datasetVersionRecord.getExpirationTimeMs() - datasetVersionRecord.getCreationTimeMs()) / 1000,
        datasetVersionRecord.getCreationTimeMs(), false, null);
    Account account = nameToAccountMap.get(accountName);
    short accountId = account.getId();
    short containerId = account.getContainerByName(containerName).getId();
    DatasetVersionRecord datasetVersionRecordToUpdate =
        idToDatasetVersionMap.get(new Pair<>(accountId, containerId)).get(new Pair<>(datasetName, targetVersion));
    datasetVersionRecordToUpdate.setRenameFrom(sourceVersion);
  }
Constructor.
@param shouldReturnOnlyUnknown {@code true} if always returns {@link InMemAccountService#UNKNOWN_ACCOUNT} when queried
                                                    by account name; {@code false} to do the actual query.
@param notifyConsumers {@code true} if consumers should be notified of account changes. {@code false} otherwise.
ambry-test-utils/src/main/java/com/github/ambry/account/InMemAccountService.java