Class HashPartitioningPolicy

  • All Implemented Interfaces:
    Serializable

    public class HashPartitioningPolicy
    extends FieldPartitioningPolicy
    PUBLIC: HashPartitioningPolicy partitions access to a database cluster by the hash of a field value from the object, such as the object's location, or tenant. The hash indexes into the list of connection pools. All write or read request for objects with that hash 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 servers and unioned, or left to the session's default behavior.
    Since:
    EclipseLink 2.2
    Author:
    James Sutherland
    See Also:
    Serialized Form
    • Field Detail

      • connectionPools

        protected List<String> connectionPools
    • Constructor Detail

      • HashPartitioningPolicy

        public HashPartitioningPolicy()
      • HashPartitioningPolicy

        public HashPartitioningPolicy​(String partitionField)
      • HashPartitioningPolicy

        public HashPartitioningPolicy​(String partitionField,
                                      boolean unionUnpartitionableQueries)
    • Method Detail

      • getConnectionPools

        public List<String> getConnectionPools()
        PUBLIC: Return the list of connection pool names to replicate queries to.
      • setConnectionPools

        public void setConnectionPools​(List<String> connectionPools)
        PUBLIC: Set the list of connection pool names to replicate queries to. A connection pool with the same name must be defined on the ServerSession.
      • addConnectionPool

        public void addConnectionPool​(String connectionPool)
        PUBLIC: Add the connection pool name to the list of pools to rotate queries through.