com.yahoo.ycsb
Class ScrambledZipfianGenerator
java.lang.Object
com.yahoo.ycsb.Generator
com.yahoo.ycsb.IntegerGenerator
com.yahoo.ycsb.ScrambledZipfianGenerator
public class ScrambledZipfianGenerator
- extends IntegerGenerator
A generator of a zipfian distribution. It produces a sequence of items, such that some items are more popular than others, according
to a zipfian distribution. When you construct an instance of this class, you specify the number of items in the set to draw from, either
by specifying an itemcount (so that the sequence is of items from 0 to itemcount-1) or by specifying a min and a max (so that the sequence is of
items from min to max inclusive). After you construct the instance, you can change the number of items by calling nextInt(itemcount) or nextLong(itemcount).
Unlike @ZipfianGenerator, this class scatters the "popular" items across the itemspace. Use this, instead of @ZipfianGenerator, if you
don't want the head of the distribution (the popular items) clustered together.
Method Summary |
static void |
main(java.lang.String[] args)
|
int |
nextInt()
Return the next int in the sequence. |
long |
nextLong()
Return the next long in the sequence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZETAN
public static final double ZETAN
- See Also:
- Constant Field Values
ITEM_COUNT
public static final long ITEM_COUNT
- See Also:
- Constant Field Values
ScrambledZipfianGenerator
public ScrambledZipfianGenerator(long _items)
- Create a zipfian generator for the specified number of items.
- Parameters:
_items
- The number of items in the distribution.
ScrambledZipfianGenerator
public ScrambledZipfianGenerator(long _min,
long _max)
- Create a zipfian generator for items between min and max.
- Parameters:
_min
- The smallest integer to generate in the sequence._max
- The largest integer to generate in the sequence.
nextInt
public int nextInt()
- Return the next int in the sequence.
- Specified by:
nextInt
in class IntegerGenerator
nextLong
public long nextLong()
- Return the next long in the sequence.
main
public static void main(java.lang.String[] args)