public interface MapEventJournal extends EventJournal<InternalEventJournalMapEvent>
If a map is destroyed or the migrated, the related event journal will be destroyed or migrated as well. In this sense, the event journal is co-located with the map partition and it's replicas.
NOTE : Map evictions are based on random samples which are then compared according to an eviction policy. This is done separately on the partition owner and the backup replica and can cause different entries to be evicted on the primary and backup replica. Because of this, the record store can contain different entries and the event journal can contain eviction/remove events for different entries on different replicas. This may cause some issues if the partition owner crashes and the backup replica is promoted to the partition owner. Readers of the event journal will then continue reading from the promoted replica and may get update and remove events for entries which have already been removed.
Modifier and Type | Method and Description |
---|---|
boolean |
hasEventJournal(ObjectNamespace namespace)
Returns
true if the object has a configured and enabled event journal. |
void |
writeAddEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
EntryEventType.ADDED to the event journal. |
void |
writeEvictEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
EntryEventType.EVICTED to the event journal. |
void |
writeRemoveEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
EntryEventType.REMOVED to the event journal. |
void |
writeUpdateEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object oldValue,
Object newValue)
Writes an
EntryEventType.UPDATED to the event journal. |
cleanup, destroy, getEventJournalConfig, getWaitNotifyKey, isAvailableOrNextSequence, isNextAvailableSequence, newestSequence, oldestSequence, readMany, toRingbufferConfig
void writeUpdateEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object oldValue, Object newValue)
EntryEventType.UPDATED
to the event journal.
If there is no event journal configured for this map, the method will do nothing.
If an event is added to the event journal, all parked operations waiting for
new events on that journal will be unparked.journalConfig
- the event journal config for the map in which the event occurrednamespace
- the map namespacepartitionId
- the entry key partitionkey
- the entry keyoldValue
- the old valuenewValue
- the new valuevoid writeAddEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
EntryEventType.ADDED
to the event journal.
If there is no event journal configured for this map, the method will do nothing.
If an event is added to the event journal, all parked operations waiting for
new events on that journal will be unparked.journalConfig
- the event journal config for the map in which the event occurrednamespace
- the map namespacepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeRemoveEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
EntryEventType.REMOVED
to the event journal.
If there is no event journal configured for this map, the method will do nothing.
If an event is added to the event journal, all parked operations waiting for
new events on that journal will be unparked.journalConfig
- the event journal config for the map in which the event occurrednamespace
- the map namespacepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeEvictEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
EntryEventType.EVICTED
to the event journal.
If there is no event journal configured for this map, the method will do nothing.
If an event is added to the event journal, all parked operations waiting for
new events on that journal will be unparked.journalConfig
- the event journal config for the map in which the event occurrednamespace
- the map namespacepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valueboolean hasEventJournal(ObjectNamespace namespace)
true
if the object has a configured and enabled event journal.hasEventJournal
in interface EventJournal<InternalEventJournalMapEvent>
namespace
- the object namespacetrue
if the object has a configured and enabled event journal, false
otherwiseCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.