PRODUCTS AND SERVICES INDUSTRIES SUPPORT PARTNERS COMMUNITIES ABOUT
  Coherence 3.4 User Guide
  Coherence User Guide (Full)
Added by Rob Misek, last edited by Jon Purdy on Oct 17, 2006  (view change)

Labels

 
(None)

Table of Contents

AbstractMultiplexingBackingMapListener Class Listing
acceptor-config
access-controller
address-provider (cache)
allow-interfaces
allow-subclasses
Analyzing Reporter Content
async-store-manager
authorized-hosts
authorized-hosts
Automatically manage dynamic cluster membership

backup-storage
bdb-store-manager
Best Practices
Best Practices for Coherence Extend
Building Integratable Objects for .NET Clients
Integrating user data types
bundle-config
burst-mode

Cache Configuration Elements
Cache Configuration Elements (Full)
Cache Configuration Elements Reference
Cache Semantics
cache-config06
cache-mapping
cache-service-proxy
cachestore-scheme
Caching HTTP Sessions for WebLogic
caching-scheme-mapping
caching-schemes
callback-handler
class-name
class-scheme
Cluster Services Overview
Cluster your objects and your data
cluster-config
Clustering
coherence
Coherence Caching Terminology
Coherence Extend
Coherence Features by Edition
Command Line Setting Override Feature
Compression Filter Parameters
configurable-cache-factory-config
Configuration and Usage for .NET Clients
Configuration and Usage for C++ Clients
Configuring a Local Cache for .NET Clients
Configuring a Local Cache for C++ Clients
Configuring a Near Cache for .NET Clients
Configuring a Near Cache for C++ Clients
Configuring and Using Coherence Extend
Configuring Coherence for JPA
Configuring Coherence for TopLink Essentials
Configuring Custom MBeans
Constraints on Re-entrant Calls
Continuous Query Cache for .NET Clients
Create and Use Coherence Caches
custom-store-manager

Data Affinity
Death Detection
Defining a Data Grid
Deliver events for changes as they occur
Deliver events for changes as they occur (C++)
Deployment Considerations - AIX
Deployment Considerations - Oracle JRockit JVMs
Deployment Considerations - Cisco Switches
Deployment Considerations - Foundry Switches
Deployment Considerations - IBM BladeCenters
Deployment Considerations - IBM JVMs
Deployment Considerations - Linux
Deployment Considerations - OS X
Deployment Considerations - Solaris
Deployment Considerations - Sun JVMs
Deployment Considerations - Virtual Machines
Deployment Considerations - Windows
Deployment Considerations - z OS
disk-scheme
distributed-scheme
DistributedCache Service Parameters

Element Attributes
enabled
Evaluating Performance and Scalability
external-scheme

file-name
filters
flow-control

High Resolution Timesource (Linux)
host-range
How to create a custom report
How to Manage Coherence Using JMX
How to Manage Custom MBeans Within the Coherence Cluster
How to modify report batch
How to run a report on demand

Implement Transactions, Locks, and Concurrency
include
incoming-message-handler
init-param
init-param (cache)
init-param (operational)
init-params
init-params (cache)
init-params (operational)
initiator-config
Installation Introduction
Installing Coherence Web Session Management Module
Installing Oracle Coherence
Integrate CacheFactory with Spring
invocation-scheme
invocation-service-proxy
InvocationService Parameters

jms-acceptor
jms-initiator
JMX Reporter

key-associator
key-partitioning

lh-file-manager
license-config
listener
Local Cache
Local Storage
local-scheme
logging-config

Manage an Object Model
management-config
Managing Map Operations with Triggers
mbean
mbean-accessor
mbean-class
mbean-factory
mbean-name
mbean-query
mbeans
member-identity
multicast-listener

Near Cache
near-scheme
Network Filters
Network Filters for .NET Clients
Network Protocols
nio-file-manager
nio-memory-manager
notification-queueing

operation-bundling
Operational Configuration Elements
Operational Configuration Elements Reference
optimistic-scheme
outgoing-message-handler
outgoing-message-handler (cache)
outstanding-packets
overflow-scheme
Overview - Coherence for C++
Overview for Implementors

packet-buffer
packet-bundling
packet-delivery
packet-pool
packet-publisher
packet-size
packet-speaker
paged-external-scheme
param-type
param-value
Parameter Macros
Parameter Settings
Parameters
partition-listener
Partitioned Cache Service
pause-detection
Perform Continuous Query
Perform Continuous Query for C++ Clients
Performance Tuning
Performing a Datagram Test for Network Performance
Performing a Multicast Connectivity Test
PKCS Encryption Filter Parameters
POF User Type Configuration Elements
pof-config
Pre-Loading the Cache
Priority Tasks
Production Checklist
Provide a Data Grid
Provide a Queryable Data Fabric
proxy-config
proxy-scheme
ProxyService Parameters

