Package com.microstrategy.webapi
Class MSIRefreshClusterMembershipCache
- java.lang.Object
-
- com.microstrategy.utils.cache.CacheBase
-
- com.microstrategy.webapi.MSIRefreshClusterMembershipCache
-
- All Implemented Interfaces:
Cache
public final class MSIRefreshClusterMembershipCache extends CacheBase
MSIGetClusterMembershipCache uses the CacheBase infrastructure to manage the calls to RefreshClusterMembership. RefreshClusterMembership is a heavy call to IServer because when called against an IServer, it makes calls to all other IServers in the cluster to get the project information before returning.
MSIGetClusterMembershipCache will cache the results of RefreshClusterMembership for a period of time in the order of 5-10 seconds. Any calls to RefreshClusterMembership before the cache expires will hit the cache and NOT make a call to an IServer. Any calls after the cache has expired will call RefreshClusterMembership on the IServer.
This paradigm is "eventual consistency"; we are allowed to use old information as long as the old information isn't too old.
This optimization allows disparate parts of the code-base to be free to call RefreshClusterMembership when needed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MSIRefreshClusterMembershipCache.RCMKey
RCMKey is the key to the getClusterMembership cache.
-
Field Summary
-
Fields inherited from class com.microstrategy.utils.cache.CacheBase
alias, DEFAULT_FILE_REFRESH_TIME, DEFAULT_REFRESH_TIME, DEFAULT_STATISTIC_TIME, DEFAULT_SYS_TIMEOUT, DEFAULT_USER_TIMEOUT, NO_KEY, NO_REFRESH, NO_STATISTIC, NO_TIMEOUT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MSIRefreshClusterMembershipCache
getInstance()
protected java.lang.Object
getKey(CacheHint iKey)
Overridable.protected java.util.Collection<com.microstrategy.webapi.ClusterMemberInfo>
load(CacheHint iKey)
Overridable.-
Methods inherited from class com.microstrategy.utils.cache.CacheBase
canUpdate, clear, close, configure, contains, delete, get, getName, getRefreshTime, getStatisticTime, getTimeout, getWithoutRefresh, logStatistic, onHintClose, onTimer, put, refresh, reLoad, remove, save, setRefreshTime, setStatisticTime, setTimeout, size, store, unLoad
-
-
-
-
Method Detail
-
getInstance
public static MSIRefreshClusterMembershipCache getInstance()
-
getKey
protected java.lang.Object getKey(CacheHint iKey) throws CacheException
Description copied from class:CacheBase
Overridable. Extracts from the hint object the key that shall be used to identify the cached object.- Specified by:
getKey
in classCacheBase
- Parameters:
iKey
- the hint object.- Returns:
- the key
- Throws:
CacheException
- if somethig gos wrong.
-
load
protected java.util.Collection<com.microstrategy.webapi.ClusterMemberInfo> load(CacheHint iKey) throws CacheException
Description copied from class:CacheBase
Overridable. Creates a new cached object instance and populates it with data from the persistent storage. In case the object not found in the persistent storage the implementation can return either null or a dummy object.- Specified by:
load
in classCacheBase
- Parameters:
iKey
- the hint object.- Returns:
- the object or null.
- Throws:
CacheException
- if somethig gos wrong.
-
-