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(ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.CREATED to the event journal. |
void |
writeEvictEvent(ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.EVICTED to the event journal. |
void |
writeExpiredEvent(ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.EXPIRED to the event journal. |
void |
writeRemoveEvent(ObjectNamespace namespace,
int partitionId,
Data key,
Object value)
Writes an
CacheEventType.REMOVED to the event journal. |
void |
writeUpdateEvent(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, newestSequence, oldestSequence, readMany, toRingbufferConfig
void writeUpdateEvent(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.namespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyoldValue
- the old valuenewValue
- the new valuevoid writeCreatedEvent(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.namespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeRemoveEvent(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.namespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeEvictEvent(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.namespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valuevoid writeExpiredEvent(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.namespace
- the cache namespace, containing the full prefixed cache namepartitionId
- the entry key partitionkey
- the entry keyvalue
- the entry valueCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.