Commit cb707179 authored by Eric Cano's avatar Eric Cano
Browse files

Added missing support for BackendFactory in CTA xroot plugin.

parent c08adc26
......@@ -39,6 +39,7 @@
#include "XrdSec/XrdSecEntity.hh"
#include "XrdVersion.hh"
#include "objectstore/RootEntry.hpp"
#include "objectstore/BackendFactory.hpp"
#include <memory>
#include <iostream>
......@@ -257,12 +258,18 @@ void XrdProFilesystem::EnvInfo(XrdOucEnv *envP)
XrdProFilesystem::XrdProFilesystem():
m_ns(castor::common::CastorConfiguration::getConfig().getConfEntString("TapeServer", "MockNameServerPath")),
m_remoteStorage(castor::common::CastorConfiguration::getConfig().getConfEntString("TapeServer", "EOSRemoteHostAndPort")),
m_backend(castor::common::CastorConfiguration::getConfig().getConfEntString("TapeServer", "ObjectStoreBackendPath")),
m_backendPopulator(m_backend),
m_scheddb(m_backend, m_backendPopulator.getAgent()),
m_backend(cta::objectstore::BackendFactory::createBackend(
castor::common::CastorConfiguration::getConfig().getConfEntString("TapeServer", "ObjectStoreBackendPath"))
.release()),
m_backendPopulator(*m_backend),
m_scheddb(*m_backend, m_backendPopulator.getAgent()),
m_scheduler(m_ns, m_scheddb, m_remoteStorage)
{
m_backend.noDeleteOnExit();
// If the backend is a VFS, make sure we don't delete it on exit.
// If not, nevermind.
try {
dynamic_cast<cta::objectstore::BackendVFS &>(*m_backend).noDeleteOnExit();
} catch (std::bad_cast &){}
const cta::SecurityIdentity bootstrap_requester;
try {
m_scheduler.createAdminUserWithoutAuthorizingRequester(bootstrap_requester, cta::UserIdentity(getuid(),getgid()), "Bootstrap operator");
......
......@@ -72,7 +72,7 @@ protected:
/**
* The VFS backend for the objectstore DB
*/
cta::objectstore::BackendVFS m_backend;
std::unique_ptr<cta::objectstore::Backend> m_backend;
/**
* The object used to populate the backend
......
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