Query the Cache
Query the Cache for C++ Clients

Read-Through, Write-Through, Write-Behind Caching and Refresh-Ahead
read-write-backing-map-scheme
Real Time Client - RTC
Recommended Reading
Remote Invocation Service for .NET Clients
Remote Invocation Service for C++ Clients
Remote Management NPE
remote-cache-scheme
remote-invocation-scheme
Replicated Cache Service
replicated-scheme
ReplicatedCache Service Parameters
report-config
report-list
Requirements, Installation and Deployment for Coherence for .NET
Requirements, Installation, and Deployment

Sample Applications for C++ Clients
Sample Bulk Loading Program and Output
Sample Cache Configurations
Sample CacheStores
Sample Code for the console Example
Sample Code for the contacts Example
Sample Code for the hellogrid Example
Sample Near Cache Configuration
Sample Web Application for .NET Clients
Sample Windows Forms Application for .NET Clients
Scaling Out Your Data Grid Aggregations Linearly
Security Framework
security-config
Serialization Paged Cache
serializer
services
Session Management for Clustered Applications
Setting Single Server Mode
shutdown-listener
socket-address
Solaris 10 Networking
Special Considerations Regarding Web Applications for .NET Clients
Special Considerations Regarding Windows Forms Applications for .NET Clients
Specifying a Custom Eviction Policy
Symmetric Encryption Filter Parameters

tangosol-license.xml
tangosol.coherence.management.report.autostart
tangosol.coherence.management.report.group
tcp-acceptor
tcp-initiator
tcp-ring-listener
The Coherence Ecosystem
traffic-jam
type-id
Types of Caches in Coherence

Understanding the Coherence C++ Object Model
Understanding the Coherence for C++ API
unicast-listener
user-type
user-type-list
Using Coherence as the Hibernate L2 Cache
Using Hibernate as a CacheStore for Coherence
Using the Coherence Web Installer Ant Task

version-persistent-scheme
version-transient-scheme
versioned-backing-map-scheme
versioned-near-scheme
volume-threshold

well-known-addresses


AbstractMultiplexingBackingMapListener Class Listing


Backing MapListener events are returned from replicated caches in readable Java format. However, backing MapListener events returned from distributed caches are in internal Coherence format. To return readable backing MapListener events from distributed caches, implement the AbstractMultiplexingBackingMapListener class.

The class provides an onBackingMapEvent method which you can override to specify how you would like the event returned.

The followiing is a code listing of the AbstractMultiplexingBackingMapListener class.

import com.tangosol.net.BackingMapManager;
import com.tangosol.net.BackingMapManagerContext;
import com.tangosol.net.cache.CacheEvent;
import com.tangosol.util.Binary;
import com.tangosol.util.ConverterCollections;
import com.tangosol.util.MapEvent;
import com.tangosol.util.MapListener;
import com.tangosol.util.MultiplexingMapListener;

/**
 * <p>The {@link AbstractMultiplexingBackingMapListener} provides a simplified 
 * base implementation for backing {@link MapListener}s that provide real objects in a map
 * event (in normal Java representation) rather than those that use the internal 
 * Coherence format (ie: {@link Binary}s.</p>
 * 
 * <p>Backing {@link MapListener}s are embeddable {@link MapListener}s that are 
 * injected into Coherence Cache members (storage-enabled) for the purpose of
 * handling events directly in-process of the primary partitions (of distributed schemes).</p>
 * 
 * <p>They are extremely useful for performing in-process processing of events within 
 * Coherence itself.</p>
 * 
 * @author Brian Oliver (brian.oliver@oracle.com)
 */
public abstract class AbstractMultiplexingBackingMapListener extends MultiplexingMapListener {
	
	/**
	 * <p>The possible causes of backing map events.</p>
	 */
	public enum Cause {
		/**
		 * <p><code>Regular</code> is for regular insert, updates and deletes.</p>
		 */
		Regular,	
		
		/**
		 * <p><code>Eviction</code> is for deletes that are due to cache
                   * eviction.</p>
		 */
		Eviction,
		
