|
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 PartitionKey
Specifies a single attribute to use to calculate the partition hash code.
(Note: this annotation is currently only used when eXtreme scale data format (XDF) is enabled)
The @PartitionKey annotation can be specified for the class using a path
syntax to identify a single attribute. Multiple attributes can be specified using
additional @PartitionKey annotations on each field, using the order()
attribute
to specify the order in which the hash codes will be calculated.
The PartitionKey is not inheritable.
Use thePartitionKeys
annotation
to specify more complex attribute combinations at the class level.
The following examples illustrate how to identify a top-level, primitive field:
Simple class annotation example:
@PartitionKey("deptId") class Employee { int empId; int deptId; }Simple field annotation example:
class Employee { int empId; @PartitionKey int deptId; }Simple, multiple field annotation example:
class Employee { int empId; @PartitionKey(order=0) int deptId; @PartitionKey(order=1) String country; }The following examples illustrate how to address an attribute inside an embedded class. In this case, the path separator is defined in the data grid as a "." character:
@PartitionKey("deptKey.id") class Employee { DepartmentKey deptKey; } class DepartmentKey { int id; }Embedded field annotation example:
class Employee { @PartitionKey("id") DepartmentKey deptKey; } class DepartmentKey { int id; }
Optional Element Summary | |
---|---|
short |
order
Order of the fields that contribute to the partition calculation. |
String |
value
Identifies the path to the attribute that should be included as part of the partition key. |
public abstract String value
public abstract short order
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |