XRootD
XrdCl::FileSystemData Struct Reference
+ Collaboration diagram for XrdCl::FileSystemData:

Public Member Functions

 FileSystemData (const URL &url)
 
void AssignLastURL (const URL &url)
 
void AssignLoadBalancer (const URL &url)
 

Static Public Member Functions

static XRootDStatus Send (std::shared_ptr< FileSystemData > &fs, Message *msg, ResponseHandler *handler, MessageSendParams &params)
 

Public Attributes

bool pFollowRedirects
 
std::unique_ptr< URLpLastUrl
 
bool pLoadBalancerLookupDone
 
XrdSysMutex pMutex
 
std::unique_ptr< URLpUrl
 

Detailed Description

Definition at line 934 of file XrdClFileSystem.cc.

Constructor & Destructor Documentation

◆ FileSystemData()

XrdCl::FileSystemData::FileSystemData ( const URL url)
inline

Definition at line 936 of file XrdClFileSystem.cc.

936  :
937  pLoadBalancerLookupDone( false ),
938  pFollowRedirects( true ),
939  pUrl( new URL( url.GetURL() ) )
940  {
941  }
URL representation.
Definition: XrdClURL.hh:31
std::string GetURL() const
Get the URL.
Definition: XrdClURL.hh:86
std::unique_ptr< URL > pUrl

Member Function Documentation

◆ AssignLastURL()

void XrdCl::FileSystemData::AssignLastURL ( const URL url)
inline

Definition at line 1000 of file XrdClFileSystem.cc.

1001  {
1002  Log *log = DefaultEnv::GetLog();
1003  XrdSysMutexHelper scopedLock( pMutex );
1004 
1005  log->Dump( FileSystemMsg, "[%p@%s] Assigning %s as last URL", (void*)this,
1006  pUrl->GetHostId().c_str(), url.GetHostId().c_str() );
1007 
1008  pLastUrl.reset( new URL( url ) );
1009  }
static Log * GetLog()
Get default log.
Handle diagnostics.
Definition: XrdClLog.hh:101
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
Definition: XrdClLog.cc:299
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:99
const uint64_t FileSystemMsg
std::unique_ptr< URL > pLastUrl

References XrdCl::Log::Dump(), XrdCl::FileSystemMsg, and XrdCl::URL::GetHostId().

+ Here is the call graph for this function:

◆ AssignLoadBalancer()

void XrdCl::FileSystemData::AssignLoadBalancer ( const URL url)
inline

Definition at line 982 of file XrdClFileSystem.cc.

983  {
984  Log *log = DefaultEnv::GetLog();
985  XrdSysMutexHelper scopedLock( pMutex );
986 
988  return;
989 
990  log->Dump( FileSystemMsg, "[%p@%s] Assigning %s as load balancer", (void*)this,
991  pUrl->GetHostId().c_str(), url.GetHostId().c_str() );
992 
993  pUrl.reset( new URL( url ) );
995  }

References XrdCl::Log::Dump(), XrdCl::FileSystemMsg, and XrdCl::URL::GetHostId().

+ Here is the call graph for this function:

◆ Send()

static XRootDStatus XrdCl::FileSystemData::Send ( std::shared_ptr< FileSystemData > &  fs,
Message msg,
ResponseHandler handler,
MessageSendParams params 
)
inlinestatic

Definition at line 946 of file XrdClFileSystem.cc.

950  {
951  Log *log = DefaultEnv::GetLog();
952  XrdSysMutexHelper scopedLock( fs->pMutex );
953 
954  log->Dump( FileSystemMsg, "[%p@%s] Sending %s", (void*)fs.get(),
955  fs->pUrl->GetHostId().c_str(), msg->GetObfuscatedDescription().c_str() );
956 
957  AssignLastURLHandler *lastUrlHandler = new AssignLastURLHandler( fs, handler );
958  handler = lastUrlHandler;
959 
960  AssignLBHandler *lbHandler = nullptr;
961  if( !fs->pLoadBalancerLookupDone && fs->pFollowRedirects )
962  {
963  lbHandler = new AssignLBHandler( fs, handler );
964  handler = lbHandler;
965  }
966 
967  params.followRedirects = fs->pFollowRedirects;
968 
969  auto st = MessageUtils::SendMessage( *fs->pUrl, msg, handler, params, 0 );
970  if( !st.IsOK() )
971  {
972  delete lastUrlHandler;
973  delete lbHandler;
974  }
975 
976  return st;
977  }
Wrapper class used to assign a load balancer.
Wrapper class used to assign last URL.
static XRootDStatus SendMessage(const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams, LocalFileHandler *lFileHandler)
Send message.
const std::string & GetObfuscatedDescription() const
Get the description of the message with authz parameter obfuscated.

References XrdCl::Log::Dump(), XrdCl::FileSystemMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Message::GetObfuscatedDescription(), and XrdCl::Status::IsOK().

Referenced by XrdCl::FileSystem::ChMod(), XrdCl::FileSystem::DirList(), XrdCl::FileSystem::Locate(), XrdCl::FileSystem::MkDir(), XrdCl::FileSystem::Mv(), XrdCl::FileSystem::Ping(), XrdCl::FileSystem::Prepare(), XrdCl::FileSystem::Protocol(), XrdCl::FileSystem::Query(), XrdCl::FileSystem::Rm(), XrdCl::FileSystem::RmDir(), XrdCl::FileSystem::Stat(), XrdCl::FileSystem::StatVFS(), and XrdCl::FileSystem::Truncate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ pFollowRedirects

bool XrdCl::FileSystemData::pFollowRedirects

Definition at line 1013 of file XrdClFileSystem.cc.

◆ pLastUrl

std::unique_ptr<URL> XrdCl::FileSystemData::pLastUrl

Definition at line 1015 of file XrdClFileSystem.cc.

◆ pLoadBalancerLookupDone

bool XrdCl::FileSystemData::pLoadBalancerLookupDone

Definition at line 1012 of file XrdClFileSystem.cc.

◆ pMutex

XrdSysMutex XrdCl::FileSystemData::pMutex

Definition at line 1011 of file XrdClFileSystem.cc.

◆ pUrl

std::unique_ptr<URL> XrdCl::FileSystemData::pUrl

Definition at line 1014 of file XrdClFileSystem.cc.


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