This class provides an example for writing event data objects to Pool.
More...
#include <AthenaRootSharedWriterSvc.h>
This class provides an example for writing event data objects to Pool.
Definition at line 25 of file AthenaRootSharedWriterSvc.h.
◆ AthenaRootSharedWriterSvc()
AthenaRootSharedWriterSvc::AthenaRootSharedWriterSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~AthenaRootSharedWriterSvc()
virtual AthenaRootSharedWriterSvc::~AthenaRootSharedWriterSvc |
( |
| ) |
|
|
virtualdefault |
◆ finalize()
StatusCode AthenaRootSharedWriterSvc::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode AthenaRootSharedWriterSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Gaudi Service Interface method implementations:
Definition at line 163 of file AthenaRootSharedWriterSvc.cxx.
168 IProperty* propertyServer =
dynamic_cast<IProperty*
>(
m_cnvSvc.get());
169 if (propertyServer ==
nullptr) {
170 ATH_MSG_ERROR(
"Unable to cast conversion service to IProperty");
171 return StatusCode::FAILURE;
173 std::string propertyName =
"ParallelCompression";
174 bool parallelCompression(
false);
175 BooleanProperty parallelCompressionProp(propertyName, parallelCompression);
176 if (propertyServer->getProperty(¶llelCompressionProp).isFailure()) {
177 ATH_MSG_INFO(
"Conversion service does not have ParallelCompression property");
178 }
else if (parallelCompressionProp.value()) {
180 propertyName =
"StreamPortString";
181 std::string streamPortString(
"");
182 StringProperty streamPortStringProp(propertyName, streamPortString);
183 if (propertyServer->getProperty(&streamPortStringProp).isFailure()) {
184 ATH_MSG_INFO(
"Conversion service does not have StreamPortString property, using default: " << streamPort);
186 streamPort =
atoi(streamPortStringProp.value().substr(streamPortStringProp.value().find(
':') + 1).c_str());
188 m_rootServerSocket =
new TServerSocket(streamPort, (streamPort == 0 ?
false :
true), 100);
190 ATH_MSG_FATAL(
"Could not create ROOT TServerSocket: " << streamPort);
191 return StatusCode::FAILURE;
194 const std::string newStreamPortString{streamPortStringProp.value().substr(0,streamPortStringProp.value().find(
':')+1) +
std::to_string(streamPort)};
195 if (propertyServer->setProperty(propertyName,newStreamPortString).isFailure()) {
196 ATH_MSG_FATAL(
"Could not set Conversion Service property " << propertyName <<
" from " << streamPortString <<
" to " << newStreamPortString);
197 return StatusCode::FAILURE;
201 ATH_MSG_DEBUG(
"Successfully created ROOT TServerSocket and added it to TMonitor: ready to accept connections, " << streamPort);
205 const IAlgManager* algMgr = Gaudi::svcLocator()->as<IAlgManager>();
206 for (
const auto&
alg : algMgr->getAlgorithms()) {
207 if (
alg->type() ==
"AthenaOutputStream") {
208 ATH_MSG_DEBUG(
"Counting " <<
alg->name() <<
" as an output stream algorithm");
213 ATH_MSG_WARNING(
"No output stream algorithm found, setting the number of streams to 1");
219 return StatusCode::SUCCESS;
◆ share()
StatusCode AthenaRootSharedWriterSvc::share |
( |
int |
numClients = 0 , |
|
|
bool |
motherClient = false |
|
) |
| |
|
overridevirtual |
Definition at line 222 of file AthenaRootSharedWriterSvc.cxx.
229 while (
sc.isSuccess() ||
sc.isRecoverable() || anyActiveClients) {
230 if (
sc.isSuccess()) {
234 if (socket !=
nullptr && socket != (TSocket*)-1) {
236 if (socket->IsA() == TServerSocket::Class()) {
237 TSocket*
client = ((TServerSocket*)socket)->Accept();
254 ATH_MSG_ERROR(
"ROOT Monitor got an error while receiving the message from the socket: " <<
result);
255 return StatusCode::FAILURE;
258 ATH_MSG_WARNING(
"ROOT Monitor got no message from socket: " << socket);
259 }
else if (
message->What() == kMESS_STRING) {
264 ATH_MSG_DEBUG(
"ROOT Monitor client: " << socket <<
", " << socket->GetBytesRecv() <<
", " << socket->GetBytesSent());
269 anyActiveClients =
false;
270 ATH_MSG_INFO(
"ROOT Monitor: No more active clients...");
272 motherClient =
false;
273 ATH_MSG_INFO(
"ROOT Monitor: Mother process is done...");
274 if (!
m_cnvSvc->commitCatalog().isSuccess()) {
276 return StatusCode::FAILURE;
280 }
else if (
message->What() == kMESS_ANY) {
296 info->MergeTrees(
transient.
get());
305 if (
sc.isSuccess() ||
sc.isRecoverable()) {
307 if (
sc.isFailure() && !
sc.isRecoverable()) {
310 ATH_MSG_INFO(
"ROOT Monitor: No clients, terminating the loop...");
311 anyActiveClients =
false;
317 return StatusCode::SUCCESS;
◆ stop()
StatusCode AthenaRootSharedWriterSvc::stop |
( |
| ) |
|
|
overridevirtual |
◆ SvcFactory< AthenaRootSharedWriterSvc >
◆ m_cnvSvc
◆ m_numberOfStreams
int AthenaRootSharedWriterSvc::m_numberOfStreams |
|
private |
◆ m_rootClientCount
int AthenaRootSharedWriterSvc::m_rootClientCount |
|
private |
◆ m_rootClientIndex
int AthenaRootSharedWriterSvc::m_rootClientIndex |
|
private |
◆ m_rootMergers
THashTable AthenaRootSharedWriterSvc::m_rootMergers |
|
private |
◆ m_rootMonitor
TMonitor* AthenaRootSharedWriterSvc::m_rootMonitor |
|
private |
◆ m_rootServerSocket
TServerSocket* AthenaRootSharedWriterSvc::m_rootServerSocket |
|
private |
The documentation for this class was generated from the following files: