|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={TYPE,FIELD}) @Retention(value=RUNTIME) public @interface PartitionKeys
Specifies one or more attributes that identify the portion of the key to calculate the partition hash code.
(Note: this annotation is currently only used when eXtreme scale data format (XDF) is enabled)
If this annotation is applied to a class, the order in which the partition hashCode is calculated is determined
by the order the PartitionKey annotations are defined. The order can be overridden using the
order attribute in the PartitionKey annotation.
The @PartitionKey annotation can be specified for the class using a path
syntax to identify all of the fields that are part of the partitioning key or
by individually identifying the fields within the class definition.
The PartitionKey is not inheritable.
The following examples illustrate how to identify a top-level, primitive field:@PartitionKeys({@PartitionKey("deptId"), @PartitionKey("addr/country")}) class Employee { int deptId; Address addr; } class Address { String city; String country; }Class annotation example with explicit ordering:
@PartitionKeys( {@PartitionKey(value="deptId", order=0), @PartitionKey(value="addr/country", order=1)}) class Employee { int deptId; Address addr; } class Address { String city; String country; }Field annotation example with explicit ordering:
class Employee { @PartitionKey(order = 0) int deptId; @PartitionKey(value="country", order = 0) Address addr; } class Address { String city; String country; }Field annotation example with explicit ordering:
class Employee { @PartitionKey(order = 0) int deptId; @PartitionKeys({ @PartitionKey(value = "state", order = 1), @PartitionKey(value = "country", order = 2) }) Address addr; } class Address { String city; String state; String country; }
Optional Element Summary | |
---|---|
PartitionKey[] |
value
One or more partition key attributes. |
public abstract PartitionKey[] value
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |