Class PeriodicPolicy.Builder

java.lang.Object
me.ahoo.cosid.segment.PeriodicPolicy.Builder
Enclosing class:
PeriodicPolicy

public static final class PeriodicPolicy.Builder extends Object
Builds a PeriodicPolicy; build() checks the fields.
  • Method Details

    • prewarm

      public PeriodicPolicy.Builder prewarm(Duration prewarm)
      Sets how long before the current period ends the next one is created and warmed up.
      Parameters:
      prewarm - the prewarm, not negative; default 1min
      Returns:
      this builder
    • sealAfter

      public PeriodicPolicy.Builder sealAfter(Duration sealAfter)
      Sets how long after a period ends its key is sealed (at least a day is advised).
      Parameters:
      sealAfter - the delay, not negative; default none, never sealed
      Returns:
      this builder
    • build

      public PeriodicPolicy build()
      Builds the policy.
      Returns:
      the policy
      Throws:
      IllegalArgumentException - if a field is negative