public class LocalCacheSupport extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_CACHE_UPDATE_MODE_PULL |
static String |
LOCAL_CACHE_UPDATE_MODE_PUSH |
Constructor and Description |
---|
LocalCacheSupport() |
Modifier and Type | Method and Description |
---|---|
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 |
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 |
setVersioned(boolean versioned)
Controls if this local cache will be versioned or not.
|
public static final String LOCAL_CACHE_UPDATE_MODE_PUSH
public static final String LOCAL_CACHE_UPDATE_MODE_PULL
public void setVersioned(boolean versioned)
true
, make sure that the actual space is versioned as well.public boolean isVersioned()
true
, make sure that the actual space is versioned as well.public void setEvictionStrategy(EvictionStrategy evictionStrategy)
public EvictionStrategy getEvictionStrategy()
public void setUpdateMode(int localCacheUpdateMode)
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.
setUpdateModeName(String)
public int getLocalCacheUpdateMode()
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.
setUpdateMode(int)
public void setUpdateModeName(String localCacheUpdateModeName)
localCacheUpdateMode
. Accepts either
push
or pull
.(int)
public void setPutFirst(boolean putFirst)
true
.public boolean isPutFirst()
true
.public void setSizeLimit(int sizeLimit)
100000
.public int getSizeLimit()
100000
.Copyright © GigaSpaces.