xrootd
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
XrdCl::FileStateHandler Class Reference

Handle the stateful operations. More...

#include <XrdClFileStateHandler.hh>

Collaboration diagram for XrdCl::FileStateHandler:
Collaboration graph
[legend]

Classes

struct  RequestData
 

Public Types

enum  FileStatus {
  Closed , Opened , Error , Recovering ,
  OpenInProgress , CloseInProgress
}
 State of the file. More...
 

Public Member Functions

 FileStateHandler (FilePlugIn *&plugin)
 Constructor.
 
 FileStateHandler (bool useVirtRedirector, FilePlugIn *&plugin)
 
 ~FileStateHandler ()
 Destructor.
 
void OnOpen (const XRootDStatus *status, const OpenInfo *openInfo, const HostList *hostList)
 Process the results of the opening operation.
 
void OnClose (const XRootDStatus *status)
 Process the results of the closing operation.
 
bool IsOpen () const
 Check if the file is open.
 
bool IsSecure () const
 Check if the file is using an encrypted connection.
 
bool SetProperty (const std::string &name, const std::string &value)
 
bool GetProperty (const std::string &name, std::string &value) const
 
void Lock ()
 Lock the internal lock.
 
void UnLock ()
 Unlock the internal lock.
 
void Tick (time_t now)
 Tick.
 
void TimeOutRequests (time_t now)
 Declare timeout on requests being recovered.
 
void AfterForkChild ()
 Called in the child process after the fork.
 

Static Public Member Functions

