XRootD
XrdCl::AssignLBHandler Class Reference

Wrapper class used to assign a load balancer. More...

+ Inheritance diagram for XrdCl::AssignLBHandler:
+ Collaboration diagram for XrdCl::AssignLBHandler:

Public Member Functions

 AssignLBHandler (std::shared_ptr< FileSystemData > &fs, ResponseHandler *userHandler)
 
virtual ~AssignLBHandler ()
 
virtual void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
 
- Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
 
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
 

Additional Inherited Members

- Static Public Member Functions inherited from XrdCl::ResponseHandler
static ResponseHandlerWrap (std::function< void(XRootDStatus &, AnyObject &)> func)
 
static ResponseHandlerWrap (std::function< void(XRootDStatus *, AnyObject *)> func)
 

Detailed Description

Wrapper class used to assign a load balancer.

Definition at line 875 of file XrdClFileSystem.cc.

Constructor & Destructor Documentation

◆ AssignLBHandler()

XrdCl::AssignLBHandler::AssignLBHandler ( std::shared_ptr< FileSystemData > &  fs,
ResponseHandler userHandler 
)
inline

Definition at line 881 of file XrdClFileSystem.cc.

882  :
883  pFS(fs), pUserHandler(userHandler) {}

◆ ~AssignLBHandler()

virtual XrdCl::AssignLBHandler::~AssignLBHandler ( )
inlinevirtual

Definition at line 885 of file XrdClFileSystem.cc.

885 {}

Member Function Documentation

◆ HandleResponseWithHosts()

void XrdCl::AssignLBHandler::HandleResponseWithHosts ( XRootDStatus status,
AnyObject response,
HostList hostList 
)
virtual

Called when a response to associated request arrives or an error occurs

Parameters
statusstatus of the request
responsean object associated with the response (request dependent)
hostListlist of hosts the request was redirected to

Reimplemented from XrdCl::ResponseHandler.

Definition at line 1027 of file XrdClFileSystem.cc.

1030  {
1031  if( status->IsOK() )
1032  {
1033  HostList::reverse_iterator it;
1034  for( it = hostList->rbegin(); it != hostList->rend(); ++it )
1035  if( it->loadBalancer )
1036  {
1037  pFS->AssignLoadBalancer( it->url );
1038  break;
1039  }
1040  }
1041 
1042  bool finalrsp = !( status->IsOK() && status->code == suContinue );
1043 
1044  SyncResponseHandler * syncHandler = dynamic_cast<SyncResponseHandler*>( pUserHandler );
1045  if( !syncHandler )
1046  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1047 
1048  if( finalrsp )
1049  {
1050  if( syncHandler )
1051  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1052  delete this;
1053  }
1054  }
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Synchronize the response.
const uint16_t suContinue
Definition: XrdClStatus.hh:39
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:147
bool IsOK() const
We're fine.
Definition: XrdClStatus.hh:124

References XrdCl::Status::code, XrdCl::ResponseHandler::HandleResponseWithHosts(), XrdCl::Status::IsOK(), and XrdCl::suContinue.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: