Interface FileRotationPolicy
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FileSizeRotationPolicy
,NoRotationPolicy
,TimedRotationPolicy
public interface FileRotationPolicy extends Serializable
Used by the HdfsBolt to decide when to rotate files.The HdfsBolt will call the
mark()
method for every tuple received. If themark()
method returnstrue
the HdfsBolt will perform a file rotation.After file rotation, the HdfsBolt will call the
reset()
method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileRotationPolicy
copy()
Must be able to copy the rotation policy.boolean
mark(Tuple tuple, long offset)
Called for every tuple the HdfsBolt executes.void
reset()
Called after the HdfsBolt rotates a file.
-
-
-
Method Detail
-
mark
boolean mark(Tuple tuple, long offset)
Called for every tuple the HdfsBolt executes.- Parameters:
tuple
- The tuple executed.offset
- current offset of file being written- Returns:
- true if a file rotation should be performed
-
reset
void reset()
Called after the HdfsBolt rotates a file.
-
copy
FileRotationPolicy copy()
Must be able to copy the rotation policy.
-
-