EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.descriptors.partitioning
Class ValuePartitioningPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
      extended by org.eclipse.persistence.descriptors.partitioning.FieldPartitioningPolicy
          extended by org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
All Implemented Interfaces:
java.io.Serializable

public class ValuePartitioningPolicy
extends FieldPartitioningPolicy

PUBLIC: ValuePartitioningPolicy partitions access to a database cluster by a field value from the object, such as the object's location, or tenant. Each value is assigned a specific server. 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
Author:
James Sutherland
Since:
EclipseLink 2.2

Field Summary
protected  java.lang.String defaultConnectionPool
          The default connection pool is used for any unmapped values.
protected  java.util.List<java.lang.String> orderedPartitions
          Use to track order for compute UCP index.
protected  java.util.Map<java.lang.String,java.lang.String> partitionNames
          Store the value partitions by name.
protected  java.util.Map<java.lang.Object,java.lang.String> partitions
          Store the value partitions.
protected  java.lang.Class partitionValueType
          The type of the partition values.
protected  java.lang.String partitionValueTypeName
          The type name of the partition value names.
 
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.FieldPartitioningPolicy
partitionField, unionUnpartitionableQueries
 
Fields inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
name
 
Constructor Summary
ValuePartitioningPolicy()
           
ValuePartitioningPolicy(java.lang.String partitionField)
           
ValuePartitioningPolicy(java.lang.String partitionField, boolean unionUnpartitionableQueries)
           
 
Method Summary
 void addPartition(java.lang.Object value, java.lang.String connectionPool)
          PUBLIC: Add the value partition.
 void addPartitionName(java.lang.String valueName, java.lang.String connectionPool)
          INTERNAL: Add partition values by name (will be initialized at runtime with the real class loader).
 void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings to actual class-based settings.
 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.
 java.lang.String getDefaultConnectionPool()
          PUBLIC: Return the default connection pool used for any unmapped values.
 java.util.List<java.lang.String> getOrderedPartitions()
           
 java.util.Map<java.lang.Object,java.lang.String> getPartitions()
          PUBLIC: Return the value partitions.
 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.
 void setDefaultConnectionPool(java.lang.String defaultConnectionPool)
          PUBLIC: Set the default connection pool used for any unmapped values.
 void setOrderedPartitions(java.util.List<java.lang.String> orderedPartitions)
           
 void setPartitions(java.util.Map<java.lang.Object,java.lang.String> partitions)
          PUBLIC: Set the value partitions.
 void setPartitionValueTypeName(java.lang.String partitionValueTypeName)
          INTERNAL:
 
Methods inherited from class org.eclipse.persistence.descriptors.partitioning.FieldPartitioningPolicy
extractPartitionValueForPersist, getPartitionField, getPartitionFieldName, getUnionUnpartitionableQueries, setPartitionField, setPartitionField, setUnionUnpartitionableQueries
 
Methods inherited from class org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
acquireAccessor, getAccessor, getName, initialize, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partitions

protected java.util.Map<java.lang.Object,java.lang.String> partitions
Store the value partitions. Each partition maps a value to a connectionPool.


partitionNames

protected java.util.Map<java.lang.String,java.lang.String> partitionNames
Store the value partitions by name. Initialized at runtime.


partitionValueTypeName

protected java.lang.String partitionValueTypeName
The type name of the partition value names. Initialized at runtime


partitionValueType

protected java.lang.Class partitionValueType
The type of the partition values. Initialized from the type name at runtime.


orderedPartitions

protected java.util.List<java.lang.String> orderedPartitions
Use to track order for compute UCP index.


defaultConnectionPool

protected java.lang.String defaultConnectionPool
The default connection pool is used for any unmapped values.

Constructor Detail

ValuePartitioningPolicy

public ValuePartitioningPolicy()

ValuePartitioningPolicy

public ValuePartitioningPolicy(java.lang.String partitionField)

ValuePartitioningPolicy

public ValuePartitioningPolicy(java.lang.String partitionField,
                               boolean unionUnpartitionableQueries)
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.

Overrides:
convertClassNamesToClasses in class PartitioningPolicy

setPartitionValueTypeName

public void setPartitionValueTypeName(java.lang.String partitionValueTypeName)
INTERNAL:


getOrderedPartitions

public java.util.List<java.lang.String> getOrderedPartitions()

setOrderedPartitions

public void setOrderedPartitions(java.util.List<java.lang.String> orderedPartitions)

getDefaultConnectionPool

public java.lang.String getDefaultConnectionPool()
PUBLIC: Return the default connection pool used for any unmapped values.


setDefaultConnectionPool

public void setDefaultConnectionPool(java.lang.String defaultConnectionPool)
PUBLIC: Set the default connection pool used for any unmapped values.


getPartitions

public java.util.Map<java.lang.Object,java.lang.String> getPartitions()
PUBLIC: Return the value partitions. Each partition maps a value to a connectionPool.


setPartitions

public void setPartitions(java.util.Map<java.lang.Object,java.lang.String> partitions)
PUBLIC: Set the value partitions. Each partition maps a value to a connectionPool.


addPartition

public void addPartition(java.lang.Object value,
                         java.lang.String connectionPool)
PUBLIC: Add the value partition.


addPartitionName

public void addPartitionName(java.lang.String valueName,
                             java.lang.String connectionPool)
INTERNAL: Add partition values by name (will be initialized at runtime with the real class loader).


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.

Overrides:
partitionPersist in class PartitioningPolicy

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference