public class CacheRecordStore extends AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
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, cacheLoader, cacheService, cacheWriter, DEFAULT_INITIAL_CAPACITY, defaultExpiryPolicy, evictionEnabled, evictionPercentage, evictionPolicy, evictionThresholdPercentage, hasExpiringEntry, isEventBatchingEnabled, isEventsEnabled, name, nodeEngine, partitionId, records, statistics
MIN_FORCED_EVICT_PERCENTAGE, ONE_HUNDRED_PERCENT
Constructor and Description |
---|
CacheRecordStore(String name,
int partitionId,
NodeEngine nodeEngine,
AbstractCacheService cacheService) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeResources() |
protected CacheEntryProcessorEntry |
createCacheEntryProcessorEntry(Data key,
CacheRecord record,
long now) |
protected CacheRecordFactory |
createCacheRecordFactory() |
protected <T> CacheRecord |
createRecord(T value,
long creationTime,
long expiryTime) |
protected CacheRecordHashMap |
createRecordCacheMap() |
protected CacheRecord |
dataToRecord(Data data) |
protected <T> T |
dataToValue(Data data) |
void |
destroy()
Destroy is equivalent to below operations in the given order:
clear all.
close resources.
unregister all listeners.
|
protected boolean |
isEvictionRequired() |
protected Data |
recordToData(CacheRecord record) |
protected <T> T |
recordToValue(CacheRecord record) |
protected Data |
toHeapData(Object obj) |
protected <T> Data |
valueToData(T value) |
protected <T> CacheRecord |
valueToRecord(T value) |
accessRecord, clear, compare, contains, createRecord, createRecord, createRecord, createRecordWithExpiry, deleteAllCacheEntry, deleteCacheEntry, deleteRecord, evictExpiredRecords, evictIfRequired, expiryPolicyToTTL, forceEvict, get, getAll, getAndPut, getAndPut, getAndPut, getAndRemove, getAndReplace, getCacheStats, getConfig, getExpiryPolicy, getName, getReadOnlyRecords, getRecord, invoke, isReadThrough, isStatisticsEnabled, isWriteThrough, iterator, loadAll, loadAllCacheEntry, onAfterGetAndPut, onAfterGetAndReplace, onAfterPutIfAbsent, onAfterUpdateRecord, onBeforeGetAndPut, onBeforeGetAndReplace, onBeforePutIfAbsent, onBeforeUpdateRecord, onDeleteRecord, onDeleteRecordError, onGet, onGetAndPutError, onPutIfAbsentError, onRemove, onUpdateRecordError, processExpiredEntry, processExpiredEntry, publishBatchedEvents, publishCompletedEvent, publishEvent, put, putIfAbsent, putIfAbsent, readThroughCache, readThroughRecord, remove, remove, removeAll, removeRecord, replace, replace, setRecord, size, toData, toEventData, toRecord, toValue, ttlToExpirePolicy, updateAccessDuration, updateGetAndPutStat, updateHasExpiringEntry, updateRecord, updateRecordWithExpiry, updateReplaceStat, writeThroughCache
protected SerializationService serializationService
protected CacheRecordFactory cacheRecordFactory
public CacheRecordStore(String name, int partitionId, NodeEngine nodeEngine, AbstractCacheService cacheService)
protected CacheRecordHashMap createRecordCacheMap()
createRecordCacheMap
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected CacheEntryProcessorEntry createCacheEntryProcessorEntry(Data key, CacheRecord record, long now)
createCacheEntryProcessorEntry
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected CacheRecordFactory createCacheRecordFactory()
protected <T> CacheRecord createRecord(T value, long creationTime, long expiryTime)
createRecord
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected <T> Data valueToData(T value)
valueToData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected <T> T dataToValue(Data data)
dataToValue
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected <T> CacheRecord valueToRecord(T value)
valueToRecord
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected <T> T recordToValue(CacheRecord record)
recordToValue
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected Data recordToData(CacheRecord record)
recordToData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected CacheRecord dataToRecord(Data data)
dataToRecord
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected Data toHeapData(Object obj)
toHeapData
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
protected boolean isEvictionRequired()
isEvictionRequired
in class AbstractCacheRecordStore<CacheRecord,CacheRecordHashMap<Data,CacheRecord>>
public void destroy()
ICacheRecordStore
protected void closeResources()
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.