Interface RollingPolicy<IN,BucketID>
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CheckpointRollingPolicy,DefaultRollingPolicy,OnCheckpointRollingPolicy
The policy based on which a
Bucket in the Filesystem Sink rolls its currently
open part file and opens a new one.-
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldRollOnCheckpoint(PartFileInfo<BucketID> partFileState) Determines if the in-progress part file for a bucket should roll on every checkpoint.booleanshouldRollOnEvent(PartFileInfo<BucketID> partFileState, IN element) Determines if the in-progress part file for a bucket should roll based on its current state, e.g. its size.booleanshouldRollOnProcessingTime(PartFileInfo<BucketID> partFileState, long currentTime) Determines if the in-progress part file for a bucket should roll based on a time condition.
-
Method Details
-
shouldRollOnCheckpoint
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:
Trueif the part file should roll, {@link false} otherwise.- Throws:
IOException
-
shouldRollOnEvent
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:
Trueif 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:
Trueif the part file should roll, {@link false} otherwise.- Throws:
IOException
-