hazelcast/hazelcast — pull request #4098 by juan-palacios (2014-11-17 07:05:14+00:00)
Title: Member capabilities

This PR introduces the concept of member Capability. It defines the `PARTITION_HOST` capability. The `InternalPartitionServiceImpl` attempts to only use members with said capability when putting together member groups. Members attempting to change their capabilities send a `MemberCapabilityUpdateRequestOperation` to the master which decides if the update is accepted, and sends a `MemberCapabilityChangedOperation` to the other nodes.

Currently the `ClusterServiceImpl` in the master tries to always keep at least one member with the `PARTITION_HOST` capability. In the event that no `PARTITION_HOST` members are left (e.g.: if the only remaining one disconnects), the master takes ownership of all partitions.

A node joining the cluster can set its initial capabilities through the `Config` instance. A node leaving the cluster can request that all partitions be drained by calling `PartitionService.drain()` and providing a timeout.