Interface RollingPolicy<IN,BucketID>

All Superinterfaces:
Serializable
All Known Implementing Classes:
CheckpointRollingPolicy, DefaultRollingPolicy, OnCheckpointRollingPolicy

@PublicEvolving public interface RollingPolicy<IN,BucketID> extends Serializable
The policy based on which a Bucket in the Filesystem Sink rolls its currently open part file and opens a new one.
  • Method Details

    • shouldRollOnCheckpoint

      boolean shouldRollOnCheckpoint(PartFileInfo<BucketID> partFileState) throws IOException
      Determines if the in-progress part file for a bucket should roll on every checkpoint.
      Parameters:
      partFileState - the state of the currently open part file of the bucket.
      Returns:
      True if the part file should roll, {@link false} otherwise.
      Throws:
      IOException
    • shouldRollOnEvent

      boolean shouldRollOnEvent(PartFileInfo<BucketID> partFileState, IN element) throws IOException
      Determines if the in-progress part file for a bucket should roll based on its current state, e.g. its size.
      Parameters:
      element - the element being processed.
      partFileState - the state of the currently open part file of the bucket.
      Returns:
      True if the part file should roll, {@link false} otherwise.
      Throws:
      IOException
    • shouldRollOnProcessingTime

      boolean shouldRollOnProcessingTime(PartFileInfo<BucketID> partFileState, long currentTime) throws IOException
      Determines if the in-progress part file for a bucket should roll based on a time condition.
      Parameters:
      partFileState - the state of the currently open part file of the bucket.
      currentTime - the current processing time.
      Returns:
      True if the part file should roll, {@link false} otherwise.
      Throws:
      IOException