org.hibernate.shards.strategy.selection
Class LoadBalancedShardSelectionStrategy

java.lang.Object
  extended by org.hibernate.shards.strategy.selection.LoadBalancedShardSelectionStrategy
All Implemented Interfaces:
ShardSelectionStrategy

public class LoadBalancedShardSelectionStrategy
extends Object
implements ShardSelectionStrategy

Author:
maxr@google.com (Max Ross)

Constructor Summary
LoadBalancedShardSelectionStrategy(ShardLoadBalancer shardLoadBalancer)
           
 
Method Summary
 ShardId selectShardIdForNewObject(Object obj)
          Determine the specific shard on which this object should reside
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadBalancedShardSelectionStrategy

public LoadBalancedShardSelectionStrategy(ShardLoadBalancer shardLoadBalancer)
Method Detail

selectShardIdForNewObject

public ShardId selectShardIdForNewObject(Object obj)
Description copied from interface: ShardSelectionStrategy
Determine the specific shard on which this object should reside

Specified by:
selectShardIdForNewObject in interface ShardSelectionStrategy
Parameters:
obj - the new object for which we are selecting a shard
Returns:
the id of the shard on which this object should live