hazelcast/hazelcast — pull request #1030 by grantlittle (2013-10-24 22:38:54+00:00)
Title: Cut of a TopologyAwareMemberGroupFactory for review

I've worked a fair bit in Oracle Coherence and one of the things that would stop me moving to Hazelcast at the enterprise level is a way to have the backup partition on a different site/rack/host/node based on the existing topology the cluster is running on. So if there are different sites then the backup node should be in another data centre, if there is only one datacenter but multiple racks in that datacenter the the data should be backed up to a different rack etc.

From what I can see this is possible with custom group partitions, however this appears to be mainly IP address based and makes it awkward to configure for different environments.

This is the a pull request for those changes. This is the first time I've really looked at the Hazelcast code base in any real way so please excuse me it this isn't the right way to do it!

What I've done is fairly similar to what happens in Coherence. System properties are defined for the site, rack and potentially process identifiers. I've also created a static process identifier factory that can be used to get the UUID of that process if a system property isn't available.

So when starting the each JVM you could (but not required) declare the following:

hazelcast.address.site
hazelcast.address.rack
hazelcast.address.process

In the config you then set the partition group type to TOPOLOGY_AWARE

The factory will group members in the same site, then rack, then host and finally node if all of the members are on the same host.

I'm not sure if this is the right way to do it as I'm not that familiar with the code, but I'm wondering what sort of appetite there is to include something like this?

Specifically I'm not sure what you guys define as an "Address", ie is this a specific class to represent a simple network address or can it represent more than that. If it is the former then maybe the changes for rack, site etc belong in something like the Member/MemberInfo classes.

As I say I'm new to the project code base so some guidance there would be good.