Data Partitioning

The PartitioningPolicy field in ClassDescriptor, AbstractSession, and DatabaseQuery is used to define a partition policy.

A partition policy is settable on a mapping, which sets it on each of the mapping's queries.

The different kinds of policies are:

RoundRobinPolicy - Cycles through a list of connection pools to distribute the load evenly. There is an option to load balance read queries only and an option to replicate write queries.

RangePartitionPolicy - Maps a query parameter name to a node, based on its value and a set of ranges. If the query does not define the parameter, the policy either uses the session default behavior or, based on the XXXXXXX option setting, sends the query to all pools and unions the result.

ValuePartitionPolicy - Behaves the same as the range policy, but maps value to a pool instead of a range. It also defines a default pool to use for any unmapped values.

HashPartitionPolicy - Hashes the parameter value into a list of connection pools.

ReplicationPolicy - Sends write queries to a set of connection pools.

UnionPartitionPolicy - Sends read queries to a set of connection pools and has an option to replicate wrties.