Class ObservableSplittingBackingCache.CapacityAwareMap

All Implemented Interfaces:
Disposable, PartitionAwareBackingMap, AutoCloseable, Map
Enclosing class:
ObservableSplittingBackingCache

protected static class ObservableSplittingBackingCache.CapacityAwareMap extends PartitionSplittingBackingMap
A subclass of PartitionSplittingBackingMap which allows an injected instance of ObservableSplittingBackingMap to be called immediately before inserting a value(s) in a partition map.

This class is intended for internal use only facilitating efficient use of PartitionSplittingBackingMap, by reducing the number of times the partitioned backing map is determined.

See Also:
  • Field Details

  • Constructor Details

    • CapacityAwareMap

      protected CapacityAwareMap(BackingMapManager bmm, String sName)
      Create a CapacityAwareMap.
      Parameters:
      bmm - a BackingMapManager that knows how to create and release the backing maps that this PartitionSplittingBackingMap is responsible for
      sName - the cache name for which this backing map exists
  • Method Details

    • putInternal

      protected Object putInternal(Map mapPart, Object oKey, Object oValue)
      Put the key and value into a map representing a given partition.
      Overrides:
      putInternal in class PartitionSplittingBackingMap
      Parameters:
      mapPart - a partition map
      oKey - oKey with which the specified value is to be associated
      oValue - oValue to be associated with the specified oKey
      Returns:
      previous value associated with specified key, or null if there was no mapping for the key
    • putAllInternal

      protected void putAllInternal(Map mapPart, Map map)
      Put all entries in mapUpdate into the provided map.
      Overrides:
      putAllInternal in class PartitionSplittingBackingMap
      Parameters:
      mapPart - a partition map
      map - the Map containing the key/value pairings to put into mapPart
    • bind

      protected void bind(ObservableSplittingBackingCache mapOuter)
      Bind to the given ObservableSplittingBackingMap instance. This instance will have prepareUpdate invoked immediately prior to an insert to a partition map.
      Parameters:
      mapOuter - the map used to call prepareUpdate