Class RangePartitioningPolicy

  • All Implemented Interfaces:

    public class RangePartitioningPolicy
    extends FieldPartitioningPolicy
    PUBLIC: RangePartitioningPolicy partitions access to a database cluster by a field value from the object, such as the object's id, location, or tenant. Each server is assigned a range of values. All write or read request for object's with that value are sent to the server. If a query does not include the field as a parameter, then it can either be sent to all server's and unioned, or left to the sesion's default behavior.
    See Also:
    Serialized Form
    James Sutherland
    EclipseLink 2.2
    • Constructor Detail

      • RangePartitioningPolicy

        public RangePartitioningPolicy()
      • RangePartitioningPolicy

        public RangePartitioningPolicy​(java.lang.String partitionField)
      • RangePartitioningPolicy

        public RangePartitioningPolicy​(java.lang.String partitionField,
                                       boolean unionUnpartitionableQueries)
      • RangePartitioningPolicy

        public RangePartitioningPolicy​(java.lang.String partitionField,
                                       RangePartition... partitions)
    • Method Detail

      • convertClassNamesToClasses

        public void convertClassNamesToClasses​(java.lang.ClassLoader classLoader)
        INTERNAL: Convert all the class-name-based settings to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.
        convertClassNamesToClasses in class PartitioningPolicy
      • getPartitions

        public java.util.List<RangePartition> getPartitions()
        PUBLIC: Return the range partitions. Each partition represents a range of value to route to a connection pool. Range values should not overlap.
      • setPartitions

        public void setPartitions​(java.util.List<RangePartition> partitions)
        PUBLIC: Set the range partitions. Each partition represents a range of value to route to a connection pool. Range values should not overlap.
      • addPartition

        public void addPartition​(java.lang.String connectionPool,
                                 java.lang.Comparable startValue,
                                 java.lang.Comparable endValue)
        PUBLIC: Add the range partition.
      • addPartition

        public void addPartition​(RangePartition partition)
        PUBLIC: Add the range partition.
      • getConnectionsForQuery

        public java.util.List<org.eclipse.persistence.internal.databaseaccess.Accessor> getConnectionsForQuery​(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                                                                               DatabaseQuery query,
                                                                                                               org.eclipse.persistence.internal.sessions.AbstractRecord arguments)
        INTERNAL: Get a connection from one of the pools in a round robin rotation fashion.
        Specified by:
        getConnectionsForQuery in class PartitioningPolicy
      • partitionPersist

        public void partitionPersist​(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                     java.lang.Object object,
                                     ClassDescriptor descriptor)
        INTERNAL: Allow for the persist call to assign the partition.
        partitionPersist in class PartitioningPolicy