public class TimedRotationPolicy extends Object implements FileRotationPolicy
| Modifier and Type | Class and Description |
|---|---|
static class |
TimedRotationPolicy.TimeUnit |
| Constructor and Description |
|---|
TimedRotationPolicy(float count,
TimedRotationPolicy.TimeUnit units) |
| Modifier and Type | Method and Description |
|---|---|
long |
getInterval() |
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.
|
public TimedRotationPolicy(float count,
TimedRotationPolicy.TimeUnit units)
public boolean mark(TridentTuple tuple, long offset)
Called for every tuple the HdfsBolt executes.
mark in interface FileRotationPolicytuple - The tuple executed.offset - current offset of file being writtenpublic boolean mark(long offset)
FileRotationPolicyCheck if a file rotation should be performed based on the offset at which file is being written.
mark in interface FileRotationPolicyoffset - the current offset of file being writtenpublic void reset()
Called after the HdfsBolt rotates a file.
reset in interface FileRotationPolicypublic long getInterval()
public void start()
Start the timer to run at fixed intervals.
start in interface FileRotationPolicyCopyright © 2021 The Apache Software Foundation. All rights reserved.