Class RetentionPolicy

  • All Implemented Interfaces:
    java.io.Serializable

    public class RetentionPolicy
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Method Detail

      • byTime

        public static RetentionPolicy byTime​(java.time.Duration duration)
        Create a retention policy to configure a stream to be periodically truncated according to the specified duration.
        Parameters:
        duration - Period to retain data in a stream.
        Returns:
        Retention policy object.
      • byTime

        public static RetentionPolicy byTime​(java.time.Duration durationMin,
                                             java.time.Duration durationMax)
        Create a retention policy to configure a stream to periodically truncated according to the specified duration.
        Parameters:
        durationMin - Minimum period for which data would be retained in the stream.
        durationMax - Maximum period for which data would be retained in the stream.
        Returns:
        Retention policy object.
      • bySizeBytes

        public static RetentionPolicy bySizeBytes​(long size)
        Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.
        Parameters:
        size - Amount of data to retain in a stream.
        Returns:
        Retention policy object.
      • bySizeBytes

        public static RetentionPolicy bySizeBytes​(long sizeMin,
                                                  long sizeMax)
        Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.
        Parameters:
        sizeMin - Minimum amount of data to retain in a Stream.
        sizeMax - Maximum amount of data to retain in a Stream.
        Returns:
        Retention policy object.
      • getRetentionParam

        public long getRetentionParam()
      • getRetentionMax

        public long getRetentionMax()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object