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 SerializationService |
serializationService |
Constructor and Description |
---|
MapEventPublisherImpl(MapServiceContext mapServiceContext) |
Modifier and Type | Method and Description |
---|---|
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 boolean |
isIncludeValue(EventFilter filter) |
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
public MapEventPublisherImpl(MapServiceContext mapServiceContext)
public void publishWanReplicationUpdate(String mapName, EntryView entryView)
publishWanReplicationUpdate
in interface MapEventPublisher
public void publishWanReplicationRemove(String mapName, Data key, long removeTime)
publishWanReplicationRemove
in interface MapEventPublisher
public void publishWanReplicationUpdateBackup(String mapName, EntryView entryView)
publishWanReplicationUpdateBackup
in interface MapEventPublisher
public void publishWanReplicationRemoveBackup(String mapName, Data key, long removeTime)
publishWanReplicationRemoveBackup
in interface MapEventPublisher
public void publishMapEvent(Address caller, String mapName, EntryEventType eventType, int numberOfEntriesAffected)
publishMapEvent
in interface MapEventPublisher
public void publishEvent(Address caller, String mapName, EntryEventType eventType, Data dataKey, Object dataOldValue, Object dataValue)
publishEvent
in interface MapEventPublisher
public void publishEvent(Address caller, String mapName, EntryEventType eventType, Data dataKey, Object oldValue, Object value, Object mergingValue)
publishEvent
in interface MapEventPublisher
protected 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
- protected boolean isIncludeValue(EventFilter filter)
public void publishMapPartitionLostEvent(Address caller, String mapName, int partitionId)
publishMapPartitionLostEvent
in interface MapEventPublisher
public void hintMapEvent(Address caller, String mapName, EntryEventType eventType, int numberOfEntriesAffected, int partitionId)
MapEventPublisher
hintMapEvent
in interface MapEventPublisher
public boolean hasEventListener(String mapName)
hasEventListener
in interface MapEventPublisher
protected Collection<EventRegistration> getRegistrations(String mapName)
protected void publishEventInternal(Collection<EventRegistration> registrations, Object eventData, int orderKey)
protected void publishWanReplicationEventInternal(String mapName, ReplicationEventObject event)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.