Reader small image

You're reading from  Getting Started with Hazelcast

Product typeBook
Published inAug 2013
Reading LevelBeginner
Publisher
ISBN-139781782167303
Edition1st Edition
Languages
Right arrow
Author (1)
Matthew Johns
Matthew Johns
author image
Matthew Johns

contacted on 6 may '16 ________ Matthew Johns is an agile software engineer and hands-on technical/solution architect; specialising in designing and delivering highly scaled and available distributed systems, with broad experience across the whole stack. He is the solution architect and lead engineer at Sky.
Read more about Matthew Johns

Right arrow

Programmatic configuration


As we saw within the book, it is also possible to configure Hazelcast programmatically, this can provide for a higher application control of the cluster.

Set general properties

Config conf = new Config();
 conf.setProperty("hazelcast.map.partition.count", "271");

Set instance name

conf.setInstanceName("my-instance");

Set as lite member

conf.setLiteMember(true);

Get reference to map configuration

MapConfig citiesConf = conf.getMapConfig("cities");

Modify default behavior

citiesConf.setBackupCount(2);
citiesConf.setAsyncBackupCount(1);

Add map index

citiesConf.addMapIndexConfig(
  new MapIndexConfig("country", false));
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Getting Started with Hazelcast
Published in: Aug 2013Publisher: ISBN-13: 9781782167303

Author (1)

author image
Matthew Johns

contacted on 6 may '16 ________ Matthew Johns is an agile software engineer and hands-on technical/solution architect; specialising in designing and delivering highly scaled and available distributed systems, with broad experience across the whole stack. He is the solution architect and lead engineer at Sky.
Read more about Matthew Johns