Class TimedRotationPolicy
- java.lang.Object
-
- org.apache.storm.hdfs.trident.rotation.TimedRotationPolicy
-
- All Implemented Interfaces:
Serializable,FileRotationPolicy
public class TimedRotationPolicy extends Object implements FileRotationPolicy
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimedRotationPolicy.TimeUnit
-
Constructor Summary
Constructors Constructor Description TimedRotationPolicy(float count, TimedRotationPolicy.TimeUnit units)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetInterval()booleanmark(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 timer to run at fixed intervals.
-
-
-
Constructor Detail
-
TimedRotationPolicy
public TimedRotationPolicy(float count, TimedRotationPolicy.TimeUnit units)
-
-
Method Detail
-
mark
public boolean mark(TridentTuple tuple, long offset)
Called for every tuple the HdfsBolt executes.- Specified by:
markin interfaceFileRotationPolicy- Parameters:
tuple- The tuple executed.offset- current offset of file being written- Returns:
- true if a file rotation should be performed
-
mark
public boolean mark(long offset)
Description copied from interface:FileRotationPolicyCheck if a file rotation should be performed based on the offset at which file is being written.- Specified by:
markin interfaceFileRotationPolicy- Parameters:
offset- the current offset of file being written- Returns:
- true if a file rotation should be performed.
-
reset
public void reset()
Called after the HdfsBolt rotates a file.- Specified by:
resetin interfaceFileRotationPolicy
-
getInterval
public long getInterval()
-
start
public void start()
Start the timer to run at fixed intervals.- Specified by:
startin interfaceFileRotationPolicy
-
-