Class TimedRotationPolicy
java.lang.Object
org.apache.storm.hdfs.trident.rotation.TimedRotationPolicy
- All Implemented Interfaces:
Serializable
,FileRotationPolicy
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
boolean
mark
(long offset) Check if a file rotation should be performed based on the offset at which file is being written.boolean
mark
(TridentTuple tuple, long offset) Called for every tuple the HdfsBolt executes.void
reset()
Called after the HdfsBolt rotates a file.void
start()
Start the timer to run at fixed intervals.
-
Constructor Details
-
TimedRotationPolicy
-
-
Method Details
-
mark
Called for every tuple the HdfsBolt executes.- Specified by:
mark
in 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:FileRotationPolicy
Check if a file rotation should be performed based on the offset at which file is being written.- Specified by:
mark
in 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:
reset
in interfaceFileRotationPolicy
-
getInterval
public long getInterval() -
start
public void start()Start the timer to run at fixed intervals.- Specified by:
start
in interfaceFileRotationPolicy
-