Book Image

Getting Started with Hazelcast, Second Edition

By : Matthew Johns
Book Image

Getting Started with Hazelcast, Second Edition

By: Matthew Johns

Overview of this book

Table of Contents (19 chapters)
Getting Started with Hazelcast Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

What happens when we reach our limits?


As large as we might be able to scale a cluster to handle the ever-growing datasets, it is quite possible that we will want to configure a map so that it features a specific behavior. The things that we can customize are the number of backup counts and types, limits on how big a particular map can grow, plus what we can do when we reach that limit, and the defining of a default lifespan for the entries. We can use the hazelcast.xml configuration to define this behavior for all the maps or for an individual one. Now, we can copy the configuration from the unpacked download bin/hazelcast.xml to our working directory, which should be on the Java classpath, and add a custom configuration for the capitals map, as follows:

<map name="capitals">

  <max-size policy="PER_NODE">10</max-size>
  <eviction-policy>LFU</eviction-policy>
  <eviction-percentage>20</eviction-percentage>

  <backup-count>1</backup-count...