public class MapEventPublisherImpl extends Object implements MapEventPublisher
| Modifier and Type | Field and Description |
|---|---|
protected EventService |
eventService |
protected FilteringStrategy |
filteringStrategy |
static HazelcastProperty |
LISTENER_WITH_PREDICATE_PRODUCES_NATURAL_EVENT_TYPES
When
true, enables processing of entry events for listeners with predicates to fit with "query cache" concept:
for example when the original event indicates an update from an old value that does not match the predicate to a new value
that does match, then the entry listener will be notified with an ADDED event. |
protected MapServiceContext |
mapServiceContext |
protected NodeEngine |
nodeEngine |
protected QueryCacheEventPublisher |
queryCacheEventPublisher |
protected SerializationService |
serializationService |
| Constructor and Description |
|---|
MapEventPublisherImpl(MapServiceContext mapServiceContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventToQueryCache(Object eventData)
Notifies
QueryCache subscribers directly, without publishing an event to
other map listeners. |
protected Collection<EventRegistration> |
getRegistrations(String mapName) |
boolean |
hasEventListener(String mapName) |
void |
hintMapEvent(Address caller,
String mapName,
EntryEventType eventType,
int numberOfEntriesAffected,
int partitionId)
Only gives a hint which indicates that a map-wide operation has just been executed on this partition.
|
protected void |
postPublishEvent(Collection<EntryEventData> eventDataIncludingValues,
Collection<EntryEventData> eventDataExcludingValues)
Hook for actions to perform after any of
publishEvent methods is executed. |
void |
publishEvent(Address caller,
String mapName,
EntryEventType eventType,
Data dataKey,
Object dataOldValue,
Object dataValue) |
void |
publishEvent(Address caller,
String mapName,
EntryEventType eventType,
Data dataKey,
Object oldValue,
Object value,
Object mergingValue) |
protected void |
publishEventInternal(Collection<EventRegistration> registrations,
Object eventData,
int orderKey) |
void |
publishMapEvent(Address caller,
String mapName,
EntryEventType eventType,
int numberOfEntriesAffected) |
void |
publishMapPartitionLostEvent(Address caller,
String mapName,
int partitionId) |
protected void |
publishWanReplicationEventInternal(String mapName,
ReplicationEventObject event) |
void |
publishWanReplicationRemove(String mapName,
Data key,
long removeTime) |
void |
publishWanReplicationRemoveBackup(String mapName,
Data key,
long removeTime) |
void |
publishWanReplicationUpdate(String mapName,
EntryView entryView) |
void |
publishWanReplicationUpdateBackup(String mapName,
EntryView entryView) |
public static final HazelcastProperty LISTENER_WITH_PREDICATE_PRODUCES_NATURAL_EVENT_TYPES
true, enables processing of entry events for listeners with predicates to fit with "query cache" concept:
for example when the original event indicates an update from an old value that does not match the predicate to a new value
that does match, then the entry listener will be notified with an ADDED event.
This affects only map listeners with predicates and the way entry updates are handled. Put/remove operations are not
affected, neither are listeners without predicates.
Default value is false, to maintain compatible behavior with previous Hazelcast versions.protected final MapServiceContext mapServiceContext
protected final NodeEngine nodeEngine
protected final SerializationService serializationService
protected final EventService eventService
protected final FilteringStrategy filteringStrategy
protected final QueryCacheEventPublisher queryCacheEventPublisher
public MapEventPublisherImpl(MapServiceContext mapServiceContext)
public void publishWanReplicationUpdate(String mapName, EntryView entryView)
publishWanReplicationUpdate in interface MapEventPublisherpublic void publishWanReplicationRemove(String mapName, Data key, long removeTime)
publishWanReplicationRemove in interface MapEventPublisherpublic void publishWanReplicationUpdateBackup(String mapName, EntryView entryView)
publishWanReplicationUpdateBackup in interface MapEventPublisherpublic void publishWanReplicationRemoveBackup(String mapName, Data key, long removeTime)
publishWanReplicationRemoveBackup in interface MapEventPublisherpublic void publishMapEvent(Address caller, String mapName, EntryEventType eventType, int numberOfEntriesAffected)
publishMapEvent in interface MapEventPublisherpublic void publishEvent(Address caller, String mapName, EntryEventType eventType, Data dataKey, Object dataOldValue, Object dataValue)
publishEvent in interface MapEventPublisherpublic void publishEvent(Address caller, String mapName, EntryEventType eventType, Data dataKey, Object oldValue, Object value, Object mergingValue)
publishEvent in interface MapEventPublisherprotected void postPublishEvent(Collection<EntryEventData> eventDataIncludingValues, Collection<EntryEventData> eventDataExcludingValues)
publishEvent methods is executed.
This method will be invoked once per unique EntryEventData generated by publishEvent,
regardless of the number of registrations on which the event is published.eventDataIncludingValues - eventDataExcludingValues - public void publishMapPartitionLostEvent(Address caller, String mapName, int partitionId)
publishMapPartitionLostEvent in interface MapEventPublisherpublic void hintMapEvent(Address caller, String mapName, EntryEventType eventType, int numberOfEntriesAffected, int partitionId)
MapEventPublisherhintMapEvent in interface MapEventPublisherpublic void addEventToQueryCache(Object eventData)
MapEventPublisherQueryCache subscribers directly, without publishing an event to
other map listeners. This is necessary in certain cases, such as when loading entries into a map.addEventToQueryCache in interface MapEventPublishereventData - the event to publish to query cachespublic boolean hasEventListener(String mapName)
hasEventListener in interface MapEventPublisherprotected Collection<EventRegistration> getRegistrations(String mapName)
protected void publishEventInternal(Collection<EventRegistration> registrations, Object eventData, int orderKey)
protected void publishWanReplicationEventInternal(String mapName, ReplicationEventObject event)
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.