Class CacheManager
- All Implemented Interfaces:
SpaceEvictionManager
The maximum number of objects cached in memory is determined by a space property (cache-size).
However, according to this implementation, the following objects are always in the cache:
- Templates of any kind
- Active Transactions
- Entries locked under Active Transactions
- Entries waiting for templates
The objects in the cache are indexed.
Templates are cached in memory and are not written to the underlying SA.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumINITIALLOAD INFO.static enumusage of recent deletes. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TerminatingFifoXtnsInfostatic final booleanstatic final intstatic final intFields inherited from class com.j_spaces.core.cache.AbstractCacheManager
_evictionQuota, m_CacheSize -
Constructor Summary
ConstructorsConstructorDescriptionCacheManager(SpaceConfigReader configReader, ClusterPolicy clusterPolicy, SpaceTypeManager typeManager, IReplicationNode replicationNode, IStorageAdapter sa, SpaceEngine engine, Properties customProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToEvictionStrategy(EvictableServerEntry entry, boolean isNew) associateEntryWithXtn(Context context, IEntryHolder entryHolder, ITemplateHolder template, XtnEntry xtnEntry, IEntryHolder new_content) tie an entry with a transaction.booleanbooleanbooleancanSkipFullScanForAggregators(ITemplateHolder template) voidvoidcommit(Context context, XtnEntry xtnEntry, boolean singleParticipant, boolean anyUpdates, boolean supportsTwoPhaseReplication) intcount(Context context, ITemplateHolder template, XtnEntry xtnFilter) voiddisconnectEntryFromXtn(Context context, IEntryHolder entryHolder, XtnEntry xtnEntry, boolean xtnEnd) disconnect an entry from xtnvoiddisconnectMVCCEntryFromXtn(Context context, MVCCEntryCacheInfo pEntry, XtnEntry xtnEntry, boolean xtnEnd) intevictBatch(int evictionQuota) evict a quota of entries from cache.voidextendLeasePeriod(Context context, long time, long original_time, String uid, String classname, int objectType, boolean shouldReplicate, boolean origin) findTemplatesByIndex(Context context, IServerTypeDesc typeDesc, IEntryHolder entry, MatchTarget matchTarget) given a class name return the SL of matching templates.booleanfreeCacheContext(Context context) static org.slf4j.LoggerintgetEntriesByUniqueIds(Context context, IServerTypeDesc currServerTypeDesc, Object[] ids, ITemplateHolder template) getEntriesMinIndex(Context context, TypeData typeData, int numOfFields, ITemplateHolder template) Computes the best way to reach a list of potential match of entries of the specified type.getEntriesMinIndexExtended(Context context, TypeData entryType, int numOfFields, ITemplateHolder template) Using extended match-getEntry(Context context, IEntryHolder entryHolder, boolean tryInsertToCache, boolean lockedEntry) getEntry(Context context, IEntryHolder entryHolder, boolean tryInsertToCache, boolean lockedEntry, boolean useOnlyCache) getEntry(Context context, String uid, String inputClassName, IEntryHolder template, boolean tryInsertToCache, boolean lockedEntry, boolean useOnlyCache) get entry by its uid, and, optionally, by its template className is passed if known, can be null template is not null if isCacheExternalDB is true: external DB, the template must contain the PK fields insertToCache- true if entry shouldbe inserted to cachegetEntryByIdFromPureCache(Object id, IServerTypeDesc typeDesc) getEntryByUniqueId(Context context, IServerTypeDesc currServerTypeDesc, Object templateValue, ITemplateHolder template) get PEntry for entry.given a PEntry, return the entry.longgetFifoXtnNumber(XtnEntry xtnEntry) get the fifo xtn number of a xtnlongget the Terminating fifo transactionget the lock managerstatic org.slf4j.LoggergetMatchingMemoryEntriesForScanning(Context context, IServerTypeDesc currServerTypeDesc, ITemplateHolder template, IServerTypeDesc serverTypeDesc) intgetMVCCEntryCacheInfoByEntryHolder(MVCCEntryHolder entryHolder) intintgetNumberOfEntries(String typeName, boolean includeSubtypes) intgetNumberOfLockedObjectsUnderTxn(XtnEntry xtnEntry) used by getTransactionsInfo to retrieve number of Locked ObjectsintintgetNumberOfNotifyTemplates(String typeName, boolean includeSubtypes) intintgetPEntryByUid(String uid) getQueryExtensionManager(String namespace) getReplicationContext(Context context) getRuntimeInfo(String typeName) getTemplate(String uid) get PEntry for entry.getTemplatesInfo(String className) returns a list of all the pending templates for the given classConcurrentHashMap<TerminatingFifoXtnsInfo.FifoXtnEntryInfo,TerminatingFifoXtnsInfo.FifoXtnEntryInfo> getTypeData(IServerTypeDesc typeDesc) voidhandleFifoGroupsCacheOnXtnEnd(Context context, XtnEntry xtnEntry) voidhandleInsertEntryReplication(Context context, IEntryHolder entryHolder) voidhandleInsertEntryReplication(Context context, IEntryHolder entryHolder, int blobstoreBulkId) voidhandleMVCCGenerations(Context context, MVCCEntryHolder entry, XtnEntry xtnEntry) voidhandleRemoveEntryReplication(Context context, IEntryHolder entryHolder, SpaceEngine.EntryRemoveReasonCodes removeReason) voidhandleRemoveEntryReplication(Context context, IEntryHolder entryHolder, SpaceEngine.EntryRemoveReasonCodes removeReason, int blobstoreBulkId) voidhandleUnderXtnUpdate(Context context, ServerTransaction xtn, IEntryHolder eh, boolean isCommitting, XtnData pXtn) xtn terminating-handle under xtn updates.voidhandleUpdateEntryReplication(Context context, IEntryHolder new_eh, IEntryData originalData, Collection<SpaceEntryMutator> mutators) voidhandleUpdateEntryReplication(Context context, IEntryHolder new_eh, IEntryData originalData, Collection<SpaceEntryMutator> mutators, int blobstoreBulkId) booleanbooleanvoidinit(Properties properties) voidinitCache(boolean loadDataFromDB, Properties properties) Init.booleaninitiatedEviction(Context context, IEntryHolder entry, boolean shouldReplicate) voidinsertEntry(Context context, IEntryHolder entryHolder, boolean shouldReplicate, boolean origin, boolean suppliedUid, boolean fromReplication) insert an entry to the space.voidinsertEntryReferences(Context context, IEntryCacheInfo pEntry, TypeData pType, boolean applySequenceNumber) Inserts the refs to cache.voidinsertTemplate(Context context, ITemplateHolder templateHolder, boolean shouldReplicate) insert a template to the cache and DB.voidinsertToRecentDeletes(IEntryHolder entry, long duration, ServerTransaction committingXtn) voidinsertToRecentUpdates(IEntryHolder entry, long duration, ServerTransaction committingXtn) voidinsertToRecentUpdatesIfNeeded(IEntryHolder entry, long duration, ServerTransaction committingXtn) internalInsertEntryToCache(Context context, IEntryHolder entryHolder, boolean newEntry, TypeData typeData, IEntryCacheInfo pEntry, boolean pin) Inserts the specified entry to cache.booleanReturns an indication if Storage Adapter acts as an external data-source.booleanreturns an indication if the underlying DB is a central DB common to several cluster membersbooleanReturns an indication if Storage Adapter acts as an external clustered data-source.booleanbooleanbooleanbooleanisEntryInPureCache(String uid) booleanbooleanisFromFifoClass(IServerTypeDesc typeDesc) booleanis this space a memory space ?booleanbooleanbooleanbooleanbooleanreturns an indication if the underlying data-source supports versioning.voidlockEntry(XtnData xtn, IEntryCacheInfo pEntry, OperationID operationID) makeChangeOpEntry(Context context, ITemplateHolder template, IEntryHolder currentEntry) makeEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly) makeEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly, boolean transientOnly) makeMVCCShellsRecoveryIter(IServerTypeDesc serverTypeDesc) makeScanableEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly) makeUnderXtnEntriesIter(Context context, XtnEntry xtnEntry, int selectType) makeUnderXtnEntriesIter(Context context, XtnEntry xtnEntry, int selectType, boolean returnPentries) makeUnderXtnTemplatesIter(Context context, XtnEntry xtnEntry) voidmakeWaitForInfo(Context context, IEntryHolder entryHolder, ITemplateHolder templateHolder) booleanbooleanbooleanvoidvoidprepare(Context context, XtnEntry xtnEntry, boolean supportsTwoPhaseReplication, boolean handleReplication, boolean handleSA) voidprePrepare(XtnEntry xtnEntry) this method is called by the engine in order to make a "snapshot" of entries needed for notify.intremoveEntry(Context context, IEntryHolder entryHolder, IEntryCacheInfo pEntry, boolean shouldReplicate, boolean origin, SpaceEngine.EntryRemoveReasonCodes removeReason, boolean disableSAcall) remove entry from cache & SAbooleanremoveEntryFromCache(IEntryHolder entryHolder) Removes the specified entry from cache.booleanremoveEntryFromCache(IEntryHolder entryHolder, boolean initiatedByEvictionStrategy, boolean locked, IEntryCacheInfo pEntry, CacheManager.RecentDeleteCodes recentDeleteUsage) Removes the specified entry from cache.voidremoveEntryReferences(IEntryCacheInfo pEntry, TypeData pType, int numOfIndexesInsertedOnError) Removes entry refs from cache.voidremove fifo xtn info for entry MUST be called when entry is lockedvoidbooleanbooleanvoidremoveLockedEntry(XtnData xtn, IEntryCacheInfo pEntry) voidremoveTemplate(Context context, ITemplateHolder template, boolean fromReplication, boolean origin, boolean dontReplicate) Marks template as DELETED and send a BUS Packet to the GC.voidremoveTemplate(Context context, ITemplateHolder template, boolean fromReplication, boolean origin, boolean dontReplicate, SpaceEngine.TemplateRemoveReasonCodes removeReason) Marks template as DELETED and send a BUS Packet to the GC.voidremoveWaitingForInfo(Context context, IEntryHolder entryHolder, ITemplateHolder templateHolder, boolean unpinIfPossible) booleanvoidrollback(Context context, XtnEntry xtnEntry, boolean alreadyPrepared, boolean anyUpdates, boolean supportsTwoPhaseReplication) safeInsertEntryToCache(Context context, IEntryHolder entryHolder, boolean newEntry, TypeData pType, boolean pin, CacheManager.InitialLoadOrigin fromInitialLoad) Inserts the specified entry to cache, perform memory manager check.voidsetFifoCreationXtnInfoForEntry(IEntryHolder eh, long xtnNumber) create fifo xtn info for entry MUST be called when entry is lockedvoidsetFifoXtnNumber(XtnEntry xtnEntry, long fifoXtnNumber) set the fifo xtn number of a xtnvoidsetLatestTransactionTerminationNum(long xtnTerminationNum) get the Terminating fifo transaction //NOTE- must be called when xtns are locked !!!!!!!!voidsetLeaseManager(LeaseManager leaseManager) voidshutDown()shut down cache manager.voidbooleantestAndSetFGCacheForEntry(Context context, IEntryHolder entry, ITemplateHolder template, boolean testOnly, IServerTypeDesc tte) voidtouchByEntry(Context context, IEntryHolder entry, boolean modifyOp, ITemplateHolder template, CacheOperationReason cacheOperationReason) booleantryEvict(EvictableServerEntry entry) get permission to evict an entry, and if granted remove the entry from cache.booleanunpinIfNeeded(Context context, IEntryHolder entry, ITemplateHolder template, IEntryCacheInfo pEntry) if relevant-unpin the entry method is called after each operation or xtn termination entry should be locked when method is calledupdateEntry(Context context, IEntryHolder entry, ITemplateHolder template, boolean shouldReplicate, boolean origin) update entry- if the entry should be updated under a xtn - insert to xtn lists.updateEntryInCache(Context context, IEntryCacheInfo pEntry, IEntryHolder entryHolder, IEntryData newEntryData, long newExpirationTime, int modifiers) update entry values in cache.voidupdateFifoXtnInfoForEntry(IEntryHolder eh, long xtnNumber, boolean writeLock, boolean entryWritingXtn) update fifo xtn info for entry MUST be called when entry is locked update write lock if writeLock is true, else update read lock entryWritingXtn = true if this is the commit of the entry writevoidupdateLock(XtnData xtn, IEntryCacheInfo pEntry, OperationID operationID, int templateOperation) booleanbooleanbooleanbooleanreturns true if recentDeletes hash in engine need to be used.booleanreturns true if recentUpdates hash in engine need to be used.voidvalidateMVCCGenerationConsistency(SpaceContext sc, int modifiers, boolean take) Methods inherited from class com.j_spaces.core.cache.AbstractCacheManager
getCachePolicy, getMaxCacheSize, isAllInCachePolicy, isBlobStoreCachePolicy, isEvictableFromSpaceCachePolicy, isPluggedEvictionPolicy, isResidentEntriesCachePolicy, isTieredStorageCachePolicy, setCachePolicy, setEvictionQuota
-
Field Details
-
_terminatingXtnsInfo
-
MIN_SIZE_TO_PERFORM_EXPLICIT_PROPERTIES_INDEX_SCAN_
public static final int MIN_SIZE_TO_PERFORM_EXPLICIT_PROPERTIES_INDEX_SCAN_- See Also:
-
GS_13953_ENABLED
public static final boolean GS_13953_ENABLED -
MIN_SIZE_TO_CONSIDER_COMPOUND_INDICES
public static final int MIN_SIZE_TO_CONSIDER_COMPOUND_INDICES- See Also:
-
-
Constructor Details
-
CacheManager
public CacheManager(SpaceConfigReader configReader, ClusterPolicy clusterPolicy, SpaceTypeManager typeManager, IReplicationNode replicationNode, IStorageAdapter sa, SpaceEngine engine, Properties customProperties) throws CreateException - Throws:
CreateException
-
-
Method Details
-
isSyncHybrid
public boolean isSyncHybrid() -
getLogger
public static org.slf4j.Logger getLogger() -
setLeaseManager
-
init
- Throws:
SAExceptionCreateException
-
isTimeBasedEvictionStrategy
public boolean isTimeBasedEvictionStrategy() -
requiresEvictionReplicationProtection
public boolean requiresEvictionReplicationProtection() -
getEvictionReplicationsMarkersRepository
-
initCache
Init. the cache.This method is called after init(), and after the engine Xtn table and Directory are completely built, but before any other SA method is called.
This implementation preloads all active transactions and entries locked under these transactions into cache.
In addition, all class info is preloaded into cache.
- Throws:
SAException
-
isCacheExternalDB
public boolean isCacheExternalDB()Returns an indication if Storage Adapter acts as an external data-source.- Returns:
trueif Storage Adapter is an external data-source;falseotherwise.
-
getEngine
-
getTypeManager
-
getLeaseManager
-
getBlobStoreStorageHandler
-
getBlobStoreMemoryMonitor
-
getBlobStoreRecoveryHelper
-
useBlobStoreBulks
public boolean useBlobStoreBulks() -
useBlobStoreReplicationBackupBulks
public boolean useBlobStoreReplicationBackupBulks() -
useBlobStorePreFetch
public boolean useBlobStorePreFetch() -
isPersistentBlobStore
public boolean isPersistentBlobStore() -
optimizedBlobStoreClear
public boolean optimizedBlobStoreClear() -
needReReadAfterEntryLock
public boolean needReReadAfterEntryLock() -
mayNeedEntriesUnpinning
public boolean mayNeedEntriesUnpinning() -
isClusteredExternalDBEnabled
public boolean isClusteredExternalDBEnabled()Returns an indication if Storage Adapter acts as an external clustered data-source.trueif either indicated by a cluster-wide property or by enabling the mirror service in the cluster.- Returns:
trueif Storage Adapter is an external clustered data-source;falseotherwise.
-
isCentralDB
public boolean isCentralDB()returns an indication if the underlying DB is a central DB common to several cluster members- Returns:
trueif the underlying DB is cental;falseotherwise.
-
isVersionedExternalDB
public boolean isVersionedExternalDB()returns an indication if the underlying data-source supports versioning.- Returns:
trueif the underlying DB supports versioning;falseotherwise.
-
isEmptyAfterInitialLoadStage
public boolean isEmptyAfterInitialLoadStage() -
isDirectPersistencyEmbeddedtHandlerUsed
public boolean isDirectPersistencyEmbeddedtHandlerUsed() -
getLockManager
get the lock manager -
touchByEntry
public void touchByEntry(Context context, IEntryHolder entry, boolean modifyOp, ITemplateHolder template, CacheOperationReason cacheOperationReason) -
getBlobStoreInternalCache
-
hasBlobStoreOffHeapCache
public boolean hasBlobStoreOffHeapCache() -
hasBlobStoreOffHeapStore
public boolean hasBlobStoreOffHeapStore() -
getConfigInfo
-
shutDown
public void shutDown()shut down cache manager. does not throw any exception- unusable. -
useRecentDeletes
public boolean useRecentDeletes()returns true if recentDeletes hash in engine need to be used. -
insertToRecentDeletes
public void insertToRecentDeletes(IEntryHolder entry, long duration, ServerTransaction committingXtn) -
removeFromRecentDeletes
-
getRecentDeletesIterator
-
getRecentDeleteInfo
-
getNumOfRecentDeletes
public int getNumOfRecentDeletes() -
useRecentUpdatesForPinning
public boolean useRecentUpdatesForPinning()returns true if recentUpdates hash in engine need to be used. -
insertToRecentUpdates
public void insertToRecentUpdates(IEntryHolder entry, long duration, ServerTransaction committingXtn) -
insertToRecentUpdatesIfNeeded
public void insertToRecentUpdatesIfNeeded(IEntryHolder entry, long duration, ServerTransaction committingXtn) -
removeFromRecentUpdatesIfNeeded
-
getRecentUpdatesIterator
-
getRecentUpdateInfo
-
getNumOfRecentUpdates
public int getNumOfRecentUpdates() -
isEntryInRecentUpdates
-
isDummyEntry
-
evictBatch
public int evictBatch(int evictionQuota) evict a quota of entries from cache.- Specified by:
evictBatchin classAbstractCacheManager- Returns:
- number of actual evicted
-
insertEntry
public void insertEntry(Context context, IEntryHolder entryHolder, boolean shouldReplicate, boolean origin, boolean suppliedUid, boolean fromReplication) throws SAException, EntryAlreadyInSpaceException insert an entry to the space. -
handleInsertEntryReplication
public void handleInsertEntryReplication(Context context, IEntryHolder entryHolder) throws SAException - Throws:
SAException
-
handleInsertEntryReplication
public void handleInsertEntryReplication(Context context, IEntryHolder entryHolder, int blobstoreBulkId) throws SAException - Throws:
SAException
-
getEvictionPolicyReplicationMembersGroupName
-
updateEntry
public IEntryHolder updateEntry(Context context, IEntryHolder entry, ITemplateHolder template, boolean shouldReplicate, boolean origin) throws SAException update entry- if the entry should be updated under a xtn - insert to xtn lists. update entry cache, call SA to perform update NOTE- if the template is under xtn associateEntryWithXtn is called by the engine- and not this routine- Throws:
SAException
-
handleUpdateEntryReplication
public void handleUpdateEntryReplication(Context context, IEntryHolder new_eh, IEntryData originalData, Collection<SpaceEntryMutator> mutators) -
handleUpdateEntryReplication
public void handleUpdateEntryReplication(Context context, IEntryHolder new_eh, IEntryData originalData, Collection<SpaceEntryMutator> mutators, int blobstoreBulkId) -
makeChangeOpEntry
public IEntryHolder makeChangeOpEntry(Context context, ITemplateHolder template, IEntryHolder currentEntry) -
insertTemplate
public void insertTemplate(Context context, ITemplateHolder templateHolder, boolean shouldReplicate) insert a template to the cache and DB. -
getEntry
public IEntryHolder getEntry(Context context, IEntryHolder entryHolder, boolean tryInsertToCache, boolean lockedEntry, boolean useOnlyCache) throws SAException - Parameters:
lockedEntry- - true if the entry is locked by the caller- Throws:
SAException
-
getEntry
public IEntryHolder getEntry(Context context, IEntryHolder entryHolder, boolean tryInsertToCache, boolean lockedEntry) throws SAException - Throws:
SAException
-
getEntry
public IEntryHolder getEntry(Context context, String uid, String inputClassName, IEntryHolder template, boolean tryInsertToCache, boolean lockedEntry, boolean useOnlyCache) throws SAException get entry by its uid, and, optionally, by its template className is passed if known, can be null template is not null if isCacheExternalDB is true: external DB, the template must contain the PK fields insertToCache- true if entry shouldbe inserted to cache- Throws:
SAException
-
getTemplatesInfo
returns a list of all the pending templates for the given class -
getTemplate
-
getMatchingMemoryEntriesForScanning
public IScanListIterator<IEntryCacheInfo> getMatchingMemoryEntriesForScanning(Context context, IServerTypeDesc currServerTypeDesc, ITemplateHolder template, IServerTypeDesc serverTypeDesc) -
removeEntry
public int removeEntry(Context context, IEntryHolder entryHolder, IEntryCacheInfo pEntry, boolean shouldReplicate, boolean origin, SpaceEngine.EntryRemoveReasonCodes removeReason, boolean disableSAcall) throws SAException remove entry from cache & SA- Parameters:
disableSAcall- - if true don't call the underlying SA- Returns:
- number of completed sync replications.
- Throws:
SAException
-
handleRemoveEntryReplication
public void handleRemoveEntryReplication(Context context, IEntryHolder entryHolder, SpaceEngine.EntryRemoveReasonCodes removeReason) -
handleRemoveEntryReplication
public void handleRemoveEntryReplication(Context context, IEntryHolder entryHolder, SpaceEngine.EntryRemoveReasonCodes removeReason, int blobstoreBulkId) -
removeTemplate
public void removeTemplate(Context context, ITemplateHolder template, boolean fromReplication, boolean origin, boolean dontReplicate) Marks template as DELETED and send a BUS Packet to the GC. Assumes the specified template is locked. -
removeTemplate
public void removeTemplate(Context context, ITemplateHolder template, boolean fromReplication, boolean origin, boolean dontReplicate, SpaceEngine.TemplateRemoveReasonCodes removeReason) Marks template as DELETED and send a BUS Packet to the GC. Assumes the specified template is locked. -
getFifoBackgroundDispatcher
-
makeWaitForInfo
public void makeWaitForInfo(Context context, IEntryHolder entryHolder, ITemplateHolder templateHolder) throws SAException - Throws:
SAException
-
removeWaitingForInfo
public void removeWaitingForInfo(Context context, IEntryHolder entryHolder, ITemplateHolder templateHolder, boolean unpinIfPossible) -
associateEntryWithXtn
public IEntryHolder associateEntryWithXtn(Context context, IEntryHolder entryHolder, ITemplateHolder template, XtnEntry xtnEntry, IEntryHolder new_content) throws SAException tie an entry with a transaction. new_content is the new values in case of update operation- Throws:
SAException
-
getPEntryByUid
-
getEntryByUidFromPureCache
-
getMVCCShellEntryCacheInfoByUid
-
getMVCCEntryCacheInfoByEntryHolder
-
isEntryInPureCache
- Parameters:
uid- of entry to check- Returns:
trueif this entry is in pure cache;falseotherwise.
-
disconnectEntryFromXtn
public void disconnectEntryFromXtn(Context context, IEntryHolder entryHolder, XtnEntry xtnEntry, boolean xtnEnd) throws SAException disconnect an entry from xtn- Parameters:
entryHolder- - entry to disconnectxtnEnd- - true if its part of commit/rb process- Throws:
SAException
-
disconnectMVCCEntryFromXtn
public void disconnectMVCCEntryFromXtn(Context context, MVCCEntryCacheInfo pEntry, XtnEntry xtnEntry, boolean xtnEnd) throws SAException - Throws:
SAException
-
prepare
public void prepare(Context context, XtnEntry xtnEntry, boolean supportsTwoPhaseReplication, boolean handleReplication, boolean handleSA) throws SAException - Throws:
SAException
-
prePrepare
this method is called by the engine in order to make a "snapshot" of entries needed for notify. -
isMVCCEnabled
public boolean isMVCCEnabled() -
getMVCCHandler
-
handleUnderXtnUpdate
public void handleUnderXtnUpdate(Context context, ServerTransaction xtn, IEntryHolder eh, boolean isCommitting, XtnData pXtn) xtn terminating-handle under xtn updates. -
preCommit
-
commit
public void commit(Context context, XtnEntry xtnEntry, boolean singleParticipant, boolean anyUpdates, boolean supportsTwoPhaseReplication) throws SAException - Throws:
SAException
-
rollback
public void rollback(Context context, XtnEntry xtnEntry, boolean alreadyPrepared, boolean anyUpdates, boolean supportsTwoPhaseReplication) throws SAException - Throws:
SAException
-
extendLeasePeriod
-
findTemplatesByIndex
public Object findTemplatesByIndex(Context context, IServerTypeDesc typeDesc, IEntryHolder entry, MatchTarget matchTarget) given a class name return the SL of matching templates. This API is more efficient than direct use of templates iterator -
getEntryFromCacheHolder
given a PEntry, return the entry. -
getEntryCacheInfo
get PEntry for entry. -
getTemplateCacheInfo
get PEntry for entry. -
makeEntriesIter
public ISAdapterIterator<IEntryHolder> makeEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly, boolean transientOnly) throws SAException - Throws:
SAException
-
makeEntriesIter
public ISAdapterIterator<IEntryHolder> makeEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly) throws SAException - Throws:
SAException
-
makeMVCCShellsRecoveryIter
public ISAdapterIterator<MVCCShellEntryCacheInfo> makeMVCCShellsRecoveryIter(IServerTypeDesc serverTypeDesc) -
makeScanableEntriesIter
public IScanListIterator makeScanableEntriesIter(Context context, ITemplateHolder template, IServerTypeDesc serverTypeDesc, long SCNFilter, long leaseFilter, boolean memoryOnly) throws SAException - Throws:
SAException
-
makeUnderXtnTemplatesIter
public ISAdapterIterator<ITemplateHolder> makeUnderXtnTemplatesIter(Context context, XtnEntry xtnEntry) throws SAException - Throws:
SAException
-
makeUnderXtnEntriesIter
public ISAdapterIterator makeUnderXtnEntriesIter(Context context, XtnEntry xtnEntry, int selectType) throws SAException - Throws:
SAException
-
makeUnderXtnEntriesIter
public ISAdapterIterator makeUnderXtnEntriesIter(Context context, XtnEntry xtnEntry, int selectType, boolean returnPentries) throws SAException - Throws:
SAException
-
count
- Throws:
SAException
-
getTypeDataFactory
-
getTypeData
-
safeInsertEntryToCache
public IEntryCacheInfo safeInsertEntryToCache(Context context, IEntryHolder entryHolder, boolean newEntry, TypeData pType, boolean pin, CacheManager.InitialLoadOrigin fromInitialLoad) throws SAException Inserts the specified entry to cache, perform memory manager check. used by initial load.- Throws:
SAException
-
forceSpaceIdIndexIfEqual
public boolean forceSpaceIdIndexIfEqual() -
getBlobStoreStatistics
-
handleMVCCGenerations
public void handleMVCCGenerations(Context context, MVCCEntryHolder entry, XtnEntry xtnEntry) throws SAException - Throws:
SAException
-
validateMVCCGenerationConsistency
-
internalInsertEntryToCache
public IEntryCacheInfo internalInsertEntryToCache(Context context, IEntryHolder entryHolder, boolean newEntry, TypeData typeData, IEntryCacheInfo pEntry, boolean pin) Inserts the specified entry to cache. -
insertEntryReferences
public void insertEntryReferences(Context context, IEntryCacheInfo pEntry, TypeData pType, boolean applySequenceNumber) Inserts the refs to cache. -
updateEntryInCache
public IEntryCacheInfo updateEntryInCache(Context context, IEntryCacheInfo pEntry, IEntryHolder entryHolder, IEntryData newEntryData, long newExpirationTime, int modifiers) update entry values in cache. pEntry - the current in cache or null if unknown -
removeEntryFromCache
Removes the specified entry from cache. return true if removal ok -
removeEntryFromCache
public boolean removeEntryFromCache(IEntryHolder entryHolder, boolean initiatedByEvictionStrategy, boolean locked, IEntryCacheInfo pEntry, CacheManager.RecentDeleteCodes recentDeleteUsage) Removes the specified entry from cache. return true if removal ok -
getSqlFunctions
-
removeEntryReferences
public void removeEntryReferences(IEntryCacheInfo pEntry, TypeData pType, int numOfIndexesInsertedOnError) Removes entry refs from cache. -
getEntryByUniqueId
public IEntryCacheInfo getEntryByUniqueId(Context context, IServerTypeDesc currServerTypeDesc, Object templateValue, ITemplateHolder template) -
getEntriesByUniqueIds
public IEntryCacheInfo[] getEntriesByUniqueIds(Context context, IServerTypeDesc currServerTypeDesc, Object[] ids, ITemplateHolder template) -
getEntriesMinIndex
public IStoredList<IEntryCacheInfo> getEntriesMinIndex(Context context, TypeData typeData, int numOfFields, ITemplateHolder template) Computes the best way to reach a list of potential match of entries of the specified type.Handles also unindexed entries.
Assumes the specified template is a superclass (in the wide sense) of the specified entry.
- Parameters:
typeData- the type of entries to search fortemplate- the template to match against- Returns:
- a SL containing potential matches or
nullif there are no matches.
-
getEntriesMinIndexExtended
public Object getEntriesMinIndexExtended(Context context, TypeData entryType, int numOfFields, ITemplateHolder template) Using extended match-Computes the best way to reach a list of potential match of entries of the specified type.
Handles also un-indexed entries.
Assumes the specified template is a superclass (in the wide sense) of the specified entry.
- Parameters:
entryType- the type of entries to search fortemplate- the template to match against- Returns:
- a SL or IOrderedIndexScan containing potential matches or
nullif there are no matches.
-
canSkipFullScanForAggregators
-
canIgnoreLeaseExpiration
public boolean canIgnoreLeaseExpiration() -
canIgnoreOpenTransactions
public boolean canIgnoreOpenTransactions() -
getEntryByIdFromPureCache
-
tryEvict
get permission to evict an entry, and if granted remove the entry from cache. this function must be called by the eviction Strategy prior to performing an eviction of an entry. eviction must be performed only if permission is granted by the space. permission can be denied if the entry is currently locked by another thread that is performing a space operation on it NOTE: after calling grantEvictionPermissionAndRemove and receiving true as an answer the eviction strategy should remove the entry from its internal state and call reportEvictionCompletion(entry)- Specified by:
tryEvictin interfaceSpaceEvictionManager- Parameters:
entry- The entry to evict.- Returns:
- true if permission is granted and entry was removed from cache
-
unpinIfNeeded
public boolean unpinIfNeeded(Context context, IEntryHolder entry, ITemplateHolder template, IEntryCacheInfo pEntry) if relevant-unpin the entry method is called after each operation or xtn termination entry should be locked when method is called- Returns:
- null if not unpinned
-
initiatedEviction
public boolean initiatedEviction(Context context, IEntryHolder entry, boolean shouldReplicate) throws SAException - Throws:
SAException
-
isMemorySpace
public boolean isMemorySpace()is this space a memory space ?- Returns:
- true if the space is a memory space
-
getReplicationContext
-
isFromFifoClass
- Returns:
- true if the class represented by enumeration a fifo class
-
getTemplatesManager
-
getNumberOfLockedObjectsUnderTxn
used by getTransactionsInfo to retrieve number of Locked Objects- Returns:
- the number of Locked Objects by the given Transaction
-
getMinExtendedIndexActivationSize
public int getMinExtendedIndexActivationSize() -
getEnriesSize
public int getEnriesSize() -
getLatestTTransactionTerminationNum
public long getLatestTTransactionTerminationNum()get the Terminating fifo transaction -
setLatestTransactionTerminationNum
public void setLatestTransactionTerminationNum(long xtnTerminationNum) get the Terminating fifo transaction //NOTE- must be called when xtns are locked !!!!!!!! -
setFifoXtnNumber
set the fifo xtn number of a xtn -
getFifoXtnNumber
get the fifo xtn number of a xtn -
updateFifoXtnInfoForEntry
public void updateFifoXtnInfoForEntry(IEntryHolder eh, long xtnNumber, boolean writeLock, boolean entryWritingXtn) update fifo xtn info for entry MUST be called when entry is locked update write lock if writeLock is true, else update read lock entryWritingXtn = true if this is the commit of the entry write -
setFifoCreationXtnInfoForEntry
create fifo xtn info for entry MUST be called when entry is locked- Parameters:
xtnNumber- - the xtn in the system when entry was created
-
getFifoEntryXtnInfo
-
removeFifoXtnInfoForEntry
remove fifo xtn info for entry MUST be called when entry is locked -
getTerminatingXtnsEntries
public ConcurrentHashMap<TerminatingFifoXtnsInfo.FifoXtnEntryInfo,TerminatingFifoXtnsInfo.FifoXtnEntryInfo> getTerminatingXtnsEntries() -
lockEntry
-
updateLock
public void updateLock(XtnData xtn, IEntryCacheInfo pEntry, OperationID operationID, int templateOperation) -
removeLockedEntry
-
getStorageAdapter
- Returns:
- the sA
-
getFifoGroupCacheImpl
-
getCacheContext
-
freeCacheContext
-
viewCacheContext
-
startTemplateExpirationManager
public void startTemplateExpirationManager() -
getTemplateExpirationManager
-
testAndSetFGCacheForEntry
public boolean testAndSetFGCacheForEntry(Context context, IEntryHolder entry, ITemplateHolder template, boolean testOnly, IServerTypeDesc tte) -
handleFifoGroupsCacheOnXtnEnd
-
addToEvictionStrategy
-
removeFromEvictionStrategy
-
getLocalCaches
-
getCacheLogger
public static org.slf4j.Logger getCacheLogger() -
getNumberOfEntries
public int getNumberOfEntries() -
getNumberOfEntries
-
getNumberOfNotifyTemplates
public int getNumberOfNotifyTemplates() -
getNumberOfNotifyTemplates
-
getRuntimeInfo
-
getQueryExtensionManager
-
closeQueryExtensionManagers
public void closeQueryExtensionManagers()
-