Class 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.
    • Method Detail

      • 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 class CacheBase
        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 class CacheBase
        Parameters:
        iKey - the hint object.
        Returns:
        the object or null.
        Throws:
        CacheException - if somethig gos wrong.