Class RetentionPolicies

java.lang.Object
org.apache.pulsar.common.policies.data.RetentionPolicies

public class RetentionPolicies extends Object
Definition of the retention policy.

When you set a retention policy you must set **both** a *size limit* and a *time limit*. In the case where you don't want to limit by either time or set, the value must be set to `-1`. Retention policy will be effectively disabled and it won't prevent the deletion of acknowledged messages when either size or time limit is set to `0`. Infinite retention can be achieved by setting both time and size limits to `-1`.

  • Constructor Details

    • RetentionPolicies

      public RetentionPolicies()
    • RetentionPolicies

      public RetentionPolicies(int retentionTimeInMinutes, int retentionSizeInMB)
  • Method Details

    • getRetentionTimeInMinutes

      public int getRetentionTimeInMinutes()
    • getRetentionSizeInMB

      public long getRetentionSizeInMB()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object