@Override
  public ExpirationAttributes setEntryTimeToLive(ExpirationAttributes timeToLive) {
    ExpirationAttributes attr = super.setEntryTimeToLive(timeToLive);

    /*
     * All buckets must be created to make this change, otherwise it is possible for
     * updatePRConfig(...) to make changes that cause bucket creation to live lock
     */
    PartitionRegionHelper.assignBucketsToPartitions(this);
    if (dataStore != null) {
      dataStore.lockBucketCreationAndVisit(
          (bucketId, r) -> r.getAttributesMutator().setEntryTimeToLive(timeToLive));
    }
    updatePartitionRegionConfig(config -> config.setEntryTimeToLive(timeToLive));
    return attr;
  }
Changes the timeToLive expiration attributes for values in this region.

@param timeToLive the timeToLive expiration attributes for entries
@return the previous value of entry timeToLive
@throws IllegalArgumentException if timeToLive is null or if the ExpirationAction is
        LOCAL_DESTROY and the region is {@link DataPolicy#withReplication replicated} or if the
        ExpirationAction is LOCAL_INVALIDATE and the region is
        {@link DataPolicy#withReplication replicated}
@throws IllegalStateException if statistics are disabled for this region.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java