public class CountSyncPolicy extends Object implements SyncPolicy
SyncPolicy implementation that will trigger a file system sync after a certain number of tuples have been processed.
Constructor and Description |
---|
CountSyncPolicy(int count) |
Modifier and Type | Method and Description |
---|---|
boolean |
mark(Tuple tuple,
long offset)
Called for every tuple the HdfsBolt executes.
|
void |
reset()
Called after the HdfsBolt performs a sync.
|
public boolean mark(Tuple tuple, long offset)
SyncPolicy
Called for every tuple the HdfsBolt executes.
mark
in interface SyncPolicy
tuple
- The tuple executed.offset
- current offset for the file being writtenpublic void reset()
SyncPolicy
Called after the HdfsBolt performs a sync.
reset
in interface SyncPolicy
Copyright © 2022 The Apache Software Foundation. All rights reserved.