Class LocalCacheSupport

java.lang.Object
org.openspaces.core.map.LocalCacheSupport

public class LocalCacheSupport extends Object
A bean holding local cache support (when using Map API) configuration.
Author:
kimchy
  • Field Details

  • Constructor Details

    • LocalCacheSupport

      public LocalCacheSupport()
  • Method Details

    • setVersioned

      public void setVersioned(boolean versioned)
      Controls if this local cache will be versioned or not. Note, when settings this to true, make sure that the actual space is versioned as well.
    • isVersioned

      public boolean isVersioned()
      Controls if this local cache will be versioned or not. Note, when settings this to true, make sure that the actual space is versioned as well.
    • setEvictionStrategy

      public void setEvictionStrategy(EvictionStrategy evictionStrategy)
      Sets the eviction strategy for the local cache.
    • getEvictionStrategy

      public EvictionStrategy getEvictionStrategy()
      Sets the eviction strategy for the local cache.
    • setUpdateMode

      public void setUpdateMode(int localCacheUpdateMode)
      If set to SpaceURL.UPDATE_MODE_PULL (1) each update triggers an invalidation event at every cache instance. The invalidate event marks the object in the local cache instances as invalid. Therefore, an attempt to read this object triggers a reload process in the master space. This configuration is useful in cases where objects are updated frequently, but the updated value is required by the application less frequently.

      If set to SpaceURL.UPDATE_MODE_PUSH (2) the master pushes the updates to the local cache, which holds a reference to the same updated object.

      See Also:
    • getLocalCacheUpdateMode

      public int getLocalCacheUpdateMode()
      If set to SpaceURL.UPDATE_MODE_PULL (1) each update triggers an invalidation event at every cache instance. The invalidate event marks the object in the local cache instances as invalid. Therefore, an attempt to read this object triggers a reload process in the master space. This configuration is useful in cases where objects are updated frequently, but the updated value is required by the application less frequently.

      If set to SpaceURL.UPDATE_MODE_PUSH (2) the master pushes the updates to the local cache, which holds a reference to the same updated object.

      See Also:
    • setUpdateModeName

      public void setUpdateModeName(String localCacheUpdateModeName)
      Allows to set the local cache update mode using a descriptive name instead of integer constants using localCacheUpdateMode. Accepts either push or pull.
      See Also:
    • setPutFirst

      public void setPutFirst(boolean putFirst)
      When performing a put operation, you may perform the put operation both into the local cache and the master space. This will speed up subsequent get operations. Default to true.
    • isPutFirst

      public boolean isPutFirst()
      When performing a put operation, you may perform the put operation both into the local cache and the master space. This will speed up subsequent get operations. Default to true.
    • setSizeLimit

      public void setSizeLimit(int sizeLimit)
      Sets the size limit of the local cache. Default to 100000.
    • getSizeLimit

      public int getSizeLimit()
      Sets the size limit of the local cache. Default to 100000.