![]() |
XRootD
|
Handle the stateful operations. More...
#include <XrdClFileStateHandler.hh>
Public Types | |
enum | FileStatus { Closed , Opened , Error , Recovering , OpenInProgress , CloseInProgress } |
State of the file. More... | |
Public Member Functions | |
FileStateHandler (bool useVirtRedirector, FilePlugIn *&plugin) | |
FileStateHandler (FilePlugIn *&plugin) | |
Constructor. More... | |
~FileStateHandler () | |
Destructor. More... | |
void | AfterForkChild () |
Called in the child process after the fork. More... | |
bool | GetProperty (const std::string &name, std::string &value) const |
bool | IsOpen () const |
Check if the file is open. More... | |
bool | IsSecure () const |
Check if the file is using an encrypted connection. More... | |
void | Lock () |
Lock the internal lock. More... | |
void | OnClose (const XRootDStatus *status) |
Process the results of the closing operation. More... | |
void | OnOpen (const XRootDStatus *status, const OpenInfo *openInfo, const HostList *hostList) |
Process the results of the opening operation. More... | |
bool | SetProperty (const std::string &name, const std::string &value) |
void | Tick (time_t now) |
Tick. More... | |
void | TimeOutRequests (time_t now) |
Declare timeout on requests being recovered. More... | |
void | UnLock () |
Unlock the internal lock. More... | |
Static Public Member Functions | |
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 XRootDStatus | Close (std::shared_ptr< FileStateHandler > &self, 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 | Fcntl (std::shared_ptr< FileStateHandler > &self, const Buffer &arg, 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 | ListXAttr (std::shared_ptr< FileStateHandler > &self, 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. More... | |
static void | OnStateRedirection (std::shared_ptr< FileStateHandler > &self, const std::string &redirectUrl, Message *message, ResponseHandler *userHandler, MessageSendParams &sendParams) |
Handle stateful redirect. More... | |
static void | OnStateResponse (std::shared_ptr< FileStateHandler > &self, XRootDStatus *status, Message *message, AnyObject *response, HostList *hostList) |
Handle stateful response. More... | |
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 | PgRead (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *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 | 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 | 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 | 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 | 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 | Read (std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, 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 | SetXAttr (std::shared_ptr< FileStateHandler > &self, const std::vector< xattr_t > &attrs, ResponseHandler *handler, uint16_t timeout=0) |
static XRootDStatus | Stat (std::shared_ptr< FileStateHandler > &self, bool force, 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 | TryOtherServer (std::shared_ptr< FileStateHandler > &self, uint16_t timeout) |
Try other data server. More... | |
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 | Visa (std::shared_ptr< FileStateHandler > &self, 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, const void *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 | WriteV (std::shared_ptr< FileStateHandler > &self, uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, uint16_t timeout=0) |
Friends | |
class | ::OpenHandler |
class | ::PgReadHandler |
class | ::PgReadRetryHandler |
class | ::PgReadSubstitutionHandler |
Handle the stateful operations.
Definition at line 79 of file XrdClFileStateHandler.hh.
State of the file.
Definition at line 90 of file XrdClFileStateHandler.hh.
XrdCl::FileStateHandler::FileStateHandler | ( | FilePlugIn *& | plugin | ) |
Constructor.
Definition at line 641 of file XrdClFileStateHandler.cc.
References XrdCl::DefaultEnv::GetFileTimer(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::FileTimer::RegisterFileObject(), and XrdCl::ForkHandler::RegisterFileObject().
XrdCl::FileStateHandler::FileStateHandler | ( | bool | useVirtRedirector, |
FilePlugIn *& | plugin | ||
) |
Constructor
useVirtRedirector | if true Metalink files will be treated as a VirtualRedirectors |
Definition at line 674 of file XrdClFileStateHandler.cc.
References XrdCl::DefaultEnv::GetFileTimer(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::FileTimer::RegisterFileObject(), and XrdCl::ForkHandler::RegisterFileObject().
XrdCl::FileStateHandler::~FileStateHandler | ( | ) |
Destructor.
Definition at line 703 of file XrdClFileStateHandler.cc.
References Closed, XrdCl::PostMaster::DecFileInstCnt(), XrdCl::DefaultEnv::GetFileTimer(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::RedirectorRegistry::Instance(), XrdCl::URL::IsLocalFile(), XrdCl::URL::IsMetalink(), XrdCl::RedirectorRegistry::Release(), XrdCl::FileTimer::UnRegisterFileObject(), and XrdCl::ForkHandler::UnRegisterFileObject().
void XrdCl::FileStateHandler::AfterForkChild | ( | ) |
Called in the child process after the fork.
Definition at line 2744 of file XrdClFileStateHandler.cc.
References Closed, XrdCl::Log::Debug(), Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetObfuscatedURL(), and Recovering.
|
static |
Create a checkpoint
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 |
Definition at line 2059 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientChkPointRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_chkpoint, ClientChkPointRequest::opcode, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientChkPointRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
|
static |
Checkpointed write - async
offset | offset from the beginning of the file |
size | number of bytes to be written |
buffer | a pointer to the buffer holding the data to be written |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 2108 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientChkPointRequest::dlen, ClientWriteRequest::dlen, XrdCl::errInvalidOp, Error, ClientChkPointRequest::fhandle, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), kXR_chkpoint, kXR_ckpXeq, kXR_write, ClientWriteRequest::offset, ClientChkPointRequest::opcode, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientChkPointRequest::requestid, ClientWriteRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
|
static |
Checkpointed WriteV - async
offset | offset from the beginning of the file |
iov | list of the buffers to be written |
iovcnt | number of buffers |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Write scattered buffers in one operation - async
offset | offset from the beginning of the file |
iov | list of the buffers to be written |
iovcnt | number of buffers |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Definition at line 2170 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientChkPointRequest::dlen, ClientWriteRequest::dlen, XrdCl::errInvalidOp, Error, ClientChkPointRequest::fhandle, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), kXR_chkpoint, kXR_ckpXeq, kXR_write, ClientWriteRequest::offset, ClientChkPointRequest::opcode, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientChkPointRequest::requestid, ClientWriteRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
|
static |
Close the file object
handler | handler to be notified about the status of the operation |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 874 of file XrdClFileStateHandler.cc.
References Closed, CloseInProgress, XrdCl::Status::code, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errConnectionError, XrdCl::errInProgress, XrdCl::errInvalidOp, XrdCl::errInvalidSession, Error, XrdCl::errPollerError, XrdCl::errSocketDisconnected, XrdCl::errSocketError, XrdCl::errSocketOptError, ClientCloseRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::PostMaster::GetJobManager(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Status::IsOK(), kXR_close, OpenInProgress, XrdCl::MessageUtils::ProcessSendParams(), XrdCl::JobManager::QueueJob(), Recovering, ClientCloseRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::Message::SetSessionId(), XrdCl::MessageSendParams::stateful, XrdCl::stError, XrdCl::stOK, XrdCl::suAlreadyDone, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Close().
|
static |
Delete extended attributes - async
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 |
Definition at line 1998 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), kXR_fattrDel, Opened, Recovering, and XrdCl::stError.
Referenced by XrdCl::File::DelXAttr().
|
static |
Performs a custom operation on an open file, server implementation dependent - async
arg | query argument |
handler | handler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1865 of file XrdClFileStateHandler.cc.
References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientQueryRequest::dlen, XrdCl::errInvalidOp, Error, ClientQueryRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), XrdCl::Buffer::GetSize(), ClientQueryRequest::infotype, kXR_Qopaqug, kXR_query, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientQueryRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Fcntl().
bool XrdCl::FileStateHandler::GetProperty | ( | const std::string & | name, |
std::string & | value | ||
) | const |
Get file property
Definition at line 2277 of file XrdClFileStateHandler.cc.
References XrdCl::URL::GetHostId(), and XrdCl::URL::GetURL().
|
static |
Get extended attributes - async
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 |
Definition at line 1972 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), kXR_fattrGet, Opened, Recovering, and XrdCl::stError.
Referenced by XrdCl::File::GetXAttr().
bool XrdCl::FileStateHandler::IsOpen | ( | ) | const |
Check if the file is open.
Definition at line 2231 of file XrdClFileStateHandler.cc.
References Opened, and Recovering.
|
inline |
Check if the file is using an encrypted connection.
Definition at line 658 of file XrdClFileStateHandler.hh.
|
static |
List extended attributes - async
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 |
Definition at line 2024 of file XrdClFileStateHandler.cc.
References ClientFattrRequest::aData, XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), kXR_fattrList, Opened, Recovering, and XrdCl::stError.
Referenced by XrdCl::File::ListXAttr().
|
inline |
Lock the internal lock.
Definition at line 680 of file XrdClFileStateHandler.hh.
void XrdCl::FileStateHandler::OnClose | ( | const XRootDStatus * | status | ) |
Process the results of the closing operation.
Definition at line 2453 of file XrdClFileStateHandler.cc.
References Closed, XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::FileMsg, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetObfuscatedURL(), and XrdCl::XRootDStatus::ToStr().
void XrdCl::FileStateHandler::OnOpen | ( | const XRootDStatus * | status, |
const OpenInfo * | openInfo, | ||
const HostList * | hostList | ||
) |
Process the results of the opening operation.
Definition at line 2312 of file XrdClFileStateHandler.cc.
References XrdCl::Monitor::OpenInfo::dataServer, XrdCl::Log::Debug(), XrdCl::Monitor::ErrorInfo::ErrOpen, Error, XrdCl::Monitor::Event(), XrdCl::Monitor::EvErrIO, XrdCl::Monitor::EvOpen, XrdCl::Monitor::OpenInfo::file, XrdCl::Monitor::ErrorInfo::file, XrdCl::FileMsg, XrdCl::Monitor::OpenInfo::fSize, XrdCl::AnyObject::Get(), XrdCl::OpenInfo::GetFileHandle(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::URL::GetObfuscatedURL(), XrdCl::URL::GetParams(), XrdCl::URL::GetPath(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::OpenInfo::GetSessionId(), XrdCl::StatInfo::GetSize(), XrdCl::OpenInfo::GetStatInfo(), XrdCl::XRootDQuery::IsEncrypted, XrdCl::URL::IsLocalFile(), XrdCl::URL::IsMetalink(), XrdCl::Status::IsOK(), kXR_recoverWrts, XrdCl::MessageUtils::MergeCGI(), XrdCl::Monitor::OpenInfo::oFlags, XrdCl::Monitor::ErrorInfo::opCode, Opened, XrdCl::URL::SetParams(), XrdCl::URL::SetPath(), XrdCl::Monitor::ErrorInfo::status, and XrdCl::XRootDStatus::ToStr().
|
static |
Handle an error while sending a stateful message.
Definition at line 2475 of file XrdClFileStateHandler.cc.
References XrdCl::Status::code, XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::Monitor::ErrorInfo::ErrRead, XrdCl::Monitor::ErrorInfo::ErrReadV, XrdCl::errRedirect, XrdCl::Monitor::ErrorInfo::ErrUnc, XrdCl::Monitor::ErrorInfo::ErrWrite, XrdCl::Monitor::ErrorInfo::ErrWriteV, XrdCl::Monitor::Event(), XrdCl::Monitor::EvErrIO, XrdCl::Monitor::ErrorInfo::file, XrdCl::FileMsg, XrdCl::Buffer::GetBuffer(), XrdCl::XRootDStatus::GetErrorMessage(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::Message::GetObfuscatedDescription(), ClientRequest::header, XrdCl::Status::IsOK(), XrdCl::MessageSendParams::kbuff, kXR_pgread, kXR_pgwrite, kXR_read, kXR_readv, kXR_write, kXR_writev, OnStateRedirection(), XrdCl::Monitor::ErrorInfo::opCode, ClientRequestHdr::requestid, XrdCl::Monitor::ErrorInfo::status, and XrdCl::XRootDStatus::ToStr().
|
static |
Handle stateful redirect.
Definition at line 2563 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::MergeCGI().
Referenced by OnStateError().
|
static |
Handle stateful response.
Definition at line 2593 of file XrdClFileStateHandler.cc.
References ClientRequestHdr::dlen, ClientPgWriteRequest::dlen, ClientWriteRequest::dlen, XrdCl::Log::Dump(), XrdCl::FileMsg, XrdCl::AnyObject::Get(), XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), XrdCl::Message::GetObfuscatedDescription(), ClientRequest::header, kXR_pgread, kXR_pgwrite, kXR_read, kXR_readv, kXR_stat, kXR_write, kXR_writev, ClientRequest::pgread, ClientRequest::pgwrite, ClientRequest::read, ClientRequestHdr::requestid, ClientPgReadRequest::rlen, ClientReadRequest::rlen, readahead_list::rlen, XrdProto::write_list::wlen, and ClientRequest::write.
|
static |
Open the file pointed to by the given URL
url | url of the file to be opened |
flags | OpenFlags::Flags |
mode | Access::Mode for new files, 0 otherwise |
handler | handler to be notified about the status of the operation |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 747 of file XrdClFileStateHandler.cc.
References XrdCl::Buffer::Append(), Closed, CloseInProgress, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientOpenRequest::dlen, XrdCl::errInProgress, XrdCl::errInvalidArgs, XrdCl::errInvalidOp, Error, XrdCl::Log::Error(), XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), XrdCl::RedirectorRegistry::Instance(), XrdCl::Status::IsOK(), kXR_async, kXR_open, kXR_retstat, ClientOpenRequest::mode, Opened, OpenInProgress, ClientOpenRequest::options, XrdCl::MessageUtils::ProcessSendParams(), Recovering, XrdCl::RedirectorRegistry::Release(), ClientOpenRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Open().
|
static |
Read data pages at a given offset
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 |
Definition at line 1055 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Debug(), XrdCl::FileMsg, XrdCl::AnyObject::Get(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Utils::GetProtocolVersion(), XrdCl::Status::IsOK(), kXR_PROTPGRWVERSION, kXR_suppgrw, XrdCl::PgReadFlags::None, PgReadImpl(), XrdCl::PostMaster::QueryTransport(), Read(), and XrdCl::XRootDQuery::ServerFlags.
Referenced by XrdCl::File::PgRead().
|
static |
Read data pages at a given offset (actual implementation)
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 |
Definition at line 1111 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientPgReadRequest::dlen, XrdCl::errInvalidOp, Error, ClientPgReadRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), kXR_pgread, ClientPgReadRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientPgReadReqArgs::reqflags, ClientPgReadRequest::requestid, ClientPgReadRequest::rlen, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by PgRead(), and PgReadRetry().
|
static |
Retry reading one page of data at a given offset
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 |
Definition at line 1093 of file XrdClFileStateHandler.cc.
References XrdCl::errInvalidArgs, XrdCl::Status::IsOK(), XrdSys::PageSize, PgReadImpl(), XrdCl::PgReadFlags::Retry, and XrdCl::stError.
|
static |
Write number of pages at a given offset - async
offset | offset from the beginning of the file |
size | buffer size |
buffer | a pointer to a buffer holding data pages |
cksums | the crc32c checksums for each 4KB page |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1292 of file XrdClFileStateHandler.cc.
References XrdCl::RetryInfo::At(), XrdOucPgrwUtils::csCalc(), XrdOucPgrwUtils::csNum(), XrdCl::DefaultRequestTimeout, XrdCl::errDataError, XrdCl::errInvalidArgs, XrdCl::errOperationExpired, XrdCl::FileMsg, XrdCl::AnyObject::Get(), XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::ResponseHandler::HandleResponse(), XrdCl::Log::Info(), XrdCl::Status::IsOK(), XrdCl::RetryInfo::NeedRetry(), XrdSys::PageSize, PgWriteImpl(), PgWriteRetry(), XrdCl::RetryInfo::Size(), XrdCl::stError, XrdCl::Log::Warning(), and XrdCl::ResponseHandler::Wrap().
Referenced by XrdCl::File::PgWrite().
|
static |
Write number of pages at a given offset - async
offset | offset from the beginning of the file |
size | buffer size |
buffer | a pointer to a buffer holding data pages |
cksums | the crc32c checksums for each 4KB page |
flags | PgWrite flags |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1463 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageSendParams::crc32cDigests, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientPgWriteRequest::dlen, XrdCl::errInvalidOp, Error, ClientPgWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_pgwrite, ClientPgWriteRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientPgWriteRequest::reqflags, ClientPgWriteRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by PgWrite(), and PgWriteRetry().
|
static |
Write number of pages at a given offset - async
offset | offset from the beginning of the file |
size | buffer size |
buffer | a pointer to a buffer holding data pages |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1448 of file XrdClFileStateHandler.cc.
References PgWriteImpl(), and XrdCl::PgReadFlags::Retry.
Referenced by PgWrite().
|
static |
Read a data chunk at a given offset - sync
offset | offset from the beginning of the file |
size | number of bytes to be read |
buffer | a pointer to a buffer big enough to hold the data or 0 if the buffer should be allocated by the system |
handler | handler 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 |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1009 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientReadRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_read, ClientReadRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientReadRequest::requestid, ClientReadRequest::rlen, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by PgRead(), and XrdCl::File::Read().
|
static |
Read data into scattered buffers in one operation - async
offset | offset from the beginning of the file |
iov | list of the buffers to be written |
iovcnt | number of buffers |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Definition at line 1806 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientReadRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_read, kXR_virtReadv, ClientReadRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientReadRequest::requestid, ClientReadRequest::rlen, XrdCl::XRootDTransport::SetDescription(), XrdCl::Message::SetVirtReqID(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::ReadV().
bool XrdCl::FileStateHandler::SetProperty | ( | const std::string & | name, |
const std::string & | value | ||
) |
Set file property
Definition at line 2243 of file XrdClFileStateHandler.cc.
|
static |
Set extended attributes - async
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 |
Definition at line 1946 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), kXR_fattrSet, Opened, Recovering, and XrdCl::stError.
Referenced by XrdCl::File::SetXAttr().
|
static |
Obtain status information for this file - async
force | do not use the cached information, force re-stating |
handler | handler to be notified when the response arrives, the response parameter will hold a StatInfo object if the procedure is successful |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 952 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientStatRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), XrdCl::ResponseHandler::HandleResponseWithHosts(), kXR_stat, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientStatRequest::requestid, XrdCl::AnyObject::Set(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Stat().
|
static |
Commit all pending disk writes - async
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1518 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientSyncRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_sync, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientSyncRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Sync().
void XrdCl::FileStateHandler::Tick | ( | time_t | now | ) |
Tick.
Definition at line 2705 of file XrdClFileStateHandler.cc.
References XrdSysMutex::CondLock(), TimeOutRequests(), and XrdSysMutex::UnLock().
void XrdCl::FileStateHandler::TimeOutRequests | ( | time_t | now | ) |
Declare timeout on requests being recovered.
Definition at line 2716 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Dump(), XrdCl::errOperationExpired, XrdCl::FileMsg, XrdCl::PostMaster::GetJobManager(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetObfuscatedURL(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::JobManager::QueueJob(), and XrdCl::stError.
Referenced by Tick().
|
static |
Truncate the file to a particular size - async
size | desired size of the file |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1556 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientTruncateRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_truncate, ClientTruncateRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientTruncateRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Truncate().
|
static |
Try other data server.
Definition at line 2767 of file XrdClFileStateHandler.cc.
References XrdCl::Log::Debug(), XrdCl::errInvalidOp, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::MessageUtils::MergeCGI(), Opened, Recovering, and XrdCl::stError.
Referenced by XrdCl::File::TryOtherServer().
|
inline |
Unlock the internal lock.
Definition at line 688 of file XrdClFileStateHandler.hh.
|
static |
Read scattered data chunks in one operation - async
chunks | list of the chunks to be read |
buffer | a pointer to a buffer big enough to hold the data |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Definition at line 1596 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientReadVRequest::dlen, XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), kXR_readv, readahead_list::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientReadVRequest::requestid, readahead_list::rlen, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::VectorRead().
|
static |
Write scattered data chunks in one operation - async
chunks | list of the chunks to be read |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Definition at line 1673 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientWriteVRequest::dlen, XrdCl::errInvalidOp, Error, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::DefaultEnv::GetLog(), kXR_writev, XrdProto::write_list::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientWriteVRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, XrdCl::MessageSendParams::timeout, and XrdProto::write_list::wlen.
Referenced by XrdCl::File::VectorWrite().
|
static |
Get access token to a file - async
handler | handler to be notified when the response arrives, the response parameter will hold a Buffer object if the procedure is successful |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1907 of file XrdClFileStateHandler.cc.
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, Error, ClientQueryRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), ClientQueryRequest::infotype, kXR_query, kXR_Qvisa, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientQueryRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Visa().
|
static |
Write a data chunk at a given offset - async
offset | offset from the beginning of the file |
buffer | r-value reference to Buffer object, in this case XrdCl runtime takes ownership of the buffer |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1216 of file XrdClFileStateHandler.cc.
References XrdCl::errInternal, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::Log::Info(), XrdCl::Status::IsOK(), XrdSys::KernelBuffer::IsPageAligned(), XProtocol::mapError(), XrdSys::Move(), and XrdCl::stError.
|
static |
Write a data chunk at a given offset - async
offset | offset from the beginning of the file |
size | number of bytes to be written |
buffer | a pointer to the buffer holding the data to be written |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1168 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientWriteRequest::dlen, XrdCl::errInvalidOp, Error, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_write, ClientWriteRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientWriteRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Write().
|
static |
Write a data from a given file descriptor at a given offset - async
offset | offset from the beginning of the file |
size | number of bytes to be written |
fdoff | offset 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) |
fd | file descriptor open for reading |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 the environment default will be used |
Definition at line 1266 of file XrdClFileStateHandler.cc.
References XrdCl::errInternal, XProtocol::mapError(), XrdSys::Read(), and XrdCl::stError.
|
static |
Write scattered buffers in one operation - async
offset | offset from the beginning of the file |
iov | list of the buffers to be written |
iovcnt | number of buffers |
handler | handler to be notified when the response arrives |
timeout | timeout value, if 0 then the environment default will be used |
Definition at line 1750 of file XrdClFileStateHandler.cc.
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientWriteRequest::dlen, XrdCl::errInvalidOp, Error, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::DefaultEnv::GetLog(), kXR_write, ClientWriteRequest::offset, Opened, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientWriteRequest::requestid, XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::WriteV().
|
friend |
Definition at line 84 of file XrdClFileStateHandler.hh.
|
friend |
Definition at line 81 of file XrdClFileStateHandler.hh.
|
friend |
Definition at line 82 of file XrdClFileStateHandler.hh.
|
friend |
Definition at line 83 of file XrdClFileStateHandler.hh.