|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.util.stats.UniformSample
public class UniformSample
A random sample of a stream of long
s. 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 reservoirMethod Detail |
---|
public void clear()
Sample
clear
in interface Sample
public int size()
Sample
size
in interface Sample
public void update(long value)
Sample
update
in interface Sample
value
- 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 |