public class RoundRobinPartitioningPolicy extends ReplicationPartitioningPolicy
Modifier and Type | Field and Description |
---|---|
protected int |
currentIndex |
protected boolean |
replicateWrites |
connectionPools
name
Constructor and Description |
---|
RoundRobinPartitioningPolicy() |
RoundRobinPartitioningPolicy(boolean replicateWrites) |
RoundRobinPartitioningPolicy(java.util.List<java.lang.String> pools) |
RoundRobinPartitioningPolicy(java.lang.String... pools) |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
getReplicateWrites()
PUBLIC:
Return if write queries should be replicated.
|
org.eclipse.persistence.internal.databaseaccess.Accessor |
nextAccessor(ServerSession session,
DatabaseQuery query)
INTERNAL:
Return the next connection accessor.
|
int |
nextIndex()
INTERNAL:
Return the next pool index to use.
|
void |
setReplicateWrites(boolean replicateWrites)
PUBLIC:
Set if write queries should be replicated.
|
addConnectionPool, getConnectionPools, initialize, setConnectionPools
acquireAccessor, convertClassNamesToClasses, getAccessor, getName, partitionPersist, setName
protected volatile int currentIndex
protected boolean replicateWrites
public RoundRobinPartitioningPolicy()
public RoundRobinPartitioningPolicy(boolean replicateWrites)
public RoundRobinPartitioningPolicy(java.lang.String... pools)
public RoundRobinPartitioningPolicy(java.util.List<java.lang.String> pools)
public boolean getReplicateWrites()
public void setReplicateWrites(boolean replicateWrites)
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)
getConnectionsForQuery
in class ReplicationPartitioningPolicy
public int nextIndex()
public org.eclipse.persistence.internal.databaseaccess.Accessor nextAccessor(ServerSession session, DatabaseQuery query)