public interface CacheEventJournal extends EventJournal<InternalEventJournalCacheEvent>
If a cache 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 cache partition and it's replicas.
NOTE : Cache 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 |
---|---|
void |
writeCreatedEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.CREATED to the event journal. |
void |
writeEvictEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.EVICTED to the event journal. |
void |
writeExpiredEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.EXPIRED to the event journal. |
void |
writeRemoveEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.REMOVED to the event journal. |
void |
writeUpdateEvent(EventJournalConfig journalConfig,
ObjectNamespace namespace,
int partitionId,
Data key,
Object oldValue,
Object newValue)
Writes an
CacheEventType.UPDATED to the event journal. |
cleanup, destroy, getEventJournalConfig, getWaitNotifyKey, hasEventJournal, isAvailableOrNextSequence, isNextAvailableSequence, isPersistenceEnabled, newestSequence, oldestSequence, readMany, toRingbufferConfig
void writeUpdateEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object oldValue, Object newValue)
CacheEventType.UPDATED
to the event journal.
If there is no event journal configured for this cache, 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 cache in which the event occurrednamespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyoldValue
- the old valuenewValue
- the new valuevoid writeCreatedEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
CacheEventType.CREATED
to the event journal.
If there is no event journal configured for this cache, 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 cache in which the event occurrednamespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeRemoveEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
CacheEventType.REMOVED
to the event journal.
If there is no event journal configured for this cache, 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 cache in which the event occurrednamespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeEvictEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
CacheEventType.EVICTED
to the event journal.
If there is no event journal configured for this cache, 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 cache in which the event occurrednamespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeExpiredEvent(EventJournalConfig journalConfig, ObjectNamespace namespace, int partitionId, Data key, Object value)
CacheEventType.EXPIRED
to the event journal.
If there is no event journal configured for this cache, 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 cache in which the event occurrednamespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valueCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.