|
xrootd
|
Handle the stateful operations. More...
#include <XrdClFileStateHandler.hh>

Classes | |
| struct | RequestData |
Public Types | |
| enum | FileStatus { Closed, Opened, Error, Recovering, OpenInProgress, CloseInProgress } |
| State of the file. More... | |
Public Member Functions | |
| FileStateHandler () | |
| Constructor. More... | |
| ~FileStateHandler () | |
| Destructor. More... | |
| XRootDStatus | Open (const std::string &url, uint16_t flags, uint16_t mode, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Close (ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Stat (bool force, ResponseHandler *handler, uint16_t timeout=0) |
| XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, 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) |
| void | OnOpen (const XRootDStatus *status, const OpenInfo *openInfo, const HostList *hostList) |
| Process the results of the opening operation. More... | |
| void | OnClose (const XRootDStatus *status) |
| Process the results of the closing operation. More... | |
| void | OnStateError (XRootDStatus *status, Message *message, ResponseHandler *userHandler, MessageSendParams &sendParams) |
| Handle an error while sending a stateful message. More... | |
| void | OnStateRedirection (RedirectInfo *redirectInfo, Message *message, ResponseHandler *userHandler, MessageSendParams &sendParams) |
| Handle stateful redirect. More... | |
| void | OnStateResponse (XRootDStatus *status, Message *message, AnyObject *response, HostList *hostList) |
| Handle stateful response. More... | |
| bool | IsOpen () const |
| Check if the file is open. More... | |
| void | EnableReadRecovery (bool enable) |
| void | EnableWriteRecovery (bool enable) |
| std::string | GetDataServer () const |
| Get the data server the file is accessed at. More... | |
| URL | GetLastURL () const |
| Get final url with all the cgi information. More... | |
| void | Lock () |
| Lock the internal lock. More... | |
| void | UnLock () |
| Unlock the internal lock. More... | |
| void | Tick (time_t now) |
| Tick. More... | |
| void | TimeOutRequests (time_t now) |
| Declare timeout on requests being recovered. More... | |
| void | AfterForkChild () |
| Called in the child process after the fork. More... | |
Private Types | |
| typedef std::list< RequestData > | RequestList |
Private Member Functions | |
| Status | SendOrQueue (const URL &url, Message *msg, ResponseHandler *handler, MessageSendParams &sendParams) |
| Send a message to a host or put it in the recovery queue. More... | |
| bool | IsRecoverable (const XRootDStatus &stataus) const |
| Check if the stateful error is recoverable. More... | |
| Status | RecoverMessage (RequestData rd, bool callbackOnFailure=true) |
| Status | RunRecovery () |
| Run the recovery procedure if appropriate. More... | |
| bool | IsReadOnly () const |
| Check if the file is open for read only. More... | |
| Status | ReOpenFileAtServer (const URL &url, uint16_t timeout) |
| Re-open the current file at a given server. More... | |
| void | FailMessage (RequestData rd, XRootDStatus status) |
| Fail a message. More... | |
| void | FailQueuedMessages (XRootDStatus status) |
| Fail queued messages. More... | |
| void | ReSendQueuedMessages () |
| Re-send queued messages. More... | |
| void | ReWriteFileHandle (Message *msg) |
| Re-write file handle. More... | |
| void | ResetMonitoringVars () |
| Reset monitoring vars. More... | |
| void | MonitorClose (const XRootDStatus *status) |
| Dispatch monitoring information on close. More... | |
Private Attributes | |
| XrdSysMutex | pMutex |
| FileStatus | pFileState |
| XRootDStatus | pStatus |
| StatInfo * | pStatInfo |
| URL * | pFileUrl |
| URL * | pDataServer |
| URL * | pLoadBalancer |
| URL * | pStateRedirect |
| uint8_t * | pFileHandle |
| uint16_t | pOpenMode |
| uint16_t | pOpenFlags |
| RequestList | pToBeRecovered |
| std::set< Message * > | pInTheFly |
| uint64_t | pSessionId |
| bool | pDoRecoverRead |
| bool | pDoRecoverWrite |
| timeval | pOpenTime |
| uint64_t | pRBytes |
| uint64_t | pVBytes |
| uint64_t | pWBytes |
| uint64_t | pVSegs |
| uint64_t | pRCount |
| uint64_t | pVCount |
| uint64_t | pWCount |
| XRootDStatus | pCloseReason |
Handle the stateful operations.
|
private |
| XrdCl::FileStateHandler::FileStateHandler | ( | ) |
| XrdCl::FileStateHandler::~FileStateHandler | ( | ) |
Destructor.
References Closed, XrdCl::DefaultEnv::GetFileTimer(), XrdCl::DefaultEnv::GetForkHandler(), MonitorClose(), pDataServer, pFileHandle, pFileState, pFileUrl, pLoadBalancer, pStatInfo, ResetMonitoringVars(), XrdCl::ForkHandler::UnRegisterFileObject(), and XrdCl::FileTimer::UnRegisterFileObject().
| void XrdCl::FileStateHandler::AfterForkChild | ( | ) |
Called in the child process after the fork.
References Closed, XrdCl::Log::Debug(), Error, XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), IsReadOnly(), pDoRecoverRead, pDoRecoverWrite, pFileState, pFileUrl, pInTheFly, pToBeRecovered, and Recovering.
| XRootDStatus XrdCl::FileStateHandler::Close | ( | ResponseHandler * | handler, |
| uint16_t | timeout = 0 |
||
| ) |
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 |
References Closed, CloseInProgress, XrdCl::Status::code, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInProgress, XrdCl::errInvalidOp, XrdCl::errInvalidSession, Error, ClientCloseRequest::fhandle, XrdCl::FileMsg, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), IsReadOnly(), kXR_close, OpenInProgress, pDataServer, pFileHandle, pFileState, pFileUrl, pInTheFly, pMutex, XrdCl::MessageUtils::ProcessSendParams(), pSessionId, pStatus, Recovering, ClientCloseRequest::requestid, XrdCl::MessageUtils::SendMessage(), XrdCl::XRootDTransport::SetDescription(), XrdCl::Message::SetSessionId(), XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Close().
| void XrdCl::FileStateHandler::EnableReadRecovery | ( | bool | enable | ) |
Enable/disable state recovery procedures while the file is open for reading
References pDoRecoverRead, and pMutex.
Referenced by XrdCl::File::EnableReadRecovery().
| void XrdCl::FileStateHandler::EnableWriteRecovery | ( | bool | enable | ) |
Enable/disable state recovery procedures while the file is open for writing or read/write
References pDoRecoverWrite, and pMutex.
Referenced by XrdCl::File::EnableWriteRecovery().
|
private |
Fail a message.
References XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::FileMsg, XrdCl::Message::GetDescription(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), XrdCl::FileStateHandler::RequestData::handler, XrdCl::ResponseHandler::HandleResponseWithHosts(), XrdCl::MessageSendParams::hostList, XrdCl::FileStateHandler::RequestData::params, pFileUrl, XrdCl::FileStateHandler::RequestData::request, and XrdCl::XRootDStatus::ToStr().
Referenced by FailQueuedMessages(), OnStateError(), RecoverMessage(), and ReSendQueuedMessages().
|
private |
Fail queued messages.
References FailMessage(), and pToBeRecovered.
Referenced by OnOpen(), and RunRecovery().
| std::string XrdCl::FileStateHandler::GetDataServer | ( | ) | const |
Get the data server the file is accessed at.
References XrdCl::URL::GetHostId(), pDataServer, and pMutex.
Referenced by XrdCl::File::GetDataServer().
| URL XrdCl::FileStateHandler::GetLastURL | ( | ) | const |
Get final url with all the cgi information.
References pDataServer, and pMutex.
Referenced by XrdCl::File::GetLastURL().
| bool XrdCl::FileStateHandler::IsOpen | ( | ) | const |
Check if the file is open.
References Opened, pFileState, pMutex, and Recovering.
Referenced by XrdCl::File::IsOpen().
|
private |
Check if the file is open for read only.
References kXR_open_apnd, kXR_open_read, kXR_open_updt, and pOpenFlags.
Referenced by AfterForkChild(), Close(), IsRecoverable(), and RunRecovery().
|
private |
Check if the stateful error is recoverable.
References XrdCl::Status::code, XrdCl::errInvalidSession, XrdCl::errSocketError, IsReadOnly(), pDoRecoverRead, and pDoRecoverWrite.
Referenced by OnStateError(), and SendOrQueue().
|
inline |
Lock the internal lock.
References XrdSysMutex::Lock(), and pMutex.
|
private |
Dispatch monitoring information on close.
References XrdCl::Monitor::CloseInfo::cTOD, XrdCl::Monitor::EvClose, XrdCl::Monitor::Event(), XrdCl::Monitor::CloseInfo::file, XrdCl::DefaultEnv::GetMonitor(), XrdCl::Monitor::CloseInfo::oTOD, pFileUrl, pOpenTime, pRBytes, pRCount, pVBytes, pVCount, pVSegs, pWBytes, pWCount, XrdCl::Monitor::CloseInfo::rBytes, XrdCl::Monitor::CloseInfo::rCount, XrdCl::Monitor::CloseInfo::status, XrdCl::Monitor::CloseInfo::vBytes, XrdCl::Monitor::CloseInfo::vCount, XrdCl::Monitor::CloseInfo::vSegs, XrdCl::Monitor::CloseInfo::wBytes, and XrdCl::Monitor::CloseInfo::wCount.
Referenced by OnClose(), and ~FileStateHandler().
| void XrdCl::FileStateHandler::OnClose | ( | const XRootDStatus * | status | ) |
Process the results of the closing operation.
References Closed, XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::FileMsg, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), MonitorClose(), pDataServer, pFileState, pFileUrl, pInTheFly, pMutex, pStatus, pToBeRecovered, ResetMonitoringVars(), and XrdCl::XRootDStatus::ToStr().
| void XrdCl::FileStateHandler::OnOpen | ( | const XRootDStatus * | status, |
| const OpenInfo * | openInfo, | ||
| const HostList * | hostList | ||
| ) |
Process the results of the opening operation.
References XrdCl::Monitor::OpenInfo::dataServer, XrdCl::Log::Debug(), XrdCl::Monitor::ErrorInfo::ErrOpen, Error, XrdCl::Monitor::Event(), XrdCl::Monitor::EvErrIO, XrdCl::Monitor::EvOpen, FailQueuedMessages(), XrdCl::Monitor::OpenInfo::file, XrdCl::Monitor::ErrorInfo::file, XrdCl::FileMsg, XrdCl::Monitor::OpenInfo::fSize, XrdCl::OpenInfo::GetFileHandle(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::URL::GetParams(), XrdCl::URL::GetPath(), XrdCl::OpenInfo::GetSessionId(), XrdCl::StatInfo::GetSize(), XrdCl::OpenInfo::GetStatInfo(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), XrdCl::MessageUtils::MergeCGI(), XrdCl::Monitor::OpenInfo::oFlags, XrdCl::Monitor::ErrorInfo::opCode, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pLoadBalancer, pMutex, pOpenFlags, pOpenTime, pSessionId, pStatInfo, pStatus, ReSendQueuedMessages(), XrdCl::URL::SetParams(), XrdCl::URL::SetPath(), XrdCl::Monitor::ErrorInfo::status, and XrdCl::XRootDStatus::ToStr().
| void XrdCl::FileStateHandler::OnStateError | ( | XRootDStatus * | status, |
| Message * | message, | ||
| ResponseHandler * | userHandler, | ||
| MessageSendParams & | sendParams | ||
| ) |
Handle an error while sending a stateful message.
References XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::Monitor::ErrorInfo::ErrRead, XrdCl::Monitor::ErrorInfo::ErrReadV, XrdCl::Monitor::ErrorInfo::ErrUnc, XrdCl::Monitor::ErrorInfo::ErrWrite, XrdCl::Monitor::Event(), XrdCl::Monitor::EvErrIO, FailMessage(), XrdCl::Monitor::ErrorInfo::file, XrdCl::FileMsg, XrdCl::Buffer::GetBuffer(), XrdCl::Message::GetDescription(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::URL::GetURL(), ClientRequest::header, IsRecoverable(), kXR_read, kXR_readv, kXR_write, XrdCl::Monitor::ErrorInfo::opCode, pCloseReason, pFileUrl, pInTheFly, pMutex, RecoverMessage(), ClientRequestHdr::requestid, XrdCl::Monitor::ErrorInfo::status, and XrdCl::XRootDStatus::ToStr().
| void XrdCl::FileStateHandler::OnStateRedirection | ( | RedirectInfo * | redirectInfo, |
| Message * | message, | ||
| ResponseHandler * | userHandler, | ||
| MessageSendParams & | sendParams | ||
| ) |
Handle stateful redirect.
References XrdCl::RedirectInfo::cgi, XrdCl::URL::GetParams(), XrdCl::RedirectInfo::host, XrdCl::MessageUtils::MergeCGI(), pFileUrl, pInTheFly, pMutex, XrdCl::RedirectInfo::port, pStateRedirect, RecoverMessage(), and XrdCl::URL::SetParams().
| void XrdCl::FileStateHandler::OnStateResponse | ( | XRootDStatus * | status, |
| Message * | message, | ||
| AnyObject * | response, | ||
| HostList * | hostList | ||
| ) |
Handle stateful response.
References ClientWriteRequest::dlen, ClientRequestHdr::dlen, XrdCl::Log::Dump(), XrdCl::FileMsg, XrdCl::AnyObject::Get(), XrdCl::Buffer::GetBuffer(), XrdCl::Message::GetDescription(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), ClientRequest::header, kXR_read, kXR_readv, kXR_stat, kXR_write, pFileUrl, pInTheFly, pMutex, pRBytes, pRCount, pStatInfo, pVBytes, pVCount, pVSegs, pWBytes, pWCount, ClientRequest::read, ClientRequestHdr::requestid, ClientReadRequest::rlen, RunRecovery(), and ClientRequest::write.
| XRootDStatus XrdCl::FileStateHandler::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
| 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 |
References XrdCl::Buffer::Append(), CloseInProgress, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientOpenRequest::dlen, XrdCl::errInProgress, XrdCl::errInvalidArgs, XrdCl::errInvalidOp, Error, XrdCl::Log::Error(), XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetParams(), XrdCl::URL::GetPath(), XrdCl::URL::GetPathWithParams(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), XrdCl::URL::IsValid(), kXR_async, kXR_open, kXR_retstat, ClientOpenRequest::mode, Opened, OpenInProgress, ClientOpenRequest::options, pDoRecoverRead, pDoRecoverWrite, pFileState, pFileUrl, pMutex, pOpenFlags, pOpenMode, XrdCl::MessageUtils::ProcessSendParams(), pStatus, Recovering, ClientOpenRequest::requestid, XrdCl::MessageUtils::SendMessage(), XrdCl::XRootDTransport::SetDescription(), XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Open().
| XRootDStatus XrdCl::FileStateHandler::Read | ( | uint64_t | offset, |
| uint32_t | size, | ||
| void * | buffer, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
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 |
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, ClientReadRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_read, ClientReadRequest::offset, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientReadRequest::requestid, ClientReadRequest::rlen, SendOrQueue(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Read().
|
private |
Recover a message
| rd | request data associated with the message |
| callbackOnFailure | should the current handler be called back if the recovery procedure fails |
References XrdCl::Log::Dump(), FailMessage(), XrdCl::FileMsg, XrdCl::Message::GetDescription(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), pFileState, pFileUrl, pToBeRecovered, Recovering, XrdCl::FileStateHandler::RequestData::request, and RunRecovery().
Referenced by OnStateError(), OnStateRedirection(), and SendOrQueue().
Re-open the current file at a given server.
References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), ClientOpenRequest::dlen, XrdCl::Log::Dump(), XrdCl::FileMsg, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetPathWithParams(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), kXR_delete, kXR_new, kXR_open, ClientOpenRequest::mode, ClientOpenRequest::options, pFileUrl, pOpenFlags, pOpenMode, XrdCl::MessageUtils::ProcessSendParams(), ClientOpenRequest::requestid, XrdCl::MessageUtils::SendMessage(), XrdCl::XRootDTransport::SetDescription(), and XrdCl::MessageSendParams::timeout.
Referenced by RunRecovery().
|
private |
Re-send queued messages.
References FailMessage(), XrdCl::Status::IsOK(), pDataServer, pSessionId, pToBeRecovered, ReWriteFileHandle(), and XrdCl::MessageUtils::SendMessage().
Referenced by OnOpen().
|
inlineprivate |
Reset monitoring vars.
References pCloseReason, pOpenTime, pRBytes, pRCount, pVBytes, pVCount, pVSegs, pWBytes, and pWCount.
Referenced by FileStateHandler(), OnClose(), and ~FileStateHandler().
|
private |
Re-write file handle.
References ClientReadVRequest::dlen, XrdCl::Log::Dump(), ClientReadRequest::fhandle, ClientSyncRequest::fhandle, ClientTruncateRequest::fhandle, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::Buffer::GetBuffer(), XrdCl::Message::GetDescription(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_read, kXR_readv, kXR_sync, kXR_truncate, kXR_write, pFileHandle, pFileUrl, ClientRequestHdr::requestid, and XrdCl::XRootDTransport::SetDescription().
Referenced by ReSendQueuedMessages().
|
private |
Run the recovery procedure if appropriate.
References XrdCl::Log::Debug(), Error, FailQueuedMessages(), XrdCl::FileMsg, XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), XrdCl::Status::IsOK(), IsReadOnly(), pDataServer, pFileState, pFileUrl, pInTheFly, pLoadBalancer, pStateRedirect, Recovering, and ReOpenFileAtServer().
Referenced by OnStateResponse(), and RecoverMessage().
|
private |
Send a message to a host or put it in the recovery queue.
References XrdCl::Status::code, XrdCl::errInvalidOp, XrdCl::errInvalidSession, XrdCl::Status::IsOK(), IsRecoverable(), Opened, pDataServer, pFileState, pInTheFly, pSessionId, Recovering, RecoverMessage(), XrdCl::MessageUtils::SendMessage(), XrdCl::Message::SetSessionId(), and XrdCl::stError.
Referenced by Read(), Stat(), Sync(), Truncate(), VectorRead(), and Write().
| XRootDStatus XrdCl::FileStateHandler::Stat | ( | bool | force, |
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
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 |
References XrdCl::Buffer::Append(), XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientStatRequest::dlen, XrdCl::errInvalidOp, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetPath(), XrdCl::URL::GetURL(), XrdCl::ResponseHandler::HandleResponseWithHosts(), kXR_stat, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), pStatInfo, Recovering, ClientStatRequest::requestid, SendOrQueue(), XrdCl::AnyObject::Set(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Stat().
| XRootDStatus XrdCl::FileStateHandler::Sync | ( | ResponseHandler * | handler, |
| uint16_t | timeout = 0 |
||
| ) |
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 |
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, ClientSyncRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_sync, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientSyncRequest::requestid, SendOrQueue(), 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.
References pMutex, and TimeOutRequests().
| void XrdCl::FileStateHandler::TimeOutRequests | ( | time_t | now | ) |
Declare timeout on requests being recovered.
References XrdCl::Log::Dump(), XrdCl::errOperationExpired, XrdCl::FileMsg, XrdCl::PostMaster::GetJobManager(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::URL::GetURL(), pFileUrl, pToBeRecovered, XrdCl::JobManager::QueueJob(), and XrdCl::stError.
Referenced by Tick().
| XRootDStatus XrdCl::FileStateHandler::Truncate | ( | uint64_t | size, |
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
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 |
References XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), XrdCl::errInvalidOp, ClientTruncateRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_truncate, ClientTruncateRequest::offset, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientTruncateRequest::requestid, SendOrQueue(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Truncate().
|
inline |
Unlock the internal lock.
References pMutex, and XrdSysMutex::UnLock().
| XRootDStatus XrdCl::FileStateHandler::VectorRead | ( | const ChunkList & | chunks, |
| void * | buffer, | ||
| ResponseHandler * | handler, | ||
| uint16_t | timeout = 0 |
||
| ) |
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 |
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientReadVRequest::dlen, XrdCl::errInvalidOp, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::Buffer::GetBuffer(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_readv, readahead_list::offset, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientReadVRequest::requestid, readahead_list::rlen, SendOrQueue(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::VectorRead().
| XRootDStatus XrdCl::FileStateHandler::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
| 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 |
References XrdCl::MessageSendParams::chunkList, XrdCl::MessageUtils::CreateRequest(), XrdCl::Log::Debug(), ClientWriteRequest::dlen, XrdCl::errInvalidOp, ClientWriteRequest::fhandle, XrdCl::FileMsg, XrdCl::MessageSendParams::followRedirects, XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetURL(), kXR_write, ClientWriteRequest::offset, Opened, pDataServer, pFileHandle, pFileState, pFileUrl, pMutex, XrdCl::MessageUtils::ProcessSendParams(), Recovering, ClientWriteRequest::requestid, SendOrQueue(), XrdCl::XRootDTransport::SetDescription(), XrdCl::MessageSendParams::stateful, XrdCl::stError, and XrdCl::MessageSendParams::timeout.
Referenced by XrdCl::File::Write().
|
private |
Referenced by OnStateError(), and ResetMonitoringVars().
|
private |
Referenced by Close(), GetDataServer(), GetLastURL(), OnClose(), OnOpen(), Read(), ReSendQueuedMessages(), RunRecovery(), SendOrQueue(), Stat(), Sync(), Truncate(), VectorRead(), Write(), and ~FileStateHandler().
|
private |
Referenced by AfterForkChild(), EnableReadRecovery(), IsRecoverable(), and Open().
|
private |
Referenced by AfterForkChild(), EnableWriteRecovery(), IsRecoverable(), and Open().
|
private |
Referenced by Close(), FileStateHandler(), OnOpen(), Read(), ReWriteFileHandle(), Stat(), Sync(), Truncate(), VectorRead(), Write(), and ~FileStateHandler().
|
private |
Referenced by AfterForkChild(), Close(), IsOpen(), OnClose(), OnOpen(), Open(), Read(), RecoverMessage(), RunRecovery(), SendOrQueue(), Stat(), Sync(), Truncate(), VectorRead(), Write(), and ~FileStateHandler().
|
private |
Referenced by AfterForkChild(), Close(), FailMessage(), MonitorClose(), OnClose(), OnOpen(), OnStateError(), OnStateRedirection(), OnStateResponse(), Open(), Read(), RecoverMessage(), ReOpenFileAtServer(), ReWriteFileHandle(), RunRecovery(), Stat(), Sync(), TimeOutRequests(), Truncate(), VectorRead(), Write(), and ~FileStateHandler().
|
private |
Referenced by AfterForkChild(), Close(), OnClose(), OnStateError(), OnStateRedirection(), OnStateResponse(), RunRecovery(), and SendOrQueue().
|
private |
Referenced by OnOpen(), RunRecovery(), and ~FileStateHandler().
|
mutableprivate |
Referenced by Close(), EnableReadRecovery(), EnableWriteRecovery(), GetDataServer(), GetLastURL(), IsOpen(), Lock(), OnClose(), OnOpen(), OnStateError(), OnStateRedirection(), OnStateResponse(), Open(), Read(), Stat(), Sync(), Tick(), Truncate(), UnLock(), VectorRead(), and Write().
|
private |
Referenced by IsReadOnly(), OnOpen(), Open(), and ReOpenFileAtServer().
|
private |
Referenced by Open(), and ReOpenFileAtServer().
|
private |
Referenced by MonitorClose(), OnOpen(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by Close(), OnOpen(), ReSendQueuedMessages(), and SendOrQueue().
|
private |
Referenced by OnStateRedirection(), and RunRecovery().
|
private |
Referenced by OnOpen(), OnStateResponse(), Stat(), and ~FileStateHandler().
|
private |
|
private |
Referenced by AfterForkChild(), FailQueuedMessages(), OnClose(), RecoverMessage(), ReSendQueuedMessages(), and TimeOutRequests().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
|
private |
Referenced by MonitorClose(), OnStateResponse(), and ResetMonitoringVars().
1.8.3.1