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

references #137: adapting xmas-store to work without discovery services

parent e6213da1
......@@ -35,7 +35,7 @@ namespace xmas
DescriptorsCache(xdaq::Application* owner);
void actionPerformed(toolbox::Event& event);
void addURL(const std::string & url);
void addURL(const std::string & url, const std::string & group);
std::list<xdaq::ApplicationDescriptorImpl> getDescriptors(std::set<std::string>& groups, const std::string & service);
private:
......
......@@ -231,7 +231,7 @@ void xmas::store2g::Application::actionPerformed (toolbox::Event& event)
try
{
LOG4CPLUS_DEBUG(this->getApplicationLogger(), "Adding tstore: " << (*i).toString());
descriptorsCache_.addURL(*i);
descriptorsCache_.addURL(*i, storeGroup_.toString());
}
catch(xmas::store2g::exception::Exception & e)
{
......@@ -241,6 +241,9 @@ void xmas::store2g::Application::actionPerformed (toolbox::Event& event)
LOG4CPLUS_ERROR (this->getApplicationLogger(), xcept::stdformat_exception_history(ex));
}
}
toolbox::TimeInterval interval;
interval.fromString(period_.toString());
stager_.enable(interval, storeGroup_.toString(), storeView_.toString(), db_.toString());
}
}
......@@ -317,15 +320,18 @@ void xmas::store2g::Application::actionPerformed (xdata::Event& event)
}
// initialize discovery services
try
{
this->subscribeToDiscoveryServices(); // this function can throw
LOG4CPLUS_INFO(this->getApplicationLogger(), "Use xmas store with dynamic (discovery service) configuration");
}
catch (xdaq::exception::Exception& e)
if (eventings_.elements() == 0)
{
LOG4CPLUS_FATAL(this->getApplicationLogger(), xcept::stdformat_exception_history(e));
// initialize discovery services
try
{
this->subscribeToDiscoveryServices(); // this function can throw
LOG4CPLUS_INFO(this->getApplicationLogger(), "Use xmas store with dynamic (discovery service) configuration");
}
catch (xdaq::exception::Exception& e)
{
LOG4CPLUS_FATAL(this->getApplicationLogger(), xcept::stdformat_exception_history(e));
}
}
if ( oclFileName_.toString() != "" ) // for backward compatibility if paramater not specified
......
......@@ -101,7 +101,7 @@ void xmas::store2g::DescriptorsCache::actionPerformed( toolbox::Event& event)
mutex_.give();
}
void xmas::store2g::DescriptorsCache::addURL(const std::string & url)
void xmas::store2g::DescriptorsCache::addURL(const std::string & url, const std::string & group)
{
mutex_.take();
......@@ -147,12 +147,14 @@ void xmas::store2g::DescriptorsCache::addURL(const std::string & url)
xdaq::ApplicationDescriptorImpl* descriptor = 0;
try
{
descriptor = new xdaq::ApplicationDescriptorImpl(cd, "tstore::TStore", lid, "");
descriptor = new xdaq::ApplicationDescriptorImpl(cd, "tstore::TStore", lid, group);
}
catch (xdaq::exception::Exception & e)
{
LOG4CPLUS_ERROR(this->getOwnerApplication()->getApplicationLogger(), xcept::stdformat_exception_history(e));
}
descriptor->setAttribute("service", "tstore");
try
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment