org.apache.storm.hdfs.bolt.sync
Class CountSyncPolicy
java.lang.Object
org.apache.storm.hdfs.bolt.sync.CountSyncPolicy
- All Implemented Interfaces:
- Serializable, SyncPolicy
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.
- See Also:
- Serialized Form
Method Summary |
boolean |
mark(Tuple tuple,
long offset)
Called for every tuple the HdfsBolt executes. |
void |
reset()
Called after the HdfsBolt performs a sync. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountSyncPolicy
public CountSyncPolicy(int count)
mark
public boolean mark(Tuple tuple,
long offset)
- Description copied from interface:
SyncPolicy
- Called for every tuple the HdfsBolt executes.
- Specified by:
mark
in interface SyncPolicy
- Parameters:
tuple
- The tuple executed.offset
- current offset for the file being written
- Returns:
- true if a sync should be performed
reset
public void reset()
- Description copied from interface:
SyncPolicy
- Called after the HdfsBolt performs a sync.
- Specified by:
reset
in interface SyncPolicy
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.