org.terracotta.async
Interface ItemScatterPolicy<I>
- All Known Implementing Classes:
- HashCodeScatterPolicy, SingleBucketScatterPolicy
public interface ItemScatterPolicy<I>
Scatter policy instances control how items are distributed amongst the local buckets.
- Author:
- Alex Snaps
|
Method Summary |
int |
selectBucket(int count,
I item)
Returns a bucket index in the range 0 to (count - 1) to which an item should be assigned. |
selectBucket
int selectBucket(int count,
I item)
- Returns a bucket index in the range 0 to (count - 1) to which an item should be assigned.
- Parameters:
count - exclusive maximum indexitem - the item we are scattering across the buckets
- Returns:
- bucket index to use
Copyright © 2015 Terracotta, Inc.. All Rights Reserved.