Class CountSyncPolicy
- java.lang.Object
-
- org.apache.storm.hdfs.trident.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
-
-
Constructor Summary
Constructors Constructor Description CountSyncPolicy(int count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmark(TridentTuple tuple, long offset)Called for every tuple the HdfsBolt executes.voidreset()Called after the HdfsBolt performs a sync.
-
-
-
Method Detail
-
mark
public boolean mark(TridentTuple tuple, long offset)
Description copied from interface:SyncPolicyCalled for every tuple the HdfsBolt executes.- Specified by:
markin interfaceSyncPolicy- 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:SyncPolicyCalled after the HdfsBolt performs a sync.- Specified by:
resetin interfaceSyncPolicy
-
-