		/**
		 * <p><code>Distribution</code> is for insert or delete events due to
                   * coherence having 
		 * to repartition data due to changes in cluster membership.</p> 
		 */
		Distribution
	}
	
	
	/**
	 * <p>The {@link BackingMapManagerContext} that owns this listener.  
	 * (all Backing {@link MapListener}s require a {@link BackingMapManagerContext})</p>
	 */
	private BackingMapManagerContext context;
	
	
	/**
	 * <p>Standard Constructor</p>
	 * 
	 * <p>The {@link BackingMapManagerContext} will be injected by Coherence during
	 * initialization and construction of the {@link BackingMapManager}.</p>
	 * 
	 * @param context
	 */
	public AbstractMultiplexingBackingMapListener(BackingMapManagerContext context) {
		this.context = context;
	}
	
	
	/**
	 * <p>The {@link BackingMapManagerContext} in which the Backing {@link MapListener}
	 * is operating.</p>
	 * 
	 * @return {@link BackingMapManagerContext}
	 */
	public BackingMapManagerContext getContext() {
		return context;
	}
	
	
	/**
	 * <p>This is the standard {@link MultiplexingMapListener} event handler.  In here
	 * we convert the internally formatted event into something a developer would 
	 * expect if using a client-side {@link MapListener}.</p>
	 * 
	 * <p>After converting the internally formatted event, this method calls 
          * the abstract {@link #onBackingMapEvent(MapEvent, Cause)}
	 * method that may be used to handle the actual event.</p>
	 */
	protected final void onMapEvent(MapEvent mapEvent) {
		
		// convert the mapEvent (in internal format) into a real event 
                  // we can deal with
		MapEvent realMapEvent = ConverterCollections.getMapEvent(mapEvent.getMap(),  mapEvent,  context.getKeyFromInternalConverter(), context.getValueFromInternalConverter());

		//determine the underlying cause of the map event
		Cause cause;
		if (context.isKeyOwned(mapEvent.getKey())) {     
			cause = mapEvent instanceof CacheEvent && ((CacheEvent) mapEvent).isSynthetic() ? Cause.Eviction : Cause.Regular;
		} else {
			cause = Cause.Distribution;
		}
		
		// now call the abstract event handler with the real event 
                  // and underlying cause
		onBackingMapEvent(realMapEvent, cause);
	}
	
	
	/**
	 * <p>Override this method to handle real backing map events.</p>
	 * 
	 * @param mapEvent A standard mapEvent (in Java format)
	 * @param cause The underlying cause of the event
	 */
	abstract protected void onBackingMapEvent(MapEvent mapEvent, Cause cause);


acceptor-config


acceptor-config

Used in: proxy-scheme.

Description

The acceptor-config element specifies the configuration info for a protocol-specific connection acceptor used by a proxy service to enable Coherence*Extend clients to connect to the cluster and use the services offered by the cluster without having to join the cluster.

The acceptor-config element must contain exactly one protocol-specific connection acceptor configuration element (either jms-acceptor or tcp-acceptor).

Elements

The following table describes the elements you can define within the acceptor-config element.

Element Required/Optional Description
<jms-acceptor> Optional Specifies the configuration info for a connection acceptor that enables Coherence*Extend clients to connect to the cluster over JMS.
<tcp-acceptor> Optional Specifies the configuration info for a connection acceptor that enables Coherence*Extend clients to connect to the cluster over TCP/IP.
<outgoing-message-handler> Optional Specifies the configuration info used by the connection acceptor to detect dropped client-to-cluster connections.
<use-filters> Optional Contains the list of filter names to be used by this connection acceptor.

For example, specifying use-filter as follows
<use-filters>
    <filter-name>gzip</filter-name>
</use-filters>

will activate gzip compression for all network messages, which can help substantially with WAN and low-bandwidth networks.

<serializer> Optional Specifies the class configuration info for a com.tangosol.io.Serializer implementation used by the connection acceptor to serialize and deserialize user types.

For example, the following configures a ConfigurablePofContext that uses the my-pof-types.xml POF type configuration file to deserialize user types to and from a POF stream:
<serializer>
  <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
  <init-params>
    <init-param>
      <param-type>string</param-type>
      <param-value>my-pof-types.xml</param-value>
    </init-param>
  </init-params>
</serializer>
<connection-limit> Optional The maximum number of simultaneous connections allowed by this connection acceptor.

Valid values are positive integers and zero. A value of zero implies no limit.

Default value is zero.


access-controller


access-controller

Used in: security-config.

The following table describes the elements you can define within the access-controller element.

Element Required/Optional Description
<class-name> Required Specifies the name of a Java class that implements com.tangosol.net.security.AccessController interface, which will be used by the Coherence Security Framework to check access rights for clustered resources and encrypt/decrypt node-to-node communications regarding those rights.

Default value is com.tangosol.net.security.DefaultController.
<init-params> Optional Contains one or more initialization parameter(s) for a class that implements the AccessController interface.

For the default AccessController implementation the parameters are the paths to the key store file and permissions description file, specified as follows:
<init-params>
  <init-param id="1">
    <param-type>java.io.File</param-type>
    <param-value system-property="tangosol.coherence.security.keystore"></param-value>
  </init-param>
  <init-param id="2">
    <param-type>java.io.File</param-type>
    <param-value system-property="tangosol.coherence.security.permissions"></param-value>
  </init-param>
</init-params>



Preconfigured overrides based on the default AccessController implementation and the default parameters as specified above are tangosol.coherence.security.keystore and tangosol.coherence.security.permissions.

For more information on the elements you can define within the init-param element, refer to init-param.


address-provider (cache)


address-provider

Used in: tcp-initiator

Description

Contains the configuration info for an address factory that implements the com.tangosol.net.AddressProvider interface.

Elements

The following table describes the elements you can define within the address-provider element.

Element Required/Optional Description
<class-name> Required The name of a class that implements the com.tangosol.net.AddressProvider interface.
<class-factory-name> Optional Specifies a fully specified name of a Java class that will be used as a factory for object instantiation.
<method-name> Optional Specifies the name of a static factory method on the factory class which will perform object instantiation.
<init-params> Optional Specifies initialization parameters which are accessible by implementations which support the com.tangosol.run.xml.XmlConfigurable interface, or which include a public constructor with a matching signature.


allow-interfaces


allow-interfaces

Used in: <pof-config>

Description

The allow-interfaces element indicates whether the user-type class-name can specify Java interface types in addition to Java class types.

Valid values are "true" or "false". Default value is false.

Elements

Terminal element.


allow-subclasses


allow-subclasses

Used in: <pof-config>

Description

The allow-subclasses element indicates whether the user-type class-name can specify a Java class type that is abstract, and whether sub-classes of any specified user-type class-name will be permitted at runtime and automatically mapped to the specified super-class for purposes of obtaining a serializer.

Valid values are "true" or "false". Default value is false.

Elements

Terminal element.


Analyzing Reporter Content


Coherence provides out of the box information that helps Administrators and Developers better analyze usage and configuration issues that may occur.

The following is included:

Network Health

The Network Health report contains the primary aggregates for determining the health of the network communications. The network health file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-network-health.txt". For example 2009013113-network-health.txt would be created on January 1, 2009 at 1:00 pm.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Min Node Rx Success Double The minimum receiver success rate for a node in the cluster. If this value is considerably less (10%) than the Grid Rx Success rate. Further analysis using the Network Health Detail should be done.
Grid Rx Success Double The receiver success rate for the grid as a whole. If this value is below 90%. Further analysis of the network health detail should be done.
Min Node Tx Success Double The minimum publisher success rate for a node in the cluster. If this value is considerably less (10%) than the Grid Rx Success rate. Further analysis using the Network Health Detail should be done.
Grid TX Success Double The publisher success rate for the grid as a whole. If this value is below 90%. Further analysis of the network health detail should be done.

Network Health Detail

The Network Health report supporting node level details for determining the health of the network communications. The network health detail file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-network-health-detail.txt". For example 2009013114-network-health.txt would be created on January 1, 2009 at 2:00 pm.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Node Id Long The node for the network statistics.
Tx Success Double The publisher success rate for the node. If this value is with 2%-3% of the "Min Node Tx Success" and more than 10% less than the "Grid Tx Success" for the batch in the Network Health File, the corresponding node may be having difficulty communicating with the cluster. Constrained CPU, constrained network bandwidth or high network latency could cause this to occur.
RX Success Double The receiver success rate for the node. If this value is with 2%-3% of the "Min Node Rx Success" and more than 10% less than the "Grid Tx Success" for the batch in the Network Health File, the corresponding node may be having difficulty communicating with the cluster. Constrained CPU, constrained network bandwidth or high network latency could cause this to occur.
PacketsSent Double The total number of network packets sent by the node.
Current Packets Sent Long The number of packets sent by the node since the prior execution of the report.
PacketsResent Long The total number of network packets resent by the node. Packets will be resent when the receiver of the packet receives and invalid packet or when an acknowledge packet is not sent within the appropriate amount of time.
Current Packet Resent Long The number of network packets resent by the node since the prior execution of the report.
PacketsRepeated Long The total number of packets received more than once.
Current Packets Repeated Long The number of packets received since the last execution of the report.
PacketsReceived Long The total number of packets received by the node.
Current Packets Received Long The total number of packets received by the node since the last execution of the report.

Memory Status

The Memory status report must be run as part of a report batch. The values are helpful in understanding memory consumption on each node and across the grid. For data to be included nodes must be configured to publish platform MBean information. The memory status file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-memory-status.txt". For example 2009013115-memory-status.txt would be created on January 1, 2009 at 3 pm.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Node Id Long The node for the memory statistics.
Gc Name String The name of the Garbage Collector information.
CollectionCount Long The number of garbage collections that have happened since the virtual machine started.
Delta Collection Count Long The number of garbage collections that have occurred since the last execution of the report.
CollectTime Long The number of milliseconds the JVM has spent on garbage collection since the start of the JVM.
Delta Collect Time Long The number of milliseconds the JVM has spent on garbage collection since the last execution of the report.
Last GC Start Time Long The start time of the last Garbage Collection.
Last GC Stop Time Long The stop time of the last garbage collection.
Heap Committed Long The number of heap bytes committed at the time of report.
Heap Init Long The number of heap bytes initialized at the time of the report.
Heap Max Long The Maximum number of bytes used by the JVM since the start of the JVM.
Heap Used Long The bytes used by the JVM at the time of the report.

Cache Size

The cache size report can be executed either on demand or it can be added as part of the report batch and the Caches should have the <unit-calculator> set to BINARY. The cache size file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-cache-size.txt". For example 2009013101-cache-size.txt would be created on January 1, 2009 at 1:00 am.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Cache Name String The name of the cache.
MemoryMB Double The MB consumed by the objects in the cache. This does not include indexes or over head.
Avg Object Size Double The Average memory consumed by each object.
Cache Size Double The number of objects in the cache.
Memory Bytes Double The number of bytes consumed by the objects in the cache. This does not include indexes or over head.

Service Report

The service report provides information to the requests processed, request failures, and request backlog, tasks processed, task failures and task backlog. Request Count and Task Count are useful to determine performance and throughput of the service. RequestPendingCount and Task Backlog are useful in determining capacity issues or blocked processes. Task Hung Count, Task Timeout Count, Thread Abandoned Count, Request Timeout Count are the number of unsuccessful executions that have occurred in the system.

Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Service String The service name.
Node Id String The numeric node identifier.
Refresh Time Date The system time when the service information was updated from a remote node.
Request Count Long The number of requests since the last report execution.
RequestPendingCount Long The number of pending requests at the time of the report.
RequestPendingDuration Long The duration for the pending requests at the time of the report.
Request Timeout Count Long The number of request timeouts since the last report execution.
Task Count Long The number of tasks executed since the last report execution.
Task Backlog Long The task backlog at the time of the report execution.
Task Timeout Count Long The number of task timeouts since the last report execution.
Task Hung Count Long The number of tasks that hung since the last report execution.
Thread Abandoned Count Long The number of threads abandoned since the last report execution.

Node List

Due to the transient nature of the node identifier (nodeId), the reporter logs out a list of nodes and the user defined <member-identity> information. The node list file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-nodes.txt". For example 2009013101-nodes.txt would be created on January 1, 2009 at 1:00 am.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Node Id String The numeric node identifier.
UnicastAddress String The Unicast address for the node.
MemberName String The member name for the node.
ProcessName String The process name for the node.
RoleName String The role name for the node.
MachineName String The machine name for the node.
RackName String The rack name for the node.
SiteName String The site name for the node.
Refresh Time Date/Time The time which the information was refreshed from a remote node. If the time is not the same as the refresh time on other rows in the batch, the node did not respond in a timely matter. This is often caused by a node preforming a garbage collection. Any information regarding a node with an "old" refresh date is questionable.

Proxy Report

The proxy file provides information about proxy servers and the information being transferred to clients. The Proxy file is a tab delimited file that is prefixed with the date in YYYYMMDDHH format and post fixed with "-report-proxy.txt". For example 2009013101-report-proxy.txt would be created on January 1, 200901.

Column Type Description
Batch Counter Long A sequential counter to help integrate information between related files. This value does reset when the reporter restarts and is not consistent across nodes. However, it is helpful when trying to integrate files.
Report Time Date The system time when the report executed.
Node Id String The numeric node identifier.
Service Name String The name of the proxy service.
HostIp String The IP Address and Port of the proxy service.
ConnectionCount Long The current number of connections to the proxy service.
OutgoingByteBacklog Long The number of bytes queued to be sent by the proxy service.
OutgoingMessageBacklog Long The number of messages queued by the proxy service.
Bytes Sent Long The number of bytes sent by the proxy service since the last execution of the report.
Bytes Received Long The number of bytes received by the proxy service since the last execution of the report.
Messages Sent Long The number of messages sent by the proxy service since the last execution of the report.
Messages Received Long The number of messages received by the proxy service since the last execution of the report.


async-store-manager


async-store-manager

Used in: external-scheme, paged-external-scheme.

Description

The async-store-manager element adds asynchronous write capabilities to other store manager implementations.

Supported store managers include:

Implementation

This store manager is implemented by the com.tangosol.io.AsyncBinaryStoreManager class.

Elements

The following table describes the elements you can define within the async-store-manager element.

Element Required/Optional Description
<class-name> Optional Specifies a custom implementation of the async-store-manager.

Any custom implementation must extend the com.tangosol.io.AsyncBinaryStoreManager class and declare the exact same set of public constructors.
<init-params> Optional Specifies initialization parameters, for use in custom async-store-manager implementations which implement the com.tangosol.run.xml.XmlConfigurable interface.
<custom-store-manager> Optional Configures the external cache to use a custom storage manager implementation.
<bdb-store-manager> Optional Configures the external cache to use Berkeley Database JE on-disk databases for cache storage.
<lh-file-manager> Optional Configures the external cache to use a Coherence LH on-disk database for cache storage.
<nio-file-manager> Optional Configures the external cache to use a memory-mapped file for cache storage.
<nio-memory-manager> Optional Configures the external cache to use an off JVM heap, memory region for cache storage.
<async-limit> Optional Specifies the maximum number of bytes that will be queued to be written asynchronously. Setting the value to zero does not disable the asynchronous writes; instead, it indicates that the implementation default for the maximum number of bytes should be used.

The value of this element must be in the following format:
[\d]+[[.][\d]+]?[K|k|M|m]?[B|b]?

where the first non-digit (from left to right) indicates the factor with which the preceeding decimal value should be multiplied:

