|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.util.stats.UniformSample
public class UniformSample
A random sample of a stream of longs. Uses Vitter's Algorithm R to produce a
statistically representative sample.
| Constructor Summary | |
|---|---|
UniformSample(int reservoirSize)
Creates a new UniformSample. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears all recorded values. |
Snapshot |
getSnapshot()
Returns a snapshot of the sample's values. |
int |
size()
Returns the number of values recorded. |
void |
update(long value)
Adds a new recorded value to the sample. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UniformSample(int reservoirSize)
UniformSample.
reservoirSize - the number of samples to keep in the sampling reservoir| Method Detail |
|---|
public void clear()
Sample
clear in interface Samplepublic int size()
Sample
size in interface Samplepublic void update(long value)
Sample
update in interface Samplevalue - a new recorded valuepublic Snapshot getSnapshot()
Sample
getSnapshot in interface Sample
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||