Package org.openmetadata.service.events
Class AbstractEventPublisher
- java.lang.Object
-
- org.openmetadata.service.events.AbstractEventPublisher
-
- All Implemented Interfaces:
com.lmax.disruptor.EventHandler<EventPubSub.ChangeEventHolder>,com.lmax.disruptor.LifecycleAware,EventPublisher
- Direct Known Subclasses:
EventMonitorPublisher,SearchEventPublisher
public abstract class AbstractEventPublisher extends Object implements EventPublisher
-
-
Field Summary
Fields Modifier and Type Field Description protected static intBACKOFF_1_HOURprotected static intBACKOFF_24_HOURprotected static intBACKOFF_3_SECONDSprotected static intBACKOFF_30_SECONDSprotected static intBACKOFF_5_MINUTESprotected static intBACKOFF_NORMALprotected List<ChangeEvent>batchprotected intcurrentBackoffTime
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEventPublisher(int batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEvent(EventPubSub.ChangeEventHolder changeEventHolder, long sequence, boolean endOfBatch)protected voidsetNextBackOff()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openmetadata.service.events.EventPublisher
publish
-
-
-
-
Field Detail
-
BACKOFF_NORMAL
protected static final int BACKOFF_NORMAL
- See Also:
- Constant Field Values
-
BACKOFF_3_SECONDS
protected static final int BACKOFF_3_SECONDS
- See Also:
- Constant Field Values
-
BACKOFF_30_SECONDS
protected static final int BACKOFF_30_SECONDS
- See Also:
- Constant Field Values
-
BACKOFF_5_MINUTES
protected static final int BACKOFF_5_MINUTES
- See Also:
- Constant Field Values
-
BACKOFF_1_HOUR
protected static final int BACKOFF_1_HOUR
- See Also:
- Constant Field Values
-
BACKOFF_24_HOUR
protected static final int BACKOFF_24_HOUR
- See Also:
- Constant Field Values
-
currentBackoffTime
protected int currentBackoffTime
-
batch
protected final List<ChangeEvent> batch
-
-
Method Detail
-
onEvent
public void onEvent(EventPubSub.ChangeEventHolder changeEventHolder, long sequence, boolean endOfBatch) throws Exception
- Specified by:
onEventin interfacecom.lmax.disruptor.EventHandler<EventPubSub.ChangeEventHolder>- Throws:
Exception
-
setNextBackOff
protected void setNextBackOff()
-
-