Class EntryCacheConfigManager.EntryCacheDispatcher

    • Constructor Detail

      • EntryCacheDispatcher

        public EntryCacheDispatcher()
    • Method Detail

      • containsEntry

        public boolean containsEntry​(Dn entryDN)
        Description copied from class: EntryCache
        Indicates whether the entry cache currently contains the entry with the specified DN. This method may be called without holding any locks if a point-in-time check is all that is required. Note that this method is called from @see #getEntry(DN entryDN, LockType lockType, List lockList)
        Specified by:
        containsEntry in class EntryCache<EntryCacheCfg>
        Parameters:
        entryDN - The DN for which to make the determination.
        Returns:
        true if the entry cache currently contains the entry with the specified DN, or false if not.
      • getEntry

        public SizedEntry getEntry​(String backendID,
                                   long entryID)
        Description copied from class: EntryCache
        Retrieves the requested entry with its size, if it is present in the cache.
        Specified by:
        getEntry in class EntryCache<EntryCacheCfg>
        Parameters:
        backendID - ID of the backend associated with the entry to retrieve.
        entryID - The entry ID within the provided backend for the specified entry.
        Returns:
        The requested entry if it is present in the cache, or null if it is not present.
      • getEntry

        public SizedEntry getEntry​(Dn entryDN)
        Description copied from class: EntryCache
        Retrieves the entry with its size, with the specified DN from the cache.
        Specified by:
        getEntry in class EntryCache<EntryCacheCfg>
        Parameters:
        entryDN - The DN of the entry to retrieve.
        Returns:
        The requested entry with its size if it is present in the cache, or null if it is not present.
      • putEntry

        public void putEntry​(SizedEntry entry,
                             String backendID,
                             long entryID)
        Description copied from class: EntryCache
        Stores the provided entry in the cache. Note that the mechanism that it uses to achieve this is implementation-dependent, and it is acceptable for the entry to not actually be stored in any cache.
        Specified by:
        putEntry in class EntryCache<EntryCacheCfg>
        Parameters:
        entry - The entry to store in the cache.
        backendID - ID of the backend with which the entry is associated.
        entryID - The entry ID within the provided backend that uniquely identifies the specified entry.
      • putEntryIfAbsent

        public void putEntryIfAbsent​(SizedEntry entry,
                                     String backendID,
                                     long entryID)
        Description copied from class: EntryCache
        Stores the provided entry in the cache only if it does not conflict with an entry that already exists. Note that the mechanism that it uses to achieve this is implementation-dependent, and it is acceptable for the entry to not actually be stored in any cache. However, this method must not overwrite an existing version of the entry.
        Specified by:
        putEntryIfAbsent in class EntryCache<EntryCacheCfg>
        Parameters:
        entry - The entry to store in the cache.
        backendID - ID of the backend with which the entry is associated.
        entryID - The entry ID within the provided backend that uniquely identifies the specified entry.
      • removeEntry

        public void removeEntry​(Dn entryDN)
        Description copied from class: EntryCache
        Removes the specified entry from the cache.
        Specified by:
        removeEntry in class EntryCache<EntryCacheCfg>
        Parameters:
        entryDN - The DN of the entry to remove from the cache.
      • clear

        public void clear()
        Description copied from class: EntryCache
        Removes all entries from the cache. The cache should still be available for future use.
        Specified by:
        clear in class EntryCache<EntryCacheCfg>
      • clearBackend

        public void clearBackend​(String backendID)
        Description copied from class: EntryCache
        Removes all entries from the cache that are associated with the provided backend.
        Specified by:
        clearBackend in class EntryCache<EntryCacheCfg>
        Parameters:
        backendID - ID of the backend for which to flush the associated entries.
      • isConfigurationChangeAcceptable

        public boolean isConfigurationChangeAcceptable​(EntryCacheCfg configuration,
                                                       List<LocalizableMessage> unacceptableReasons)
        Description copied from interface: ConfigurationChangeListener
        Indicates whether the proposed change to the configuration is acceptable to this change listener.
        Specified by:
        isConfigurationChangeAcceptable in interface ConfigurationChangeListener<EntryCacheCfg>
        Parameters:
        configuration - The new configuration containing the changes.
        unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
        Returns:
        Returns true if the proposed change is acceptable, or false if it is not.
      • getEntryCount

        public long getEntryCount()
        Description copied from class: EntryCache
        Retrieves the current number of entries stored within the cache.
        Specified by:
        getEntryCount in class EntryCache<EntryCacheCfg>
        Returns:
        The current number of entries stored within the cache.
      • getMemoryUsage

        public long getMemoryUsage()
        Description copied from class: EntryCache
        Retrieves the current amount of memory used by this cache in bytes.
        Specified by:
        getMemoryUsage in class EntryCache<EntryCacheCfg>
        Returns:
        The current amount of memory used by this cache in bytes.
      • toVerboseString

        public String toVerboseString()
        Description copied from class: EntryCache
        Return a verbose string representation of the current cache maps. This is useful primary for debugging and diagnostic purposes such as in the entry cache unit tests.

        This method is invoked by unit tests for debugging.

        Specified by:
        toVerboseString in class EntryCache<EntryCacheCfg>
        Returns:
        String verbose string representation of the current cache maps in the following format: dn:id:backend one cache entry map representation per line or null if all maps are empty.
      • setOrderedEntryCaches

        public void setOrderedEntryCaches​(List<EntryCache<?>> orderedEntryCaches)
        Sets the current cache order array.
        Parameters:
        orderedEntryCaches - The current cache order array.
      • performBackendPostFinalizationProcessing

        public void performBackendPostFinalizationProcessing​(String backendId,
                                                             Predicate<Dn> handlesEntry)
        Description copied from interface: LocalBackendInitializationListener
        Performs any processing that may be required whenever a backend is finalized. This method will be invoked after the backend has been taken out of service and after it has been finalized.
        Specified by:
        performBackendPostFinalizationProcessing in interface LocalBackendInitializationListener
        Parameters:
        backendId - The backend ID of the backend that has been taken out of service.
        handlesEntry - A predicate which can be used for determining whether the finalized backend contained an entry.
      • finalizeEntryCache

        public void finalizeEntryCache()
        Description copied from class: EntryCache
        Performs any necessary cleanup work (e.g., flushing all cached entries and releasing any other held resources) that should be performed when the server is to be shut down or the entry cache destroyed or replaced.
        Specified by:
        finalizeEntryCache in class EntryCache<EntryCacheCfg>