Class TimedRotationPolicy
- java.lang.Object
-
- org.apache.storm.hdfs.bolt.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 Modifier Constructor Description TimedRotationPolicy(float count, TimedRotationPolicy.TimeUnit units)protectedTimedRotationPolicy(long interval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileRotationPolicycopy()Must be able to copy the rotation policy.longgetInterval()booleanmark(Tuple tuple, long offset)Called for every tuple the HdfsBolt executes.voidreset()Called after the HdfsBolt rotates a file.
-
-
-
Constructor Detail
-
TimedRotationPolicy
public TimedRotationPolicy(float count, TimedRotationPolicy.TimeUnit units)
-
TimedRotationPolicy
protected TimedRotationPolicy(long interval)
-
-
Method Detail
-
mark
public boolean mark(Tuple 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
-
reset
public void reset()
Called after the HdfsBolt rotates a file.- Specified by:
resetin interfaceFileRotationPolicy
-
copy
public FileRotationPolicy copy()
Description copied from interface:FileRotationPolicyMust be able to copy the rotation policy.- Specified by:
copyin interfaceFileRotationPolicy
-
getInterval
public long getInterval()
-
-