Commit b1824b68 authored by Dainius Simelevicius's avatar Dainius Simelevicius
Browse files

references #281: merging baseline_phosphorus_15 into baseline_sulfur_16

parents 1680012b 8d268132
variables:
EXTERN_PACKAGES: "extern/dim extern/smi extern/yui extern/caen/a2818 extern/caen/a3818 extern/caen/CAENUSBdrvB extern/caen/caenvmelib extern/caen/caencomm extern/caen/caenbridgeupgrade extern/caen/caenupgrader extern/prometheus-cpp"
WORKSUITE_PACKAGES: "xdaq2rc interface/evb interface/shared interface/bril evb jobcontrol xpci/drv xpci hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen hal/busAdapter/pci hal/PyHAL pheaps/drv/cmem_rcc pheaps jal/jtagChain jal/jtagController jal/jtagSVFSequencer ttc/utils ttc/monitoring ttc/ltc ttc/ttcci tts/ttsbase tts/atts tts/cpcibase tts/fmmtd tts/ipcutils tts/fmm tts/fmmcontroller tts/fmmdbi tts/fmmtester d2s/utils d2s/fedemulator d2s/gtpe d2s/gtpecontroller d2s/firmwareloader fedstreamer fedkit ferol ferol40 psx/sapi psx/mapi psx psx/watchdog sentinel sentinel/utils sentinel/probe sentinel/sentineld sentinel/tester sentinel/bridge2g sentinel/spotlight2g sentinel/spotlightocci tstore/utils tstore/client tstore tstore/api xmas/admin xmas/heartbeat xmas/heartbeat/probe xmas/heartbeat/heartbeatd xmas/utils xmas/sensord xmas/probe xmas/tester xmas/bridge2g xmas/slash2g xmas/store2g xmas/smarthub ibvla pt/ibv gevb2g elastic/api elastic/timestream amc13controller dipbridge oms pt/vpi"
WORKSUITE_PACKAGES: "xdaq2rc interface/evb interface/shared interface/bril/shared evb jobcontrol xpci/drv xpci hal/generic hal/utilities hal/busAdapter/dummy hal/busAdapter/caen hal/busAdapter/pci hal/PyHAL pheaps/drv/cmem_rcc pheaps jal/jtagChain jal/jtagController jal/jtagSVFSequencer ttc/utils ttc/monitoring ttc/ltc ttc/ttcci tts/ttsbase tts/atts tts/cpcibase tts/fmmtd tts/ipcutils tts/fmm tts/fmmcontroller tts/fmmdbi tts/fmmtester d2s/utils d2s/fedemulator d2s/gtpe d2s/gtpecontroller d2s/firmwareloader fedstreamer fedkit ferol ferol40 psx/sapi psx/mapi psx psx/watchdog sentinel sentinel/utils sentinel/probe sentinel/sentineld sentinel/tester sentinel/bridge2g sentinel/spotlight2g sentinel/spotlightocci tstore/utils tstore/client tstore tstore/api xmas/admin xmas/heartbeat xmas/heartbeat/probe xmas/heartbeat/heartbeatd xmas/utils xmas/sensord xmas/probe xmas/tester xmas/bridge2g xmas/slash2g xmas/store2g xmas/smarthub ibvla pt/ibv gevb2g elastic/api elastic/timestream amc13controller dipbridge oms pt/vpi"
RPM_REPO_DIR: "/tmp/$CI_PROJECT_NAME/$CI_JOB_NAME/repo"
DOCKER_IMAGE: gitlab-registry.cern.ch/cmsos/docker/docker-image-cmsos-16-cc8-x64-worksuite:2.4.0.0
ARTIFACT_PREREQUISITE_DIR: "$CI_PROJECT_DIR/prerequisites/"
......@@ -152,7 +152,7 @@ interface/shared:
extends: .build_package
before_script:
interface/bril:
interface/bril/shared:
extends: .build_package
before_script:
......@@ -227,7 +227,7 @@ dipbridge:
oms:
extends: .build_package
before_script:
- export DEPENDENCY_LIST="interface/bril"
- export DEPENDENCY_LIST="interface/bril/shared"
d2s/fedemulator:
extends: .build_package
......@@ -490,7 +490,7 @@ deploy:
- xdaq2rc
- interface/evb
- interface/shared
- interface/bril
- interface/bril/shared
- evb
- jobcontrol
- xpci/drv
......@@ -611,7 +611,7 @@ git:
- xdaq2rc
- interface/evb
- interface/shared
- interface/bril
- interface/bril/shared
- evb
- jobcontrol
- xpci/drv
......@@ -732,7 +732,7 @@ yum:
- xdaq2rc
- interface/evb
- interface/shared
- interface/bril
- interface/bril/shared
- evb
- jobcontrol
- xpci/drv
......
......@@ -33,7 +33,7 @@ PACKAGES= \
xdaq2rc \
interface/evb \
interface/shared \
interface/bril \
interface/bril/shared \
evb \
jobcontrol \
xpci/drv \
......
......@@ -16,7 +16,7 @@ Package=amc13controller
PACKAGE_REQUIRED_PACKAGE_LIST = \
cactuscore-uhal-uhal >= 2.7.9 \
cactuscore-uhal-log >= 2.7.9 \
cactusboards-amc13-amc13 >= 1.2.17 \
cactusboards-amc13-amc13 >= 1.2.18 \
boost-filesystem >= 1.53.0 \
boost-regex >= 1.53.0 \
boost-system >= 1.53.0 \
......
......@@ -7,11 +7,11 @@
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_AMC13CONTROLLER_VERSION_MAJOR 1
#define WORKSUITE_AMC13CONTROLLER_VERSION_MINOR 3
#define WORKSUITE_AMC13CONTROLLER_VERSION_MINOR 4
#define WORKSUITE_AMC13CONTROLLER_VERSION_PATCH 0
// If any previous versions available E.g. #define WORKSUITE_AMC13_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#undef WORKSUITE_AMC13CONTROLLER_PREVIOUS_VERSIONS
#define WORKSUITE_AMC13CONTROLLER_PREVIOUS_VERSIONS "1.0.0, 1.0.1, 1.1.0,1.1.1,1.2.0"
#define WORKSUITE_AMC13CONTROLLER_PREVIOUS_VERSIONS "1.0.0, 1.0.1, 1.1.0,1.1.1,1.2.0,1.3.0"
//
// Template macros
......
// $Id$
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2020, CERN. *
* Copyright (C) 2000-2021, CERN. *
* All rights reserved. *
* Authors: Zhen Xie, Luciano Orsini, Dainius Simelevicius *
* Authors: Zhen Xie, Luciano Orsini and Dainius Simelevicius *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
......@@ -49,6 +47,22 @@ namespace dipbridge
class PubErrorHandler;
class ServerErrorHandler;
enum Command{update, destroy, incUpdate, incPublish, dipPublish};
class DipCommand
{
public:
DipCommand(Command c, const std::string & topic);
DipCommand(Command c, const std::string & topic, xdata::Table::Reference & tabRef);
Command getCommand();
std::string getTopic();
xdata::Table::Reference getTable();
protected:
Command c_;
std::string topic_;
xdata::Table::Reference tabRef_;
};
/**
receive xdata::Table from eventing and publish it to dip
subscribe to dip topic and send it as xdata::Table to eventing
......@@ -58,64 +72,64 @@ namespace dipbridge
public eventing::api::Member,
public xdata::ActionListener,
public toolbox::ActionListener,
public DipSubscriptionListener,
public toolbox::task::TimerListener
public DipSubscriptionListener
{
public:
XDAQ_INSTANTIATOR();
// constructor
Application(xdaq::ApplicationStub* s);
Application(xdaq::ApplicationStub * s);
// destructor
~Application();
// xgi(web) callback
void Default(xgi::Input * in, xgi::Output * out);
// infospace event callback
virtual void actionPerformed(xdata::Event& e);
virtual void actionPerformed(xdata::Event & e);
// toolbox event callback
virtual void actionPerformed(toolbox::Event& e);
virtual void actionPerformed(toolbox::Event & e);
// b2in callback
void onMessage(toolbox::mem::Reference * ref, xdata::Properties & plist);
// timer callback
void timeExpired(toolbox::task::TimerEvent& e);
// dip message handler
void handleMessage(DipSubscription* dipsub, DipData& message);
void handleMessage(DipSubscription * dipsub, DipData & message);
// DipSubscriptionListener methods
void connected(DipSubscription* dipsub);
void connected(DipSubscription * dipsub);
// DipSubscriptionListener methods
void disconnected(DipSubscription* subscription,char *reason);
void disconnected(DipSubscription * subscription, char * reason);
// DipSubscriptionListener methods
void handleException(DipSubscription* subscription, DipException& ex);
// workloop method
bool publishingToDip( toolbox::task::WorkLoop* wl );
void handleException(DipSubscription * subscription, DipException & ex);
private:
void publishDipMessageToEventing( const std::string& dipname, xdata::Table& dipmessage);
void publishDipMessageToEventing(const std::string & dipname, xdata::Table & dipmessage);
void process(std::string name);
void init(std::string name);
protected:
std::string m_processuuid;
std::string m_startsubtimer_name;
toolbox::BSem m_applock;
bool m_busready;
DipFactory* pm_dip;
toolbox::mem::Pool* pm_memPool;
PubErrorHandler* pm_puberrorhandler;
ServerErrorHandler* pm_servererrorhandler;
std::string processuuid_;
toolbox::BSem applock_;
bool busready_;
DipFactory * dip_;
toolbox::mem::Pool * memPool_;
PubErrorHandler * puberrorhandler_;
ServerErrorHandler * servererrorhandler_;
// config parameters
xdata::String m_bus;
xdata::Vector< xdata::String > m_dipSubTopics;
xdata::String m_dipDataTopic;
xdata::Integer32 m_throttle_threshold_millisec;
xdata::String bus_;
xdata::Vector< xdata::String > dipSubTopics_;
std::string dipDataTopic_;
xdata::Integer32 throttleThresholdMillisec_;
// registries
std::map< std::string,DipSubscription* > m_dipsubs;
std::map< std::string,dipDataInsert* > m_dippubs;
std::map< std::string,long long > m_millisecsincelast;
xdata::exdr::Serializer m_serializer;
// outdata queue
std::map< dipDataInsert*, toolbox::squeue< xdata::Table::Reference >* > m_dippubqueuestore;
// workloops
toolbox::task::WorkLoop* pm_pubtodip_wl;
toolbox::task::ActionSignature* pm_pubtodip_as;
std::map< std::string, DipSubscription* > dipsubs_;
std::map< std::string, dipDataInsert* > dippubs_;
std::map< std::string, long long > millisecSinceLast_;
xdata::exdr::Serializer serializer_;
// statistics
typedef struct stat
{
size_t requestDipUpdateCounter;
size_t updateDipCounter;
size_t publishToEventingCounter;
} Stat;
std::map< std::string, Stat > statistics_;
toolbox::squeue < DipCommand* > commandQueue_;
};
}
#endif
......@@ -22,11 +22,12 @@
#include "xgi/exception/Exception.h"
#include "xdata/String.h"
#include "xdata/Table.h"
#include "toolbox/ActionListener.h"
#include <list>
namespace dipbridge
{
class subscriber : public xdaq::Application, public xgi::framework::UIManager, public eventing::api::Member,public xdata::ActionListener
class subscriber : public xdaq::Application, public xgi::framework::UIManager, public eventing::api::Member,public xdata::ActionListener, public toolbox::ActionListener
{
public:
XDAQ_INSTANTIATOR();
......@@ -36,10 +37,14 @@ namespace dipbridge
~subscriber();
// xgi(web) callback
void Default(xgi::Input * in, xgi::Output * out);
void metaregister(xgi::Input * in, xgi::Output * out);
void metaunregister(xgi::Input * in, xgi::Output * out);
// infospace callback
virtual void actionPerformed(xdata::Event& e);
// b2in message callback
void onMessage(toolbox::mem::Reference * ref, xdata::Properties & plist);
void actionPerformed (toolbox::Event& e);
private:
xdata::String m_bus;
xdata::String m_topics;
......
// $Id$
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2020, CERN. *
* Copyright (C) 2000-2021, CERN. *
* All rights reserved. *
* Authors: Zhen Xie, Luciano Orsini, Dainius Simelevicius *
* Authors: Zhen Xie, Luciano Orsini, Dainius Simelevicius *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
......@@ -17,7 +15,7 @@
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_DIPBRIDGE_VERSION_MAJOR 3
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR 0
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR 3
#define WORKSUITE_DIPBRIDGE_VERSION_PATCH 0
// If any previous versions available E.g. #define ESOURCE_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#define DIPBRIDGE_PREVIOUS_VERSIONS
......
This diff is collapsed.
......@@ -40,6 +40,13 @@ xdata::Table::Reference dipbridge::dipDataExtract::getAll( const DipData& dipdat
std::stringstream ss;
int nfields;
xdata::Table* data = new xdata::Table;
//Adding timestamp
const DipTimestamp dipt = dipdata.extractDipTime();
data->addColumn("DipTimestamp", "int 64");
xdata::Integer64 fieldvalue(dipt.getAsMillis());
data->setValueAt(0, "DipTimestamp", fieldvalue);
const char** allfields = dipdata.getTags(nfields);
for(int i=0; i<nfields; ++i)
{
......
......@@ -32,7 +32,10 @@ XDAQ_INSTANTIATOR_IMPL (dipbridge::subscriber)
dipbridge::subscriber::subscriber(xdaq::ApplicationStub* s) : xdaq::Application(s),xgi::framework::UIManager(this),eventing::api::Member(this)
{
xgi::framework::deferredbind(this,this,&dipbridge::subscriber::Default,"Default");
xgi::framework::deferredbind(this,this,&dipbridge::subscriber::Default,"Default");
xgi::bind(this, &dipbridge::subscriber::metaregister, "register");
xgi::bind(this, &dipbridge::subscriber::metaunregister, "unregister");
b2in::nub::bind(this, &dipbridge::subscriber::onMessage);
m_bus.fromString("dip");
getApplicationInfoSpace()->fireItemAvailable("bus",&m_bus);
......@@ -124,6 +127,14 @@ void dipbridge::subscriber::actionPerformed(xdata::Event& e)
if( e.type() == "urn:xdaq-event:setDefaultValues" )
{
// User should listen for publsh readiness, but should also check immediately
this->getEventingBus(m_bus.value_).addActionListener(this);
if (this->getEventingBus(m_bus.value_).canPublish())
{
// ready now
std::cout << "Eventing bus is ready at setDefaultValues" << std::endl;
}
m_intopics = toolbox::parseTokenList(m_topics.value_,",");
try
{
......@@ -141,4 +152,38 @@ void dipbridge::subscriber::actionPerformed(xdata::Event& e)
}
}
void dipbridge::subscriber::actionPerformed (toolbox::Event& event)
{
if (event.type() == "eventing::api::BusReadyToPublish")
{
std::string busname = (static_cast<eventing::api::Bus*>(event.originator()))->getBusName();
std::cout << "event Bus '" << busname << "' is ready to publish" << std::endl;
}
}
void dipbridge::subscriber::metaregister (xgi::Input * in, xgi::Output * out)
{
// create fake message with fake property
xdata::Properties plist;
plist.setProperty("urn:dip:action", "register");
plist.setProperty("urn:dip:topicname", "dip/CMS/MCS/Current");
this->getEventingBus(m_bus.toString()).publish("urn:dip:metacontrol", 0, plist);
std::cout << "message sent" << std::endl;
out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
}
void dipbridge::subscriber::metaunregister (xgi::Input * in, xgi::Output * out)
{
// create fake message with fake property
xdata::Properties plist;
plist.setProperty("urn:dip:action", "unregister");
plist.setProperty("urn:dip:topicname", "dip/CMS/MCS/Current");
this->getEventingBus(m_bus.toString()).publish("urn:dip:metacontrol", 0, plist);
std::cout << "message sent" << std::endl;
out->getHTTPResponseHeader().addHeader("Content-Type", "text/plain");
}
<?xml version="1.0" encoding="UTF-8"?>
<xc:Partition xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xc="http://xdaq.web.cern.ch/xdaq/xsd/2004/XMLConfiguration-30" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xc:Context url="http://kvm-s3562-1-ip151-69.cms:9868">
<xc:Context url="http://kvm-s3562-1-ip151-69.cms:1972">
<xc:Endpoint protocol="utcp" service="b2in" rmode="select" hostname="kvm-s3562-1-ip151-69.cms" port="9869" network="slimnet" sndTimeout="2000" rcvTimeout="2000" affinity="RCV:P,SND:W,DSR:W,DSS:W" singleThread="true" publish="true"/>
<xc:Application class="eventing::core::Subscriber" id="11" instance="0" network="slimnet" group="b2in" service="eventing-subscriber" bus="slimbus">
......@@ -14,15 +14,25 @@
<xc:Module>${XDAQ_ROOT}/lib/libb2inutils.so</xc:Module>
<xc:Module>${XDAQ_ROOT}/lib/libeventingapi.so</xc:Module>
<xc:Module>${XDAQ_ROOT}/lib/libeventingcore.so</xc:Module>
<xc:Application class="eventing::core::Publisher" id="63" instance="0" network="slimnet" bus="slimbus" service="eventing-publisher" logpolicy="inherit">
<properties xmlns="urn:xdaq-application:eventing::core::Publisher" xsi:type="soapenc:Struct">
<eventings xsi:type="soapenc:Array" soapenc:arrayType="xsd:ur-type[1]">
<item xsi:type="xsd:string" soapenc:position="[0]">utcp://kvm-s3562-1-ip151-131.cms:1977</item>
</eventings>
</properties>
</xc:Application>
<xc:Module>${XDAQ_ROOT}/lib/libeventingapi.so</xc:Module>
<xc:Module>${XDAQ_ROOT}/lib/libeventingcore.so</xc:Module>
<xc:Application class="dipbridge::subscriber" id="101" instance="0" network="local" logpolicy="inherit">
<properties xmlns="urn:xdaq-dipbridge::subscriber" xsi:type="soapenc:Struct">
<bus xsi:type="xsd:string">slimbus</bus>
<!-- topics xsi:type="xsd:string">dip/acc/LHC/Beam/Energy,dip/acc/LHC/Beam/IntensityPerBunch/Beam1,dip/acc/LHC/Beam/IntensityPerBunch/Beam2</topics -->
<topics xsi:type="xsd:string">dip/CMS/MCS/Current,dip/CMS/DCS/CMS_CSC/CMS_CSCM/state,dip/CMS/DCS/CMS_CSC/CMS_CSCP/state,dip/CMS/DCS/CMS_DT/CMS_DT_DT0/state,dip/CMS/DCS/CMS_DT/CMS_DT_DTM/state,dip/CMS/DCS/CMS_DT/CMS_DT_DTP/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_BM/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_BP/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_EM/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_EP/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_ESM/state,dip/CMS/DCS/CMS_ECAL/CMS_ECAL_ESP/state,dip/CMS/DCS/CMS_HCAL/CMS_HCAL_HEHBa/state,dip/CMS/DCS/CMS_HCAL/CMS_HCAL_HEHBb/state,dip/CMS/DCS/CMS_HCAL/CMS_HCAL_HEHBc/state,dip/CMS/DCS/CMS_HCAL/CMS_HCAL_HF/state,dip/CMS/DCS/CMS_HCAL/CMS_HCAL_HO/state,dip/CMS/DCS/CMS_PIXEL/CMS_PIXEL_BPIX/state,dip/CMS/DCS/CMS_PIXEL/CMS_PIXEL_FPIX/state,dip/CMS/DCS/CMS_RPC/state,dip/CMS/DCS/CMS_TRACKER/CMS_TRACKER_TECM/state,dip/CMS/DCS/CMS_TRACKER/CMS_TRACKER_TECP/state,dip/CMS/DCS/CMS_TRACKER/CMS_TRACKER_TIB_TID/state,dip/CMS/DCS/CMS_TRACKER/CMS_TRACKER_TOB/state</topics>
</properties>
<topics xsi:type="xsd:string">dip/CMS/MCS/Current</topics>
</properties>
</xc:Application>
<xc:Module>/nfshome0/lorsini/devel/localbus/worksuite/dipbridge/lib/linux/x86_64_centos7/libdipbridge.so</xc:Module>
<xc:Module>/usr/repos/worksuite/dipbridge/lib/linux/x86_64_centos7/libdipbridge.so</xc:Module>
</xc:Context>
......
// $Id$
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2018, CERN. *
* Copyright (C) 2000-2021, CERN. *
* All rights reserved. *
* Authors:L. Orsini, P. Roberts, D. Simelevicius *
* *
......@@ -18,9 +16,9 @@
#define WORKSUITE_ELASTICTIMESTREAM_VERSION_MAJOR 2
#define WORKSUITE_ELASTICTIMESTREAM_VERSION_MINOR 4
#define WORKSUITE_ELASTICTIMESTREAM_VERSION_PATCH 0
#define WORKSUITE_ELASTICTIMESTREAM_VERSION_PATCH 2
// If any previous versions available E.g. #define WORKSUITE_ELASTICTIMESTREAM_PREVIOUS_VERSIONS ""
#undef WORKSUITE_ELASTICTIMESTREAM_PREVIOUS_VERSIONS
#define WORKSUITE_ELASTICTIMESTREAM_PREVIOUS_VERSIONS "2.4.1"
//
// Template macros
......
......@@ -253,32 +253,33 @@ void elastic::timestream::Application::actionPerformed(xdata::Event& event)
try
{
if ( dynamicMetadata_ )
toolbox::Properties properties;
if ( httpVerbose_ )
{
toolbox::Properties properties;
if ( httpVerbose_ )
{
properties.setProperty("urn:es-api-stream:CURLOPT_VERBOSE","true");
}
if ( tcpNoDelay_ )
{
properties.setProperty("urn:es-api-stream:CURLOPT_TCP_NODELAY","true");
}
properties.setProperty("urn:es-api-stream:CURLOPT_VERBOSE","true");
}
if ( tcpNoDelay_ )
{
properties.setProperty("urn:es-api-stream:CURLOPT_TCP_NODELAY","true");
}
LOG4CPLUS_INFO(this->getApplicationLogger(), "Attaching to elastic search...");
LOG4CPLUS_INFO(this->getApplicationLogger(), "Attaching to elastic search...");
if ( (bool)(elasticsearchConnectionForbidReuse_) )
{
properties.setProperty("urn:es-api-stream:CURLOPT_FORBID_REUSE", "true");
}
if ( (bool)(elasticsearchConnectionForbidReuse_) )
{
properties.setProperty("urn:es-api-stream:CURLOPT_FORBID_REUSE", "true");
}
properties.setProperty("urn:es-api-cluster:number-of-channels", numberOfChannels_.toString());
properties.setProperty("urn:es-api-cluster:number-of-channels", numberOfChannels_.toString());
member_ = new elastic::api::Member(this, properties);
member_ = new elastic::api::Member(this, properties);
//curl -XPOST -H 'Content-Type: application/json' 'http://cmsos-iaas-cdaq.cms:9200/cmsos-meta-development-tags/_doc/_search?pretty' -d '{ "size": 1, "sort": { "timestamp": "desc"}, "query": { "match_all": {}}}'
std::string zone = this->getApplicationContext()->getDefaultZoneName();
elastic::api::Cluster& cluster = member_->joinCluster(elasticsearchClusterUrl_.toString());
//curl -XPOST -H 'Content-Type: application/json' 'http://cmsos-iaas-cdaq.cms:9200/cmsos-meta-development-tags/_doc/_search?pretty' -d '{ "size": 1, "sort": { "timestamp": "desc"}, "query": { "match_all": {}}}'
std::string zone = this->getApplicationContext()->getDefaultZoneName();
elastic::api::Cluster& cluster = member_->joinCluster(elasticsearchClusterUrl_.toString());
if ( dynamicMetadata_ )
{
if ( autoTag_ != "" ) // retrieve tag from elasticsearch
{
tag_ = "";
......@@ -400,12 +401,17 @@ void elastic::timestream::Application::timeExpired(toolbox::task::TimerEvent& e)
void elastic::timestream::Application::onMessage(toolbox::mem::Reference* ref, xdata::Properties& plist)
{
// some protections
if (enable_ == false)
if (ref == 0)
{
return;
}
if (ref == 0)
// some protections
if (enable_ == false)
{
ref->release();
return;
}
std::string qname = plist.getProperty("urn:xmas-flashlist:name");
......@@ -426,7 +432,6 @@ void elastic::timestream::Application::onMessage(toolbox::mem::Reference* ref, x
return;
}
toolbox::mem::Reference * localRef;
if (spoolerPool_->isHighThresholdExceeded())
......@@ -482,7 +487,6 @@ void elastic::timestream::Application::onMessage(toolbox::mem::Reference* ref, x
return;
}
elastic::timestream::Event * ep = new elastic::timestream::Event(plist, localRef);
toolbox::task::EventReference e(ep);
......@@ -507,12 +511,10 @@ void elastic::timestream::Application::onMessage(toolbox::mem::Reference* ref, x
}
catch(toolbox::task::exception::InternalError& e)
{
// we do not know what happen to this reference, therefore we cannot free , this reference can be considered lost
//localRef->release();
localRef->release();
statistics_[qname].lossQueueFullCounter++;
std::stringstream msg;
msg << "Failed to dispatch event report for flashlist '" << qname << "' , a memory reference can be lost";
std::stringstream msg;
msg << "Failed to dispatch event report for flashlist '" << qname << "'";
XCEPT_DECLARE_NESTED(elastic::timestream::exception::Exception, q, msg.str(), e);
this->notifyQualified("fatal", q);
}
......
#ifndef _interface_bril_Utils_h
#define _interface_bril_Utils_h
#include <vector>
#include <string>
namespace interface{ namespace bril{ namespace Utils{
static std::vector<std::string> splitstring(const std::string& input, char separator = ' '){
const char* str=input.c_str();
std::vector<std::string> result;
do{
const char* begin = str;
while(*str != separator && *str){
str++;
}
result.push_back(std::string(begin,str));
} while (0 != *str++);
return result;
}
}}}
#endif
BUILD_HOME:=$(shell pwd)/../..
BUILD_HOME:=$(shell pwd)/../../..
BUILD_SUPPORT=build
PROJECT_NAME=worksuite
......@@ -8,12 +8,16 @@ include $(XDAQ_ROOT)/$(BUILD_SUPPORT)/mfDefs.$(XDAQ_OS)
include $(BUILD_HOME)/mfDefs.$(PROJECT_NAME)
Project=$(PROJECT_NAME)
Package=interface/bril
PackageName=interfacebril
Package=interface/bril/shared
PackageName=interfacebrilshared
Sources=version.cc
IncludeDirs=
DynamicLibrary=interfacebril
IncludeDirs=$(CONFIG_INCLUDE_PREFIX)
#
# Compile the source files and create a shared library
#
DynamicLibrary=interfacebrilshared
include $(XDAQ_ROOT)/$(BUILD_SUPPORT)/Makefile.rules
include $(XDAQ_ROOT)/$(BUILD_SUPPORT)/mfRPM.rules
#ifndef _interface_bril_CommonDataFormat_h_
#define _interface_bril_CommonDataFormat_h_
#ifndef _interface_bril_shared_CommonDataFormat_h_
#define _interface_bril_shared_CommonDataFormat_h_
#include <string>
#include "interface/bril/CompoundDataStreamer.h"
#include "interface/bril/shared/CompoundDataStreamer.h"
#define STRINGIZE_NX(z) #z
#define STRINGIZE(z) STRINGIZE_NX(z)
......@@ -10,9 +10,12 @@
#define PPCAT(A,B) PPCAT_NX(A,B)
#define PPCAT_DOT(A,B) PPCAT(PPCAT(A,.),B)
namespace interface{ namespace bril{
namespace interface{
namespace bril{
namespace shared{
//static const std::string DATA_VERSION = STRINGIZE( PPCAT_DOT(INTERFACEBRIL_VERSION_MAJOR,INTERFACEBRIL_VERSION_MINOR) );
//required common property for bril data "DATA_VERSION" to compare with interface::bril::DATA_VERSION
//required common property for bril data "DATA_VERSION" to compare with interface::bril::shared::DATA_VERSION
static const std::string DATA_VERSION = "1.1";
const unsigned int MAX_NUM_LOOKUPITEMS = 26;
......@@ -30,7 +33,7 @@ struct LookupItem{unsigned int id; std::string name;};
#define DEFINE_LOOKUPTABLE(Xnsname,ENUM_DEF) namespace Xnsname{ \
enum{ENUM_DEF(ENUM_VALUE)}; \