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.Object
A 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 interface
OffsetCommitter.Callback
Callback 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 void
clear()
Clear completely all mappings.void
clear(ID id, long offset)
Clear all records for given topic partition and offset.void
confirm(ID id, long offset)
Confirm that action associated with given offset has been performed.void
register(ID id, long offset, int numActions, OffsetCommitter.Callback commit)
Register number of actions to be performed before offset can be committed.java.lang.String
toString()
-
-
-
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.Callback
to 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:
toString
in classjava.lang.Object
-
-