  • K (kilo, 210)
  • M (mega, 220)

If the value does not contain a factor, a factor of one is assumed.

Valid values are any positive memory sizes and zero.

Default value is 4MB.


authorized-hosts


authorized-hosts

Used in: cluster-config.

Description

If specified, restricts cluster membership to the cluster nodes specified in the collection of unicast addresses, or address range. The unicast address is the address value from the authorized cluster nodes' unicast-listener element. Any number of host-address and host-range elements may be specified.

Elements

The following table describes the elements you can define within the authorized-hosts element.

Element Required/Optional Description
<host-address> Optional Specifies an IP address or hostname. If any are specified, only hosts with specified host-addresses or within the specified host-ranges will be allowed to join the cluster.

The content override attributes id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.
<host-range> Optional Specifies a range of IP addresses. If any are specified, only hosts with specified host-addresses or within the specified host-ranges will be allowed to join the cluster.

The content override attributes id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.

The content override attributes xml-override and id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.


authorized-hosts


authorized-hosts

Used in: cluster-config.

Description

If specified, restricts cluster membership to the cluster nodes specified in the collection of unicast addresses, or address range. The unicast address is the address value from the authorized cluster nodes' unicast-listener element. Any number of host-address and host-range elements may be specified.

Elements

The following table describes the elements you can define within the authorized-hosts element.

Element Required/Optional Description
<host-address> Optional Specifies an IP address or hostname. If any are specified, only hosts with specified host-addresses or within the specified host-ranges will be allowed to join the cluster.

The content override attributes id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.
<host-range> Optional Specifies a range of IP addresses. If any are specified, only hosts with specified host-addresses or within the specified host-ranges will be allowed to join the cluster.

The content override attributes id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.

The content override attributes xml-override and id can be optionally used to fully or partially override the contents of this element with XML document that is external to the base document.


Automatically manage dynamic cluster membership


Coherence manages cluster membership, automatically adding new servers to the cluster when they start up and automatically detecting their departure when they are shut down or fail. Applications have full access to this information, and can sign up to receive event notifications when members join and leave the cluster. Coherence also tracks all the services that each member is providing and consuming, and uses this information to plan for service resiliency in case of server failure, and to load-balance data management and other responsibilities across all members of the cluster.

This section contains the following information:

Cluster and Service objects

From any cache, the application can obtain a reference to the local representation of a cache's service. From any service, the application can obtain a reference to the local representation of the cluster.

CacheService service = cache.getCacheService();
Cluster      cluster = service.getCluster();

From the Cluster object, the application can determine the set of services that are running in the cluster:

for (Enumeration enum = cluster.getServiceNames(); enum.hasMoreElements(); )
    {
    String sName = (String) enum.nextElement();
    ServiceInfo info = cluster.getServiceInfo(sName);
    // ...
    }

The ServiceInfo object provides information about the service, including its name, type, version and membership.

For more information on this feature, see the API documentation for NamedCache, CacheService, Service, ServiceInfo and Cluster.

Member object

The primary information that an application can determine about each member in the cluster is:

