public class FileSizeRotationPolicy extends Object implements 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);
| Modifier and Type | Class and Description | 
|---|---|
| static class  | FileSizeRotationPolicy.Units | 
| Modifier | Constructor and Description | 
|---|---|
|   | FileSizeRotationPolicy(float count,
                      FileSizeRotationPolicy.Units units) | 
| protected  | FileSizeRotationPolicy(long maxBytes) | 
| Modifier and Type | Method and Description | 
|---|---|
| FileRotationPolicy | copy()Must be able to copy the rotation policy | 
| boolean | mark(Tuple tuple,
    long offset)Called for every tuple the HdfsBolt executes. | 
| void | reset()Called after the HdfsBolt rotates a file. | 
public FileSizeRotationPolicy(float count,
                              FileSizeRotationPolicy.Units units)
protected FileSizeRotationPolicy(long maxBytes)
public boolean mark(Tuple tuple, long offset)
FileRotationPolicyCalled for every tuple the HdfsBolt executes.
mark in interface FileRotationPolicytuple - The tuple executed.offset - current offset of file being writtenpublic void reset()
FileRotationPolicyCalled after the HdfsBolt rotates a file.
reset in interface FileRotationPolicypublic FileRotationPolicy copy()
FileRotationPolicyMust be able to copy the rotation policy
copy in interface FileRotationPolicyCopyright © 2022 The Apache Software Foundation. All Rights Reserved.