![]() |
XRootD
|
A hub for dispatching and receiving messages. More...
#include <XrdClPostMaster.hh>
Public Member Functions | |
PostMaster () | |
Constructor. More... | |
virtual | ~PostMaster () |
Destructor. More... | |
void | CollapseRedirect (const URL &oldurl, const URL &newURL) |
Collapse channel URL - replace the URL of the channel. More... | |
void | DecFileInstCnt (const URL &url) |
Decrement file object instance count bound to this channel. More... | |
bool | Finalize () |
Finalizer. More... | |
Status | ForceDisconnect (const URL &url) |
Shut down a channel. More... | |
Status | ForceDisconnect (const URL &url, bool hush) |
Shut down a channel. More... | |
Status | ForceReconnect (const URL &url) |
Reconnect the channel. More... | |
JobManager * | GetJobManager () |
Get the job manager object user by the post master. More... | |
TaskManager * | GetTaskManager () |
Get the task manager object user by the post master. More... | |
bool | Initialize () |
Initializer. More... | |
bool | IsRunning () |
uint16_t | NbConnectedStrm (const URL &url) |
Get the number of connected data streams. More... | |
void | NotifyConnectHandler (const URL &url) |
Notify the global on-connect handler. More... | |
void | NotifyConnErrHandler (const URL &url, const XRootDStatus &status) |
Notify the global error connection handler. More... | |
Status | QueryTransport (const URL &url, uint16_t query, AnyObject &result) |
Status | Redirect (const URL &url, Message *msg, MsgHandler *handler) |
Status | RegisterEventHandler (const URL &url, ChannelEventHandler *handler) |
Register channel event handler. More... | |
bool | Reinitialize () |
Reinitialize after fork. More... | |
Status | RemoveEventHandler (const URL &url, ChannelEventHandler *handler) |
Remove a channel event handler. More... | |
XRootDStatus | Send (const URL &url, Message *msg, MsgHandler *handler, bool stateful, time_t expires) |
void | SetConnectionErrorHandler (std::function< void(const URL &, const XRootDStatus &)> handler) |
Set the global on-error on-connect handler for control streams. More... | |
void | SetOnConnectHandler (std::unique_ptr< Job > onConnJob) |
Set the global connection error handler. More... | |
void | SetOnDataConnectHandler (const URL &url, std::shared_ptr< Job > onConnJob) |
Set the on-connect handler for data streams. More... | |
bool | Start () |
Start the post master. More... | |
bool | Stop () |
Stop the postmaster. More... | |
A hub for dispatching and receiving messages.
Definition at line 47 of file XrdClPostMaster.hh.
XrdCl::PostMaster::PostMaster | ( | ) |
Constructor.
Definition at line 97 of file XrdClPostMaster.cc.
|
virtual |
Collapse channel URL - replace the URL of the channel.
Definition at line 422 of file XrdClPostMaster.cc.
References XrdCl::Channel::CanCollapse(), XrdCl::Log::Error(), XrdCl::URL::GetChannelId(), XrdCl::TransportManager::GetHandler(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetProtocol(), XrdCl::DefaultEnv::GetTransportManager(), XrdCl::Log::Info(), and XrdCl::PostMasterMsg.
Referenced by XrdCl::XRootDMsgHandler::Process().
void XrdCl::PostMaster::DecFileInstCnt | ( | const URL & | url | ) |
Decrement file object instance count bound to this channel.
Definition at line 474 of file XrdClPostMaster.cc.
References XrdCl::Channel::DecFileInstCnt().
Referenced by XrdCl::FileStateHandler::~FileStateHandler().
bool XrdCl::PostMaster::Finalize | ( | ) |
Finalizer.
Definition at line 138 of file XrdClPostMaster.cc.
Referenced by XrdCl::ForkHandler::Child(), and XrdCl::DefaultEnv::GetPostMaster().
Shut down a channel.
Definition at line 315 of file XrdClPostMaster.cc.
Referenced by XrdCl::Stream::OnReadTimeout().
Shut down a channel.
Definition at line 323 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::URL::GetChannelId(), and XrdCl::stError.
Reconnect the channel.
Definition at line 339 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::URL::GetChannelId(), and XrdCl::stError.
JobManager * XrdCl::PostMaster::GetJobManager | ( | ) |
Get the job manager object user by the post master.
Definition at line 307 of file XrdClPostMaster.cc.
Referenced by XrdCl::FileStateHandler::Close(), XrdCl::LocalFileHandler::QueueTask(), XrdCl::Operation< HasHndl >::Run(), XrdEc::ScheduleHandler(), and XrdCl::FileStateHandler::TimeOutRequests().
TaskManager * XrdCl::PostMaster::GetTaskManager | ( | ) |
Get the task manager object user by the post master.
Definition at line 299 of file XrdClPostMaster.cc.
Referenced by XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::GetPostMaster(), and XrdCl::XRootDMsgHandler::Process().
bool XrdCl::PostMaster::Initialize | ( | ) |
Initializer.
Definition at line 111 of file XrdClPostMaster.cc.
References XrdCl::PollerFactory::CreatePoller(), XrdCl::DefaultPollerPreference, XrdCl::DefaultEnv::GetEnv(), and XrdCl::Env::GetString().
Referenced by XrdCl::ForkHandler::Child(), and XrdCl::DefaultEnv::GetPostMaster().
bool XrdCl::PostMaster::IsRunning | ( | ) |
Definition at line 487 of file XrdClPostMaster.cc.
uint16_t XrdCl::PostMaster::NbConnectedStrm | ( | const URL & | url | ) |
Get the number of connected data streams.
Definition at line 355 of file XrdClPostMaster.cc.
References XrdCl::Channel::NbConnectedStrm().
void XrdCl::PostMaster::NotifyConnectHandler | ( | const URL & | url | ) |
Notify the global on-connect handler.
Definition at line 396 of file XrdClPostMaster.cc.
Referenced by XrdCl::Stream::OnConnect().
void XrdCl::PostMaster::NotifyConnErrHandler | ( | const URL & | url, |
const XRootDStatus & | status | ||
) |
Notify the global error connection handler.
Definition at line 409 of file XrdClPostMaster.cc.
Referenced by XrdCl::Stream::OnConnectError().
Query the transport handler for a given URL
url | the channel to be queried |
query | the query as defined in the TransportQuery struct or others that may be recognized by the protocol transport |
result | the result of the query |
Definition at line 243 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::errNotSupported, XrdCl::URL::GetChannelId(), XrdCl::Channel::QueryTransport(), and XrdCl::stError.
Referenced by XrdCl::FileSystem::DirList(), XrdCl::FileStateHandler::PgRead(), and XrdCl::XRootDMsgHandler::Process().
Status XrdCl::PostMaster::Redirect | ( | const URL & | url, |
Message * | msg, | ||
MsgHandler * | handler | ||
) |
Definition at line 229 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::RedirectorRegistry::Get(), XrdCl::VirtualRedirector::HandleRequest(), XrdCl::RedirectorRegistry::Instance(), and XrdCl::stError.
Referenced by XrdCl::MessageUtils::RedirectMessage().
Status XrdCl::PostMaster::RegisterEventHandler | ( | const URL & | url, |
ChannelEventHandler * | handler | ||
) |
Register channel event handler.
Definition at line 267 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, XrdCl::Channel::RegisterEventHandler(), and XrdCl::stError.
bool XrdCl::PostMaster::Reinitialize | ( | ) |
Reinitialize after fork.
Definition at line 206 of file XrdClPostMaster.cc.
Status XrdCl::PostMaster::RemoveEventHandler | ( | const URL & | url, |
ChannelEventHandler * | handler | ||
) |
Remove a channel event handler.
Definition at line 283 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, XrdCl::Channel::RemoveEventHandler(), and XrdCl::stError.
XRootDStatus XrdCl::PostMaster::Send | ( | const URL & | url, |
Message * | msg, | ||
MsgHandler * | handler, | ||
bool | stateful, | ||
time_t | expires | ||
) |
Send the message asynchronously - the message is inserted into the send queue and a listener is called when the message is succesfsully pushed through the wire or when the timeout elapses
DEADLOCK WARNING: no lock should be taken while calling this method that are used in the callback as well.
url | recipient of the message |
msg | message to be sent |
expires | unix timestamp after which a failure is reported to the handler |
handler | handler will be notified about the status |
stateful | physical stream disconnection causes an error |
Definition at line 214 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, XrdCl::Channel::Send(), and XrdCl::stError.
Referenced by XrdCl::MessageUtils::SendMessage().
void XrdCl::PostMaster::SetConnectionErrorHandler | ( | std::function< void(const URL &, const XRootDStatus &)> | handler | ) |
Set the global on-error on-connect handler for control streams.
Definition at line 387 of file XrdClPostMaster.cc.
void XrdCl::PostMaster::SetOnConnectHandler | ( | std::unique_ptr< Job > | onConnJob | ) |
Set the global connection error handler.
Set the global on-connect handler for control streams.
Definition at line 378 of file XrdClPostMaster.cc.
Referenced by XrdPosixConfig::conTracker().
void XrdCl::PostMaster::SetOnDataConnectHandler | ( | const URL & | url, |
std::shared_ptr< Job > | onConnJob | ||
) |
Set the on-connect handler for data streams.
Definition at line 366 of file XrdClPostMaster.cc.
References XrdCl::Channel::SetOnDataConnectHandler().
bool XrdCl::PostMaster::Start | ( | ) |
Start the post master.
Definition at line 160 of file XrdClPostMaster.cc.
Referenced by XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::GetPostMaster(), and XrdCl::ForkHandler::Parent().
bool XrdCl::PostMaster::Stop | ( | ) |
Stop the postmaster.
Definition at line 188 of file XrdClPostMaster.cc.
Referenced by main(), and XrdCl::ForkHandler::Prepare().