public void setDataPolicy(DataPolicy dataPolicy) {
    if (dataPolicy == null) {
      throw new IllegalArgumentException(
          "dataPolicy must not be null");
    }
    if (regionAttributes.partitionAttributes != null) {
      if (!PartitionedRegionHelper.ALLOWED_DATA_POLICIES.contains(dataPolicy)) {
        throw new IllegalStateException(
            String.format("Data policies other than %s are not supported for Partitioned Regions",
                PartitionedRegionHelper.ALLOWED_DATA_POLICIES));
      }
    }
    regionAttributes.setDataPolicy(dataPolicy);
  }
Sets the data policy for the next {@code RegionAttributes} created. Default data policy is
'Normal'. Please refer gemfire documentation for more details on this.

@param dataPolicy The data policy to use for the region
@throws IllegalArgumentException if dataPolicy is null
geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java