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 the mark()
method returns true
the HdfsBolt will perform a file rotation.
After file rotation, the HdfsBolt will call the reset()
method.
Modifier and Type | Method and 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.
|
boolean mark(Tuple tuple, long offset)
Called for every tuple the HdfsBolt executes.
tuple
- The tuple executed.offset
- current offset of file being writtenvoid reset()
Called after the HdfsBolt rotates a file.
FileRotationPolicy copy()
Must be able to copy the rotation policy.
Copyright © 2020 The Apache Software Foundation. All rights reserved.