Package com.couchbase.client.dcp.buffer
Class StreamEventBuffer
java.lang.Object
com.couchbase.client.dcp.buffer.StreamEventBuffer
- All Implemented Interfaces:
ControlEventHandler,DataEventHandler
When rollback mitigation / persistence polling is enabled, the stream event buffer
intercepts stream events and stores them until being notified that persistence is observed.
Then it forwards the events to the handlers set by the user.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(int vbucket) Discard all buffered events in the given vbucket.voidonEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event) Called when a data event happens.voidonStreamEnd(StreamEndEvent event) voidsetControlEventHandler(ControlEventHandler controlEventHandler) voidsetDataEventHandler(DataEventHandler dataEventHandler)
-
Constructor Details
-
StreamEventBuffer
-
-
Method Details
-
setDataEventHandler
-
setControlEventHandler
-
onEvent
public void onEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event) Description copied from interface:DataEventHandlerCalled when a data event happens.Make sure to release the buffers!!
- Specified by:
onEventin interfaceControlEventHandler- Specified by:
onEventin interfaceDataEventHandler- Parameters:
flowController- the flow controller for the passed event.event- the data event happening right now.
-
onStreamEnd
-
clear
public void clear(int vbucket) Discard all buffered events in the given vbucket.
-