static XRootDStatus Open (std::shared_ptr< FileStateHandler > &self, const std::string &url, uint16_t flags, uint16_t mode, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Close (std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Stat (std::shared_ptr< FileStateHandler > &self, bool force, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Read (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus PgRead (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus PgReadRetry (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, size_t pgnb, void *buffer, PgReadHandler *handler, uint16_t timeout=0)
 
static XRootDStatus PgReadImpl (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, uint16_t flags, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Write (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Write (std::shared_ptr< FileStateHandler > &self, uint64_t offset, Buffer &&buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Write (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, Optional< uint64_t > fdoff, int fd, ResponseHandler *handler, uint16_t timeout=0)
 
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)
 
static XRootDStatus PgWriteRetry (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, uint32_t digest, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus PgWriteImpl (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, kXR_char flags, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Sync (std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Truncate (std::shared_ptr< FileStateHandler > &self, uint64_t size, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus VectorRead (std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus VectorWrite (std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, 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)
 
static XRootDStatus ReadV (std::shared_ptr< FileStateHandler > &self, uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Fcntl (std::shared_ptr< FileStateHandler > &self, const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Visa (std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus SetXAttr (std::shared_ptr< FileStateHandler > &self, const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus GetXAttr (std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus DelXAttr (std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus ListXAttr (std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus Checkpoint (std::shared_ptr< FileStateHandler > &self, kXR_char code, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus ChkptWrt (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
static XRootDStatus ChkptWrtV (std::shared_ptr< FileStateHandler > &self, uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
 
static void OnStateError (std::shared_ptr< FileStateHandler > &self, XRootDStatus *status, Message *message, ResponseHandler *userHandler, MessageSendParams &sendParams)
 Handle an error while sending a stateful message.
 
static void OnStateRedirection (std::shared_ptr< FileStateHandler > &self, const std::string &redirectUrl, Message *message, ResponseHandler *userHandler, MessageSendParams &sendParams)
 Handle stateful redirect.
 
static void OnStateResponse (std::shared_ptr< FileStateHandler > &self, XRootDStatus *status, Message *message, AnyObject *response, HostList *hostList)
 Handle stateful response.
 
static XRootDStatus TryOtherServer (std::shared_ptr< FileStateHandler > &self, uint16_t timeout)
 Try other data server.
 

Private Types

typedef std::list< RequestDataRequestList
 

Private Member Functions

bool IsRecoverable (const XRootDStatus &stataus) const
 Check if the stateful error is recoverable.
 
bool IsReadOnly () const
 Check if the file is open for read only.
 
void FailMessage (RequestData rd, XRootDStatus status)
 Fail a message.
 
void FailQueuedMessages (XRootDStatus status)
 Fail queued messages.
 
void ReSendQueuedMessages ()
 Re-send queued messages.
 
void ReWriteFileHandle (Message *msg)
 Re-write file handle.
 
void ResetMonitoringVars ()
 Reset monitoring vars.
 
void MonitorClose (const XRootDStatus *status)
 Dispatch monitoring information on close.
 
XRootDStatus IssueRequest (const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams)
 

Static Private Member Functions

template<typename T >
static Status XAttrOperationImpl (std::shared_ptr< FileStateHandler > &self, kXR_char subcode, kXR_char options, const std::vector< T > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
static Status SendOrQueue (std::shared_ptr< FileStateHandler > &self, const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams)
 Send a message to a host or put it in the recovery queue.
 
static Status RecoverMessage (std::shared_ptr< FileStateHandler > &self, RequestData rd, bool callbackOnFailure=true)
 
static Status RunRecovery (std::shared_ptr< FileStateHandler > &self)
 Run the recovery procedure if appropriate.
 
static XRootDStatus SendClose (std::shared_ptr< FileStateHandler > &self, uint16_t timeout)
 
static XRootDStatus ReOpenFileAtServer (std::shared_ptr< FileStateHandler > &self, const URL &url, uint16_t timeout)
 Re-open the current file at a given server.
 
static XRootDStatus WriteKernelBuffer (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t length, std::unique_ptr< XrdSys::KernelBuffer > kbuff, ResponseHandler *handler, uint16_t timeout)
 Send a write request with payload being stored in a kernel buffer.
 

Private Attributes

XrdSysMutex pMutex
 
FileStatus pFileState
 
XRootDStatus pStatus
 
StatInfopStatInfo
 
URLpFileUrl
 
URLpDataServer
 
URLpLoadBalancer
 
URLpStateRedirect
 
URLpWrtRecoveryRedir
 
uint8_t * pFileHandle
 
uint16_t pOpenMode
 
uint16_t pOpenFlags
 
RequestList pToBeRecovered
 
std::set< Message * > pInTheFly
 
uint64_t pSessionId
 
bool pDoRecoverRead
 
bool pDoRecoverWrite
 
bool pFollowRedirects
 
bool pUseVirtRedirector
 
bool pIsChannelEncrypted
 
bool pAllowBundledClose
 
timeval pOpenTime
 
uint64_t pRBytes
 
uint64_t pVRBytes
 
uint64_t pWBytes
 
uint64_t pVWBytes
 
uint64_t pVSegs
 
uint64_t pRCount
 
uint64_t pVRCount
 
uint64_t pWCount
 
uint64_t pVWCount
 
XRootDStatus pCloseReason
 
LocalFileHandlerpLFileHandler
 
FilePlugIn *& pPlugin
 

Friends

class ::PgReadHandler
 
class ::PgReadRetryHandler
 
class ::PgReadSubstitutionHandler
 
class ::OpenHandler
 

Detailed Description

Handle the stateful operations.

Member Typedef Documentation

◆ RequestList

Member Enumeration Documentation

◆ FileStatus

State of the file.

Enumerator
Closed 

The file is closed.

Opened 

Opening has succeeded.

Error 

Opening has failed.

Recovering 

Recovering from an error.

OpenInProgress 

Opening is in progress.

CloseInProgress 

Closing operation is in progress.

Constructor & Destructor Documentation

◆ FileStateHandler() [1/2]

XrdCl::FileStateHandler::FileStateHandler ( FilePlugIn *&  plugin)

Constructor.

◆ FileStateHandler() [2/2]

XrdCl::FileStateHandler::FileStateHandler ( bool  useVirtRedirector,
FilePlugIn *&  plugin 
)

Constructor

Parameters
useVirtRedirectorif true Metalink files will be treated as a VirtualRedirectors

◆ ~FileStateHandler()

XrdCl::FileStateHandler::~FileStateHandler ( )

Destructor.

Member Function Documentation

◆ AfterForkChild()

void XrdCl::FileStateHandler::AfterForkChild ( )

Called in the child process after the fork.

◆ Checkpoint()

static XRootDStatus XrdCl::FileStateHandler::Checkpoint ( std::shared_ptr< FileStateHandler > &  self,
kXR_char  code,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Create a checkpoint

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

◆ ChkptWrt()

static XRootDStatus XrdCl::FileStateHandler::ChkptWrt ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
const void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Checkpointed write - async

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

◆ ChkptWrtV()

static XRootDStatus XrdCl::FileStateHandler::ChkptWrtV ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Checkpointed WriteV - 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

◆ Close()

static XRootDStatus XrdCl::FileStateHandler::Close ( std::shared_ptr< FileStateHandler > &  self,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Close the file object

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

◆ DelXAttr()

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

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

◆ FailMessage()

void XrdCl::FileStateHandler::FailMessage ( RequestData  rd,
XRootDStatus  status 
)
private

Fail a message.

◆ FailQueuedMessages()

void XrdCl::FileStateHandler::FailQueuedMessages ( XRootDStatus  status)
private

Fail queued messages.

◆ Fcntl()

static XRootDStatus XrdCl::FileStateHandler::Fcntl ( std::shared_ptr< FileStateHandler > &  self,
const Buffer arg,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ GetProperty()

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

Get file property

See also
File::SetProperty for property list

◆ GetXAttr()

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

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

◆ IsOpen()

bool XrdCl::FileStateHandler::IsOpen ( ) const

Check if the file is open.

◆ IsReadOnly()

bool XrdCl::FileStateHandler::IsReadOnly ( ) const
private

Check if the file is open for read only.

◆ IsRecoverable()

bool XrdCl::FileStateHandler::IsRecoverable ( const XRootDStatus stataus) const
private

Check if the stateful error is recoverable.

◆ IsSecure()

bool XrdCl::FileStateHandler::IsSecure ( ) const
inline

Check if the file is using an encrypted connection.

◆ IssueRequest()

XRootDStatus XrdCl::FileStateHandler::IssueRequest ( const URL url,
Message msg,
ResponseHandler handler,
MessageSendParams sendParams 
)
private

Issues request:

  • if the request is for a Metalink a redirect is generated
  • if the request is for a local file, it will be passed to LocalFileHandler
  • otherwise vanilla XRootD request will be sent

◆ ListXAttr()

static XRootDStatus XrdCl::FileStateHandler::ListXAttr ( std::shared_ptr< FileStateHandler > &  self,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ Lock()

void XrdCl::FileStateHandler::Lock ( )
inline

Lock the internal lock.

◆ MonitorClose()

void XrdCl::FileStateHandler::MonitorClose ( const XRootDStatus status)
private

Dispatch monitoring information on close.

◆ OnClose()

void XrdCl::FileStateHandler::OnClose ( const XRootDStatus status)

Process the results of the closing operation.

◆ OnOpen()

void XrdCl::FileStateHandler::OnOpen ( const XRootDStatus status,
const OpenInfo openInfo,
const HostList hostList 
)

Process the results of the opening operation.

◆ OnStateError()

static void XrdCl::FileStateHandler::OnStateError ( std::shared_ptr< FileStateHandler > &  self,
XRootDStatus status,
Message message,
ResponseHandler userHandler,
MessageSendParams sendParams 
)
static

Handle an error while sending a stateful message.

◆ OnStateRedirection()

static void XrdCl::FileStateHandler::OnStateRedirection ( std::shared_ptr< FileStateHandler > &  self,
const std::string &  redirectUrl,
Message message,
ResponseHandler userHandler,
MessageSendParams sendParams 
)
static

Handle stateful redirect.

◆ OnStateResponse()

static void XrdCl::FileStateHandler::OnStateResponse ( std::shared_ptr< FileStateHandler > &  self,
XRootDStatus status,
Message message,
AnyObject response,
HostList hostList 
)
static

Handle stateful response.

◆ Open()

static XRootDStatus XrdCl::FileStateHandler::Open ( std::shared_ptr< FileStateHandler > &  self,
const std::string &  url,
uint16_t  flags,
uint16_t  mode,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Open the file pointed to by the given URL

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

◆ PgRead()

static XRootDStatus XrdCl::FileStateHandler::PgRead ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Read data pages at a given offset

Parameters
offset: offset from the beginning of the file (Note: has to 4KB aligned)
size: buffer size
buffer: a pointer to buffer big enough to hold the data
handler: handler to be notified when the response arrives, the response parameter will hold a PgReadInfo object if the procedure was successful
timeout: timeout value, if 0 environment default will be used
Returns
: status of the operation

◆ PgReadImpl()

static XRootDStatus XrdCl::FileStateHandler::PgReadImpl ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
void *  buffer,
uint16_t  flags,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Read data pages at a given offset (actual implementation)

Parameters
offset: offset from the beginning of the file (Note: has to 4KB aligned)
size: buffer size
buffer: a pointer to buffer big enough to hold the data
flags: PgRead flags
handler: handler to be notified when the response arrives, the response parameter will hold a PgReadInfo object if the procedure was successful
timeout: timeout value, if 0 environment default will be used
Returns
: status of the operation

◆ PgReadRetry()

static XRootDStatus XrdCl::FileStateHandler::PgReadRetry ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
size_t  pgnb,
void *  buffer,
PgReadHandler handler,
uint16_t  timeout = 0 
)
static

Retry reading one page of data at a given offset

Parameters
offset: offset from the beginning of the file (Note: has to 4KB aligned)
size: buffer size
buffer: a pointer to buffer big enough to hold the data
handler: handler to be notified when the response arrives
timeout: timeout value, if 0 environment default will be used
Returns
: status of the operation

◆ PgWrite()

static XRootDStatus XrdCl::FileStateHandler::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 
)
static

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

◆ PgWriteImpl()

static XRootDStatus XrdCl::FileStateHandler::PgWriteImpl ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
const void *  buffer,
std::vector< uint32_t > &  cksums,
kXR_char  flags,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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
flagsPgWrite flags
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

◆ PgWriteRetry()

static XRootDStatus XrdCl::FileStateHandler::PgWriteRetry ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
const void *  buffer,
uint32_t  digest,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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
handlerhandler to be notified when the response arrives
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

◆ Read()

static XRootDStatus XrdCl::FileStateHandler::Read ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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 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 buffer object if the procedure was successful, if a preallocated buffer was specified then the buffer object will "wrap" this buffer
timeouttimeout value, if 0 the environment default will be used
Returns
status of the operation

◆ ReadV()

static XRootDStatus XrdCl::FileStateHandler::ReadV ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ RecoverMessage()

static Status XrdCl::FileStateHandler::RecoverMessage ( std::shared_ptr< FileStateHandler > &  self,
RequestData  rd,
bool  callbackOnFailure = true 
)
staticprivate

Recover a message

Parameters
rdrequest data associated with the message
callbackOnFailureshould the current handler be called back if the recovery procedure fails

◆ ReOpenFileAtServer()

static XRootDStatus XrdCl::FileStateHandler::ReOpenFileAtServer ( std::shared_ptr< FileStateHandler > &  self,
const URL url,
uint16_t  timeout 
)
staticprivate

Re-open the current file at a given server.

◆ ReSendQueuedMessages()

void XrdCl::FileStateHandler::ReSendQueuedMessages ( )
private

Re-send queued messages.

◆ ResetMonitoringVars()

void XrdCl::FileStateHandler::ResetMonitoringVars ( )
inlineprivate

Reset monitoring vars.

◆ ReWriteFileHandle()

void XrdCl::FileStateHandler::ReWriteFileHandle ( Message msg)
private

Re-write file handle.

◆ RunRecovery()

static Status XrdCl::FileStateHandler::RunRecovery ( std::shared_ptr< FileStateHandler > &  self)
staticprivate

Run the recovery procedure if appropriate.

◆ SendClose()

static XRootDStatus XrdCl::FileStateHandler::SendClose ( std::shared_ptr< FileStateHandler > &  self,
uint16_t  timeout 
)
staticprivate

◆ SendOrQueue()

static Status XrdCl::FileStateHandler::SendOrQueue ( std::shared_ptr< FileStateHandler > &  self,
const URL url,
Message msg,
ResponseHandler handler,
MessageSendParams sendParams 
)
staticprivate

Send a message to a host or put it in the recovery queue.

◆ SetProperty()

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

Set file property

See also
File::GetProperty for propert list

◆ SetXAttr()

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

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

◆ Stat()

static XRootDStatus XrdCl::FileStateHandler::Stat ( std::shared_ptr< FileStateHandler > &  self,
bool  force,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ Sync()

static XRootDStatus XrdCl::FileStateHandler::Sync ( std::shared_ptr< FileStateHandler > &  self,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ Tick()

void XrdCl::FileStateHandler::Tick ( time_t  now)

Tick.

◆ TimeOutRequests()

void XrdCl::FileStateHandler::TimeOutRequests ( time_t  now)

Declare timeout on requests being recovered.

◆ Truncate()

static XRootDStatus XrdCl::FileStateHandler::Truncate ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  size,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ TryOtherServer()

static XRootDStatus XrdCl::FileStateHandler::TryOtherServer ( std::shared_ptr< FileStateHandler > &  self,
uint16_t  timeout 
)
static

Try other data server.

◆ UnLock()

void XrdCl::FileStateHandler::UnLock ( )
inline

Unlock the internal lock.

◆ VectorRead()

static XRootDStatus XrdCl::FileStateHandler::VectorRead ( std::shared_ptr< FileStateHandler > &  self,
const ChunkList chunks,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Read scattered data chunks in one operation - async

Parameters
chunkslist of the chunks to be read
buffera pointer to a buffer big enough to hold the 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

◆ VectorWrite()

static XRootDStatus XrdCl::FileStateHandler::VectorWrite ( std::shared_ptr< FileStateHandler > &  self,
const ChunkList chunks,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Write scattered data chunks in one operation - async

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

◆ Visa()

static XRootDStatus XrdCl::FileStateHandler::Visa ( std::shared_ptr< FileStateHandler > &  self,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ Write() [1/3]

static XRootDStatus XrdCl::FileStateHandler::Write ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
Buffer &&  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ Write() [2/3]

static XRootDStatus XrdCl::FileStateHandler::Write ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
const void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

Write a data chunk at a given offset - async

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

◆ Write() [3/3]

static XRootDStatus XrdCl::FileStateHandler::Write ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  size,
Optional< uint64_t >  fdoff,
int  fd,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ WriteKernelBuffer()

static XRootDStatus XrdCl::FileStateHandler::WriteKernelBuffer ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
uint32_t  length,
std::unique_ptr< XrdSys::KernelBuffer kbuff,
ResponseHandler handler,
uint16_t  timeout 
)
staticprivate

Send a write request with payload being stored in a kernel buffer.

◆ WriteV()

static XRootDStatus XrdCl::FileStateHandler::WriteV ( std::shared_ptr< FileStateHandler > &  self,
uint64_t  offset,
const struct iovec *  iov,
int  iovcnt,
ResponseHandler handler,
uint16_t  timeout = 0 
)
static

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

◆ XAttrOperationImpl()

template<typename T >
static Status XrdCl::FileStateHandler::XAttrOperationImpl ( std::shared_ptr< FileStateHandler > &  self,
kXR_char  subcode,
kXR_char  options,
const std::vector< T > &  attrs,
ResponseHandler handler,
uint16_t  timeout = 0 
)
staticprivate

Generic implementation of xattr operation

Parameters
subcode: xattr operation code
attrs: operation argument
handler: operation handler
timeout: operation timeout

Friends And Related Symbol Documentation

◆ ::OpenHandler

friend class ::OpenHandler
friend

◆ ::PgReadHandler

friend class ::PgReadHandler
friend

◆ ::PgReadRetryHandler

friend class ::PgReadRetryHandler
friend

◆ ::PgReadSubstitutionHandler

friend class ::PgReadSubstitutionHandler
friend

Member Data Documentation

◆ pAllowBundledClose

bool XrdCl::FileStateHandler::pAllowBundledClose
private

◆ pCloseReason

XRootDStatus XrdCl::FileStateHandler::pCloseReason
private

◆ pDataServer

URL* XrdCl::FileStateHandler::pDataServer
private

◆ pDoRecoverRead

bool XrdCl::FileStateHandler::pDoRecoverRead
private

◆ pDoRecoverWrite

bool XrdCl::FileStateHandler::pDoRecoverWrite
private

◆ pFileHandle

uint8_t* XrdCl::FileStateHandler::pFileHandle
private

◆ pFileState

FileStatus XrdCl::FileStateHandler::pFileState
private

◆ pFileUrl

URL* XrdCl::FileStateHandler::pFileUrl
private

◆ pFollowRedirects

bool XrdCl::FileStateHandler::pFollowRedirects
private

◆ pInTheFly

std::set<Message*> XrdCl::FileStateHandler::pInTheFly
private

◆ pIsChannelEncrypted

bool XrdCl::FileStateHandler::pIsChannelEncrypted
private

◆ pLFileHandler

LocalFileHandler* XrdCl::FileStateHandler::pLFileHandler
private

◆ pLoadBalancer

URL* XrdCl::FileStateHandler::pLoadBalancer
private

◆ pMutex

XrdSysMutex XrdCl::FileStateHandler::pMutex
mutableprivate

◆ pOpenFlags

uint16_t XrdCl::FileStateHandler::pOpenFlags
private

◆ pOpenMode

uint16_t XrdCl::FileStateHandler::pOpenMode
private

◆ pOpenTime

timeval XrdCl::FileStateHandler::pOpenTime
private

◆ pPlugin

FilePlugIn*& XrdCl::FileStateHandler::pPlugin
private

◆ pRBytes

uint64_t XrdCl::FileStateHandler::pRBytes
private

◆ pRCount

uint64_t XrdCl::FileStateHandler::pRCount
private

◆ pSessionId

uint64_t XrdCl::FileStateHandler::pSessionId
private

◆ pStateRedirect

URL* XrdCl::FileStateHandler::pStateRedirect
private

◆ pStatInfo

StatInfo* XrdCl::FileStateHandler::pStatInfo
private

◆ pStatus

XRootDStatus XrdCl::FileStateHandler::pStatus
private

◆ pToBeRecovered

RequestList XrdCl::FileStateHandler::pToBeRecovered
private

◆ pUseVirtRedirector

bool XrdCl::FileStateHandler::pUseVirtRedirector
private

◆ pVRBytes

uint64_t XrdCl::FileStateHandler::pVRBytes
private

◆ pVRCount

uint64_t XrdCl::FileStateHandler::pVRCount
private

◆ pVSegs

uint64_t XrdCl::FileStateHandler::pVSegs
private

◆ pVWBytes

uint64_t XrdCl::FileStateHandler::pVWBytes
private

◆ pVWCount

uint64_t XrdCl::FileStateHandler::pVWCount
private

◆ pWBytes

uint64_t XrdCl::FileStateHandler::pWBytes
private

◆ pWCount

uint64_t XrdCl::FileStateHandler::pWCount
private

◆ pWrtRecoveryRedir

URL* XrdCl::FileStateHandler::pWrtRecoveryRedir
private

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