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

Partially completed process manager and plugged in cleaner session.

parent a44c9bc1
......@@ -28,8 +28,8 @@
#include "common/exception/InvalidArgument.hpp"
#include "common/exception/NoPortInRange.hpp"
#include "common/exception/TimeOut.hpp"
#include "castor/io/Constants.hpp"
#include "castor/io/IpAndPort.hpp"
#include "Constants.hpp"
#include "IpAndPort.hpp"
#include "common/exception/Exception.hpp"
#include <errno.h>
......
......@@ -23,7 +23,7 @@
#pragma once
#include "h/Castor_limits.h"
#include "tapeserver/h/Castor_limits.h"
#include <stdint.h>
namespace castor {
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/ScsiLibrarySlot.hpp"
#include "tapeserver/castor/mediachanger/ScsiLibrarySlot.hpp"
#include "common/exception/Exception.hpp"
#include <string>
......
......@@ -21,14 +21,14 @@
#pragma once
#include "castor/io/io.hpp"
#include "castor/legacymsg/MessageHeader.hpp"
#include "castor/legacymsg/RmcMountMsgBody.hpp"
#include "castor/legacymsg/RmcProxy.hpp"
#include "castor/legacymsg/RmcUnmountMsgBody.hpp"
#include "castor/utils/utils.hpp"
#include "tapeserver/castor/io/io.hpp"
#include "MessageHeader.hpp"
#include "RmcMountMsgBody.hpp"
#include "RmcProxy.hpp"
#include "RmcUnmountMsgBody.hpp"
#include "tapeserver/castor/utils/utils.hpp"
#include "common/SmartFd.hpp"
#include "h/rmc_constants.h"
#include "tapeserver/h/rmc_constants.h"
#include <unistd.h>
#include <sys/types.h>
......
......@@ -23,7 +23,7 @@
#pragma once
#include "h/Castor_limits.h"
#include "tapeserver/h/Castor_limits.h"
#include <stdint.h>
namespace castor {
......
......@@ -22,7 +22,7 @@
#pragma once
#include "common/exception/InvalidArgument.hpp"
#include "castor/mediachanger/LibrarySlot.hpp"
#include "tapeserver/castor/mediachanger/LibrarySlot.hpp"
#include <stdint.h>
......
......@@ -23,7 +23,7 @@
#pragma once
#include "castor/mediachanger/TapeLibraryType.hpp"
#include "tapeserver/castor/mediachanger/TapeLibraryType.hpp"
#include <string>
......
......@@ -23,10 +23,10 @@
#pragma once
#include "castor/mediachanger/LibrarySlot.hpp"
#include "castor/mediachanger/AcsLibrarySlot.hpp"
#include "castor/mediachanger/ManualLibrarySlot.hpp"
#include "castor/mediachanger/ScsiLibrarySlot.hpp"
#include "LibrarySlot.hpp"
#include "AcsLibrarySlot.hpp"
#include "ManualLibrarySlot.hpp"
#include "ScsiLibrarySlot.hpp"
namespace castor {
namespace mediachanger {
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/LibrarySlot.hpp"
#include "LibrarySlot.hpp"
namespace castor {
namespace mediachanger {
......
......@@ -21,11 +21,11 @@
#pragma once
#include "castor/legacymsg/RmcProxy.hpp"
#include "castor/mediachanger/LibrarySlot.hpp"
#include "castor/mediachanger/MmcProxy.hpp"
#include "castor/mediachanger/MmcProxyNotSupported.hpp"
#include "castor/messages/AcsProxy.hpp"
#include "tapeserver/castor/legacymsg/RmcProxy.hpp"
#include "LibrarySlot.hpp"
#include "MmcProxy.hpp"
#include "MmcProxyNotSupported.hpp"
#include "tapeserver/castor/messages/AcsProxy.hpp"
#include <unistd.h>
#include <sys/types.h>
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/ManualLibrarySlot.hpp"
#include "ManualLibrarySlot.hpp"
#include <string>
......
......@@ -22,7 +22,7 @@
#pragma once
#include "common/log/Logger.hpp"
#include "castor/mediachanger/MmcProxy.hpp"
#include "MmcProxy.hpp"
namespace castor {
namespace mediachanger {
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/MmcProxy.hpp"
#include "MmcProxy.hpp"
namespace castor {
namespace mediachanger {
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/LibrarySlot.hpp"
#include "LibrarySlot.hpp"
#include <stdint.h>
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/mediachanger/AcsLibrarySlot.hpp"
#include "tapeserver/castor/mediachanger/AcsLibrarySlot.hpp"
#include <stdint.h>
#include <string>
......
......@@ -19,7 +19,7 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/messages/AcsProxyDummy.hpp"
#include "AcsProxyDummy.hpp"
//------------------------------------------------------------------------------
// mountTapeReadOnly
......
......@@ -21,10 +21,10 @@
#pragma once
#include "castor/messages/AcsProxy.hpp"
#include "castor/messages/Frame.hpp"
#include "castor/messages/Mutex.hpp"
#include "castor/messages/ZmqSocketMT.hpp"
#include "AcsProxy.hpp"
#include "Frame.hpp"
#include "Mutex.hpp"
#include "ZmqSocketMT.hpp"
namespace castor {
namespace messages {
......
......@@ -24,8 +24,8 @@
#pragma once
#include "castor/messages/Header.pb.h"
#include "castor/messages/ZmqMsg.hpp"
#include "castor/utils/utils.hpp"
#include "ZmqMsg.hpp"
#include "tapeserver/castor/utils/utils.hpp"
#include <google/protobuf/message.h>
#include <string>
......
......@@ -22,11 +22,14 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/messages/SmartZmqContext.hpp"
#include "tapeserver/castor/messages/SmartZmqContext.hpp"
#include "tapeserver/castor/utils/utils.hpp"
#include "common/log/Logger.hpp"
#include <errno.h>
#include <unistd.h>
#include <zmq.h>
#include <list>
//-----------------------------------------------------------------------------
// constructor
......@@ -106,3 +109,24 @@ void *castor::messages::SmartZmqContext::release() {
return tmp;
}
//-----------------------------------------------------------------------------
// release
//-----------------------------------------------------------------------------
void* castor::messages::SmartZmqContext::instantiateZmqContext(const int sizeOfIOThreadPoolForZMQ, cta::log::Logger& log) {
void *const zmqContext = zmq_init(sizeOfIOThreadPoolForZMQ);
if(NULL == zmqContext) {
const std::string message = castor::utils::errnoToString(errno);
cta::exception::Exception ex;
ex.getMessage() << "Child of ProcessForker failed to instantiate ZMQ"
" context: " << message;
throw ex;
}
std::ostringstream contextAddr;
contextAddr << std::hex << zmqContext;
std::list<cta::log::Param> params = {cta::log::Param("contextAddr", contextAddr.str())};
log(cta::log::INFO, "Child of ProcessForker instantiated a ZMQ context", params);
return zmqContext;
}
......@@ -24,6 +24,7 @@
#pragma once
#include "common/exception/NotAnOwner.hpp"
#include "common/log/Logger.hpp"
#include <stdio.h>
......@@ -98,6 +99,16 @@ public:
* @return The released ZMQ context.
*/
void *release() ;
/**
* Helper function instancing a ZMQ context.
* @param sizeOfIOThreadPoolForZMQ The size of the IO thread pool to be used
* by ZMQ.
* @param log a reference to the logger, provided by the caller.
* @return The ZMQ context.
*/
static void *instantiateZmqContext(const int sizeOfIOThreadPoolForZMQ,
cta::log::Logger & log);
private:
......
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