org.terracotta.async.scatterpolicies
Class SingleBucketScatterPolicy

java.lang.Object
  extended by org.terracotta.async.scatterpolicies.SingleBucketScatterPolicy
All Implemented Interfaces:
ItemScatterPolicy<Object>

public class SingleBucketScatterPolicy
extends Object
implements ItemScatterPolicy<Object>

A simplistic scatter policy that directs all work items in to the first bucket.


Constructor Summary
SingleBucketScatterPolicy()
           
 
Method Summary
 int selectBucket(int count, Object item)
          Returns a bucket index in the range 0 to (count - 1) to which an item should be assigned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleBucketScatterPolicy

public SingleBucketScatterPolicy()
Method Detail

selectBucket

public int selectBucket(int count,
                        Object item)
Description copied from interface: ItemScatterPolicy
Returns a bucket index in the range 0 to (count - 1) to which an item should be assigned.

Specified by:
selectBucket in interface ItemScatterPolicy<Object>
Parameters:
count - exclusive maximum index
item - the item we are scattering across the buckets
Returns:
bucket index to use


Copyright © 2015 Terracotta, Inc.. All Rights Reserved.