XRootD
XrdCl::File Class Reference

A file. More...

#include <XrdClFile.hh>

+ Collaboration diagram for XrdCl::File:

Public Types

enum  VirtRedirect {
  EnableVirtRedirect ,
  DisableVirtRedirect
}
 

Public Member Functions

 File (bool enablePlugIns=true)
 Constructor. More...
 
 File (VirtRedirect virtRedirect, bool enablePlugIns=true)
 Constructor. More...
 
virtual ~File ()
 Destructor. More...
 
XRootDStatus Close (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Close (uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus DelXAttr (const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus DelXAttr (const std::vector< std::string > &attrs, std::vector< XAttrStatus > &result, uint16_t timeout=0)
 
XRootDStatus Fcntl (const Buffer &arg, Buffer *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Fcntl (const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
bool GetProperty (const std::string &name, std::string &value) const
 
XRootDStatus GetXAttr (const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus GetXAttr (const std::vector< std::string > &attrs, std::vector< XAttr > &result, uint16_t timeout=0)
 
bool IsOpen () const
 Check if the file is open. More...
 
bool IsSecure () const
 Check if the file is using an encrypted connection. More...
 
XRootDStatus ListXAttr (ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus ListXAttr (std::vector< XAttr > &result, uint16_t timeout=0)
 
XRootDStatus Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Open (const std::string &url, OpenFlags::Flags flags, Access::Mode mode=Access::None, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus PgRead (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus PgRead (uint64_t offset, uint32_t size, void *buffer, std::vector< uint32_t > &cksums, uint32_t &bytesRead, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus PgWrite (uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus PgWrite (uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus ReadV (uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus ReadV (uint64_t offset, struct iovec *iov, int iovcnt, uint32_t &bytesRead, uint16_t timeout=0)
 
bool SetProperty (const std::string &name, const std::string &value)
 
XRootDStatus SetXAttr (const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus SetXAttr (const std::vector< xattr_t > &attrs, std::vector< XAttrStatus > &result, uint16_t timeout=0)
 
XRootDStatus Stat (bool force, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Stat (bool force, StatInfo *&response, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Sync (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Sync (uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Truncate (uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Truncate (uint64_t size, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus TryOtherServer (uint16_t timeout=0)
 
XRootDStatus VectorRead (const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus VectorRead (const ChunkList &chunks, void *buffer, VectorReadInfo *&vReadInfo, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus VectorWrite (const ChunkList &chunks, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus VectorWrite (const ChunkList &chunks, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Visa (Buffer *&visa, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Visa (ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 Get access token to a file - async. More...
 
XRootDStatus Write (uint64_t offset, Buffer &&buffer, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Write (uint64_t offset, Buffer &&buffer, uint16_t timeout=0)
 
XRootDStatus Write (uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Write (uint64_t offset, uint32_t size, const void *buffer, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
 
XRootDStatus Write (uint64_t offset, uint32_t size, Optional< uint64_t > fdoff, int fd, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Write (uint64_t offset, uint32_t size, Optional< uint64_t > fdoff, int fd, uint16_t timeout=0)
 
XRootDStatus WriteV (uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus WriteV (uint64_t offset, const struct iovec *iov, int iovcnt, uint16_t timeout=0)
 

Friends

template<bool HasHndl>
class CheckpointImpl
 
template<bool HasHndl>
class ChkptWrtImpl
 
template<bool HasHndl>
class ChkptWrtVImpl
 

Detailed Description

A file.

Definition at line 45 of file XrdClFile.hh.

Member Enumeration Documentation

◆ VirtRedirect

Enumerator
EnableVirtRedirect 
DisableVirtRedirect 

Definition at line 49 of file XrdClFile.hh.

50  {
53  };
@ EnableVirtRedirect
Definition: XrdClFile.hh:51
@ DisableVirtRedirect
Definition: XrdClFile.hh:52

Constructor & Destructor Documentation

◆ File() [1/2]

XrdCl::File::File ( bool  enablePlugIns = true)

Constructor.

Definition at line 59 of file XrdClFile.cc.

59  :
60  pPlugIn(0),
61  pEnablePlugIns( enablePlugIns )
62  {
63  pImpl = new FileImpl( pPlugIn );
64  }

◆ File() [2/2]

XrdCl::File::File ( VirtRedirect  virtRedirect,
bool  enablePlugIns = true 
)

Constructor.

Definition at line 69 of file XrdClFile.cc.

69  :
70  pPlugIn(0),
71  pEnablePlugIns( enablePlugIns )
72  {
73  pImpl = new FileImpl( virtRedirect == EnableVirtRedirect, pPlugIn );
74  }

References EnableVirtRedirect.

◆ ~File()

XrdCl::File::~File ( )
virtual

Destructor.

Definition at line 79 of file XrdClFile.cc.

80  {
81  //--------------------------------------------------------------------------
82  // This, in principle, should never ever happen. Except for the case
83  // when we're interfaced with ROOT that may call this desctructor from
84  // its garbage collector, from its __cxa_finalize, ie. after the XrdCl lib
85  // has been finalized by the linker. So, if we don't have the log object
86  // at this point we just give up the hope.
87  // Also, make sure the PostMaster threads are running - if not the Close
88  // will hang forever (this could happen when Python interpreter exits).
89  //--------------------------------------------------------------------------
90  if ( DefaultEnv::GetLog() && DefaultEnv::GetPostMaster()->IsRunning() && IsOpen() )
91  XRootDStatus status = Close( nullptr, 0 );
92  delete pImpl;
93  delete pPlugIn;
94  }
static Log * GetLog()
Get default log.
static PostMaster * GetPostMaster()
Get default post master.
XRootDStatus Close(ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:151
bool IsOpen() const
Check if the file is open.
Definition: XrdClFile.cc:846

References Close(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), and IsOpen().

+ Here is the call graph for this function:

Member Function Documentation

◆ Close() [1/2]

XRootDStatus XrdCl::File::Close ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Close the file - async

Parameters
handlerhandler to be notified about the status of the operation
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 151 of file XrdClFile.cc.

153  {
154  if( pPlugIn )
155  return pPlugIn->Close( handler, timeout );
156 
157  return FileStateHandler::Close( pImpl->pStateHandler, handler, timeout );
158  }
virtual XRootDStatus Close(ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Close(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)
std::shared_ptr< FileStateHandler > pStateHandler
Definition: XrdClFile.cc:53

References XrdCl::FilePlugIn::Close(), XrdCl::FileStateHandler::Close(), and XrdCl::FileImpl::pStateHandler.

Referenced by ~File(), XrdPosixFile::~XrdPosixFile(), XrdCl::Recorder::Close(), Close(), XrdPosixFile::Close(), and DoTail().

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

◆ Close() [2/2]

XRootDStatus XrdCl::File::Close ( uint16_t  timeout = 0)

Close the file - sync

Parameters
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 164 of file XrdClFile.cc.

165  {
166  SyncResponseHandler handler;
167  XRootDStatus st = Close( &handler, timeout );
168  if( !st.IsOK() || st.code == suAlreadyDone )
169  return st;
170 
171  return MessageUtils::WaitForStatus( &handler );
172  }
static XRootDStatus WaitForStatus(SyncResponseHandler *handler)
Wait and return the status of the query.
const uint16_t suAlreadyDone
Definition: XrdClStatus.hh:42

References Close(), XrdCl::Status::code, XrdCl::Status::IsOK(), XrdCl::suAlreadyDone, and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ DelXAttr() [1/2]

XRootDStatus XrdCl::File::DelXAttr ( const std::vector< std::string > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Delete extended attributes - async

Parameters
attrs: list of extended attributes to set
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttrStatus objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 731 of file XrdClFile.cc.

734  {
735  if( pPlugIn )
736  return XRootDStatus( stError, errNotSupported );
737 
738  return FileStateHandler::DelXAttr( pImpl->pStateHandler, attrs, handler, timeout );
739  }
static XRootDStatus DelXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
const uint16_t errNotSupported
Definition: XrdClStatus.hh:62

References XrdCl::FileStateHandler::DelXAttr(), XrdCl::errNotSupported, XrdCl::FileImpl::pStateHandler, and XrdCl::stError.

Referenced by DelXAttr().

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

◆ DelXAttr() [2/2]

XRootDStatus XrdCl::File::DelXAttr ( const std::vector< std::string > &  attrs,
std::vector< XAttrStatus > &  result,
uint16_t  timeout = 0 
)

Delete extended attributes - sync

Parameters
attrs: list of extended attributes to set
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 744 of file XrdClFile.cc.

747  {
748  SyncResponseHandler handler;
749  XRootDStatus st = DelXAttr( attrs, &handler, timeout );
750  if( !st.IsOK() )
751  return st;
752 
753  std::vector<XAttrStatus> *resp = 0;
754  st = MessageUtils::WaitForResponse( &handler, resp );
755  if( resp ) result.swap( *resp );
756  delete resp;
757 
758  return st;
759  }
XRootDStatus DelXAttr(const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:731
static XrdCl::XRootDStatus WaitForResponse(SyncResponseHandler *handler, Type *&response)
Wait for the response.

References DelXAttr(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Fcntl() [1/2]

XRootDStatus XrdCl::File::Fcntl ( const Buffer arg,
Buffer *&  response,
uint16_t  timeout = 0 
)

Performs a custom operation on an open file, server implementation dependent - sync

Parameters
argquery argument
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 624 of file XrdClFile.cc.

627  {
628  SyncResponseHandler handler;
629  XRootDStatus st = Fcntl( arg, &handler, timeout );
630  if( !st.IsOK() )
631  return st;
632 
633  return MessageUtils::WaitForResponse( &handler, response );
634  }
XRootDStatus Fcntl(const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:610

References Fcntl(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Fcntl() [2/2]

XRootDStatus XrdCl::File::Fcntl ( const Buffer arg,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Performs a custom operation on an open file, server implementation dependent - async

Parameters
argquery argument
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 610 of file XrdClFile.cc.

613  {
614  if( pPlugIn )
615  return pPlugIn->Fcntl( arg, handler, timeout );
616 
617  return FileStateHandler::Fcntl( pImpl->pStateHandler, arg, handler, timeout );
618  }
virtual XRootDStatus Fcntl(const Buffer &arg, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Fcntl(std::shared_ptr< FileStateHandler > &self, const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FilePlugIn::Fcntl(), XrdCl::FileStateHandler::Fcntl(), and XrdCl::FileImpl::pStateHandler.

Referenced by Fcntl(), and XrdCl::Recorder::Fcntl().

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

◆ GetProperty()

bool XrdCl::File::GetProperty ( const std::string &  name,
std::string &  value 
) const

Get file property

See also
File::SetProperty for property list

Read-only properties: DataServer [string] - the data server the file is accessed at LastURL [string] - final file URL with all the cgi information

Definition at line 878 of file XrdClFile.cc.

879  {
880  if( pPlugIn )
881  return pPlugIn->GetProperty( name, value );
882 
883  return pImpl->pStateHandler->GetProperty( name, value );
884  }
virtual bool GetProperty(const std::string &name, std::string &value) const

References XrdCl::FilePlugIn::GetProperty(), and XrdCl::FileImpl::pStateHandler.

Referenced by XrdPosixXrootd::endPoint(), XrdCl::Recorder::GetProperty(), XrdCl::ZipArchive::List(), and XrdPosixFile::Location().

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

◆ GetXAttr() [1/2]

XRootDStatus XrdCl::File::GetXAttr ( const std::vector< std::string > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Get extended attributes - async

Parameters
attrs: list of extended attributes to get
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttr objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 698 of file XrdClFile.cc.

701  {
702  if( pPlugIn )
703  return XRootDStatus( stError, errNotSupported );
704 
705  return FileStateHandler::GetXAttr( pImpl->pStateHandler, attrs, handler, timeout );
706  }
static XRootDStatus GetXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::errNotSupported, XrdCl::FileStateHandler::GetXAttr(), XrdCl::FileImpl::pStateHandler, and XrdCl::stError.

Referenced by GetXAttr().

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

◆ GetXAttr() [2/2]

XRootDStatus XrdCl::File::GetXAttr ( const std::vector< std::string > &  attrs,
std::vector< XAttr > &  result,
uint16_t  timeout = 0 
)

Get extended attributes - sync

Parameters
attrs: list of extended attributes to get
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 711 of file XrdClFile.cc.

714  {
715  SyncResponseHandler handler;
716  XRootDStatus st = GetXAttr( attrs, &handler, timeout );
717  if( !st.IsOK() )
718  return st;
719 
720  std::vector<XAttr> *resp = 0;
721  st = MessageUtils::WaitForResponse( &handler, resp );
722  if( resp ) result.swap( *resp );
723  delete resp;
724 
725  return st;
726  }
XRootDStatus GetXAttr(const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:698

References GetXAttr(), XrdCl::Status::IsOK(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ IsOpen()

bool XrdCl::File::IsOpen ( ) const

Check if the file is open.

Definition at line 846 of file XrdClFile.cc.

847  {
848  if( pPlugIn )
849  return pPlugIn->IsOpen();
850 
851  return pImpl->pStateHandler->IsOpen();
852  }
virtual bool IsOpen() const

References XrdCl::FilePlugIn::IsOpen(), and XrdCl::FileImpl::pStateHandler.

Referenced by ~File(), XrdPosixFile::~XrdPosixFile(), XrdPosixFile::Close(), XrdPosixFile::DelayedDestroy(), XrdPosixXrootd::endPoint(), XrdCl::Recorder::IsOpen(), XrdPosixFile::Location(), and XrdCl::ZipArchive::OpenFile().

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

◆ IsSecure()

bool XrdCl::File::IsSecure ( ) const

Check if the file is using an encrypted connection.

Definition at line 857 of file XrdClFile.cc.

858  {
859  if( pPlugIn )
860  return false;
861  return pImpl->pStateHandler->IsSecure();
862  }

References XrdCl::FileImpl::pStateHandler.

◆ ListXAttr() [1/2]

XRootDStatus XrdCl::File::ListXAttr ( ResponseHandler handler,
uint16_t  timeout = 0 
)

List extended attributes - async

Parameters
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttr objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 764 of file XrdClFile.cc.

766  {
767  if( pPlugIn )
768  return XRootDStatus( stError, errNotSupported );
769 
770  return FileStateHandler::ListXAttr( pImpl->pStateHandler, handler, timeout );
771  }
static XRootDStatus ListXAttr(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::errNotSupported, XrdCl::FileStateHandler::ListXAttr(), XrdCl::FileImpl::pStateHandler, and XrdCl::stError.

Referenced by ListXAttr().

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

◆ ListXAttr() [2/2]

XRootDStatus XrdCl::File::ListXAttr ( std::vector< XAttr > &  result,
uint16_t  timeout = 0 
)

List extended attributes - sync

Parameters
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 776 of file XrdClFile.cc.

778  {
779  SyncResponseHandler handler;
780  XRootDStatus st = ListXAttr( &handler, timeout );
781  if( !st.IsOK() )
782  return st;
783 
784  std::vector<XAttr> *resp = 0;
785  st = MessageUtils::WaitForResponse( &handler, resp );
786  if( resp ) result.swap( *resp );
787  delete resp;
788 
789  return st;
790  }
XRootDStatus ListXAttr(ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:764

References XrdCl::Status::IsOK(), ListXAttr(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Open() [1/2]

XRootDStatus XrdCl::File::Open ( const std::string &  url,
OpenFlags::Flags  flags,
Access::Mode  mode,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Open the file pointed to by the given URL - async

Parameters
urlurl of the file to be opened
flagsOpenFlags::Flags
modeAccess::Mode for new files, 0 otherwise
handlerhandler to be notified about the status of the operation
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 99 of file XrdClFile.cc.

104  {
105  //--------------------------------------------------------------------------
106  // Check if we need to install and run a plug-in for this URL
107  //--------------------------------------------------------------------------
108  if( pEnablePlugIns && !pPlugIn )
109  {
110  Log *log = DefaultEnv::GetLog();
111  PlugInFactory *fact = DefaultEnv::GetPlugInManager()->GetFactory( url );
112  if( fact )
113  {
114  pPlugIn = fact->CreateFile( url );
115  if( !pPlugIn )
116  {
117  log->Error( FileMsg, "Plug-in factory failed to produce a plug-in "
118  "for %s, continuing without one", url.c_str() );
119  }
120  }
121  }
122 
123  //--------------------------------------------------------------------------
124  // Open the file
125  //--------------------------------------------------------------------------
126  if( pPlugIn )
127  return pPlugIn->Open( url, flags, mode, handler, timeout );
128 
129  return FileStateHandler::Open( pImpl->pStateHandler, url, flags, mode, handler, timeout );
130  }
static PlugInManager * GetPlugInManager()
Get plug-in manager.
virtual XRootDStatus Open(const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Open(std::shared_ptr< FileStateHandler > &self, const std::string &url, uint16_t flags, uint16_t mode, ResponseHandler *handler, uint16_t timeout=0)
PlugInFactory * GetFactory(const std::string url)
const uint64_t FileMsg
XrdSysError Log
Definition: XrdConfig.cc:112

References XrdCl::PlugInFactory::CreateFile(), XrdCl::Log::Error(), XrdCl::FileMsg, XrdCl::PlugInManager::GetFactory(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPlugInManager(), XrdCl::FilePlugIn::Open(), XrdCl::FileStateHandler::Open(), and XrdCl::FileImpl::pStateHandler.

Referenced by DoTail(), XrdCl::MetalinkRedirector::Load(), XrdCl::Recorder::Open(), xrdcl_proxy::ProxyPrefixFile::Open(), and Open().

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

◆ Open() [2/2]

XRootDStatus XrdCl::File::Open ( const std::string &  url,
OpenFlags::Flags  flags,
Access::Mode  mode = Access::None,
uint16_t  timeout = 0 
)

Open the file pointed to by the given URL - sync

Parameters
urlurl of the file to be opened
flagsOpenFlags::Flags
modeAccess::Mode for new files, 0 otherwise
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 135 of file XrdClFile.cc.

139  {
140  SyncResponseHandler handler;
141  XRootDStatus st = Open( url, flags, mode, &handler, timeout );
142  if( !st.IsOK() )
143  return st;
144 
145  return MessageUtils::WaitForStatus( &handler );
146  }
XRootDStatus Open(const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:99

References XrdCl::Status::IsOK(), Open(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ PgRead() [1/2]

XRootDStatus XrdCl::File::PgRead ( uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Read number of pages at a given offset - async

Parameters
offsetoffset from the beginning of the file
sizebuffer size, at least 1 page big (4KB)
buffera pointer to a buffer big enough to hold the data
handlerhandler to be notified when the response arrives, the response parameter will hold a PageInfo object if the procedure was successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 245 of file XrdClFile.cc.

250  {
251  if( pPlugIn )
252  return pPlugIn->PgRead( offset, size, buffer, handler, timeout );
253 
254  return FileStateHandler::PgRead( pImpl->pStateHandler, offset, size, buffer, handler, timeout );
255  }
virtual XRootDStatus PgRead(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus PgRead(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileStateHandler::PgRead(), XrdCl::FilePlugIn::PgRead(), and XrdCl::FileImpl::pStateHandler.

Referenced by XrdCl::Recorder::PgRead(), PgRead(), XrdPosixFile::pgRead(), and XrdPosixFile::Read().

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

◆ PgRead() [2/2]

XRootDStatus XrdCl::File::PgRead ( uint64_t  offset,
uint32_t  size,
void *  buffer,
std::vector< uint32_t > &  cksums,
uint32_t &  bytesRead,
uint16_t  timeout = 0 
)

Read a data chunk at a given offset - sync

Parameters
offsetoffset from the beginning of the file
sizebuffer size, at least 1 page big (4KB)
buffera pointer to a buffer big enough to hold the data
cksumscrc32c checksum for each read 4KB page
bytesReadnumber of bytes actually read
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 260 of file XrdClFile.cc.

266  {
267  SyncResponseHandler handler;
268  XRootDStatus st = PgRead( offset, size, buffer, &handler, timeout );
269  if( !st.IsOK() )
270  return st;
271 
272  PageInfo *pageInfo = 0;
273  XRootDStatus status = MessageUtils::WaitForResponse( &handler, pageInfo );
274  if( status.IsOK() )
275  {
276  bytesRead = pageInfo->GetLength();
277  cksums = pageInfo->GetCksums();
278  delete pageInfo;
279  }
280  return status;
281  }
XRootDStatus PgRead(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:245

References XrdCl::PageInfo::GetCksums(), XrdCl::PageInfo::GetLength(), XrdCl::Status::IsOK(), PgRead(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ PgWrite() [1/2]

XRootDStatus XrdCl::File::PgWrite ( uint64_t  offset,
uint32_t  size,
const void *  buffer,
std::vector< uint32_t > &  cksums,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write number of pages at a given offset - async

Parameters
offsetoffset from the beginning of the file
sizebuffer size
buffera pointer to a buffer holding data pages
cksumsthe crc32c checksums for each 4KB page
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 380 of file XrdClFile.cc.

386  {
387  if( pPlugIn )
388  return pPlugIn->PgWrite( offset, size, buffer, cksums, handler, timeout );
389 
390  return FileStateHandler::PgWrite( pImpl->pStateHandler, offset, size, buffer, cksums, handler, timeout );
391  }
virtual XRootDStatus PgWrite(uint64_t offset, uint32_t nbpgs, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus PgWrite(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileStateHandler::PgWrite(), XrdCl::FilePlugIn::PgWrite(), and XrdCl::FileImpl::pStateHandler.

Referenced by XrdPosixFile::pgWrite(), XrdCl::Recorder::PgWrite(), and PgWrite().

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

◆ PgWrite() [2/2]

XRootDStatus XrdCl::File::PgWrite ( uint64_t  offset,
uint32_t  size,
const void *  buffer,
std::vector< uint32_t > &  cksums,
uint16_t  timeout = 0 
)

Write number of pages at a given offset - sync

Parameters
offsetoffset from the beginning of the file
sizebuffer size
buffera pointer to a buffer holding data pages
cksumsthe crc32c checksums for each 4KB page
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 396 of file XrdClFile.cc.

401  {
402  SyncResponseHandler handler;
403  XRootDStatus st = PgWrite( offset, size, buffer, cksums, &handler, timeout );
404  if( !st.IsOK() )
405  return st;
406 
407  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
408  return status;
409  }
XRootDStatus PgWrite(uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:380

References XrdCl::Status::IsOK(), PgWrite(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Read() [1/2]

XRootDStatus XrdCl::File::Read ( uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Read a data chunk at a given offset - async

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be read
buffera pointer to a buffer big enough to hold the data or 0 if the buffer should be allocated by the system
handlerhandler to be notified when the response arrives, the response parameter will hold a ChunkInfo object if the procedure was successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 206 of file XrdClFile.cc.

211  {
212  if( pPlugIn )
213  return pPlugIn->Read( offset, size, buffer, handler, timeout );
214 
215  return FileStateHandler::Read( pImpl->pStateHandler, offset, size, buffer, handler, timeout );
216  }
virtual XRootDStatus Read(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Read(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::Read(), and XrdCl::FilePlugIn::Read().

Referenced by DoTail(), XrdCl::MetalinkReadHandler::HandleResponse(), XrdCl::MetalinkOpenHandler::HandleResponseWithHosts(), XrdPosixFile::Read(), XrdCl::Recorder::Read(), and Read().

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

◆ Read() [2/2]

XRootDStatus XrdCl::File::Read ( uint64_t  offset,
uint32_t  size,
void *  buffer,
uint32_t &  bytesRead,
uint16_t  timeout = 0 
)

Read a data chunk at a given offset - sync

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be read
buffera pointer to a buffer big enough to hold the data
bytesReadnumber of bytes actually read
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 221 of file XrdClFile.cc.

226  {
227  SyncResponseHandler handler;
228  XRootDStatus st = Read( offset, size, buffer, &handler, timeout );
229  if( !st.IsOK() )
230  return st;
231 
232  ChunkInfo *chunkInfo = 0;
233  XRootDStatus status = MessageUtils::WaitForResponse( &handler, chunkInfo );
234  if( status.IsOK() )
235  {
236  bytesRead = chunkInfo->length;
237  delete chunkInfo;
238  }
239  return status;
240  }
XRootDStatus Read(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:206

References XrdCl::Status::IsOK(), XrdCl::ChunkInfo::length, Read(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ ReadV() [1/2]

XRootDStatus XrdCl::File::ReadV ( uint64_t  offset,
struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Read data into scattered buffers in one operation - async

Parameters
offsetoffset from the beginning of the file
iovlist of the buffers to be written
iovcntnumber of buffers
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 565 of file XrdClFile.cc.

570  {
571  return FileStateHandler::ReadV( pImpl->pStateHandler, offset, iov, iovcnt, handler, timeout );
572  }
static XRootDStatus ReadV(std::shared_ptr< FileStateHandler > &self, uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, and XrdCl::FileStateHandler::ReadV().

Referenced by ReadV().

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

◆ ReadV() [2/2]

XRootDStatus XrdCl::File::ReadV ( uint64_t  offset,
struct iovec *  iov,
int  iovcnt,
uint32_t &  bytesRead,
uint16_t  timeout = 0 
)

Read data into scattered buffers in one operation - sync

Parameters
offsetoffset from the beginning of the file
iovlist of the buffers to be written
iovcntnumber of buffers
bytesReadnumber of bytes actually read
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Read data into scattered buffers in one operation - sync

Parameters
offsetoffset from the beginning of the file
iovlist of the buffers to be written
iovcntnumber of buffers
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 585 of file XrdClFile.cc.

590  {
591  SyncResponseHandler handler;
592  XRootDStatus st = ReadV( offset, iov, iovcnt, &handler, timeout );
593  if( !st.IsOK() )
594  return st;
595 
596  VectorReadInfo *vrInfo = 0;
597  XRootDStatus status = MessageUtils::WaitForResponse( &handler, vrInfo );
598  if( status.IsOK() )
599  {
600  bytesRead = vrInfo->GetSize();
601  delete vrInfo;
602  }
603  return status;
604  }
XRootDStatus ReadV(uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:565

References XrdCl::VectorReadInfo::GetSize(), XrdCl::Status::IsOK(), ReadV(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ SetProperty()

bool XrdCl::File::SetProperty ( const std::string &  name,
const std::string &  value 
)

Set file property

File properties: ReadRecovery [true/false] - enable/disable read recovery WriteRecovery [true/false] - enable/disable write recovery FollowRedirects [true/false] - enable/disable following redirections BundledClose [true/false] - enable/disable bundled close

Definition at line 867 of file XrdClFile.cc.

868  {
869  if( pPlugIn )
870  return pPlugIn->SetProperty( name, value );
871 
872  return pImpl->pStateHandler->SetProperty( name, value );
873  }
virtual bool SetProperty(const std::string &name, const std::string &value)

References XrdCl::FileImpl::pStateHandler, and XrdCl::FilePlugIn::SetProperty().

Referenced by XrdCl::Recorder::SetProperty().

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

◆ SetXAttr() [1/2]

XRootDStatus XrdCl::File::SetXAttr ( const std::vector< xattr_t > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Set extended attributes - async

Parameters
attrs: list of extended attributes to set
handler: handler to be notified when the response arrives, the response parameter will hold a std::vector of XAttrStatus objects
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 665 of file XrdClFile.cc.

668  {
669  if( pPlugIn )
670  return XRootDStatus( stError, errNotSupported );
671 
672  return FileStateHandler::SetXAttr( pImpl->pStateHandler, attrs, handler, timeout );
673  }
static XRootDStatus SetXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::errNotSupported, XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::SetXAttr(), and XrdCl::stError.

Referenced by SetXAttr().

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

◆ SetXAttr() [2/2]

XRootDStatus XrdCl::File::SetXAttr ( const std::vector< xattr_t > &  attrs,
std::vector< XAttrStatus > &  result,
uint16_t  timeout = 0 
)

Set extended attributes - sync

Parameters
attrs: list of extended attributes to set
result: result of the operation
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 678 of file XrdClFile.cc.

681  {
682  SyncResponseHandler handler;
683  XRootDStatus st = SetXAttr( attrs, &handler, timeout );
684  if( !st.IsOK() )
685  return st;
686 
687  std::vector<XAttrStatus> *resp = 0;
688  st = MessageUtils::WaitForResponse( &handler, resp );
689  if( resp ) result.swap( *resp );
690  delete resp;
691 
692  return st;
693  }
XRootDStatus SetXAttr(const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:665

References XrdCl::Status::IsOK(), SetXAttr(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Stat() [1/2]

XRootDStatus XrdCl::File::Stat ( bool  force,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain status information for this file - async

Parameters
forcedo not use the cached information, force re-stating
handlerhandler to be notified when the response arrives, the response parameter will hold a StatInfo object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 177 of file XrdClFile.cc.

180  {
181  if( pPlugIn )
182  return pPlugIn->Stat( force, handler, timeout );
183 
184  return FileStateHandler::Stat( pImpl->pStateHandler, force, handler, timeout );
185  }
virtual XRootDStatus Stat(bool force, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Stat(std::shared_ptr< FileStateHandler > &self, bool force, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FilePlugIn::Stat(), and XrdCl::FileStateHandler::Stat().

Referenced by DoTail(), XrdCl::ZipArchive::List(), XrdCl::Recorder::Stat(), Stat(), and XrdPosixFile::Stat().

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

◆ Stat() [2/2]

XRootDStatus XrdCl::File::Stat ( bool  force,
StatInfo *&  response,
uint16_t  timeout = 0 
)

Obtain status information for this file - sync

Parameters
forcedo not use the cached information, force re-stating
responsethe response (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 190 of file XrdClFile.cc.

193  {
194  SyncResponseHandler handler;
195  XRootDStatus st = Stat( force, &handler, timeout );
196  if( !st.IsOK() )
197  return st;
198 
199  return MessageUtils::WaitForResponse( &handler, response );
200  }
XRootDStatus Stat(bool force, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:177

References XrdCl::Status::IsOK(), Stat(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Sync() [1/2]

XRootDStatus XrdCl::File::Sync ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Commit all pending disk writes - async

Parameters
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 414 of file XrdClFile.cc.

416  {
417  if( pPlugIn )
418  return pPlugIn->Sync( handler, timeout );
419 
420  return FileStateHandler::Sync( pImpl->pStateHandler, handler, timeout );
421  }
virtual XRootDStatus Sync(ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Sync(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FilePlugIn::Sync(), and XrdCl::FileStateHandler::Sync().

Referenced by XrdPosixFile::Sync(), XrdCl::Recorder::Sync(), and Sync().

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

◆ Sync() [2/2]

XRootDStatus XrdCl::File::Sync ( uint16_t  timeout = 0)

Commit all pending disk writes - sync

Parameters
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 426 of file XrdClFile.cc.

427  {
428  SyncResponseHandler handler;
429  XRootDStatus st = Sync( &handler, timeout );
430  if( !st.IsOK() )
431  return st;
432 
433  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
434  return status;
435  }
XRootDStatus Sync(ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:414

References XrdCl::Status::IsOK(), Sync(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Truncate() [1/2]

XRootDStatus XrdCl::File::Truncate ( uint64_t  size,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Truncate the file to a particular size - async

Parameters
sizedesired size of the file
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 440 of file XrdClFile.cc.

443  {
444  if( pPlugIn )
445  return pPlugIn->Truncate( size, handler, timeout );
446 
447  return FileStateHandler::Truncate( pImpl->pStateHandler, size, handler, timeout );
448  }
virtual XRootDStatus Truncate(uint64_t size, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Truncate(std::shared_ptr< FileStateHandler > &self, uint64_t size, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::Truncate(), and XrdCl::FilePlugIn::Truncate().

Referenced by XrdPosixFile::Trunc(), XrdCl::Recorder::Truncate(), and Truncate().

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

◆ Truncate() [2/2]

XRootDStatus XrdCl::File::Truncate ( uint64_t  size,
uint16_t  timeout = 0 
)

Truncate the file to a particular size - sync

Parameters
sizedesired size of the file
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 454 of file XrdClFile.cc.

455  {
456  SyncResponseHandler handler;
457  XRootDStatus st = Truncate( size, &handler, timeout );
458  if( !st.IsOK() )
459  return st;
460 
461  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
462  return status;
463  }
XRootDStatus Truncate(uint64_t size, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:440

References XrdCl::Status::IsOK(), Truncate(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ TryOtherServer()

XRootDStatus XrdCl::File::TryOtherServer ( uint16_t  timeout = 0)

Try different data server

Parameters
timeout: timeout value, if 0 the environment default will be used
Returns
: status of the operation

Definition at line 838 of file XrdClFile.cc.

839  {
840  return FileStateHandler::TryOtherServer( pImpl->pStateHandler, timeout );
841  }
static XRootDStatus TryOtherServer(std::shared_ptr< FileStateHandler > &self, uint16_t timeout)
Try other data server.

References XrdCl::FileImpl::pStateHandler, and XrdCl::FileStateHandler::TryOtherServer().

+ Here is the call graph for this function:

◆ VectorRead() [1/2]

XRootDStatus XrdCl::File::VectorRead ( const ChunkList chunks,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Read scattered data chunks in one operation - async

Parameters
chunkslist of the chunks to be read and buffers to put the data in. The default maximum chunk size is 2097136 bytes and the default maximum number of chunks per request is 1024. The server may be queried using FileSystem::Query for the actual settings.
bufferif zero the buffer pointers in the chunk list will be used, otherwise it needs to point to a buffer big enough to hold the requested data
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 468 of file XrdClFile.cc.

472  {
473  if( pPlugIn )
474  return pPlugIn->VectorRead( chunks, buffer, handler, timeout );
475 
476  return FileStateHandler::VectorRead( pImpl->pStateHandler, chunks, buffer, handler, timeout );
477  }
virtual XRootDStatus VectorRead(const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus VectorRead(std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FilePlugIn::VectorRead(), and XrdCl::FileStateHandler::VectorRead().

Referenced by XrdPosixFile::ReadV(), XrdCl::Recorder::VectorRead(), and VectorRead().

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

◆ VectorRead() [2/2]

XRootDStatus XrdCl::File::VectorRead ( const ChunkList chunks,
void *  buffer,
VectorReadInfo *&  vReadInfo,
uint16_t  timeout = 0 
)

Read scattered data chunks in one operation - sync

Parameters
chunkslist of the chunks to be read and buffers to put the data in. The default maximum chunk size is 2097136 bytes and the default maximum number of chunks per request is 1024. The server may be queried using FileSystem::Query for the actual settings.
bufferif zero the buffer pointers in the chunk list will be used, otherwise it needs to point to a buffer big enough to hold the requested data
vReadInfobuffer size and chunk information
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 482 of file XrdClFile.cc.

486  {
487  SyncResponseHandler handler;
488  XRootDStatus st = VectorRead( chunks, buffer, &handler, timeout );
489  if( !st.IsOK() )
490  return st;
491 
492  return MessageUtils::WaitForResponse( &handler, vReadInfo );
493  }
XRootDStatus VectorRead(const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:468

References XrdCl::Status::IsOK(), VectorRead(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ VectorWrite() [1/2]

XRootDStatus XrdCl::File::VectorWrite ( const ChunkList chunks,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write scattered data chunks in one operation - async

Parameters
chunkslist of the chunks to be written.
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 498 of file XrdClFile.cc.

501  {
502  if( pPlugIn )
503  return pPlugIn->VectorWrite( chunks, handler, timeout );
504 
505  return FileStateHandler::VectorWrite( pImpl->pStateHandler, chunks, handler, timeout );
506  }
virtual XRootDStatus VectorWrite(const ChunkList &chunks, ResponseHandler *handler, uint16_t timeout=0)
static XRootDStatus VectorWrite(std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FilePlugIn::VectorWrite(), and XrdCl::FileStateHandler::VectorWrite().

Referenced by XrdCl::Recorder::VectorWrite(), and VectorWrite().

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

◆ VectorWrite() [2/2]

XRootDStatus XrdCl::File::VectorWrite ( const ChunkList chunks,
uint16_t  timeout = 0 
)

Write scattered data chunks in one operation - sync

Parameters
chunkslist of the chunks to be written.
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 511 of file XrdClFile.cc.

513  {
514  SyncResponseHandler handler;
515  XRootDStatus st = VectorWrite( chunks, &handler, timeout );
516  if( !st.IsOK() )
517  return st;
518 
519  return MessageUtils::WaitForStatus( &handler );
520  }
XRootDStatus VectorWrite(const ChunkList &chunks, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:498

References XrdCl::Status::IsOK(), VectorWrite(), and XrdCl::MessageUtils::WaitForStatus().

+ Here is the call graph for this function:

◆ Visa() [1/2]

XRootDStatus XrdCl::File::Visa ( Buffer *&  visa,
uint16_t  timeout = 0 
)

Get access token to a file - sync

Parameters
visathe access token (to be deleted by the user)
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 651 of file XrdClFile.cc.

653  {
654  SyncResponseHandler handler;
655  XRootDStatus st = Visa( &handler, timeout );
656  if( !st.IsOK() )
657  return st;
658 
659  return MessageUtils::WaitForResponse( &handler, visa );
660  }
XRootDStatus Visa(ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Get access token to a file - async.
Definition: XrdClFile.cc:639

References XrdCl::Status::IsOK(), Visa(), and XrdCl::MessageUtils::WaitForResponse().

+ Here is the call graph for this function:

◆ Visa() [2/2]

XRootDStatus XrdCl::File::Visa ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Get access token to a file - async.

Get access token to a file - async

Parameters
handlerhandler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 639 of file XrdClFile.cc.

641  {
642  if( pPlugIn )
643  return pPlugIn->Visa( handler, timeout );
644 
645  return FileStateHandler::Visa( pImpl->pStateHandler, handler, timeout );
646  }
virtual XRootDStatus Visa(ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Visa(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FilePlugIn::Visa(), and XrdCl::FileStateHandler::Visa().

Referenced by Visa(), and XrdCl::Recorder::Visa().

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

◆ Write() [1/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
Buffer &&  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write a data chunk at a given offset - async

Parameters
offsetoffset from the beginning of the file
bufferr-value reference to Buffer object, in this case XrdCl runtime takes ownership of the buffer
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 316 of file XrdClFile.cc.

320  {
321  if( pPlugIn )
322  return pPlugIn->Write( offset, std::move( buffer ), handler, timeout );
323 
324  return FileStateHandler::Write( pImpl->pStateHandler, offset, std::move( buffer ), handler, timeout );
325  }
virtual XRootDStatus Write(uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout)
static XRootDStatus Write(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::Write(), and XrdCl::FilePlugIn::Write().

+ Here is the call graph for this function:

◆ Write() [2/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
Buffer &&  buffer,
uint16_t  timeout = 0 
)

Write a data chunk at a given offset - sync

Parameters
offsetoffset from the beginning of the file
bufferr-value reference to Buffer object, in this case XrdCl runtime takes ownership of the buffer
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 330 of file XrdClFile.cc.

333  {
334  SyncResponseHandler handler;
335  XRootDStatus st = Write( offset, std::move( buffer ), &handler, timeout );
336  if( !st.IsOK() )
337  return st;
338 
339  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
340  return status;
341  }
XRootDStatus Write(uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) XRD_WARN_UNUSED_RESULT
Definition: XrdClFile.cc:286

References XrdCl::Status::IsOK(), XrdCl::MessageUtils::WaitForStatus(), and Write().

+ Here is the call graph for this function:

◆ Write() [3/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
uint32_t  size,
const void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write a data chunk at a given offset - async The call interprets and returns the server response, which may be either a success or a failure, it does not contain the number of bytes that were actually written.

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be written
buffera pointer to the buffer holding the data to be written
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 286 of file XrdClFile.cc.

291  {
292  if( pPlugIn )
293  return pPlugIn->Write( offset, size, buffer, handler, timeout );
294 
295  return FileStateHandler::Write( pImpl->pStateHandler, offset, size, buffer, handler, timeout );
296  }

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::Write(), and XrdCl::FilePlugIn::Write().

Referenced by XrdPosixFile::Write(), XrdCl::Recorder::Write(), and Write().

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

◆ Write() [4/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
uint32_t  size,
const void *  buffer,
uint16_t  timeout = 0 
)

Write a data chunk at a given offset - sync The call interprets and returns the server response, which may be either a success or a failure, it does not contain the number of bytes that were actually written.

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be written
buffera pointer to the buffer holding the data to be written
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 301 of file XrdClFile.cc.

305  {
306  SyncResponseHandler handler;
307  XRootDStatus st = Write( offset, size, buffer, &handler, timeout );
308  if( !st.IsOK() )
309  return st;
310 
311  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
312  return status;
313  }

References XrdCl::Status::IsOK(), XrdCl::MessageUtils::WaitForStatus(), and Write().

+ Here is the call graph for this function:

◆ Write() [5/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
uint32_t  size,
Optional< uint64_t >  fdoff,
int  fd,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write a data from a given file descriptor at a given offset - async

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be written
fdoffoffset of the data to be written from the file descriptor (optional, if not provided will copy data from the file descriptor at the current cursor position)
fdfile descriptor open for reading
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 346 of file XrdClFile.cc.

352  {
353  if( pPlugIn )
354  return pPlugIn->Write( offset, size, fdoff, fd, handler, timeout );
355 
356  return FileStateHandler::Write( pImpl->pStateHandler, offset, size, fdoff, fd, handler, timeout );
357  }

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::Write(), and XrdCl::FilePlugIn::Write().

+ Here is the call graph for this function:

◆ Write() [6/6]

XRootDStatus XrdCl::File::Write ( uint64_t  offset,
uint32_t  size,
Optional< uint64_t >  fdoff,
int  fd,
uint16_t  timeout = 0 
)

Write a data from a given file descriptor at a given offset - sync

Parameters
offsetoffset from the beginning of the file
sizenumber of bytes to be written
fdoffoffset of the data to be written from the file descriptor (optional, if not provided will copy data from the file descriptor at the current cursor position)
fdfile descriptor open for reading
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

Definition at line 362 of file XrdClFile.cc.

367  {
368  SyncResponseHandler handler;
369  XRootDStatus st = Write( offset, size, fdoff, fd, &handler, timeout );
370  if( !st.IsOK() )
371  return st;
372 
373  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
374  return status;
375  }

References XrdCl::Status::IsOK(), XrdCl::MessageUtils::WaitForStatus(), and Write().

+ Here is the call graph for this function:

◆ WriteV() [1/2]

XRootDStatus XrdCl::File::WriteV ( uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write scattered buffers in one operation - async

Parameters
offsetoffset from the beginning of the file
iovlist of the buffers to be written
iovcntnumber of buffers
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 525 of file XrdClFile.cc.

530  {
531  if( pPlugIn )
532  return pPlugIn->WriteV( offset, iov, iovcnt, handler, timeout );
533 
534  return FileStateHandler::WriteV( pImpl->pStateHandler, offset, iov, iovcnt, handler, timeout );
535  }
virtual XRootDStatus WriteV(uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
static XRootDStatus WriteV(std::shared_ptr< FileStateHandler > &self, uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)

References XrdCl::FileImpl::pStateHandler, XrdCl::FileStateHandler::WriteV(), and XrdCl::FilePlugIn::WriteV().

Referenced by WriteV().

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

◆ WriteV() [2/2]

XRootDStatus XrdCl::File::WriteV ( uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
uint16_t  timeout = 0 
)

Write scattered buffers in one operation - sync

Parameters
offsetoffset from the beginning of the file
iovlist of the buffers to
iovcntnumber of buffers
timeouttimeout value, if 0 then the environment default will be used
Returns
status of the operation

Definition at line 540 of file XrdClFile.cc.

544  {
545  SyncResponseHandler handler;
546  XRootDStatus st = WriteV( offset, iov, iovcnt, &handler, timeout );
547  if( !st.IsOK() )
548  return st;
549 
550  XRootDStatus status = MessageUtils::WaitForStatus( &handler );
551  return status;
552  }
XRootDStatus WriteV(uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClFile.cc:525

References XrdCl::Status::IsOK(), XrdCl::MessageUtils::WaitForStatus(), and WriteV().

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ CheckpointImpl

template<bool HasHndl>
friend class CheckpointImpl
friend

Definition at line 790 of file XrdClFile.hh.

◆ ChkptWrtImpl

template<bool HasHndl>
friend class ChkptWrtImpl
friend

Definition at line 793 of file XrdClFile.hh.

◆ ChkptWrtVImpl

template<bool HasHndl>
friend class ChkptWrtVImpl
friend

Definition at line 796 of file XrdClFile.hh.


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