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

Constructor & Destructor Documentation

◆ FileSystemData()

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

Definition at line 929 of file XrdClFileSystem.cc.

929  :
930  pLoadBalancerLookupDone( false ),
931  pFollowRedirects( true ),
932  pUrl( new URL( url.GetURL() ) )
933  {
934  }
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 993 of file XrdClFileSystem.cc.

994  {
995  Log *log = DefaultEnv::GetLog();
996  XrdSysMutexHelper scopedLock( pMutex );
997 
998  log->Dump( FileSystemMsg, "[%p@%s] Assigning %s as last URL", this,
999  pUrl->GetHostId().c_str(), url.GetHostId().c_str() );
1000 
1001  pLastUrl.reset( new URL( url ) );
1002  }
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 975 of file XrdClFileSystem.cc.

976  {
977  Log *log = DefaultEnv::GetLog();
978  XrdSysMutexHelper scopedLock( pMutex );
979 
981  return;
982 
983  log->Dump( FileSystemMsg, "[%p@%s] Assigning %s as load balancer", this,
984  pUrl->GetHostId().c_str(), url.GetHostId().c_str() );
985 
986  pUrl.reset( new URL( url ) );
988  }

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

943  {
944  Log *log = DefaultEnv::GetLog();
945  XrdSysMutexHelper scopedLock( fs->pMutex );
946 
947  log->Dump( FileSystemMsg, "[%p@%s] Sending %s", fs.get(),
948  fs->pUrl->GetHostId().c_str(), msg->GetObfuscatedDescription().c_str() );
949 
950  AssignLastURLHandler *lastUrlHandler = new AssignLastURLHandler( fs, handler );
951  handler = lastUrlHandler;
952 
953  AssignLBHandler *lbHandler = nullptr;
954  if( !fs->pLoadBalancerLookupDone && fs->pFollowRedirects )
955  {
956  lbHandler = new AssignLBHandler( fs, handler );
957  handler = lbHandler;
958  }
959 
960  params.followRedirects = fs->pFollowRedirects;
961 
962  auto st = MessageUtils::SendMessage( *fs->pUrl, msg, handler, params, 0 );
963  if( !st.IsOK() )
964  {
965  delete lastUrlHandler;
966  delete lbHandler;
967  }
968 
969  return st;
970  }
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 1006 of file XrdClFileSystem.cc.

◆ pLastUrl

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

Definition at line 1008 of file XrdClFileSystem.cc.

◆ pLoadBalancerLookupDone

bool XrdCl::FileSystemData::pLoadBalancerLookupDone

Definition at line 1005 of file XrdClFileSystem.cc.

◆ pMutex

XrdSysMutex XrdCl::FileSystemData::pMutex

Definition at line 1004 of file XrdClFileSystem.cc.

◆ pUrl

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

Definition at line 1007 of file XrdClFileSystem.cc.


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