public class CacheRecordStore extends AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
ICacheRecordStore
Hazelcast splits data homogeneously to partitions using keys. CacheRecordStore represents a named ICache on-heap
data store for a single partition.
This data structure is responsible for CRUD operations, entry processing, statistics, publishing events, cache
loader and writer and internal data operations like backup.
CacheRecordStore is accessed through CachePartitionSegment and CacheService.
CacheRecordStore is managed by CachePartitionSegment.Sample code accessing a CacheRecordStore and getting a value. Typical operation implementation:
CacheService service = getService();
ICacheRecordStore cache = service.getOrCreateCache(name, partitionId);
cache.get(key, expiryPolicy);
See AbstractCacheOperation
subclasses for actual examples.
CachePartitionSegment
,
CacheService
,
AbstractCacheOperation
Modifier and Type | Field and Description |
---|---|
protected CacheRecordFactory |
cacheRecordFactory |
protected SerializationService |
serializationService |
batchEvent, cacheConfig, cacheContext, cacheLoader, cacheService, cacheWriter, DEFAULT_INITIAL_CAPACITY, defaultExpiryPolicy, disablePerEntryInvalidationEvents, eventJournalConfig, eventsBatchingEnabled, eventsEnabled, evictionChecker, evictionConfig, evictionPolicyEvaluator, evictionStrategy, name, nodeEngine, objectNamespace, partitionCount, partitionId, primary, records, SOURCE_NOT_AVAILABLE, statistics, wanReplicationEnabled
NO_LISTENER
Constructor and Description |
---|
CacheRecordStore(String cacheNameWithPrefix,
int partitionId,
NodeEngine nodeEngine,
AbstractCacheService cacheService) |
Modifier and Type | Method and Description |
---|---|
protected CacheEntryProcessorEntry |
createCacheEntryProcessorEntry(Data key,
CacheRecord record,
long now,
int completionId) |
protected EvictionChecker |
createCacheEvictionChecker(int size,
EvictionConfig.MaxSizePolicy maxSizePolicy)
Creates an instance for checking if the maximum cache size has been reached.
|
protected CacheRecordFactory |
createCacheRecordFactory() |
protected CacheRecord |
createRecord(Object value,
long creationTime,
long expiryTime) |
protected CacheRecordHashMap |
createRecordCacheMap() |
protected Object |
dataToValue(Data data) |
protected Data |
recordToData(CacheRecord record) |
protected Object |
recordToValue(CacheRecord record) |
protected Data |
toHeapData(Object obj) |
protected Data |
valueToData(Object value) |
accessRecord, clear, close, closeListeners, compare, contains, createEvictionPolicyEvaluator, createEvictionStrategy, createRecord, createRecord, createRecord, createRecord, createRecordWithExpiry, createRecordWithExpiry, createRecordWithExpiry, createRecordWithExpiry, deleteAllCacheEntry, deleteCacheEntry, deleteRecord, deleteRecord, deleteRecord, destroy, destroyEventJournal, destroyInternals, doPutRecord, doRemoveRecord, evictIfRequired, fetchEntries, fetchKeys, get, getAll, getAndPut, getAndRemove, getAndRemove, getAndReplace, getCacheStats, getConfig, getExpiryPolicy, getName, getObjectNamespace, getPartitionId, getReadOnlyRecords, getRecord, init, instrument, invalidateAllEntries, invalidateAllEntries, invalidateEntry, invalidateEntry, invoke, isEventsEnabled, isEvictionEnabled, isInvalidationEnabled, isReadThrough, isStatisticsEnabled, isWanReplicationEnabled, isWriteThrough, loadAll, loadAllCacheEntry, merge, merge, onCreateRecordError, onDeleteRecord, onDeleteRecordError, onDestroy, onEvict, onGet, onGetError, onProcessExpiredEntry, onPut, onPutError, onPutIfAbsent, onPutIfAbsentError, onRecordAccess, onRemove, onRemoveError, onReplace, onReplaceError, onUpdateRecord, onUpdateRecordError, processExpiredEntry, processExpiredEntry, processExpiredEntry, processExpiredEntry, processExpiredEntry, publishBatchedEvents, publishEvent, put, put, put, putIfAbsent, putIfAbsent, putRecord, readThroughCache, readThroughRecord, remove, remove, removeAll, removeRecord, replace, replace, reset, size, toData, toEventData, toStorageValue, toValue, updateAccessDuration, updateGetAndPutStat, updateRecord, updateRecordValue, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateReplaceStat, writeThroughCache
protected SerializationService serializationService
protected CacheRecordFactory cacheRecordFactory
public CacheRecordStore(String cacheNameWithPrefix, int partitionId, NodeEngine nodeEngine, AbstractCacheService cacheService)
protected EvictionChecker createCacheEvictionChecker(int size, EvictionConfig.MaxSizePolicy maxSizePolicy)
EvictionConfig.MaxSizePolicy.ENTRY_COUNT
policy. Throws an IllegalArgumentException
if other maxSizePolicy
is
used.createCacheEvictionChecker
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
size
- the maximum number of entriesmaxSizePolicy
- the way in which the size is interpreted, only the EvictionConfig.MaxSizePolicy.ENTRY_COUNT
maxSizePolicy
is supported.IllegalArgumentException
- if the policy is not EvictionConfig.MaxSizePolicy.ENTRY_COUNT
or if the maxSizePolicy
is nullprotected CacheRecordHashMap createRecordCacheMap()
createRecordCacheMap
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected CacheEntryProcessorEntry createCacheEntryProcessorEntry(Data key, CacheRecord record, long now, int completionId)
createCacheEntryProcessorEntry
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected CacheRecordFactory createCacheRecordFactory()
protected CacheRecord createRecord(Object value, long creationTime, long expiryTime)
createRecord
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected Data valueToData(Object value)
valueToData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected Object dataToValue(Data data)
dataToValue
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected Object recordToValue(CacheRecord record)
recordToValue
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected Data recordToData(CacheRecord record)
recordToData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
protected Data toHeapData(Object obj)
toHeapData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap>
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.