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

#include <XrdClLocalFileHandler.hh>

Public Member Functions

 LocalFileHandler ()
 
 ~LocalFileHandler ()
 
XRootDStatus Open (const std::string &url, uint16_t flags, uint16_t mode, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Open (const URL *url, const Message *req, AnyObject *&resp)
 Handle local redirect to given URL triggered by the given request.
 
XRootDStatus Close (ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Stat (ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus ReadV (uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Write (uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Sync (ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Truncate (uint64_t size, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus VectorRead (const ChunkList &chunks, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus VectorWrite (const ChunkList &chunks, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus WriteV (uint64_t offset, ChunkList *chunks, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus QueueTask (XRootDStatus *st, AnyObject *obj, ResponseHandler *handler)
 
XRootDStatus Fcntl (const Buffer &arg, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus Visa (ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus SetXAttr (const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus GetXAttr (const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus DelXAttr (const std::vector< std::string > &attrs, ResponseHandler *handler, uint16_t timeout=0)
 
XRootDStatus ListXAttr (ResponseHandler *handler, uint16_t timeout=0)
 
void SetHostList (const HostList &hostList)
 
const HostListGetHostList ()
 
XRootDStatus ExecRequest (const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams)
 Translate an XRootD request into LocalFileHandler call.
 

Static Public Member Functions

static XRootDStatus MkdirPath (const std::string &path)
 

Private Member Functions

XRootDStatus OpenImpl (const std::string &url, uint16_t flags, uint16_t mode, AnyObject *&resp)
 
XRootDStatus XAttrImpl (kXR_char code, kXR_char numattr, size_t bodylen, char *body, ResponseHandler *handler)
 Parses kXR_fattr request and calls respective XAttr operation.
 

Private Attributes

int fd
 
std::string pUrl
 
HostList pHostList
 

Constructor & Destructor Documentation

◆ LocalFileHandler()

XrdCl::LocalFileHandler::LocalFileHandler ( )

◆ ~LocalFileHandler()

XrdCl::LocalFileHandler::~LocalFileHandler ( )

Member Function Documentation

◆ Close()

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

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()

XRootDStatus XrdCl::LocalFileHandler::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

◆ ExecRequest()

XRootDStatus XrdCl::LocalFileHandler::ExecRequest ( const URL url,
Message msg,
ResponseHandler handler,
MessageSendParams sendParams 
)

Translate an XRootD request into LocalFileHandler call.

◆ Fcntl()

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

Performs a custom operation on an open file - 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

◆ GetHostList()

const HostList & XrdCl::LocalFileHandler::GetHostList ( )
inline

References pHostList.

◆ GetXAttr()

XRootDStatus XrdCl::LocalFileHandler::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

◆ ListXAttr()

XRootDStatus XrdCl::LocalFileHandler::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

◆ MkdirPath()

static XRootDStatus XrdCl::LocalFileHandler::MkdirPath ( const std::string &  path)
static

creates the directories specified in path

Parameters
pathspecifies which directories are to be created
Returns
status of the mkdir system call

◆ Open() [1/2]

XRootDStatus XrdCl::LocalFileHandler::Open ( const std::string &  url,
uint16_t  flags,
uint16_t  mode,
ResponseHandler handler,
uint16_t  timeout = 0 
)

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

◆ Open() [2/2]

XRootDStatus XrdCl::LocalFileHandler::Open ( const URL url,
const Message req,
AnyObject *&  resp 
)

Handle local redirect to given URL triggered by the given request.

◆ OpenImpl()

XRootDStatus XrdCl::LocalFileHandler::OpenImpl ( const std::string &  url,
uint16_t  flags,
uint16_t  mode,
AnyObject *&  resp 
)
private

◆ QueueTask()

XRootDStatus XrdCl::LocalFileHandler::QueueTask ( XRootDStatus st,
AnyObject obj,
ResponseHandler handler 
)

Queues a task to the jobmanager

Parameters
stthe status of the file operation
objthe object holding data like open-, chunk- or vreadinfo
handlerhandler to be notified when the response arrives
Returns
status of the operation

◆ Read()

XRootDStatus XrdCl::LocalFileHandler::Read ( uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
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 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()

XRootDStatus XrdCl::LocalFileHandler::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

◆ SetHostList()

void XrdCl::LocalFileHandler::SetHostList ( const HostList hostList)
inline

References pHostList.

◆ SetXAttr()

XRootDStatus XrdCl::LocalFileHandler::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

◆ Stat()

XRootDStatus XrdCl::LocalFileHandler::Stat ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Obtain status information for this file - async

Parameters
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()

XRootDStatus XrdCl::LocalFileHandler::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

◆ Truncate()

XRootDStatus XrdCl::LocalFileHandler::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

◆ VectorRead()

XRootDStatus XrdCl::LocalFileHandler::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
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()

XRootDStatus XrdCl::LocalFileHandler::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 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()

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

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()

XRootDStatus XrdCl::LocalFileHandler::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

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

◆ WriteV()

XRootDStatus XrdCl::LocalFileHandler::WriteV ( uint64_t  offset,
ChunkList chunks,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Write scattered buffers in one operation - async

Parameters
offsetoffset from the beginning of the file
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

◆ XAttrImpl()

XRootDStatus XrdCl::LocalFileHandler::XAttrImpl ( kXR_char  code,
kXR_char  numattr,
size_t  bodylen,
char *  body,
ResponseHandler handler 
)
private

Parses kXR_fattr request and calls respective XAttr operation.

Member Data Documentation

◆ fd

int XrdCl::LocalFileHandler::fd
private

◆ pHostList

HostList XrdCl::LocalFileHandler::pHostList
private

Referenced by GetHostList(), and SetHostList().

◆ pUrl

std::string XrdCl::LocalFileHandler::pUrl
private

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