public abstract class AbstractEvictableRecordStore extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractEvictableRecordStore.ReadOnlyRecordIterator
Read only iterator.
|
DEFAULT_MAX_IDLE, DEFAULT_TTL| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEvictableRecordStore(MapContainer mapContainer,
int partitionId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
accessRecord(Record record,
long now) |
protected LockStore |
createLockStore() |
Record |
createRecord(Object value,
long ttlMillis,
long maxIdle,
long now) |
protected com.hazelcast.map.impl.recordstore.RecordStoreLoader |
createRecordStoreLoader(MapStoreContext mapStoreContext) |
Storage |
createStorage(RecordFactory recordFactory,
InMemoryFormat memoryFormat) |
void |
disposeDeferredBlocks()
This can be used to release unused resources.
|
void |
doPostEvictionOperations(Record record,
boolean backup)
Does post eviction operations like sending events
|
void |
evictEntries(Data excludedKey)
Evicts entries from this record-store.
|
void |
evictExpiredEntries(int percentage,
boolean backup)
Do expiration operations.
|
InvalidationQueue<ExpiredKey> |
getExpiredKeys() |
LocalRecordStoreStats |
getLocalRecordStoreStats() |
int |
getLockedEntryCount() |
MapContainer |
getMapContainer() |
String |
getName() |
protected long |
getNow() |
protected Record |
getOrNullIfExpired(Record record,
long now,
boolean backup)
Check if record is reachable according to TTL or idle times.
|
long |
getOwnedEntryCost() |
int |
getPartitionId()
Returns the partition id this RecordStore belongs to.
|
Storage<Data,? extends Record> |
getStorage() |
protected boolean |
hasReplicaAddress(int partitionId,
int replicaIndex) |
void |
init()
Initialize the recordStore after creation
|
boolean |
isExpirable() |
boolean |
isExpired(Record record,
long now,
boolean backup)
Checks whether a record is expired or not.
|
protected boolean |
isInfiniteTTL(long ttl) |
protected boolean |
isMaxIdleDefined(long maxIdle) |
protected void |
markRecordStoreExpirable(long ttl,
long maxIdle) |
protected void |
mergeRecordExpiration(Record record,
EntryView mergingEntry) |
protected void |
mergeRecordExpiration(Record record,
SplitBrainMergeTypes.MapMergeTypes mergingEntry) |
protected boolean |
persistenceEnabledFor(CallerProvenance provenance) |
protected void |
removeIndex(Collection<Record> records) |
protected void |
removeIndex(Record record) |
protected void |
saveIndex(Record record,
Object oldValue) |
void |
sendExpiredKeysToBackups(boolean checkIfReachedBatch) |
void |
setSizeEstimator(EntryCostEstimator entryCostEstimator) |
boolean |
shouldEvict()
Returns
true if eviction is allowed on this record-store, otherwise false |
protected Data |
toData(Object value) |
protected void |
updateRecord(Data key,
Record record,
Object value,
long now,
boolean countAsAccess) |
protected void |
updateStatsOnGet(long now) |
protected void |
updateStatsOnPut(boolean countAsAccess,
long now) |
protected void |
updateStatsOnPut(long hits) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanAcquireLock, checkIfLoaded, clear, clearPartition, containsKey, containsValue, delete, destroy, evict, evictAll, existInMemory, extendLock, fetchEntries, fetchKeys, forceUnlock, get, getAll, getLockOwnerInfo, getMapDataStore, getRecord, getRecordOrNull, hasQueryCache, isEmpty, isKeyLoadFinished, isLoaded, isLocked, isLockedBy, isTransactionallyLocked, iterator, iterator, loadAll, loadAllFromStore, loadAwareIterator, loadRecordOrNull, localLock, lock, maybeDoInitialLoad, merge, merge, merge, merge, put, putBackup, putBackup, putFromLoad, putFromLoadBackup, putIfAbsent, putRecord, putTransient, readBackupData, remove, remove, removeBackup, replace, replace, reset, set, setPreMigrationLoadedStatus, setTtl, setWithUncountedAccess, size, softFlush, startLoading, txnLock, unlock, updateLoadStatusprotected final long expiryDelayMillis
protected final EventService eventService
protected final MapEventPublisher mapEventPublisher
protected final Address thisAddress
protected final ExpirationManager expirationManager
protected final InvalidationQueue<ExpiredKey> expiredKeys
protected Iterator<Record> expirationIterator
protected volatile boolean hasEntryWithCustomExpiration
protected final int partitionId
protected final String name
protected final LockStore lockStore
protected final MapContainer mapContainer
protected final RecordFactory recordFactory
protected final InMemoryFormat inMemoryFormat
protected final MapStoreContext mapStoreContext
protected final RecordComparator recordComparator
protected final MapServiceContext mapServiceContext
protected final SerializationService serializationService
protected final MapDataStore<Data,Object> mapDataStore
protected final LocalRecordStoreStatsImpl stats
protected final RecordStoreMutationObserver<Record> mutationObserver
protected AbstractEvictableRecordStore(MapContainer mapContainer, int partitionId)
public void evictExpiredEntries(int percentage,
boolean backup)
RecordStorepercentage - of max expirables according to the record store size.backup - true if a backup partition, otherwise false.public boolean isExpirable()
true if record store has at least one candidate entry
for expiration else return false.public void evictEntries(Data excludedKey)
RecordStoreexcludedKey - this key has lowest priority to be selected for evictionpublic boolean shouldEvict()
RecordStoretrue if eviction is allowed on this record-store, otherwise falsetrue if eviction is allowed on this record-store, otherwise falseprotected void markRecordStoreExpirable(long ttl,
long maxIdle)
protected boolean isInfiniteTTL(long ttl)
true if the supplied ttl doesn't not represent infinity and as a result entry should be
removed after some time, otherwise return false to indicate entry should live forever.protected boolean isMaxIdleDefined(long maxIdle)
protected Record getOrNullIfExpired(Record record, long now, boolean backup)
record - Recordpublic boolean isExpired(Record record, long now, boolean backup)
RecordStorerecord - the record from record-store.now - current time in millisbackup - true if a backup partition, otherwise false.true if the record is expired, false otherwise.public void doPostEvictionOperations(Record record, boolean backup)
RecordStorerecord - record to processbackup - true if a backup partition, otherwise false.public InvalidationQueue<ExpiredKey> getExpiredKeys()
public void sendExpiredKeysToBackups(boolean checkIfReachedBatch)
protected boolean hasReplicaAddress(int partitionId,
int replicaIndex)
protected void accessRecord(Record record, long now)
protected void mergeRecordExpiration(Record record, SplitBrainMergeTypes.MapMergeTypes mergingEntry)
protected boolean persistenceEnabledFor(@Nonnull CallerProvenance provenance)
public LocalRecordStoreStats getLocalRecordStoreStats()
getLocalRecordStoreStats in interface RecordStore<Record>public void init()
RecordStoreinit in interface RecordStore<Record>public Record createRecord(Object value, long ttlMillis, long maxIdle, long now)
createRecord in interface RecordStore<Record>public Storage createStorage(RecordFactory recordFactory, InMemoryFormat memoryFormat)
createStorage in interface RecordStore<Record>public String getName()
getName in interface RecordStore<Record>public MapContainer getMapContainer()
getMapContainer in interface RecordStore<Record>public long getOwnedEntryCost()
getOwnedEntryCost in interface RecordStore<Record>protected long getNow()
protected void updateRecord(Data key, Record record, Object value, long now, boolean countAsAccess)
public int getPartitionId()
RecordStoregetPartitionId in interface RecordStore<Record>protected void removeIndex(Record record)
protected void removeIndex(Collection<Record> records)
protected LockStore createLockStore()
public int getLockedEntryCount()
getLockedEntryCount in interface RecordStore<Record>protected com.hazelcast.map.impl.recordstore.RecordStoreLoader createRecordStoreLoader(MapStoreContext mapStoreContext)
public void setSizeEstimator(EntryCostEstimator entryCostEstimator)
public void disposeDeferredBlocks()
RecordStoredisposeDeferredBlocks in interface RecordStore<Record>public Storage<Data,? extends Record> getStorage()
getStorage in interface RecordStore<Record>protected void updateStatsOnPut(boolean countAsAccess,
long now)
protected void updateStatsOnPut(long hits)
protected void updateStatsOnGet(long now)
Copyright © 2018. All Rights Reserved.