Package cz.o2.proxima.direct.io.kafka
Class OffsetCommitter<ID>
- java.lang.Object
-
- cz.o2.proxima.direct.io.kafka.OffsetCommitter<ID>
-
public class OffsetCommitter<ID> extends java.lang.ObjectA committer of kafka offsets. This committer is used for asynchronous operations to enforce that the offset is not committed earlier then all associated actions are performed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOffsetCommitter.CallbackCallback to be called for performing the commit.
-
Constructor Summary
Constructors Constructor Description OffsetCommitter()OffsetCommitter(long staleCommitWarningMillis, long autoCommitMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear completely all mappings.voidclear(ID id, long offset)Clear all records for given topic partition and offset.voidconfirm(ID id, long offset)Confirm that action associated with given offset has been performed.voidregister(ID id, long offset, int numActions, OffsetCommitter.Callback commit)Register number of actions to be performed before offset can be committed.java.lang.StringtoString()
-
-
-
Method Detail
-
register
public void register(ID id, long offset, int numActions, OffsetCommitter.Callback commit)
Register number of actions to be performed before offset can be committed.- Parameters:
id- id of the consumeroffset- the registered offsetnumActions- how many timesconfirm(Object, long)should be called to consider the action as donecommit-OffsetCommitter.Callbackto call to commit
-
confirm
public void confirm(ID id, long offset)
Confirm that action associated with given offset has been performed.- Parameters:
id- id of the consumeroffset- the offset to confirm
-
clear
public void clear(ID id, long offset)
Clear all records for given topic partition and offset.- Parameters:
id- id of the consumeroffset- offset to clear
-
clear
public void clear()
Clear completely all mappings.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-