Partition Methods

You can codify a partitioning scheme for instances of a partitioned class by defining a partition method. Partition methods have two main usage contexts, as follows.

In the first case, you can reimplement the autoPartitionIndex method defined in the Object class. If it is not reimplemented and the partition index has not been explicitly set when an object is created, the object is located in the default (latest) partition. In the second case, the name of the partition method is optionally specified for the MakePartitioned operation carried out by the JADE Database Administration utility (jdbadmin). If no method is specified, the MakePartitioned operation invokes the autoPartitionIndex method.

A partition method enables you to implement partitioning algorithms based on the values of one or more attributes of the object being created.

Two common single-attribute partitioning strategies are:

With list partitioning, there is a one-to-one correspondence between an attribute value and a partition. An example might be partitioning sales by region, where the region attribute determines the partition.

With range partitioning, a range of values are mapped to a partition. A simple example might be to use the month part of a date or timestamp attribute to map sales data to one of 12 monthly sales partitions.

The partition method is evaluated during the execution of the commitTransaction instruction for each object created in the transaction with a zero partition index. When the returned value is outside the partition modulus range, an exception is raised.

Changes to the property values used in a partition method that occur after the creating transaction commits do not trigger the partition method or cause the object to be relocated.

For more details about partition methods, see "partitionMethod Option", in Chapter 1.