Interface ObserveHandle
-
- All Superinterfaces:
java.lang.AutoCloseable
@Stable public interface ObserveHandle extends java.lang.AutoCloseable
A interface for handling progress and control consumption of running observe process.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Stop the consumption.java.util.List<Offset>getCommittedOffsets()Retrieve currently committed offsets.java.util.List<Offset>getCurrentOffsets()voidresetOffsets(java.util.List<Offset> offsets)Reset the consumption to given offsets.voidwaitUntilReady()Wait until the consumer is ready to read data.
-
-
-
Method Detail
-
close
void close()
Stop the consumption.- Specified by:
closein interfacejava.lang.AutoCloseable
-
getCommittedOffsets
java.util.List<Offset> getCommittedOffsets()
Retrieve currently committed offsets.- Returns:
- list of offsets that have been committed for each partition assigned to the observation
-
resetOffsets
void resetOffsets(java.util.List<Offset> offsets)
Reset the consumption to given offsets.- Parameters:
offsets- the offsets to reset the processing to
-
getCurrentOffsets
java.util.List<Offset> getCurrentOffsets()
- Returns:
- list of last processed element from each assigned partition.
-
waitUntilReady
void waitUntilReady() throws java.lang.InterruptedExceptionWait until the consumer is ready to read data.- Throws:
java.lang.InterruptedException- when interrupted before the wait is done
-
-