xrootd
XrdClXRootDResponses.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_XROOTD_RESPONSES_HH__
20 #define __XRD_CL_XROOTD_RESPONSES_HH__
21 
22 #include "XrdCl/XrdClBuffer.hh"
23 #include "XrdCl/XrdClStatus.hh"
24 #include "XrdCl/XrdClURL.hh"
25 #include "XrdCl/XrdClAnyObject.hh"
26 #include "XProtocol/XProtocol.hh"
27 #include <string>
28 #include <vector>
29 #include <list>
30 #include <ctime>
31 #include <tuple>
32 #include <memory>
33 
34 namespace XrdCl
35 {
36  //----------------------------------------------------------------------------
38  //----------------------------------------------------------------------------
40  {
41  public:
42  //------------------------------------------------------------------------
44  //------------------------------------------------------------------------
46  {
51  };
52 
53  //------------------------------------------------------------------------
55  //------------------------------------------------------------------------
57  {
58  Read,
59  ReadWrite
60  };
61 
62  //------------------------------------------------------------------------
64  //------------------------------------------------------------------------
65  class Location
66  {
67  public:
68 
69  //--------------------------------------------------------------------
71  //--------------------------------------------------------------------
72  Location( const std::string &address,
73  LocationType type,
75  pAddress( address ),
76  pType( type ),
77  pAccess( access ) {}
78 
79  //--------------------------------------------------------------------
81  //--------------------------------------------------------------------
82  const std::string &GetAddress() const
83  {
84  return pAddress;
85  }
86 
87  //--------------------------------------------------------------------
89  //--------------------------------------------------------------------
91  {
92  return pType;
93  }
94 
95  //--------------------------------------------------------------------
97  //--------------------------------------------------------------------
99  {
100  return pAccess;
101  }
102 
103  //--------------------------------------------------------------------
105  //--------------------------------------------------------------------
106  bool IsServer() const
107  {
108  return pType == ServerOnline || pType == ServerPending;
109  }
110 
111  //--------------------------------------------------------------------
113  //--------------------------------------------------------------------
114  bool IsManager() const
115  {
116  return pType == ManagerOnline || pType == ManagerPending;
117  }
118 
119  private:
120  std::string pAddress;
123  };
124 
125  //------------------------------------------------------------------------
127  //------------------------------------------------------------------------
128  typedef std::vector<Location> LocationList;
129 
130  //------------------------------------------------------------------------
132  //------------------------------------------------------------------------
133  typedef LocationList::iterator Iterator;
134 
135  //------------------------------------------------------------------------
137  //------------------------------------------------------------------------
138  typedef LocationList::const_iterator ConstIterator;
139 
140  //------------------------------------------------------------------------
142  //------------------------------------------------------------------------
144 
145  //------------------------------------------------------------------------
147  //------------------------------------------------------------------------
148  uint32_t GetSize() const
149  {
150  return pLocations.size();
151  }
152 
153  //------------------------------------------------------------------------
155  //------------------------------------------------------------------------
156  Location &At( uint32_t index )
157  {
158  return pLocations[index];
159  }
160 
161  //------------------------------------------------------------------------
163  //------------------------------------------------------------------------
165  {
166  return pLocations.begin();
167  }
168 
169  //------------------------------------------------------------------------
171  //------------------------------------------------------------------------
173  {
174  return pLocations.begin();
175  }
176 
177  //------------------------------------------------------------------------
179  //------------------------------------------------------------------------
181  {
182  return pLocations.end();
183  }
184 
185  //------------------------------------------------------------------------
187  //------------------------------------------------------------------------
189  {
190  return pLocations.end();
191  }
192 
193  //------------------------------------------------------------------------
195  //------------------------------------------------------------------------
196  void Add( const Location &location )
197  {
198  pLocations.push_back( location );
199  }
200 
201  //------------------------------------------------------------------------
203  //------------------------------------------------------------------------
204  bool ParseServerResponse( const char *data );
205 
206  private:
207  bool ProcessLocation( std::string &location );
209  };
210 
211  //----------------------------------------------------------------------------
213  //----------------------------------------------------------------------------
214  class XRootDStatus: public Status
215  {
216  public:
217  //------------------------------------------------------------------------
219  //------------------------------------------------------------------------
220  XRootDStatus( uint16_t st = 0,
221  uint16_t code = 0,
222  uint32_t errN = 0,
223  const std::string &message = "" ):
224  Status( st, code, errN ),
225  pMessage( message ) {}
226 
227  //------------------------------------------------------------------------
229  //------------------------------------------------------------------------
230  XRootDStatus( const Status &st,
231  const std::string &message = "" ):
232  Status( st ),
233  pMessage( message ) {}
234 
235  //------------------------------------------------------------------------
237  //------------------------------------------------------------------------
238  const std::string &GetErrorMessage() const
239  {
240  return pMessage;
241  }
242 
243  //------------------------------------------------------------------------
245  //------------------------------------------------------------------------
246  void SetErrorMessage( const std::string &message )
247  {
248  pMessage = message;
249  }
250 
251  //------------------------------------------------------------------------
253  //------------------------------------------------------------------------
254  std::string ToStr() const
255  {
256  if( code == errErrorResponse )
257  {
258  std::ostringstream o;
259  o << "[ERROR] Server responded with an error: [" << errNo << "] ";
260  o << pMessage << std::endl;
261  return o.str();
262  }
263  std::string str = ToString();
264  if( !pMessage.empty() )
265  str += ": " + pMessage;
266  return str;
267  }
268 
269  private:
270  std::string pMessage;
271  };
272 
273  //----------------------------------------------------------------------------
275  //----------------------------------------------------------------------------
276  enum
277  {
279  xattr_value = 1
280  };
281 
282  //----------------------------------------------------------------------------
284  //----------------------------------------------------------------------------
285  typedef std::tuple<std::string, std::string> xattr_t;
286 
287  //----------------------------------------------------------------------------
289  //----------------------------------------------------------------------------
290  struct XAttrStatus
291  {
292  friend class FileStateHandler;
293  friend class FileSystem;
294 
295  XAttrStatus( const std::string &name, const XRootDStatus &status ) :
296  name( name ), status( status )
297  {
298 
299  }
300 
301  std::string name;
303  };
304 
305  //----------------------------------------------------------------------------
307  //----------------------------------------------------------------------------
308  struct XAttr : public XAttrStatus
309  {
310  friend class FileStateHandler;
311  friend class FileSystem;
312 
313  XAttr( const std::string &name, const XRootDStatus &status ) :
315  {
316 
317  }
318 
319  XAttr( const std::string &name, const std::string &value = "",
320  const XRootDStatus &status = XRootDStatus() ) :
322  {
323 
324  }
325 
326  std::string value;
327  };
328 
329  //----------------------------------------------------------------------------
331  //----------------------------------------------------------------------------
333 
334  //----------------------------------------------------------------------------
336  //----------------------------------------------------------------------------
338  {
339  public:
340  //------------------------------------------------------------------------
342  //------------------------------------------------------------------------
344  {
350  };
351 
352  //------------------------------------------------------------------------
354  //------------------------------------------------------------------------
355  ProtocolInfo( uint32_t version, uint32_t hostInfo ):
356  pVersion( version ), pHostInfo( hostInfo ) {}
357 
358  //------------------------------------------------------------------------
360  //------------------------------------------------------------------------
361  uint32_t GetVersion() const
362  {
363  return pVersion;
364  }
365 
366  //------------------------------------------------------------------------
368  //------------------------------------------------------------------------
369  uint32_t GetHostInfo() const
370  {
371  return pHostInfo;
372  }
373 
374  //------------------------------------------------------------------------
376  //------------------------------------------------------------------------
377  bool TestHostInfo( uint32_t flags )
378  {
379  return pHostInfo & flags;
380  }
381 
382  private:
383  uint32_t pVersion;
384  uint32_t pHostInfo;
385  };
386 
387  //----------------------------------------------------------------------------
389  //----------------------------------------------------------------------------
390  struct StatInfoImpl;
391 
392  //----------------------------------------------------------------------------
394  //----------------------------------------------------------------------------
395  class StatInfo
396  {
397  public:
398  //------------------------------------------------------------------------
400  //------------------------------------------------------------------------
401  enum Flags
402  {
412  };
413 
414  //------------------------------------------------------------------------
416  //------------------------------------------------------------------------
418 
419  //------------------------------------------------------------------------
421  //------------------------------------------------------------------------
422  StatInfo( const std::string &id, uint64_t size, uint32_t flags,
423  uint64_t modTime );
424 
425  //------------------------------------------------------------------------
427  //------------------------------------------------------------------------
428  StatInfo( const StatInfo &info );
429 
430  //------------------------------------------------------------------------
432  //------------------------------------------------------------------------
434 
435  //------------------------------------------------------------------------
437  //------------------------------------------------------------------------
438  const std::string& GetId() const;
439 
440  //------------------------------------------------------------------------
442  //------------------------------------------------------------------------
443  uint64_t GetSize() const;
444 
445  //------------------------------------------------------------------------
447  //------------------------------------------------------------------------
448  uint32_t GetFlags() const;
449 
450  //------------------------------------------------------------------------
452  //------------------------------------------------------------------------
453  void SetFlags( uint32_t flags );
454 
455  //------------------------------------------------------------------------
457  //------------------------------------------------------------------------
458  bool TestFlags( uint32_t flags ) const;
459 
460  //------------------------------------------------------------------------
462  //------------------------------------------------------------------------
463  uint64_t GetModTime() const;
464 
465  //------------------------------------------------------------------------
467  //------------------------------------------------------------------------
468  std::string GetModTimeAsString() const;
469 
470  //------------------------------------------------------------------------
472  //------------------------------------------------------------------------
473  uint64_t GetChangeTime() const;
474 
475  //------------------------------------------------------------------------
477  //------------------------------------------------------------------------
478  std::string GetChangeTimeAsString() const;
479 
480  //------------------------------------------------------------------------
482  //------------------------------------------------------------------------
483  uint64_t GetAccessTime() const;
484 
485  //------------------------------------------------------------------------
487  //------------------------------------------------------------------------
488  std::string GetAccessTimeAsString() const;
489 
490  //------------------------------------------------------------------------
492  //------------------------------------------------------------------------
493  const std::string& GetModeAsString() const;
494 
495  //------------------------------------------------------------------------
497  //------------------------------------------------------------------------
498  const std::string GetModeAsOctString() const;
499 
500  //------------------------------------------------------------------------
502  //------------------------------------------------------------------------
503  const std::string& GetOwner() const;
504 
505  //------------------------------------------------------------------------
507  //------------------------------------------------------------------------
508  const std::string& GetGroup() const;
509 
510  //------------------------------------------------------------------------
512  //------------------------------------------------------------------------
513  bool ParseServerResponse( const char *data );
514 
515  //------------------------------------------------------------------------
517  //------------------------------------------------------------------------
518  bool ExtendedFormat() const;
519 
520  private:
521 
522  static inline std::string TimeToString( uint64_t time )
523  {
524  char ts[256];
525  time_t modTime = time;
526  tm *t = gmtime( &modTime );
527  strftime( ts, 255, "%F %T", t );
528  return ts;
529  }
530 
531  static inline void OctToString( uint8_t oct, std::string &str )
532  {
533  static const uint8_t r_mask = 0x4;
534  static const uint8_t w_mask = 0x2;
535  static const uint8_t x_mask = 0x1;
536 
537  if( r_mask & oct ) str.push_back( 'r' );
538  else str.push_back( '-' );
539 
540  if( w_mask & oct ) str.push_back( 'w' );
541  else str.push_back( '-' );
542 
543  if( x_mask & oct ) str.push_back( 'x' );
544  else str.push_back( '-' );
545  }
546 
547  std::unique_ptr<StatInfoImpl> pImpl;
548  };
549 
550  //----------------------------------------------------------------------------
552  //----------------------------------------------------------------------------
554  {
555  public:
556  //------------------------------------------------------------------------
558  //------------------------------------------------------------------------
560 
561  //------------------------------------------------------------------------
563  //------------------------------------------------------------------------
564  uint64_t GetNodesRW() const
565  {
566  return pNodesRW;
567  }
568 
569  //------------------------------------------------------------------------
571  //------------------------------------------------------------------------
572  uint64_t GetFreeRW() const
573  {
574  return pFreeRW;
575  }
576 
577  //------------------------------------------------------------------------
579  //------------------------------------------------------------------------
580  uint8_t GetUtilizationRW() const
581  {
582  return pUtilizationRW;
583  }
584 
585  //------------------------------------------------------------------------
587  //------------------------------------------------------------------------
588  uint64_t GetNodesStaging() const
589  {
590  return pNodesStaging;
591  }
592 
593  //------------------------------------------------------------------------
595  //------------------------------------------------------------------------
596  uint64_t GetFreeStaging() const
597  {
598  return pFreeStaging;
599  }
600 
601  //------------------------------------------------------------------------
603  //------------------------------------------------------------------------
604  uint8_t GetUtilizationStaging() const
605  {
606  return pUtilizationStaging;
607  }
608 
609  //------------------------------------------------------------------------
611  //------------------------------------------------------------------------
612  bool ParseServerResponse( const char *data );
613 
614  private:
615 
616  //------------------------------------------------------------------------
617  // kXR_vfs stat
618  //------------------------------------------------------------------------
619  uint64_t pNodesRW;
620  uint64_t pFreeRW;
621  uint32_t pUtilizationRW;
622  uint64_t pNodesStaging;
623  uint64_t pFreeStaging;
625  };
626 
627  //----------------------------------------------------------------------------
629  //----------------------------------------------------------------------------
631  {
632  public:
633 
634  //------------------------------------------------------------------------
636  //------------------------------------------------------------------------
637  class ListEntry
638  {
639  public:
640  //--------------------------------------------------------------------
642  //--------------------------------------------------------------------
643  ListEntry( const std::string &hostAddress,
644  const std::string &name,
645  StatInfo *statInfo = 0):
646  pHostAddress( hostAddress ),
647  pName( name ),
648  pStatInfo( statInfo )
649  {}
650 
651  //--------------------------------------------------------------------
653  //--------------------------------------------------------------------
655  {
656  delete pStatInfo;
657  }
658 
659  //--------------------------------------------------------------------
661  //--------------------------------------------------------------------
662  const std::string &GetHostAddress() const
663  {
664  return pHostAddress;
665  }
666 
667  //--------------------------------------------------------------------
669  //--------------------------------------------------------------------
670  const std::string &GetName() const
671  {
672  return pName;
673  }
674 
675  //--------------------------------------------------------------------
677  //--------------------------------------------------------------------
679  {
680  return pStatInfo;
681  }
682 
683  //--------------------------------------------------------------------
685  //--------------------------------------------------------------------
686  const StatInfo *GetStatInfo() const
687  {
688  return pStatInfo;
689  }
690 
691  //--------------------------------------------------------------------
693  //--------------------------------------------------------------------
694  void SetStatInfo( StatInfo *info )
695  {
696  pStatInfo = info;
697  }
698 
699  private:
700  std::string pHostAddress;
701  std::string pName;
703  };
704 
705  //------------------------------------------------------------------------
707  //------------------------------------------------------------------------
709 
710  //------------------------------------------------------------------------
712  //------------------------------------------------------------------------
714 
715  //------------------------------------------------------------------------
717  //------------------------------------------------------------------------
718  typedef std::vector<ListEntry*> DirList;
719 
720  //------------------------------------------------------------------------
722  //------------------------------------------------------------------------
723  typedef DirList::iterator Iterator;
724 
725  //------------------------------------------------------------------------
727  //------------------------------------------------------------------------
728  typedef DirList::const_iterator ConstIterator;
729 
730  //------------------------------------------------------------------------
732  //------------------------------------------------------------------------
733  void Add( ListEntry *entry )
734  {
735  pDirList.push_back( entry );
736  }
737 
738  //------------------------------------------------------------------------
740  //------------------------------------------------------------------------
741  ListEntry *At( uint32_t index )
742  {
743  return pDirList[index];
744  }
745 
746  //------------------------------------------------------------------------
748  //------------------------------------------------------------------------
750  {
751  return pDirList.begin();
752  }
753 
754  //------------------------------------------------------------------------
756  //------------------------------------------------------------------------
758  {
759  return pDirList.begin();
760  }
761 
762  //------------------------------------------------------------------------
764  //------------------------------------------------------------------------
766  {
767  return pDirList.end();
768  }
769 
770  //------------------------------------------------------------------------
772  //------------------------------------------------------------------------
774  {
775  return pDirList.end();
776  }
777 
778  //------------------------------------------------------------------------
780  //------------------------------------------------------------------------
781  uint32_t GetSize() const
782  {
783  return pDirList.size();
784  }
785 
786  //------------------------------------------------------------------------
788  //------------------------------------------------------------------------
789  const std::string &GetParentName() const
790  {
791  return pParent;
792  }
793 
794  //------------------------------------------------------------------------
796  //------------------------------------------------------------------------
797  void SetParentName( const std::string &parent )
798  {
799  size_t pos = parent.find( '?' );
800  pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
801  if( !pParent.empty() && pParent[pParent.length()-1] != '/' )
802  pParent += "/";
803  }
804 
805  //------------------------------------------------------------------------
807  //------------------------------------------------------------------------
808  bool ParseServerResponse( const std::string &hostId,
809  const char *data );
810 
811  //------------------------------------------------------------------------
813  //------------------------------------------------------------------------
814  bool ParseServerResponse( const std::string &hostId,
815  const char *data,
816  bool isDStat );
817 
818  //------------------------------------------------------------------------
820  //------------------------------------------------------------------------
821  static bool HasStatInfo( const char *data );
822 
823  private:
825  std::string pParent;
826 
827  static const std::string dStatPrefix;
828  };
829 
830  //----------------------------------------------------------------------------
832  //----------------------------------------------------------------------------
833  class OpenInfo
834  {
835  public:
836  //------------------------------------------------------------------------
838  //------------------------------------------------------------------------
839  OpenInfo( const uint8_t *fileHandle,
840  uint64_t sessionId,
841  StatInfo *statInfo = 0 ):
842  pSessionId(sessionId), pStatInfo( statInfo )
843  {
844  memcpy( pFileHandle, fileHandle, 4 );
845  }
846 
847  //------------------------------------------------------------------------
849  //------------------------------------------------------------------------
851  {
852  delete pStatInfo;
853  }
854 
855  //------------------------------------------------------------------------
857  //------------------------------------------------------------------------
858  void GetFileHandle( uint8_t *fileHandle ) const
859  {
860  memcpy( fileHandle, pFileHandle, 4 );
861  }
862 
863  //------------------------------------------------------------------------
865  //------------------------------------------------------------------------
866  const StatInfo *GetStatInfo() const
867  {
868  return pStatInfo;
869  }
870 
871  //------------------------------------------------------------------------
872  // Get session ID
873  //------------------------------------------------------------------------
874  uint64_t GetSessionId() const
875  {
876  return pSessionId;
877  }
878 
879  private:
880  uint8_t pFileHandle[4];
881  uint64_t pSessionId;
883  };
884 
885  //----------------------------------------------------------------------------
887  //----------------------------------------------------------------------------
888  struct ChunkInfo
889  {
890  //--------------------------------------------------------------------------
892  //--------------------------------------------------------------------------
893  ChunkInfo( uint64_t off = 0, uint32_t len = 0, void *buff = 0 ):
894  offset( off ), length( len ), buffer(buff) {}
895 
896  uint64_t offset;
897  uint32_t length;
898  void *buffer;
899  };
900 
901  //----------------------------------------------------------------------------
903  //----------------------------------------------------------------------------
904  typedef std::vector<ChunkInfo> ChunkList;
905 
906  //----------------------------------------------------------------------------
908  //----------------------------------------------------------------------------
910  {
911  public:
912  //------------------------------------------------------------------------
914  //------------------------------------------------------------------------
916 
917  //------------------------------------------------------------------------
919  //------------------------------------------------------------------------
920  uint32_t GetSize() const
921  {
922  return pSize;
923  }
924 
925  //------------------------------------------------------------------------
927  //------------------------------------------------------------------------
928  void SetSize( uint32_t size )
929  {
930  pSize = size;
931  }
932 
933  //------------------------------------------------------------------------
935  //------------------------------------------------------------------------
937  {
938  return pChunks;
939  }
940 
941  //------------------------------------------------------------------------
943  //------------------------------------------------------------------------
944  const ChunkList &GetChunks() const
945  {
946  return pChunks;
947  }
948 
949  private:
951  uint32_t pSize;
952  };
953 
954  //----------------------------------------------------------------------------
955  // List of URLs
956  //----------------------------------------------------------------------------
957  struct HostInfo
958  {
960  flags(0), protocol(0), loadBalancer(false) {}
961  HostInfo( const URL &u, bool lb = false ):
962  flags(0), protocol(0), loadBalancer(lb), url(u) {}
963  uint32_t flags;
964  uint32_t protocol;
967  };
968 
969  typedef std::vector<HostInfo> HostList;
970 
971  //----------------------------------------------------------------------------
973  //----------------------------------------------------------------------------
975  {
976  public:
977  virtual ~ResponseHandler() {}
978 
979  //------------------------------------------------------------------------
987  //------------------------------------------------------------------------
988  virtual void HandleResponseWithHosts( XRootDStatus *status,
989  AnyObject *response,
990  HostList *hostList )
991  {
992  delete hostList;
993  HandleResponse( status, response );
994  }
995 
996  //------------------------------------------------------------------------
1003  //------------------------------------------------------------------------
1004  virtual void HandleResponse( XRootDStatus *status,
1005  AnyObject *response )
1006  {
1007  (void)status; (void)response;
1008  }
1009  };
1010 }
1011 
1012 #endif // __XRD_CL_XROOTD_RESPONSES_HH__
XrdCl::Status::code
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:138
XrdCl::ChunkInfo
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:889
XrdCl::LocationInfo::Read
@ Read
read access is allowed
Definition: XrdClXRootDResponses.hh:58
XrdCl::ProtocolInfo::IsManager
@ IsManager
Manager.
Definition: XrdClXRootDResponses.hh:345
XrdCl::StatInfo::TestFlags
bool TestFlags(uint32_t flags) const
Test flags.
XrdCl::StatInfoVFS::pFreeStaging
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:623
XrdCl::XAttrStatus
Extended attribute operation status.
Definition: XrdClXRootDResponses.hh:291
XrdCl::StatInfo::GetOwner
const std::string & GetOwner() const
Get owner.
XrdCl::ProtocolInfo::GetVersion
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:361
XrdCl::ResponseHandler
Handle an async response.
Definition: XrdClXRootDResponses.hh:975
XrdCl::LocationInfo::GetSize
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:148
XrdCl::StatInfoVFS::StatInfoVFS
StatInfoVFS()
Constructor.
XrdCl::StatInfo::GetModTime
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
XrdCl::DirectoryList::Add
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:733
XrdCl::StatInfo::ParseServerResponse
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
XrdCl::LocationInfo::pLocations
LocationList pLocations
Definition: XrdClXRootDResponses.hh:208
XrdCl::BinaryDataInfo
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:332
XrdCl::StatInfo::StatInfo
StatInfo(const StatInfo &info)
Copy constructor.
kXR_isManager
#define kXR_isManager
Definition: XProtocol.hh:1055
XrdCl::XAttrStatus::status
XRootDStatus status
Definition: XrdClXRootDResponses.hh:302
XrdCl::StatInfo::OctToString
static void OctToString(uint8_t oct, std::string &str)
Definition: XrdClXRootDResponses.hh:531
XrdCl::LocationInfo::Iterator
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:133
XrdCl::ResponseHandler::HandleResponseWithHosts
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:988
access
#define access(a, b)
Definition: XrdPosix.hh:39
XrdCl::HostInfo::protocol
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:964
XrdCl::DirectoryList::ParseServerResponse
bool ParseServerResponse(const std::string &hostId, const char *data, bool isDStat)
Parse chunked server response and fill up the object.
XrdCl::LocationInfo::ManagerOnline
@ ManagerOnline
manager node where the file is online
Definition: XrdClXRootDResponses.hh:47
XrdCl::StatInfo::XBitSet
@ XBitSet
Executable/searchable bit set.
Definition: XrdClXRootDResponses.hh:403
XrdCl::Status::ToString
std::string ToString() const
Create a string representation.
XrdCl::LocationInfo
Path location info.
Definition: XrdClXRootDResponses.hh:40
XrdCl::XAttr
Extended attributes with status.
Definition: XrdClXRootDResponses.hh:309
XrdCl::ResponseHandler::~ResponseHandler
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:977
XrdCl::StatInfo::ExtendedFormat
bool ExtendedFormat() const
Parse server response and fill up the object.
XrdCl::LocationInfo::Location::pAddress
std::string pAddress
Definition: XrdClXRootDResponses.hh:120
XrdCl::LocationInfo::LocationInfo
LocationInfo()
Constructor.
XrdCl::StatInfoVFS
VFS stat info.
Definition: XrdClXRootDResponses.hh:554
XrdCl::LocationInfo::Location::IsServer
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:106
XrdCl::VectorReadInfo::GetChunks
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:936
XrdCl::XRootDStatus::SetErrorMessage
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:246
kXR_writable
@ kXR_writable
Definition: XProtocol.hh:1117
XrdCl::DirectoryList::DirList
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:718
XrdCl::DirectoryList::ListEntry::GetHostAddress
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:662
kXR_isDir
@ kXR_isDir
Definition: XProtocol.hh:1113
XrdCl::OpenInfo::~OpenInfo
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:850
XrdCl::XAttr::XAttr
XAttr(const std::string &name, const XRootDStatus &status)
Definition: XrdClXRootDResponses.hh:313
XrdCl::XAttr::value
std::string value
Definition: XrdClXRootDResponses.hh:326
XrdCl::FileStateHandler
Handle the stateful operations.
Definition: XrdClFileStateHandler.hh:50
kXR_other
@ kXR_other
Definition: XProtocol.hh:1114
XrdCl::LocationInfo::ServerOnline
@ ServerOnline
server node where the file is online
Definition: XrdClXRootDResponses.hh:49
XrdCl::StatInfo::IsDir
@ IsDir
This is a directory.
Definition: XrdClXRootDResponses.hh:404
XrdCl::LocationInfo::Location
Location.
Definition: XrdClXRootDResponses.hh:66
XrdCl::LocationInfo::Begin
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:172
XrdCl::DirectoryList::DirectoryList
DirectoryList()
Constructor.
XrdCl::StatInfoVFS::GetUtilizationRW
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:580
XrdCl::StatInfo::GetModeAsString
const std::string & GetModeAsString() const
Get mode.
XrdCl::OpenInfo::GetStatInfo
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:866
XrdCl::StatInfo::GetSize
uint64_t GetSize() const
Get size (in bytes)
XrdCl::StatInfo::GetGroup
const std::string & GetGroup() const
Get group.
XrdCl::LocationInfo::ParseServerResponse
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
XrdCl::DirectoryList::HasStatInfo
static bool HasStatInfo(const char *data)
Returns true if data contain stat info.
XrdCl::OpenInfo::pSessionId
uint64_t pSessionId
Definition: XrdClXRootDResponses.hh:881
XrdCl::ResponseHandler::HandleResponse
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:1004
XrdCl::ProtocolInfo::pVersion
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:383
XrdCl::ChunkInfo::ChunkInfo
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:893
XrdCl::DirectoryList::pDirList
DirList pDirList
Definition: XrdClXRootDResponses.hh:824
XrdCl::StatInfo::Offline
@ Offline
File is not online (ie. on disk)
Definition: XrdClXRootDResponses.hh:406
XrdCl::OpenInfo::OpenInfo
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:839
XProtocol.hh
XrdCl::DirectoryList::SetParentName
void SetParentName(const std::string &parent)
Set name of the parent directory.
Definition: XrdClXRootDResponses.hh:797
XrdCl::LocationInfo::ManagerPending
@ ManagerPending
manager node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
XrdCl::LocationInfo::Add
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:196
XrdCl::StatInfo::GetAccessTimeAsString
std::string GetAccessTimeAsString() const
Get change time.
XrdCl::DirectoryList::Begin
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:757
XrdCl::StatInfo::StatInfo
StatInfo(const std::string &id, uint64_t size, uint32_t flags, uint64_t modTime)
Constructor.
kXR_isServer
#define kXR_isServer
Definition: XProtocol.hh:1056
XrdCl::DirectoryList::ListEntry::GetStatInfo
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:686
XrdCl::DirectoryList::End
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:773
XrdCl::HostInfo::flags
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:963
XrdCl::LocationInfo::Location::pAccess
AccessType pAccess
Definition: XrdClXRootDResponses.hh:122
XrdCl::LocationInfo::Begin
Iterator Begin()
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:164
XrdCl::StatInfo::GetId
const std::string & GetId() const
Get id.
XrdCl::LocationInfo::Location::IsManager
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:114
XrdCl::StatInfo::Other
@ Other
Neither a file nor a directory.
Definition: XrdClXRootDResponses.hh:405
XrdCl::Status::errNo
uint32_t errNo
Errno, if any.
Definition: XrdClStatus.hh:139
XrdCl::DirectoryList::~DirectoryList
~DirectoryList()
Destructor.
XrdCl::HostInfo::HostInfo
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:961
kXR_attrSuper
#define kXR_attrSuper
Definition: XProtocol.hh:1059
XrdCl::StatInfoVFS::ParseServerResponse
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
XrdCl::XRootDStatus
Request status.
Definition: XrdClXRootDResponses.hh:215
XrdCl::StatInfo::GetChangeTimeAsString
std::string GetChangeTimeAsString() const
Get change time.
XrdCl::DirectoryList::End
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:765
kXR_offline
@ kXR_offline
Definition: XProtocol.hh:1115
XrdCl::ChunkList
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:904
XrdCl::DirectoryList::GetParentName
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:789
XrdCl::StatInfoVFS::pNodesRW
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:619
XrdCl::XAttr::XAttr
XAttr(const std::string &name, const std::string &value="", const XRootDStatus &status=XRootDStatus())
Definition: XrdClXRootDResponses.hh:319
XrdCl::LocationInfo::ReadWrite
@ ReadWrite
write access is allowed
Definition: XrdClXRootDResponses.hh:59
kXR_attrMeta
#define kXR_attrMeta
Definition: XProtocol.hh:1057
XrdCl::errErrorResponse
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:102
XrdCl::ProtocolInfo
Protocol response.
Definition: XrdClXRootDResponses.hh:338
XrdCl::LocationInfo::ProcessLocation
bool ProcessLocation(std::string &location)
XrdCl::LocationInfo::Location::GetAddress
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:82
XrdCl::StatInfoVFS::GetUtilizationStaging
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:604
XrdCl::StatInfo::GetAccessTime
uint64_t GetAccessTime() const
Get change time (in seconds since epoch)
XrdCl::StatInfo::IsWritable
@ IsWritable
Write access is allowed.
Definition: XrdClXRootDResponses.hh:410
XrdCl::VectorReadInfo::GetChunks
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:944
XrdCl::DirectoryList
Directory list.
Definition: XrdClXRootDResponses.hh:631
XrdCl::StatInfo::Flags
Flags
Flags.
Definition: XrdClXRootDResponses.hh:402
XrdCl::DirectoryList::ListEntry::GetName
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:670
kXR_attrProxy
#define kXR_attrProxy
Definition: XProtocol.hh:1058
XrdCl::VectorReadInfo::pChunks
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:950
XrdCl::StatInfo::GetChangeTime
uint64_t GetChangeTime() const
Get change time (in seconds since epoch)
XrdClBuffer.hh
XrdCl::StatInfoVFS::pFreeRW
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:620
XrdCl::XRootDStatus::XRootDStatus
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:230
XrdCl::StatInfo::IsReadable
@ IsReadable
Read access is allowed.
Definition: XrdClXRootDResponses.hh:409
XrdCl::OpenInfo::pFileHandle
uint8_t pFileHandle[4]
Definition: XrdClXRootDResponses.hh:880
XrdCl::ProtocolInfo::ProtocolInfo
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:355
XrdCl::LocationInfo::ServerPending
@ ServerPending
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:50
XrdCl::LocationInfo::ConstIterator
LocationList::const_iterator ConstIterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:138
XrdCl::DirectoryList::ListEntry::GetStatInfo
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:678
XrdCl::StatInfoVFS::pNodesStaging
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:622
XrdCl::StatInfoVFS::pUtilizationRW
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:621
XrdCl::StatInfo::pImpl
std::unique_ptr< StatInfoImpl > pImpl
Definition: XrdClXRootDResponses.hh:547
XrdCl::OpenInfo::GetFileHandle
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:858
XrdCl::XRootDStatus::XRootDStatus
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:220
XrdCl::DirectoryList::Iterator
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:723
XrdCl::DirectoryList::ListEntry::pHostAddress
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:700
XrdCl::xattr_name
@ xattr_name
Definition: XrdClXRootDResponses.hh:278
XrdCl::StatInfo::GetFlags
uint32_t GetFlags() const
Get flags.
XrdCl::DirectoryList::ConstIterator
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:728
XrdCl::ChunkInfo::length
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:897
XrdCl::HostInfo::HostInfo
HostInfo()
Definition: XrdClXRootDResponses.hh:959
XrdCl::ProtocolInfo::AttrProxy
@ AttrProxy
Proxy attribute.
Definition: XrdClXRootDResponses.hh:348
XrdCl::ProtocolInfo::AttrMeta
@ AttrMeta
Meta attribute.
Definition: XrdClXRootDResponses.hh:347
XrdCl::ProtocolInfo::AttrSuper
@ AttrSuper
Supervisor attribute.
Definition: XrdClXRootDResponses.hh:349
XrdCl::LocationInfo::At
Location & At(uint32_t index)
Get the location at index.
Definition: XrdClXRootDResponses.hh:156
XrdCl::XAttrStatus::name
std::string name
Definition: XrdClXRootDResponses.hh:301
XrdCl::StatInfoVFS::GetFreeStaging
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:596
XrdCl::DirectoryList::ListEntry
Directory entry.
Definition: XrdClXRootDResponses.hh:638
XrdCl::StatInfo::POSCPending
@ POSCPending
Definition: XrdClXRootDResponses.hh:407
XrdCl::FileSystem
Send file/filesystem queries to an XRootD cluster.
Definition: XrdClFileSystem.hh:202
XrdCl::LocationInfo::AccessType
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:57
XrdCl::xattr_value
@ xattr_value
Definition: XrdClXRootDResponses.hh:279
XrdCl::VectorReadInfo::pSize
uint32_t pSize
Definition: XrdClXRootDResponses.hh:951
XrdCl::DirectoryList::ListEntry::SetStatInfo
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:694
kXR_xset
@ kXR_xset
Definition: XProtocol.hh:1112
XrdCl::HostInfo::url
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:966
XrdCl::DirectoryList::Begin
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:749
XrdCl::DirectoryList::At
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:741
XrdCl::XRootDStatus::GetErrorMessage
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:238
XrdCl::ChunkInfo::buffer
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:898
XrdCl::StatInfoVFS::GetFreeRW
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:572
XrdCl::LocationInfo::LocationList
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:128
XrdCl
Definition: XrdClAnyObject.hh:26
XrdCl::DirectoryList::ListEntry::~ListEntry
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:654
XrdCl::OpenInfo::GetSessionId
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:874
XrdCl::ProtocolInfo::GetHostInfo
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:369
XrdCl::HostList
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:969
XrdCl::VectorReadInfo
Vector read info.
Definition: XrdClXRootDResponses.hh:910
XrdCl::ProtocolInfo::HostTypes
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:344
XrdCl::StatInfo::~StatInfo
~StatInfo()
Destructor.
XrdCl::LocationInfo::Location::Location
Location(const std::string &address, LocationType type, AccessType access)
Constructor.
Definition: XrdClXRootDResponses.hh:72
XrdCl::XRootDStatus::ToStr
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:254
XrdCl::LocationInfo::Location::GetType
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:90
XrdCl::VectorReadInfo::VectorReadInfo
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:915
XrdCl::LocationInfo::Location::pType
LocationType pType
Definition: XrdClXRootDResponses.hh:121
XrdCl::LocationInfo::End
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:180
XrdCl::StatInfo::GetModeAsOctString
const std::string GetModeAsOctString() const
Get mode.
XrdCl::LocationInfo::LocationType
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:46
XrdCl::StatInfo::GetModTimeAsString
std::string GetModTimeAsString() const
Get modification time.
XrdCl::StatInfoVFS::pUtilizationStaging
uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:624
XrdCl::StatInfo
Object stat info.
Definition: XrdClXRootDResponses.hh:396
XrdCl::HostInfo
Definition: XrdClXRootDResponses.hh:958
XrdCl::VectorReadInfo::SetSize
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:928
XrdClStatus.hh
XrdCl::OpenInfo
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:834
XrdClAnyObject.hh
XrdClURL.hh
XrdCl::ChunkInfo::offset
uint64_t offset
Definition: XrdClXRootDResponses.hh:896
XrdCl::DirectoryList::GetSize
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:781
kXR_readable
@ kXR_readable
Definition: XProtocol.hh:1116
XrdCl::StatInfoVFS::GetNodesStaging
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:588
XrdCl::Status
Procedure execution status.
Definition: XrdClStatus.hh:111
XrdCl::URL
URL representation.
Definition: XrdClURL.hh:31
XrdCl::StatInfo::TimeToString
static std::string TimeToString(uint64_t time)
Definition: XrdClXRootDResponses.hh:522
XrdCl::StatInfo::StatInfo
StatInfo()
Constructor.
XrdCl::Buffer
Binary blob representation.
Definition: XrdClBuffer.hh:34
XrdCl::DirectoryList::ListEntry::pName
std::string pName
Definition: XrdClXRootDResponses.hh:701
XrdCl::DirectoryList::ListEntry::ListEntry
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:643
kXR_poscpend
@ kXR_poscpend
Definition: XProtocol.hh:1118
XrdCl::DirectoryList::ParseServerResponse
bool ParseServerResponse(const std::string &hostId, const char *data)
Parse server response and fill up the object.
XrdCl::DirectoryList::ListEntry::pStatInfo
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:702
XrdCl::LocationInfo::Location::GetAccessType
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:98
XrdCl::ProtocolInfo::pHostInfo
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:384
XrdCl::StatInfo::SetFlags
void SetFlags(uint32_t flags)
Set flags.
XrdCl::OpenInfo::pStatInfo
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:882
XrdCl::AnyObject
Definition: XrdClAnyObject.hh:33
XrdCl::DirectoryList::pParent
std::string pParent
Definition: XrdClXRootDResponses.hh:825
XrdCl::HostInfo::loadBalancer
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:965
XrdCl::LocationInfo::End
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:188
kXR_bkpexist
@ kXR_bkpexist
Definition: XProtocol.hh:1119
XrdCl::DirectoryList::dStatPrefix
static const std::string dStatPrefix
Definition: XrdClXRootDResponses.hh:827
XrdCl::ProtocolInfo::TestHostInfo
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:377
XrdCl::VectorReadInfo::GetSize
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:920
XrdCl::StatInfo::BackUpExists
@ BackUpExists
Back up copy exists.
Definition: XrdClXRootDResponses.hh:411
XrdCl::XAttrStatus::XAttrStatus
XAttrStatus(const std::string &name, const XRootDStatus &status)
Definition: XrdClXRootDResponses.hh:295
XrdCl::xattr_t
std::tuple< std::string, std::string > xattr_t
Extended attribute key - value pair.
Definition: XrdClXRootDResponses.hh:285
XrdCl::StatInfoVFS::GetNodesRW
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:564
XrdCl::XRootDStatus::pMessage
std::string pMessage
Definition: XrdClXRootDResponses.hh:270
XrdCl::ProtocolInfo::IsServer
@ IsServer
Data server.
Definition: XrdClXRootDResponses.hh:346