nidas v1.2.3
|
A RawSampleService reads raw Samples from a socket connection and sends the samples to one or more SampleIOProcessors. More...
#include <RawSampleService.h>
Classes | |
class | Worker |
Worker thread that is run when a SampleInputConnection is established. More... | |
Public Member Functions | |
RawSampleService () | |
~RawSampleService () | |
void | connect (nidas::core::SampleInput *) throw () |
void | disconnect (nidas::core::SampleInput *) throw () |
void | schedule (bool optionalProcessing) |
void | interrupt () throw () |
void | fromDOMElement (const xercesc::DOMElement *node) |
void | printClock (std::ostream &ostr) throw () |
void | printStatus (std::ostream &ostr, float deltat) throw () |
float | getRawSorterLength () const |
Get the length of the SampleSorter of raw Samples, in seconds. | |
void | setRawSorterLength (float val) |
Set the length of the SampleSorter of raw Samples, in seconds. | |
float | getProcSorterLength () const |
Get the length of the SampleSorter of processed Samples, in seconds. | |
void | setProcSorterLength (float val) |
Set the length of the SampleSorter of processed Samples, in seconds. | |
size_t | getRawHeapMax () const |
Get the size of in bytes of the raw SampleSorter. | |
void | setRawHeapMax (size_t val) |
Set the size of in bytes of the raw SampleSorter. | |
size_t | getProcHeapMax () const |
Get the size of in bytes of the processed SampleSorter. | |
void | setProcHeapMax (size_t val) |
Set the size of in bytes of the processed SampleSorter. | |
unsigned int | getRawLateSampleCacheSize () const |
Get the size of the late sample cache in the raw sample sorter. | |
void | setRawLateSampleCacheSize (unsigned int val) |
Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter. | |
unsigned int | getProcLateSampleCacheSize () const |
Get the size of the late sample cache in the processed sample sorter. | |
void | setProcLateSampleCacheSize (unsigned int val) |
Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter. | |
const std::string & | getName () const |
virtual void | setDSMServer (DSMServer *val) |
virtual DSMServer * | getDSMServer () const |
virtual void | addProcessor (SampleIOProcessor *proc) |
Add a processor to this RawSampleService. | |
virtual const std::list< SampleIOProcessor * > & | getProcessors () const |
const std::list< SampleInput * > & | getInputs () const |
ProcessorIterator | getProcessorIterator () const |
virtual int | checkSubThreads () throw () |
virtual void | cancel () throw () |
virtual int | join () throw () |
nidas::util::Thread::SchedPolicy | getSchedPolicy () const |
int | getSchedPriority () const |
virtual xercesc::DOMElement * | toDOMParent (xercesc::DOMElement *parent, bool complete) const |
Create a DOMElement and append it to the parent. | |
virtual xercesc::DOMElement * | toDOMElement (xercesc::DOMElement *node, bool complete) const |
Add my content into a DOMElement. | |
Static Public Member Functions | |
static const std::string | getClassName (const xercesc::DOMElement *node, const Project *) |
static const XMLCh * | getNamespaceURI () |
Protected Member Functions | |
void | addSubThread (nidas::util::Thread *) throw () |
Protected Attributes | |
std::string | _name |
DSMServer * | _server |
std::set< nidas::util::Thread * > | _subThreads |
nidas::util::Mutex | _subThreadMutex |
std::list< SampleInput * > | _inputs |
std::list< SampleIOProcessor * > | _processors |
std::list< IOChannel * > | _ochans |
nidas::util::Thread::SchedPolicy | _threadPolicy |
int | _threadPriority |
Private Member Functions | |
RawSampleService (const RawSampleService &) | |
Copying not supported. | |
RawSampleService & | operator= (const RawSampleService &) |
Assignment not supported. | |
Private Attributes | |
nidas::core::SamplePipeline * | _pipeline |
std::map< nidas::core::SampleInput *, Worker * > | _workers |
Keep track of the Worker for each SampleInput. | |
std::map< nidas::core::SampleInput *, const nidas::core::DSMConfig * > | _dsms |
nidas::util::Mutex | _workerMutex |
std::map< void *, size_t > | _nsampsLast |
Saved between calls to printStatus in order to compute data rates. | |
std::map< void *, long long > | _nbytesLast |
Saved between calls to printStatus in order to compute sample rates. | |
float | _rawSorterLength |
float | _procSorterLength |
size_t | _rawHeapMax |
size_t | _procHeapMax |
unsigned int | _rawLateSampleCacheSize |
unsigned int | _procLateSampleCacheSize |
Static Private Attributes | |
static XMLCh * | namespaceURI = 0 |
A RawSampleService reads raw Samples from a socket connection and sends the samples to one or more SampleIOProcessors.
RawSampleService::RawSampleService | ( | ) |
RawSampleService::~RawSampleService | ( | ) |
References _pipeline, and nidas::core::SamplePipeline::join().
|
private |
Copying not supported.
|
inlinevirtualinherited |
Add a processor to this RawSampleService.
This is done at configuration (XML) time.
References nidas::core::DSMService::_processors.
Referenced by nidas::core::DSMService::fromDOMElement().
|
protectedinherited |
References nidas::core::getSample().
|
virtualinherited |
|
virtualinherited |
|
virtual |
void RawSampleService::disconnect | ( | nidas::core::SampleInput * | input | ) | ||
throw | ( | ) |
References DLOG, ELOG, nidas::core::getSample(), ILOG, nidas::dynld::RawSampleService::Worker::interrupt(), VLOG, and WLOG.
nidas::util::InvalidParameterException |
Reimplemented from nidas::core::DSMService.
References nidas::core::DSMService::_inputs, nidas::core::DSMSensor::addSampleTag(), nidas::core::DSMService::fromDOMElement(), nidas::core::DSMService::getDSMServer(), nidas::core::DSMService::getName(), nidas::core::DSMSensor::getRawSampleTag(), nidas::core::getSample(), setProcHeapMax(), setProcLateSampleCacheSize(), setProcSorterLength(), setRawHeapMax(), setRawLateSampleCacheSize(), and setRawSorterLength().
|
staticinherited |
nidas::util::InvalidParameterException |
References nidas::core::DSMService::getClassName(), and nidas::core::getSample().
Referenced by nidas::core::DSMServer::fromDOMElement(), and nidas::core::DSMService::getClassName().
References nidas::core::DSMService::_server.
Referenced by nidas::core::DSMService::fromDOMElement(), fromDOMElement(), and schedule().
|
inlineinherited |
References nidas::core::DSMService::_inputs.
Referenced by schedule().
|
inlineinherited |
References nidas::core::DSMService::_name.
Referenced by nidas::core::DSMService::fromDOMElement(), fromDOMElement(), and schedule().
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), nidas::core::DSMConfig::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Project::toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::Site::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inherited |
Referenced by printStatus().
|
inlinevirtualinherited |
References nidas::core::DSMService::_processors.
Referenced by interrupt().
|
inline |
Get the size of in bytes of the processed SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _procHeapMax.
Referenced by schedule().
Get the size of the late sample cache in the processed sample sorter.
See SampleSorter::getLateSampleCacheSize(). Default: 0.
References _procLateSampleCacheSize.
Referenced by schedule().
|
inline |
Get the length of the SampleSorter of processed Samples, in seconds.
References _procSorterLength.
Referenced by schedule().
|
inline |
Get the size of in bytes of the raw SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _rawHeapMax.
Referenced by schedule().
Get the size of the late sample cache in the raw sample sorter.
See SampleSorter::getLateSampleCacheSize(). Default: 0.
References _rawLateSampleCacheSize.
Referenced by schedule().
|
inline |
Get the length of the SampleSorter of raw Samples, in seconds.
References _rawSorterLength.
Referenced by schedule().
|
inlineinherited |
References nidas::core::DSMService::_threadPolicy.
|
inlineinherited |
References nidas::core::DSMService::_threadPriority.
|
virtual |
|
virtualinherited |
|
private |
Assignment not supported.
|
virtual |
Reimplemented from nidas::core::DSMService.
References _pipeline, nidas::util::UTime::format(), nidas::core::SampleStats::getLastTimeTag(), and nidas::core::SamplePipeline::getRawSampleSource().
Referenced by printStatus().
Reimplemented from nidas::core::DSMService.
References _dsms, _nbytesLast, _nsampsLast, _pipeline, _workerMutex, nidas::util::UTime::format(), nidas::core::SampleStats::getLastTimeTag(), nidas::core::SamplePipeline::getNumDiscardedProcSamples(), nidas::core::SamplePipeline::getNumDiscardedRawSamples(), nidas::core::SamplePipeline::getNumFutureProcSamples(), nidas::core::SamplePipeline::getNumFutureRawSamples(), nidas::core::SamplePipeline::getProcessedSampleSource(), nidas::core::DSMService::getProcessorIterator(), nidas::core::SamplePipeline::getRawSampleSource(), nidas::core::getSample(), nidas::core::SampleSource::getSampleStats(), nidas::core::SamplePipeline::getSorterNumProcBytes(), nidas::core::SamplePipeline::getSorterNumProcBytesMax(), nidas::core::SamplePipeline::getSorterNumProcSamples(), nidas::core::SamplePipeline::getSorterNumRawBytes(), nidas::core::SamplePipeline::getSorterNumRawBytesMax(), nidas::core::SamplePipeline::getSorterNumRawSamples(), nidas::util::Mutex::lock(), printClock(), nidas::core::SampleIOProcessor::printStatus(), and nidas::util::Mutex::unlock().
nidas::util::Exception |
Implements nidas::core::DSMService.
References _pipeline, nidas::core::DSMService::_processors, nidas::core::SampleSource::addSampleTag(), nidas::core::DSMService::getDSMServer(), nidas::core::DSMService::getInputs(), nidas::core::DSMService::getName(), nidas::core::SamplePipeline::getName(), nidas::core::DSMSensor::getProcessedSampleSource(), nidas::core::SamplePipeline::getProcessedSampleSource(), getProcHeapMax(), getProcLateSampleCacheSize(), getProcSorterLength(), getRawHeapMax(), getRawLateSampleCacheSize(), nidas::core::DSMSensor::getRawSampleSource(), nidas::core::SamplePipeline::getRawSampleSource(), getRawSorterLength(), nidas::core::getSample(), nidas::core::SampleSource::getSampleTags(), LOG_ERR, nidas::core::SamplePipeline::setHeapBlock(), nidas::core::SamplePipeline::setKeepStats(), nidas::core::SamplePipeline::setProcHeapMax(), nidas::core::SamplePipeline::setProcLateSampleCacheSize(), nidas::core::SamplePipeline::setProcSorterLength(), nidas::core::SamplePipeline::setRawHeapMax(), nidas::core::SamplePipeline::setRawLateSampleCacheSize(), nidas::core::SamplePipeline::setRawSorterLength(), and nidas::core::SamplePipeline::setRealTime().
References nidas::core::DSMService::_server, and nidas::core::getSample().
Set the size of in bytes of the processed SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _procHeapMax, and nidas::core::getSample().
Referenced by fromDOMElement().
Cache this number of samples with potentially anomalous, late time tags in the processed sample sorter.
See SampleSorter::setLateSampleCacheSize(val).
References _procLateSampleCacheSize, and nidas::core::getSample().
Referenced by fromDOMElement().
Set the length of the SampleSorter of processed Samples, in seconds.
References _procSorterLength, and nidas::core::getSample().
Referenced by fromDOMElement().
Set the size of in bytes of the raw SampleSorter.
If the size of the sorter exceeds this value then samples will be discarded.
References _rawHeapMax, and nidas::core::getSample().
Referenced by fromDOMElement().
Cache this number of samples with potentially anomalous, late time tags in the raw sample sorter.
See SampleSorter::setLateSampleCacheSize(val).
References _rawLateSampleCacheSize, and nidas::core::getSample().
Referenced by fromDOMElement().
Set the length of the SampleSorter of raw Samples, in seconds.
References _rawSorterLength, and nidas::core::getSample().
Referenced by fromDOMElement().
|
virtualinherited |
Add my content into a DOMElement.
xercesc::DOMException |
Reimplemented in nidas::core::DSMConfig, nidas::core::DSMSensor, nidas::core::Project, nidas::core::SampleTag, nidas::core::Site, nidas::core::ServerSocket, and nidas::core::Variable.
Referenced by nidas::core::ServerSocket::toDOMParent().
|
virtualinherited |
Create a DOMElement and append it to the parent.
xercesc::DOMException |
Reimplemented in nidas::core::DSMConfig, nidas::core::DSMSensor, nidas::core::Project, nidas::core::SampleTag, nidas::core::Site, nidas::core::ServerSocket, and nidas::core::Variable.
|
private |
Referenced by printStatus().
|
protectedinherited |
|
protectedinherited |
Referenced by nidas::core::DSMService::getName().
Saved between calls to printStatus in order to compute sample rates.
Referenced by printStatus().
Saved between calls to printStatus in order to compute data rates.
Referenced by printStatus().
|
protectedinherited |
|
private |
Referenced by interrupt(), printClock(), printStatus(), schedule(), and ~RawSampleService().
|
protectedinherited |
|
private |
Referenced by getProcHeapMax(), and setProcHeapMax().
Referenced by getProcLateSampleCacheSize(), and setProcLateSampleCacheSize().
|
private |
Referenced by getProcSorterLength(), and setProcSorterLength().
|
private |
Referenced by getRawHeapMax(), and setRawHeapMax().
Referenced by getRawLateSampleCacheSize(), and setRawLateSampleCacheSize().
|
private |
Referenced by getRawSorterLength(), and setRawSorterLength().
|
protectedinherited |
Referenced by nidas::core::DSMService::getDSMServer(), and nidas::core::DSMService::setDSMServer().
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Referenced by nidas::core::DSMService::fromDOMElement(), and nidas::core::DSMService::getSchedPolicy().
|
protectedinherited |
Referenced by nidas::core::DSMService::fromDOMElement(), and nidas::core::DSMService::getSchedPriority().
|
private |
Referenced by printStatus().
|
private |
Keep track of the Worker for each SampleInput.
|
staticprivateinherited |
Referenced by nidas::core::DOMable::getNamespaceURI().