xrootd
|
#include <XrdClMetalinkRedirector.hh>
Public Member Functions | |
MetalinkRedirector (const std::string &url) | |
virtual | ~MetalinkRedirector () |
Destructor. | |
XRootDStatus | Load (ResponseHandler *userHandler) |
XRootDStatus | HandleRequest (const Message *msg, MsgHandler *handler) |
std::string | GetTargetName () const |
Gets the file name as specified in the metalink. | |
std::string | GetCheckSum (const std::string &type) const |
std::vector< std::string > | GetSupportedCheckSums () const |
long long | GetSize () const |
const std::vector< std::string > & | GetReplicas () |
Returns a vector with replicas as given in the meatlink file. | |
virtual int | Count (Message &req) const |
Count how many replicas do we have left to try for given request. | |
Public Member Functions inherited from XrdCl::VirtualRedirector | |
virtual | ~VirtualRedirector () |
Destructor. | |
Private Types | |
typedef std::list< std::pair< const Message *, MsgHandler * > > | RedirectList |
typedef std::map< std::string, std::string > | CksumMap |
typedef std::vector< std::string > | ReplicaList |
Private Member Functions | |
XRootDStatus | HandleRequestImpl (const Message *msg, MsgHandler *handler) |
XRootDStatus | Parse (const std::string &metalink) |
void | FinalizeInitialization (const XRootDStatus &status=XRootDStatus()) |
std::shared_ptr< Message > | GetResponse (const Message *msg) const |
Generates redirect response for the given request. | |
std::shared_ptr< Message > | GetErrorMsg (const Message *msg, const std::string &errMsg, XErrorCode code) const |
Generates error response for the given request. | |
void | InitCksum (XrdOucFileInfo **fileInfos) |
Initializes checksum map. | |
void | InitReplicas (XrdOucFileInfo **fileInfos) |
Initializes replica list. | |
XRootDStatus | GetReplica (const Message &msg, std::string &replica) const |
Get the next replica for the given message. | |
XRootDStatus | GetCgiInfo (const Message &msg, const std::string &key, std::string &out) const |
Extracts an element from URL cgi. | |
ReplicaList::const_iterator | GetReplica (const Message &msg) const |
Get the next replica for the given message. | |
Private Attributes | |
RedirectList | pPendingRedirects |
std::string | pUrl |
File * | pFile |
CksumMap | pChecksums |
ReplicaList | pReplicas |
bool | pReady |
XRootDStatus | pStatus |
std::string | pTarget |
long long | pFileSize |
XrdSysMutex | pMutex |
Static Private Attributes | |
static const std::string | LocalFile |
Friends | |
class | MetalinkOpenHandler |
class | MetalinkReadHandler |
An abstraction representing a virtual redirector based on a metalink file
|
private |
|
private |
|
private |
XrdCl::MetalinkRedirector::MetalinkRedirector | ( | const std::string & | url | ) |
Constructor
url | : URL to the metalink file |
|
virtual |
Destructor.
|
virtual |
Count how many replicas do we have left to try for given request.
Implements XrdCl::VirtualRedirector.
|
private |
Finalize the initialization process:
|
private |
Extracts an element from URL cgi.
|
inlinevirtual |
Returns the checksum of the given type if specified in the metalink file, or an empty string otherwise
Implements XrdCl::VirtualRedirector.
References pChecksums.
|
private |
Generates error response for the given request.
|
private |
Get the next replica for the given message.
|
private |
Get the next replica for the given message.
|
inlinevirtual |
Returns a vector with replicas as given in the meatlink file.
Implements XrdCl::VirtualRedirector.
References pReplicas.
|
private |
Generates redirect response for the given request.
|
inlinevirtual |
Returns the file size if specified in the metalink file, otherwise a negative number
Implements XrdCl::VirtualRedirector.
References pFileSize.
|
inlinevirtual |
Returns the first (in alphabetical order) checksum type available in the metalink file, if no checksum is available returns an empty string
Implements XrdCl::VirtualRedirector.
References pChecksums.
|
inlinevirtual |
Gets the file name as specified in the metalink.
Implements XrdCl::VirtualRedirector.
References pTarget.
|
virtual |
If the MetalinkRedirector is initialized creates an instant redirect response, otherwise queues the request until initialization is done.
Implements XrdCl::VirtualRedirector.
|
private |
Creates an instant redirect response for the given message or an error response if there are no more replicas to try. The virtual response is being handled by the given handler in the thread-pool.
|
private |
Initializes checksum map.
|
private |
Initializes replica list.
|
virtual |
Initializes the object with the content of the metalink file
userHandler | : the response handler provided by end user |
Implements XrdCl::VirtualRedirector.
|
private |
Parses the metalink file
metalink | : the content of the metalink file |
|
friend |
|
friend |
|
staticprivate |
|
private |
Referenced by GetCheckSum(), and GetSupportedCheckSums().
|
private |
|
private |
Referenced by GetSize().
|
private |
|
private |
|
private |
|
private |
Referenced by GetReplicas().
|
private |
|
private |
Referenced by GetTargetName().
|
private |