Config: ClusterCache

From Resin 4.0 Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Config}} {{Caching}} = ClusterCache = A cache which stores consistent copies on the cluster segment. Using the cache is like using java.util.Map. To add a new entry, cal...")
 
Line 24: Line 24:
 
== <resin:ClusterCache> Attributes ==
 
== <resin:ClusterCache> Attributes ==
  
{|
+
{| class="gallery"
 
! Name
 
! Name
 
! Description
 
! Description
Line 30: Line 30:
 
! Default
 
! Default
 
|-
 
|-
| name
+
| style="white-space:nowrap" | name
 
| A name is mandatory and must be unique among open caches
 
| A name is mandatory and must be unique among open caches
 
| String
 
| String
 
| required
 
| required
 
|-
 
|-
| manager-name
+
| style="white-space:nowrap" | manager-name
 
|  
 
|  
 
| String
 
| String
 
| Null
 
| Null
 
|-
 
|-
| cache-loader
+
| style="white-space:nowrap" | cache-loader
 
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)
 
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)
 
| javax.cache.CacheLoader
 
| javax.cache.CacheLoader
 
| Null
 
| Null
 
|-  
 
|-  
| read-through
+
| style="white-space:nowrap" | read-through
 
| Use CacheLoader
 
| Use CacheLoader
 
| Boolean
 
| Boolean
 
| False
 
| False
 
|-
 
|-
| read-through-expire-timeout
+
| style="white-space:nowrap" | read-through-expire-timeout
 
|  
 
|  
 
| Period
 
| Period
 
| Infinity
 
| Infinity
 
|-
 
|-
| cache-writer
+
| style="white-space:nowrap" | cache-writer
 
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)
 
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)
 
| javax.cache.CacheWriter
 
| javax.cache.CacheWriter
 
| Null
 
| Null
 
|-
 
|-
| write-through
+
| style="white-space:nowrap" | write-through
 
| Use CacheWriter
 
| Use CacheWriter
 
| Boolean
 
| Boolean
 
| False
 
| False
 
|-
 
|-
| cache-reader-writer
+
| style="white-space:nowrap" | cache-reader-writer
 
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)
 
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)
 
| javax.cache.CacheLoader, javax.cache.CacheWriter
 
| javax.cache.CacheLoader, javax.cache.CacheWriter
 
| Null
 
| Null
 
|-
 
|-
| serializer
+
| style="white-space:nowrap" | serializer
 
| Assign the serializer used on values. (This setting should not be changed after a cache is created)
 
| Assign the serializer used on values. (This setting should not be changed after a cache is created)
 
| com.caucho.distcache.CacheSerializer
 
| com.caucho.distcache.CacheSerializer
 
| Null
 
| Null
 
|-
 
|-
| accessed-expire-timeout
+
| style="white-space:nowrap" | accessed-expire-timeout
 
| The maximum idle time for an item, which is typically used for temporary data like sessions.  For example, session data might be removed if idle over 30 minutes.  Cached data would have infinite idle time because it doesn't depend on how often it's accessed.
 
| The maximum idle time for an item, which is typically used for temporary data like sessions.  For example, session data might be removed if idle over 30 minutes.  Cached data would have infinite idle time because it doesn't depend on how often it's accessed.
 
| Period
 
| Period
 
| Infinity
 
| Infinity
 
|-
 
|-
| idle-timeout
+
| style="white-space:nowrap" | idle-timeout
 
| Deprecated - use accessed-expire-timeout
 
| Deprecated - use accessed-expire-timeout
 
| Period
 
| Period
 
| Infinity
 
| Infinity
| -
+
|-
| accessed-expire-timeout-window
+
| style="white-space:nowrap" | accessed-expire-timeout-window
 
| Idle check window, used to minimize traffic when updating access times
 
| Idle check window, used to minimize traffic when updating access times
 
| Period
 
| Period
| accessed-expire-timeout / 4
+
| style="white-space:nowrap" | accessed-expire-timeout / 4
 
|-
 
|-
| modified-expire-timeout
+
| style="white-space:nowrap" | modified-expire-timeout
 
| The maximum valid time for an item.  Items stored in the cache for longer than the expire time are no longer valid and will return null from a get
 
| The maximum valid time for an item.  Items stored in the cache for longer than the expire time are no longer valid and will return null from a get
 
| Period
 
| Period
 
| Infinity
 
| Infinity
 
|-
 
|-
| lease-expire-timeout
+
| style="white-space:nowrap" | lease-expire-timeout
 
| The lease timeout is the time a server can use the local version if it owns it, before a timeout
 
| The lease timeout is the time a server can use the local version if it owns it, before a timeout
 
| Period
 
| Period
 
| 5m
 
| 5m
 
|-
 
|-
| local-expire-timeout
+
| style="white-space:nowrap" | local-expire-timeout
 
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1).  A slow changing item like a list of bulletin-board comments could be 10s.  Even a relatively quickly changing item can be 10ms or 100ms.
 
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1).  A slow changing item like a list of bulletin-board comments could be 10s.  Even a relatively quickly changing item can be 10ms or 100ms.
 
| Period
 
| Period
 
| 250ms
 
| 250ms
 
|-
 
|-
| local-read-timeout
+
| style="white-space:nowrap" | local-read-timeout
 
| Deprecated - use local-expire-timeout
 
| Deprecated - use local-expire-timeout
 
| Period
 
| Period
 
| 250ms
 
| 250ms
 
|-
 
|-
| scope-model
+
| style="white-space:nowrap" | scope-model
 
|  
 
|  
 
| TRANSIENT|LOCAL|CLUSTER
 
| TRANSIENT|LOCAL|CLUSTER
 
| CLUSTER
 
| CLUSTER
 
|-
 
|-
| backing
+
| style="white-space:nowrap" | backing
 
| Same effect as cache-reader-writer
 
| Same effect as cache-reader-writer
 
| com.caucho.server.distcache.CacheBacking
 
| com.caucho.server.distcache.CacheBacking
 
| Null
 
| Null
 +
|}
 +
 +
=== Period Format ===
 +
 +
{| class="gallery"
 +
|-
 +
| ms
 +
| milliseconds
 +
|-
 +
| s
 +
| seconds
 +
|-
 +
| m
 +
| minutes
 +
|-
 +
| h
 +
| hours
 +
|-
 +
| D
 +
| days
 +
|-
 +
| W
 +
| weeks
 +
|-
 +
| M
 +
| months
 +
|-
 +
| Y
 +
| years
 +
|}

Revision as of 03:21, 18 October 2013

Gears-48.pngSquirrel-48.png

Contents

ClusterCache

A cache which stores consistent copies on the cluster segment.

Using the cache is like using java.util.Map. To add a new entry, call cache.put(key, value). To get the entry, call cache.get(key).

The cache configuration affects the lifetime, local caching timeouts and consistency.

ClusterCache is a javax.cache.Cache (JSR 107: JCache)

Example resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee">

  <resin:ClusterCache ee:Named="myCache">
    <name>myCache</name>
    <modified-expire-timeout>1h</modified-expire-timeout>
  </resin:ClusterCache>

</web-app>

<resin:ClusterCache> Attributes

Period Format

Personal tools
TOOLBOX
LANGUAGES