private void checkPreconditions(String accountName, String containerName, String datasetName, String retentionPolicy) {
    if (accountName == null || containerName == null || datasetName == null) {
      throw new IllegalStateException(
          "At lease one of required fields accountName=" + accountName + " or containerName=" + containerName
              + " or datasetName=" + datasetName + " is null");
    }
    if (accountName.isEmpty() || containerName.isEmpty() || datasetName.isEmpty()) {
      throw new IllegalArgumentException(
          "At lease one of required fields accountName=" + accountName + " or containerName=" + containerName
              + " or datasetName=" + datasetName + " is empty");
    }
    if (!AMBRY_VALID_DATASET_NAME_PATTERN.matcher(datasetName).matches()) {
      throw new IllegalArgumentException("Invalid name for an Ambry dataset: " + datasetName
          + ". Valid names should only include alphanumeric characters, periods, underscores, and hyphens. The exact regex you must match is: "
          + AMBRY_VALID_DATASET_NAME_PATTERN);
    }
    if (retentionPolicy != null && retentionPolicy.length() > AMBRY_DATASET_RETENTION_POLICY_MAX_LENGTH) {
      throw new IllegalArgumentException(
          "retention policy maximum length can not be larger than " + AMBRY_DATASET_RETENTION_POLICY_MAX_LENGTH);
    }
  }
Checks if any required fields is missing for a {@link Dataset} or for any incompatible settings.
@param accountName The name of the account. Cannot be null.
@param containerName The name of the container. Cannot be null.
@param datasetName The name of the dataset. Cannot be null.
@param retentionPolicy The retention policy of the dataset, can be null.
ambry-api/src/main/java/com/github/ambry/account/Dataset.java