Class CountSyncPolicy
java.lang.Object
org.apache.storm.hdfs.trident.sync.CountSyncPolicy
- All Implemented Interfaces:
Serializable
,SyncPolicy
SyncPolicy implementation that will trigger a
file system sync after a certain number of tuples
have been processed.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
mark
(TridentTuple tuple, long offset) Called for every tuple the HdfsBolt executes.void
reset()
Called after the HdfsBolt performs a sync.
-
Constructor Details
-
CountSyncPolicy
public CountSyncPolicy(int count)
-
-
Method Details
-
mark
Description copied from interface:SyncPolicy
Called for every tuple the HdfsBolt executes.- Specified by:
mark
in 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:SyncPolicy
Called after the HdfsBolt performs a sync.- Specified by:
reset
in interfaceSyncPolicy
-