Interface DrainingCloseable
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
JStreamParallelStreamProcessor<K,V>,ParallelConsumer<K,V>,ParallelStreamProcessor<K,V>
- All Known Implementing Classes:
AbstractParallelEoSStreamProcessor,ExternalEngine,JStreamParallelEoSStreamProcessor,ParallelEoSStreamProcessor
public interface DrainingCloseable extends Closeable
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDrainingCloseable.DrainingMode -
Field Summary
Fields Modifier and Type Field Description static DurationDEFAULT_TIMEOUT -
Method Summary
Modifier and Type Method Description default voidclose()Close the consumer, without draining.voidclose(Duration timeout, DrainingCloseable.DrainingMode drainingMode)Close the consumer.default voidcloseDontDrainFirst()default voidcloseDontDrainFirst(Duration timeout)default voidcloseDrainFirst()default voidcloseDrainFirst(Duration timeout)longworkRemaining()Of the records consumed from the broker, how many do we have remaining in our local queues
-
Field Details
-
Method Details
-
close
default void close()Close the consumer, without draining. Uses a reasonable default timeout.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- See Also:
DEFAULT_TIMEOUT,close(Duration, DrainingMode)
-
closeDrainFirst
default void closeDrainFirst()- See Also:
DrainingCloseable.DrainingMode.DRAIN
-
closeDontDrainFirst
default void closeDontDrainFirst() -
closeDrainFirst
- See Also:
DrainingCloseable.DrainingMode.DRAIN
-
closeDontDrainFirst
-
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
long 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
-