GigaSpaces XAP 7.0 API

org.openspaces.core.map
Class LocalCacheSupport

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

public class LocalCacheSupport
extends Object

A bean holding local cache support (when using Map API) configuration.

Author:
kimchy

Field Summary
static String LOCAL_CACHE_UPDATE_MODE_PULL
           
static String LOCAL_CACHE_UPDATE_MODE_PUSH
           
 
Constructor Summary
LocalCacheSupport()
           
 
Method Summary
 EvictionStrategy getEvictionStrategy()
          Sets the eviction strategy for the local cache.
 int getLocalCacheUpdateMode()
          If set to SpaceURL.UPDATE_MODE_PULL (1) each update triggers an invalidation event at every cache instance.
 int getSizeLimit()
          Sets the size limit of the local cache.
 boolean isPutFirst()
          When performing a put operation, you may perform the put operation both into the local cache and the master space.
 boolean isUseMulticast()
          Local cache updates can be sent via unicast or multicast.
 boolean isVersioned()
          Controls if this local cache will be versioned or not.
 void setEvictionStrategy(EvictionStrategy evictionStrategy)
          Sets the eviction strategy for the local cache.
 void setPutFirst(boolean putFirst)
          When performing a put operation, you may perform the put operation both into the local cache and the master space.
 void setSizeLimit(int sizeLimit)
          Sets the size limit of the local cache.
 void setUpdateMode(int localCacheUpdateMode)
          If set to SpaceURL.UPDATE_MODE_PULL (1) each update triggers an invalidation event at every cache instance.
 void setUpdateModeName(String localCacheUpdateModeName)
          Allows to set the local cache update mode using a descriptive name instead of integer constants using localCacheUpdateMode.
 void setUseMulticast(boolean useMulticast)
          Local cache updates can be sent via unicast or multicast.
 void setVersioned(boolean versioned)
          Controls if this local cache will be versioned or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_CACHE_UPDATE_MODE_PUSH

public static final String LOCAL_CACHE_UPDATE_MODE_PUSH
See Also:
Constant Field Values

LOCAL_CACHE_UPDATE_MODE_PULL

public static final String LOCAL_CACHE_UPDATE_MODE_PULL
See Also:
Constant Field Values
Constructor Detail

LocalCacheSupport

public LocalCacheSupport()
Method Detail

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:
setUpdateModeName(String)

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:
setUpdateMode(int)

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:
(int)

setUseMulticast

public void setUseMulticast(boolean useMulticast)
Local cache updates can be sent via unicast or multicast. When using multicast, make sure MulticastNotifyWorker as part of the space schema configuration is enabled. Default to false.


isUseMulticast

public boolean isUseMulticast()
Local cache updates can be sent via unicast or multicast. When using multicast, make sure MulticastNotifyWorker as part of the space schema configuration is enabled. Default to false.


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.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.