Class FileSizeRotationPolicy
java.lang.Object
org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy
- All Implemented Interfaces:
Serializable,FileRotationPolicy
File rotation policy that will rotate files when a certain
file size is reached.
For example:
// rotate when files reach 5MB
FileSizeRotationPolicy policy =
new FileSizeRotationPolicy(5.0, Units.MB);
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionFileSizeRotationPolicy(float count, FileSizeRotationPolicy.Units units) protectedFileSizeRotationPolicy(long maxBytes) -
Method Summary
-
Constructor Details
-
FileSizeRotationPolicy
-
FileSizeRotationPolicy
protected FileSizeRotationPolicy(long maxBytes)
-
-
Method Details
-
mark
Description copied from interface:FileRotationPolicyCalled 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()Description copied from interface:FileRotationPolicyCalled after the HdfsBolt rotates a file.- Specified by:
resetin interfaceFileRotationPolicy
-
copy
Description copied from interface:FileRotationPolicyMust be able to copy the rotation policy.- Specified by:
copyin interfaceFileRotationPolicy
-