Package io.confluent.parallelconsumer
Interface DrainingCloseable
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Subinterfaces:
JStreamParallelStreamProcessor<K,V>,ParallelConsumer<K,V>,ParallelStreamProcessor<K,V>
- All Known Implementing Classes:
JStreamParallelEoSStreamProcessor,ParallelEoSStreamProcessor
public interface DrainingCloseable
extends java.io.Closeable
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDrainingCloseable.DrainingMode -
Field Summary
Fields Modifier and Type Field Description static java.time.DurationDEFAULT_TIMEOUT -
Method Summary
Modifier and Type Method Description default voidclose()Close the consumer.voidclose(java.time.Duration timeout, DrainingCloseable.DrainingMode drainingMode)Close the consumer.default voidcloseDontDrainFirst()default voidcloseDontDrainFirst(java.time.Duration timeout)default voidcloseDrainFirst()default voidcloseDrainFirst(java.time.Duration timeout)intworkRemaining()Of the records consumed from the broker, how many do we have remaining in our local queues
-
Field Details
-
DEFAULT_TIMEOUT
static final java.time.Duration DEFAULT_TIMEOUT
-
-
Method Details
-
close
default void close()Close the consumer. Uses a reasonable default timeout, and drains by default.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- See Also:
DEFAULT_TIMEOUT,close(Duration, DrainingMode)
-
closeDrainFirst
default void closeDrainFirst()- See Also:
DrainingCloseable.DrainingMode.DRAIN
-
closeDontDrainFirst
default void closeDontDrainFirst() -
closeDrainFirst
default void closeDrainFirst(java.time.Duration timeout)- See Also:
DrainingCloseable.DrainingMode.DRAIN
-
closeDontDrainFirst
default void closeDontDrainFirst(java.time.Duration timeout) -
close
Close the consumer.- Parameters:
timeout- how long to wait before giving updrainingMode- wait for messages already consumed from the broker to be processed before closing
-
workRemaining
int workRemaining()Of the records consumed from the broker, how many do we have remaining in our local queues- Returns:
- the number of consumed but outstanding records to process
-