Class PeriodicPolicy

java.lang.Object
me.ahoo.cosid.segment.PeriodicPolicy

public final class PeriodicPolicy extends Object
How a PeriodicSegmentGenerator moves between periods (04-segment.md §3). Immutable; built with builder(), the only way to create one, so fields can be added with a default (api-freeze.md §4).
  • Field Details

    • DEFAULT

      public static final PeriodicPolicy DEFAULT
      Every default: prewarm 1min, never sealed.
  • Method Details

    • builder

      public static PeriodicPolicy.Builder builder()
      A builder starting from the defaults (DEFAULT).
      Returns:
      the builder
    • prewarm

      public Duration prewarm()
      The next period is created and warmed up this long before the current one ends.
      Returns:
      the prewarm; default 1min
    • sealAfter

      public Optional<Duration> sealAfter()
      The key of a period is sealed this long after the period ends (at least a day is advised).
      Returns:
      the delay; default none, never sealed
    • 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