XRootD
Loading...
Searching...
No Matches
XrdCl::VectorReadAction Struct Reference

VectorRead action. More...

#include <XrdClAction.hh>

+ Inheritance diagram for XrdCl::VectorReadAction:
+ Collaboration diagram for XrdCl::VectorReadAction:

Public Member Functions

 VectorReadAction (void *file, const ChunkList &chunks, uint16_t timeout)
 
std::string ArgStr ()
 Convert operation arguments into a string.
 
std::string Name ()
 Action name.
 
void Serialize (AnyObject *response)
 Serialize server response.
 
- Public Member Functions inherited from XrdCl::Action
 Action (void *file, uint16_t timeout)
 
virtual ~Action ()
 Destructor.
 
void RecordResult (XRootDStatus *st, AnyObject *rsp)
 Record the server response / error / timeout.
 
std::string ToString ()
 Convert the action / response data into csv row.
 

Public Attributes

ChunkList req
 
- Public Attributes inherited from XrdCl::Action
uint64_t id
 
std::string serialrsp
 
std::chrono::system_clock::time_point start
 
XRootDStatus status
 
std::chrono::system_clock::time_point stop
 
uint16_t timeout
 

Additional Inherited Members

- Static Public Member Functions inherited from XrdCl::Action
static double time (std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > tp)
 Convert timpoint to unix timestamp with ns.
 
static double timeNow ()
 Get curretn unix time in ns precision as a double.
 

Detailed Description

VectorRead action.

Definition at line 358 of file XrdClAction.hh.

Constructor & Destructor Documentation

◆ VectorReadAction()

XrdCl::VectorReadAction::VectorReadAction ( void * file,
const ChunkList & chunks,
uint16_t timeout )
inline

Definition at line 360 of file XrdClAction.hh.

361 : Action(file, timeout)
362 , req(chunks)
363 {
364 }
int Action
uint16_t timeout

References XrdCl::Action::Action(), req, and XrdCl::Action::timeout.

+ Here is the call graph for this function:

Member Function Documentation

◆ ArgStr()

std::string XrdCl::VectorReadAction::ArgStr ( )
inlinevirtual

Convert operation arguments into a string.

Implements XrdCl::Action.

Definition at line 368 of file XrdClAction.hh.

369 {
370 if (req.empty())
371 return {};
372 std::stringstream ss;
373 ss << req[0].offset << ";" << req[0].length;
374 for (size_t i = 1; i < req.size(); ++i)
375 ss << ";" << req[i].offset << ";" << req[i].length;
376 return ss.str();
377 }

References req.

◆ Name()

std::string XrdCl::VectorReadAction::Name ( )
inlinevirtual

Action name.

Implements XrdCl::Action.

Definition at line 366 of file XrdClAction.hh.

366{ return "VectorRead"; }

◆ Serialize()

void XrdCl::VectorReadAction::Serialize ( AnyObject * response)
inlinevirtual

Serialize server response.

Reimplemented from XrdCl::Action.

Definition at line 379 of file XrdClAction.hh.

380 {
381 if (!response)
382 return;
383 VectorReadInfo* ptr = nullptr;
384 response->Get(ptr);
385 if (!ptr)
386 return;
387 std::stringstream ss;
388 ss << ptr->GetSize();
389 auto& chunks = ptr->GetChunks();
390 for (auto& ch : chunks)
391 ss << ';' << ch.offset << ';' << ch.length;
392 serialrsp = ss.str();
393 }
std::string serialrsp

References XrdCl::AnyObject::Get(), XrdCl::VectorReadInfo::GetChunks(), XrdCl::VectorReadInfo::GetSize(), and XrdCl::Action::serialrsp.

+ Here is the call graph for this function:

Member Data Documentation

◆ req

ChunkList XrdCl::VectorReadAction::req

Definition at line 395 of file XrdClAction.hh.

Referenced by VectorReadAction(), and ArgStr().


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