Contents

Preface
1 Introduction
 1.1 About This Book
 1.2 About the product
 1.3 Testing
2 Integration Recipes
 2.1 Introduction
 2.2 Write Your Own Main Class
 2.3 Build a CacheFactory with Spring Framework
  2.3.1 Ordered Hierarchy of Application Contexts
  2.3.2 Preventing Premature Cluster Startup
  2.3.3 Waiting for Cluster Startup to Complete
  2.3.4 Application Context in a Class Scheme
  2.3.5 Putting it Together: the Main Class
  2.3.6 Avoid Static CacheFactory Methods
  2.3.7 Rewiring Deserialised Objects
  2.3.8 Using Spring with Littlegrid
  2.3.9 Other Strategies
 2.4 Linking Spring and Coherence JMX Support
 2.5 Using Maven Repositories
  2.5.1 Install and Extract Jars
  2.5.2 Applying Oracle Patches
  2.5.3 Remove Default Configuration
  2.5.4 Select Maven Co-ordinates
3 Serialisation
 3.1 Introduction
 3.2 Tips and Tricks with POF
  3.2.1 Use Uniform Collections
  3.2.2 Put Often Used Fields First
  3.2.3 Define Common Extractors as Static Member Variables
  3.2.4 Determining Serialised Object Sizes
 3.3 Testing POF Serialisation
 3.4 Polymorphic Caches
  3.4.1 Value Objects of Different Types
  3.4.2 Value Objects with Properties of Different Types
 3.5 Codecs
  3.5.1 Serialiser Codec
  3.5.2 Serialise Enum by Ordinal
  3.5.3 Enforcing Collection Type
 3.6 Testing Evolvable
  3.6.1 Testing with binary serialised data
  3.6.2 Testing with Duplicated Classes
  3.6.3 Classloader-based Testing
 3.7 Implementing Custom Serialisation
  3.7.1 Setup
  3.7.2 A Coherence Serialiser for Google Protocol Buffers
  3.7.3 Custom Serialisation and EntryExtractor
 3.8 Avoiding Deserialisation
  3.8.1 Tracking Deserialisation While Testing
  3.8.2 Avoid Reflection Filters
  3.8.3 Consider Member Failure
4 Queries
 4.1 Introduction
  4.1.1 Useful Idioms
 4.2 Projection Queries
  4.2.1 Projection Queries
  4.2.2 Covered Indexes
  4.2.3 DeserializationAccelerator
 4.3 Conditional Indexes
  4.3.1 Conditional Index on a Polymorphic Cache
 4.4 Querying Collections
  4.4.1 A Collection Element Extractor
  4.4.2 A POF Collection Extractor
  4.4.3 Querying With The Collection Extractor
  4.4.4 Derived Values
 4.5 Custom Indexes
  4.5.1 IndexAwareFilter on a SimpleMapIndex
  4.5.2 A Custom Index Implementation
  4.5.3 Further Reading
5 Grid Processing
 5.1 Introduction
  5.1.1 EntryAggregator vs EntryProcessor
  5.1.2 Useful Idioms
 5.2 Void EntryProcessor
 5.3 Keeping the Service Guardian Happy
 5.4 Writing a custom aggregator
 5.5 Exceptions in EntryProcessors
  5.5.1 Setting up the examples
  5.5.2 Exception When Invoking with a Filter
  5.5.3 Exception When Invoking with a Set of Keys
  5.5.4 When Many Exceptions Are Thrown
  5.5.5 How To Manage Exceptions in an EntryProcessor
  5.5.6 Return Exceptions
  5.5.7 Invoking Per Partition
  5.5.8 Use an AsynchronousProcessor
 5.6 Using Invocation Service on All Partitions
  5.6.1 Create the Invocable
  5.6.2 Test setup
  5.6.3 A Sunny Day Test
  5.6.4 Testing Member Failure During Invocation
  5.6.5 Other Variations
 5.7 Working With Many Caches
  5.7.1 Referencing Another Cache From an EntryProcessor
  5.7.2 Partition-Local Atomic Operations
  5.7.3 Updating Many Entries
  5.7.4 Backing Map Queries
  5.7.5 Backing Map Deadlocks
 5.8 Joins
  5.8.1 Many-to-One Joins
  5.8.2 One-to-Many Joins
  5.8.3 Join Using a ValueExtractor
  5.8.4 Joins Without Key Affinity
  5.8.5 Further Reading
6 Persistence
 6.1 Introduction
  6.1.1 Expiry and Eviction
  6.1.2 Thread Model
  6.1.3 Read-Through and Write-Through
  6.1.4 Read-Ahead
  6.1.5 Write-Behind
  6.1.6 Consistency Model
 6.2 A JDBC CacheStore
  6.2.1 The Example Table
  6.2.2 Loading
  6.2.3 Erasing
  6.2.4 Updating
  6.2.5 Testing with JDBC and Littlegrid
 6.3 A Controllable Cache Store
  6.3.1 Using Invocation
  6.3.2 Wiring the Invocable with Spring
  6.3.3 Using A Control Cache
  6.3.4 Wiring the CacheStore with Spring
  6.3.5 Decorated Values Anti-pattern
 6.4 Error Handling in a CacheStore
  6.4.1 Mitigating CacheStore Failure Problems
  6.4.2 Handling Exceptions In A CacheStore
  6.4.3 Notes on Categorising Exceptions
  6.4.4 Limiting the Number of Retries
 6.5 Priming Caches
  6.5.1 Mapping Keys to Partitions
  6.5.2 Testing the Prime
  6.5.3 Increasing Parallelism
  6.5.4 Ensuring All Partitions Are Loaded
  6.5.5 Interaction With CacheStore and CacheLoader
 6.6 Persist Without Deserialising
  6.6.1 Binary Key And Value
  6.6.2 Character Encoded Keys
7 Events
 7.1 Introduction
  7.1.1 A Coherence Event Taxonomy
 7.2 Have I Lost Data?
  7.2.1 A Lost Partition Listener
 7.3 Event Storms
 7.4 Transactional Persistence
  7.4.1 Synchronous or Asynchronous operation
  7.4.2 Implementation
  7.4.3 Catching Side-effects
  7.4.4 Database Contention
 7.5 Singleton Service
  7.5.1 MemberListener
  7.5.2 Instantiating the Service
  7.5.3 The Leaving Member
8 Configuration
 8.1 Introduction
  8.1.1 Operating System
  8.1.2 Hardware Considerations
  8.1.3 Virtualisation
  8.1.4 Breaking These Rules
 8.2 Cache Configuration Best Practices
  8.2.1 Avoid Wildcard Cache Names
  8.2.2 User-defined Macros in Cache Configuration
  8.2.3 Avoid Unnecessary Service Proliferation
  8.2.4 Separate Service Definitions and Cache Templates
  8.2.5 Minimise Duplication in Configuration for Different Roles
  8.2.6 Service Parameters
  8.2.7 Partitioned backing map
  8.2.8 Overflow Scheme
  8.2.9 Beware of large high-units settings
 8.3 Operational Configuration Best Practice
  8.3.1 Use the Same Operational Configuration In All Environments
  8.3.2 Service Guardian Configuration
  8.3.3 Specify Authorised Hosts
  8.3.4 Use Unique Multicast Addresses
 8.4 Validate Configuration With A NameSpaceHandler
 8.5 NUMA
 8.6 Eliminate Swapping
  8.6.1 Mitigation Strategies
  8.6.2 Prevention Strategy
A Dependencies
B Additional Resources