#include <FragmentStore.h>
Public Member Functions | |
const bool | addFragment (I2OChain &) |
void | addToStaleEventTimes (const utils::Duration_t) |
void | clear () |
bool | empty () const |
FragmentStore (size_t maxMemoryUsageMB) | |
bool | full () const |
const bool | getStaleEvent (I2OChain &, utils::Duration_t timeout) |
size_t | memoryUsed () const |
void | resetStaleEventTimes () |
unsigned int | size () const |
Private Types | |
typedef std::map< FragKey, I2OChain > | fragmentMap |
Private Member Functions | |
FragmentStore (FragmentStore const &) | |
FragmentStore & | operator= (FragmentStore const &) |
Private Attributes | |
const size_t | maxMemoryUsage_ |
size_t | memoryUsed_ |
fragmentMap | store_ |
Stores incomplete events
Uses a map of I2OChains to store incomplete events.
Definition at line 26 of file FragmentStore.h.
|
private |
Definition at line 105 of file FragmentStore.h.
|
explicit |
|
private |
const bool FragmentStore::addFragment | ( | I2OChain & | chain | ) |
Adds fragments of the I2OChain to the fragment store. If the passed fragments completes an event, it returns true. In this case, the passed I2OChain contains the completed event. Otherwise, it returns false and the I2OChain is empty.
Definition at line 16 of file FragmentStore.cc.
References stor::I2OChain::complete(), stor::I2OChain::fragmentKey(), stor::I2OChain::memoryUsed(), memoryUsed_, pos, stor::I2OChain::release(), stor::I2OChain::resetStaleWindowStartTime(), and store_.
Referenced by stor::Processing::do_processI2OFragment().
void FragmentStore::addToStaleEventTimes | ( | const utils::Duration_t | duration | ) |
Add the duration to the stale window start time for all I2OChains hold by the store.
Definition at line 57 of file FragmentStore.cc.
References store_.
Referenced by stor::FragmentProcessor::processOneFragmentIfPossible().
|
inline |
Clears all fragments hold by the fragment store
Definition at line 67 of file FragmentStore.h.
References memoryUsed_, and store_.
Referenced by stor::DrainingQueues::allQueuesAndWorkersAreEmpty(), Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), FragmentStore(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().
|
inline |
Checks if the fragment store is empty
Definition at line 74 of file FragmentStore.h.
References store_.
Referenced by stor::DrainingQueues::allQueuesAndWorkersAreEmpty(), Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().
|
inline |
Checks if the fragment store is full
Definition at line 81 of file FragmentStore.h.
References maxMemoryUsage_, and memoryUsed_.
Referenced by stor::FragmentProcessor::processOneFragmentIfPossible().
const bool FragmentStore::getStaleEvent | ( | I2OChain & | chain, |
utils::Duration_t | timeout | ||
) |
Checks for event fragments for which the last event fragment was added longer than timeout seconds ago. If it finds one it returns true and the I2OChain contains the faulty event. Otherwise it returns false and the I2OChain is empty.
Definition at line 81 of file FragmentStore.cc.
References end, stor::utils::getCurrentTime(), stor::I2OChain::markFaulty(), stor::I2OChain::memoryUsed(), memoryUsed_, pos, stor::I2OChain::release(), and store_.
|
inline |
Returns the total memory occupied by the events in the fragment store
Definition at line 95 of file FragmentStore.h.
References memoryUsed_.
Referenced by stor::Processing::do_processI2OFragment().
|
private |
void FragmentStore::resetStaleEventTimes | ( | ) |
Resets the stale window start time for all I2OChains hold by the store.
Definition at line 69 of file FragmentStore.cc.
References store_.
|
inline |
Returns the number of events in the fragment store (complete or not).
Definition at line 88 of file FragmentStore.h.
References store_.
Referenced by stor::Processing::do_processI2OFragment().
|
private |
Definition at line 109 of file FragmentStore.h.
Referenced by full().
|
private |
Definition at line 108 of file FragmentStore.h.
Referenced by addFragment(), clear(), full(), getStaleEvent(), and memoryUsed().
|
private |
Definition at line 106 of file FragmentStore.h.
Referenced by addFragment(), addToStaleEventTimes(), clear(), empty(), getStaleEvent(), resetStaleEventTimes(), and size().