  • The Member's IP address
  • What date/time the Member joined the cluster

As an example, if there are four servers in the cluster with each server running one copy ("instance") of the application and all four instances of the application are clustered together, then the cluster is composed of four Members. From the Cluster object, the application can determine what the local Member is:

Member memberThis = cluster.getLocalMember();

From the Cluster object, the application can also determine the entire set of cluster members:

Set setMembers = cluster.getMemberSet();

From the ServiceInfo object, the application can determine the set of cluster members that are participating in that service:

ServiceInfo info = cluster.getServiceInfo(sName);
Set setMembers = info.getMemberSet();

For more information on this feature, see the [API documentation for Member.

Listener interface and Event object

To listen to cluster and/or service membership changes, the application places a listener on the desired Service. As discussed before, the Service can come from a cache:

Service service = cache.getCacheService();

The Service can also be looked up by its name:

Service service = cluster.getService(sName);

To receive membership events, the application implements a MemberListener. For example, the following listener example prints out all the membership events that it receives:

public class MemberEventPrinter
        extends Base
        implements MemberListener
    {
    public void memberJoined(MemberEvent evt)
        {
        out(evt);
        }

    public void memberLeaving(MemberEvent evt)
        {
        out(evt);
        }

    public void memberLeft(MemberEvent evt)
        {
        out(evt);
        }
    }

The MemberEvent object carries information about the event type (joined / leaving / left), the member that generated the event, and the service that acts as the source of the event. Additionally, the event provides a method, isLocal(), that indicates to the application that it is this member that is joining or leaving the cluster. This is useful for recognizing soft restarts in which an application automatically rejoins a cluster after a failure occurs. For example:

public class RejoinEventPrinter
        extends Base
        implements MemberListener
    {
    public void memberJoined(MemberEvent evt)
        {
        if (evt.isLocal())
            {
            out("this member just rejoined the cluster: " + evt);
            }
        }

    public void memberLeaving(MemberEvent evt)
        {
        }

    public void memberLeft(MemberEvent evt)
        {
        }
    }

For more information on these feature, see the [API documentation for Service, MemberListener and MemberEvent.


backup-storage


backup-storage

Used in: distributed-scheme.

Description

The backup-storage element specifies the type and configuration of backup storage for a partitioned cache.

Elements

The following table describes the elements you can define within the backup-storage element.

Element Required/Optional Description
<type> Required Specifies the type of the storage used to hold the backup data.

Legal values are:

Default value is the value specified in the tangosol-coherence.xml descriptor.

<initial-size> Optional Only applicable with the off-heap and file-mapped types.
Specifies the initial buffer size in bytes.

The value of this element must be in the following format:
[\d]+[[.][\d]]?[K|k|M|m|G|g]?[B|b]?

where the first non-digit (from left to right) indicates the factor with which the preceding decimal value should be multiplied:

  • K or k (kilo, 210)
  • M or m (mega, 220)
  • G or g (giga, 230)

If the value does not contain a factor, a factor of mega is assumed.

Legal values are positive integers between 1 and Integer.MAX_VALUE - 1023 (that is, 2,147,482,624 bytes).

Default value is the value specified in the tangosol-coherence.xml descriptor.

<maximum-size> Optional Only applicable with the off-heap and file-mapped types.
Specifies the initial buffer size in bytes.

The value of this element must be in the following format:
[\d]+[[.][\d]]?[K|k|M|m|G|g]?[B|b]?

where the first non-digit (from left to right) indicates the factor with which the preceding decimal value should be multiplied:

  • K or k (kilo, 210)
  • M or m (mega, 220)
  • G or g (giga, 230)

If the value does not contain a factor, a factor of mega is assumed.

Legal values are positive integers between 1 and Integer.MAX_VALUE - 1023 (that is, 2,147,482,624 bytes).

Default value is the value specified in the tangosol-coherence.xml descriptor.

<directory> Optional Only applicable with the file-mapped type.

Specifies the path name for the directory that the disk persistence manager ( com.tangosol.util.nio.MappedBufferManager) will use as "root" to store files in. If not specified or specifies a non-existent directory, a temporary file in the default location is used.

Default value is the value specified in the tangosol-coherence.xml descriptor.
<class-name> Optional Only applicable with the custom type.

Specifies a class name for the custom storage implementation. If the class implements com.tangosol.run.xml.XmlConfigurable interface then upon construction the setConfig method is called passing the entire backup-storage element.

Default value is the value specified in the tangosol-coherence.xml descriptor.
<scheme-name> Optional Only applicable with the scheme type.

Specifies a scheme name for the ConfigurableCacheFactory.

Default value is the value specified in the tangosol-coherence.xml descriptor.


bdb-store-manager


bdb-store-manager

Used in: external-scheme, paged-external-scheme, async-store-manager.

Berkeley Database JE Java class libraries are required to utilize a bdb-store-manager, visit the Berkeley Database JE product page for additional information.

Description

The BDB store manager is used to define external caches which will use Berkeley Database JE on-disk embedded databases for storage. See the persistent disk cache and overflow cache samples for examples of Berkeley based store configurations.

Implementation

This store manager is implemented by the com.tangosol.io.bdb.BerkeleyDBBinaryStoreManager class, and produces BinaryStore objects implemened by the com.tangosol.io.bdb.BerkeleyDBBinaryStore class.

Elements

The following table describes the elements you can define within the bdb-store-manager element.

Element Required/Optional Description
<class-name> Optional Specifies a custom implementation of the Berkeley Database BinaryStoreManager.

Any custom implementation must extend the com.tangosol.io.bdb.BerkeleyDBBinaryStoreManager class and declare the exact same set of public constructors.
<init-params> Optional Specifies additional Berkeley DB configuration settings. See Berkeley DB Configuration.

Also used to specify initialization parameters, for use in custom implementations which implement the com.tangosol.run.xml.XmlConfigurable interface.
<directory> Optional Specifies the pathname for the root directory that the Berkeley Database JE store manager will use to store files in. If not specified or specifies a non-existent directory, a temporary directory in the default location will be used.
<store-name> Optional Specifies the name for a database table that the Berkely Database JE store manager will use to store data in. Specifying this parameter will cause the bdb-store-manager to use non-temporary (persistent) database instances. This is intended only for local caches that are backed by a cache loader from a non-temporary store, so that the local cache can be pre-populated from the disk on startup. When specified it is recommended that it utilize the {cache-name} macro.

Normally this parameter should be left unspecified, indicating that temporary storage is to be used.


Best Practices


Coherence supports several cache topologies. This section contains the following information:

Coherence and Cache Topologies

Coherence supports several cache topologies, but the replicated, partitioned, and near options will satisfy the vast majority of use cases. All are fully coherent and support cluster-wide locking and transactions:

  • Replicated - Each machine contains a full copy of the dataset. Read access is instantaneous.
  • Partitioned (or Distributed) - Each machine contains a unique partition of the dataset. Adding machines to the cluster will increase the capacity of the cache. Both read and write access involve network transfer and serialization/deserialization.
  • Near - Each machine contains a small local cache which is synchronized with a larger Partitioned cache, optimizing read performance. There is some overhead involved with synchronizing the caches.

Data Access Patterns

Data access distribution (hot spots)

When caching a large dataset, typically a small portion of that dataset will be responsible for most data accesses. For example, in a 1000 object dataset, 80% of operations may be be against a 100 object subset. The remaining 20% of operations may be against the other 900 objects. Obviously the most effective return on investment will be gained by caching the 100 most active objects; caching the remaining 900 objects will provide 25% more effective caching while requiring a 900% increase in resources.

On the other hand, if every object is accessed equally often (for example in sequential scans of the dataset), then caching will require more resources for the same level of effectiveness. In this case, achieving 80% cache effectiveness would require caching 80% of the dataset versus 10%. (Note that sequential scans of partially cached data sets will generally defeat MRU, LFU and MRU-LFU eviction policies). In practice, almost all non-synthetic (benchmark) data access patterns are uneven, and will respond well to caching subsets of data.

In cases where a subset of data is active, and a smaller subset is particularly active, Near caching can be very beneficial when used with the "all" invalidation strategy (this is effectively a two-tier extension of the above rules).

Cluster-node affinity

Coherence's Near cache technology will transparently take advantage of cluster-node affinity, especially when used with the "present" invalidation strategy. This topology is particularly useful when used in conjunction with a sticky load-balancer. Note that the "present" invalidation strategy results in higher overhead (as opposed to "all") when the front portion of the cache is "thrashed" (very short lifespan of cache entries); this is due to the higher overhead of adding/removing key-level event listeners. In general, a cache should be tuned to avoid thrashing and so this is usually not an issue.

Read-write ratio and data sizes

Generally speaking, the following cache topologies are best for the following use cases:

  • Replicated cache - small amounts of read-heavy data (e.g. metadata)
  • Partitioned cache - large amounts of read-write data (e.g. large data caches)
  • Near cache - similar to Partitioned, but has further benefits from read-heavy tiered access patterns (e.g. large data caches with hotspots) and "sticky" data access (e.g. sticky HTTP session data). Depending on the synchronization method (expiry, asynchronous, synchronous), the worst case performance may range from similar to a Partitioned cache to considerably worse.

Interleaving

Interleaving refers to the number of cache reads between each cache write. The Partitioned cache is not affected by interleaving (as it is designed for 1:1 interleaving). The Replicated and Near caches by contrast are optimized for read-heavy caching, and prefer a read-heavy interleave (e.g. 10 reads between every write). This is because they both locally cache data for subsequent read access. Writes to the cache will force these locally cached items to be refreshed, a comparatively expensive process (relative to the near-zero cost of fetching an object off the local memory heap). Note that with the Near cache technology, worst-case performance is still similar to the Partitioned cache; the loss of performance is relative to best-case scenarios.

Note that interleaving is related to read-write ratios, but only indirectly. For example, a Near cache with a 1:1 read-write ratio may be extremely fast (all writes followed by all reads) or much slower (1:1 interleave, write-read-write-read...).

Heap Size Considerations

Using several small heaps

For large datasets, Partitioned or Near caches are recommended. As the scalability of the Partitioned cache is linear for both reading and writing, varying the number of Coherence JVMs will not significantly affect cache performance. On the other hand, JVM memory management routines show worse than linear scalability. For example, increasing JVM heap size from 512MB to 2GB may substantially increase garbage collection (GC) overhead and pauses.

For this reason, it is common to use multiple Coherence instances per physical machine. As a general rule of thumb, current JVM technology works well up to 512MB heap sizes. Thererfore, using a number of 512MB Coherence instances will provide optimal performance without a great deal of JVM configuration or tuning.

For performance-sensitive applications, experimentation may provide better tuning. When considering heap size, it is important to find the right balance. The lower bound is determined by per-JVM overhead (and also, manageability of a potentially large number of JVMs). For example, if there is a fixed overhead of 100MB for infrastructure software (e.g. JMX agents, connection pools, internal JVM structures), then the use of JVMs with 256MB heap sizes will result in close to 40% overhead for non-cache data. The upper bound on JVM heap size is governed b