Interface FileRotationPolicy
- All Superinterfaces:
- Serializable
- All Known Implementing Classes:
- FileSizeRotationPolicy,- NoRotationPolicy,- TimedRotationPolicy
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.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanmark(long offset) Check if a file rotation should be performed based on the offset at which file is being written.booleanmark(TridentTuple tuple, long offset) Called for every tuple the HdfsBolt executes.voidreset()Called after the HdfsBolt rotates a file.voidstart()Start the policy.
- 
Method Details- 
markCalled 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
 
- 
markboolean mark(long offset) Check if a file rotation should be performed based on the offset at which file is being written.- Parameters:
- offset- the current offset of file being written
- Returns:
- true if a file rotation should be performed.
 
- 
resetvoid reset()Called after the HdfsBolt rotates a file.
- 
startvoid start()Start the policy. Useful in case of policies like timed rotation where the timer can be started.
 
-