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 KeyBasedCacheOperation
subclasses for actual examples.
CachePartitionSegment
,
CacheService
,
KeyBasedCacheOperation
Modifier and Type | Field and Description |
---|---|
protected SerializationService |
serializationService |
batchEvent, cacheConfig, cacheContext, cacheLoader, cacheRecordFactory, cacheService, cacheWriter, clearExpiredRecordsTask, DEFAULT_INITIAL_CAPACITY, defaultExpiryPolicy, disablePerEntryInvalidationEvents, eventJournalConfig, eventsBatchingEnabled, eventsEnabled, evictionChecker, evictionConfig, evictionPolicyEvaluator, evictionStrategy, expirationIterator, expiredKeys, hasEntryWithExpiration, name, nodeEngine, objectNamespace, partitionCount, partitionId, persistWanReplicatedData, primary, records, SOURCE_NOT_AVAILABLE, ss, statistics, valueComparator, 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 CacheRecord |
createRecord(Object value,
long creationTime,
long expiryTime) |
protected CacheRecordHashMap |
createRecordCacheMap() |
protected Object |
dataToValue(Data data) |
void |
disposeDeferredBlocks() |
protected Data |
recordToData(CacheRecord record) |
protected Object |
recordToValue(CacheRecord record) |
protected Data |
toHeapData(Object obj) |
protected Data |
valueToData(Object value) |
accessRecord, accumulateOrSendExpiredKeysToBackup, clear, close, closeListeners, compare, contains, createEvictionPolicyEvaluator, createEvictionStrategy, createRecord, createRecord, createRecord, createRecord, createRecordWithExpiry, createRecordWithExpiry, createRecordWithExpiry, createRecordWithExpiry, deleteAllCacheEntry, deleteCacheEntry, deleteCacheEntry, deleteRecord, deleteRecord, deleteRecord, destroy, destroyEventJournal, destroyInternals, doPutRecord, doRemoveRecord, evictExpiredEntries, evictIfExpired, evictIfRequired, extractExpiryPolicyOfRecord, fetchEntries, fetchKeys, forceRemoveRecord, get, getAll, getAndPut, getAndRemove, getAndRemove, getAndReplace, getCacheStats, getConfig, getExpiredKeysQueue, getExpiryPolicy, getExpiryPolicy, getName, getObjectNamespace, getPartitionId, getReadOnlyRecords, getRecord, getValueComparatorOf, init, initExpirationIterator, instrument, invalidateEntry, invalidateEntry, invoke, isEventsEnabled, isEvictionEnabled, isExpirable, isInvalidationEnabled, isReadThrough, isStatisticsEnabled, isWanReplicationEnabled, isWriteThrough, loadAll, loadAllCacheEntry, markExpirable, merge, merge, onCreateRecordError, onDeleteRecord, onDestroy, onEvict, onGet, onGetError, onProcessExpiredEntry, onPut, onPutError, onPutIfAbsent, onPutIfAbsentError, onRecordAccess, onRemove, onRemoveError, onReplace, onReplaceError, onUpdateExpiryPolicy, onUpdateExpiryPolicyError, onUpdateRecord, onUpdateRecordError, processExpiredEntry, processExpiredEntry, processExpiredEntry, processExpiredEntry, processExpiredEntry, publishBatchedEvents, publishEvent, put, put, put, putIfAbsent, putIfAbsent, putRecord, readThroughCache, readThroughRecord, remove, remove, remove, removeAll, removeRecord, replace, replace, reset, sampleAndForceRemoveEntries, setExpiryPolicy, size, toData, toEventData, toStorageValue, toValue, updateAccessDuration, updateExpiryPolicyOfRecord, updateGetAndPutStat, updateRecord, updateRecord, updateRecordValue, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateRecordWithExpiry, updateReplaceStat, writeThroughCache
protected SerializationService serializationService
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 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>
public void disposeDeferredBlocks()
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.