#include <EventStreamHttpReader.h>
Public Member Functions | |
EventStreamHttpReader (edm::ParameterSet const &, edm::InputSourceDescription const &) | |
virtual EventPrincipal * | read () |
virtual | ~EventStreamHttpReader () |
Private Member Functions | |
void | readHeader () |
Private Attributes | |
const bool | dropOldLumisectionEvents_ |
stor::EventServerProxy < stor::EventConsumerRegistrationInfo > | eventServerProxy_ |
unsigned int | lastLS_ |
Input source for event consumers that will get events from the Storage Manager Event Server. This does uses a HTTP get using the CURL library. The Storage Manager Event Server responses with a binary octet-stream. The product registry is also obtained through a HTTP get.
There is currently no test of the product registry against the consumer client product registry within the code. It should already be done if this was inherenting from the standard framework input source. Currently we inherit from InputSource.
Definition at line 33 of file EventStreamHttpReader.h.
edm::EventStreamHttpReader::EventStreamHttpReader | ( | edm::ParameterSet const & | pset, |
edm::InputSourceDescription const & | desc | ||
) |
Definition at line 20 of file EventStreamHttpReader.cc.
References edm::ParameterSet::getUntrackedParameter(), and xuti::readHeader().
: StreamerInputSource(pset, desc), eventServerProxy_(pset), dropOldLumisectionEvents_(pset.getUntrackedParameter<bool>("dropOldLumisectionEvents", false)), lastLS_(0) { // Default in StreamerInputSource is 'false' inputFileTransitionsEachEvent_ = pset.getUntrackedParameter<bool>("inputFileTransitionsEachEvent", true); readHeader(); }
virtual edm::EventStreamHttpReader::~EventStreamHttpReader | ( | ) | [inline, virtual] |
Definition at line 41 of file EventStreamHttpReader.h.
{};
EventPrincipal * edm::EventStreamHttpReader::read | ( | ) | [virtual] |
Implements edm::StreamerInputSource.
Definition at line 37 of file EventStreamHttpReader.cc.
References HeaderView::code(), runTheMatrix::data, edm::StreamerInputSource::deserializeEvent(), Header::DONE, dropOldLumisectionEvents_, eventServerProxy_, stor::EventServerProxy< RegInfo >::getOneEvent(), lastLS_, EventMsgView::lumi(), and edm::StreamerInputSource::setEndRun().
{ stor::CurlInterface::Content data; unsigned int currentLS(0); do { eventServerProxy_.getOneEvent(data); if ( data.empty() ) return 0; HeaderView hdrView(&data[0]); if (hdrView.code() == Header::DONE) { setEndRun(); return 0; } EventMsgView eventView(&data[0]); currentLS = eventView.lumi(); } while ( dropOldLumisectionEvents_ && lastLS_ > currentLS ); lastLS_ = currentLS; return deserializeEvent(EventMsgView(&data[0])); }
void edm::EventStreamHttpReader::readHeader | ( | ) | [private] |
Definition at line 67 of file EventStreamHttpReader.cc.
References runTheMatrix::data, edm::StreamerInputSource::deserializeAndMergeWithRegistry(), eventServerProxy_, and stor::EventServerProxy< RegInfo >::getInitMsg().
{ stor::CurlInterface::Content data; eventServerProxy_.getInitMsg(data); InitMsgView initView(&data[0]); deserializeAndMergeWithRegistry(initView); }
const bool edm::EventStreamHttpReader::dropOldLumisectionEvents_ [private] |
Definition at line 50 of file EventStreamHttpReader.h.
Referenced by read().
stor::EventServerProxy<stor::EventConsumerRegistrationInfo> edm::EventStreamHttpReader::eventServerProxy_ [private] |
Definition at line 48 of file EventStreamHttpReader.h.
Referenced by read(), and readHeader().
unsigned int edm::EventStreamHttpReader::lastLS_ [private] |
Definition at line 51 of file EventStreamHttpReader.h.
Referenced by read().