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 882 of file XrdClFileSystem.cc.

Constructor & Destructor Documentation

◆ AssignLBHandler()

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

Definition at line 888 of file XrdClFileSystem.cc.

889  :
890  pFS(fs), pUserHandler(userHandler) {}

◆ ~AssignLBHandler()

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

Definition at line 892 of file XrdClFileSystem.cc.

892 {}

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 1034 of file XrdClFileSystem.cc.

1037  {
1038  if( status->IsOK() )
1039  {
1040  HostList::reverse_iterator it;
1041  for( it = hostList->rbegin(); it != hostList->rend(); ++it )
1042  if( it->loadBalancer )
1043  {
1044  pFS->AssignLoadBalancer( it->url );
1045  break;
1046  }
1047  }
1048 
1049  bool finalrsp = !( status->IsOK() && status->code == suContinue );
1050 
1051  SyncResponseHandler * syncHandler = dynamic_cast<SyncResponseHandler*>( pUserHandler );
1052  if( !syncHandler )
1053  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1054 
1055  if( finalrsp )
1056  {
1057  if( syncHandler )
1058  pUserHandler->HandleResponseWithHosts( status, response, hostList );
1059  delete this;
1060  }
1061  }
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: