I am using Apache Commons Math in my web application. I need to use this class:
SummaryStatistics
However, I am puzzled by this description:
Computes summary statistics for a stream of data values added using the addValue method. The data values are not stored in memory, so this class can be used to compute statistics for very large data streams.
If the values are not stored in memory, where are they stored? On disks? If on disks, what about the file names? Can someone shed light on this? I would also like to know whether SummaryStatistics supports mutli-threads.
This is important to me because a web application allows multi-thread requests and I need to make sure one person's request does not overwrite the summary statistics for another person.
They're not stored anywhere. The class only maintains the minimum summary values it needs, which are the sum, sum of squares, min, max, and a few more values. If in doubt, you can always check out the source code.
Per thread-safety, the JavaDoc specifically says:
This class is not thread-safe. Use
SynchronizedSummaryStatistics
if concurrent access from multiple threads is required.