Skip to content

Commit bee4bd8

Browse files
committed
[occ] Yank out workaround for creating channels in FairMQ 1.3
1 parent 2c8715d commit bee4bd8

1 file changed

Lines changed: 0 additions & 43 deletions

File tree

occ/plugin/OccPluginServer.cxx

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -250,49 +250,6 @@ OccPluginServer::Transition(grpc::ServerContext* context,
250250

251251
try {
252252
auto evt = fair::mq::PluginServices::ToDeviceStateTransition(event);
253-
254-
// FIXME: big ugly workaround over here
255-
// Since FairMQ currently (11/2018) can't yet implicitly create channels when receiving
256-
// chans.* properties during INITIALIZING DEVICE, we must fake a --channel-config cli
257-
// parameter during INIT and before the INIT DEVICE event.
258-
// We extract channel related properties from the OCC transition arguments vector and we
259-
// build up a vector of strings which mimics stuff along the lines of
260-
// --channel-config name=data,type=push,method=bind,address=tcp://*:5555,rateLogging=0"
261-
// See https://github.com/FairRootGroup/FairMQ/pull/111
262-
// When the relevant FairMQ 1.4.x version implements implicit channel creation, this whole
263-
// block should be removed with no loss of functionality.
264-
if (evt == fair::mq::PluginServices::DeviceStateTransition::InitDevice) {
265-
std::unordered_map<std::string, std::unordered_map<std::string, std::string>> channels;
266-
for (auto it = arguments.cbegin(); it != arguments.cend(); ++it) {
267-
auto key = it->key();
268-
if (boost::starts_with(key, "chans.")) {
269-
key.erase(0, 6);
270-
std::vector<std::string> split;
271-
boost::split(split, key, std::bind1st(std::equal_to<char>(), '.'));
272-
if (split.size() != 3)
273-
continue;
274-
auto name = split[0];
275-
auto propKey = split[2];
276-
if (channels.find(name) == channels.end()) // if map for this chan doesn't exist yet
277-
channels[name] = std::unordered_map<std::string, std::string>();
278-
channels[name][propKey] = it->value();
279-
}
280-
}
281-
282-
std::vector<std::string> channelLines;
283-
for (auto it = channels.cbegin(); it != channels.cend(); ++it) {
284-
std::vector<std::string> line;
285-
line.push_back("name=" + it->first);
286-
for (auto jt = it->second.cbegin(); jt != it->second.cend(); ++jt) {
287-
line.push_back(jt->first + "=" + jt->second);
288-
}
289-
channelLines.push_back(boost::join(line, ","));
290-
OLOG(DEBUG) << "[request Transition] pushing channel configuration " << channelLines.back();
291-
}
292-
if (!channelLines.empty()) {
293-
m_pluginServices->SetProperty("channel-config", channelLines);
294-
}
295-
}
296253
m_pluginServices->ChangeDeviceState("OCC", evt);
297254
}
298255
catch (fair::mq::PluginServices::DeviceControlError& e) {

0 commit comments

Comments
 (0)