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 
32 namespace XrdCl
33 {
34  //----------------------------------------------------------------------------
36  //----------------------------------------------------------------------------
38  {
39  public:
40  //------------------------------------------------------------------------
42  //------------------------------------------------------------------------
44  {
49  };
50 
51  //------------------------------------------------------------------------
53  //------------------------------------------------------------------------
55  {
56  Read,
58  };
59 
60  //------------------------------------------------------------------------
62  //------------------------------------------------------------------------
63  class Location
64  {
65  public:
66 
67  //--------------------------------------------------------------------
69  //--------------------------------------------------------------------
70  Location( const std::string &address,
71  LocationType type,
73  pAddress( address ),
74  pType( type ),
75  pAccess( access ) {}
76 
77  //--------------------------------------------------------------------
79  //--------------------------------------------------------------------
80  const std::string &GetAddress() const
81  {
82  return pAddress;
83  }
84 
85  //--------------------------------------------------------------------
87  //--------------------------------------------------------------------
89  {
90  return pType;
91  }
92 
93  //--------------------------------------------------------------------
95  //--------------------------------------------------------------------
97  {
98  return pAccess;
99  }
100 
101  //--------------------------------------------------------------------
103  //--------------------------------------------------------------------
104  bool IsServer() const
105  {
106  return pType == ServerOnline || pType == ServerPending;
107  }
108 
109  //--------------------------------------------------------------------
111  //--------------------------------------------------------------------
112  bool IsManager() const
113  {
114  return pType == ManagerOnline || pType == ManagerPending;
115  }
116 
117  private:
118  std::string pAddress;
121  };
122 
123  //------------------------------------------------------------------------
125  //------------------------------------------------------------------------
126  typedef std::vector<Location> LocationList;
127 
128  //------------------------------------------------------------------------
130  //------------------------------------------------------------------------
131  typedef LocationList::iterator Iterator;
132 
133  //------------------------------------------------------------------------
135  //------------------------------------------------------------------------
136  typedef LocationList::const_iterator ConstIterator;
137 
138  //------------------------------------------------------------------------
140  //------------------------------------------------------------------------
141  LocationInfo();
142 
143  //------------------------------------------------------------------------
145  //------------------------------------------------------------------------
146  uint32_t GetSize() const
147  {
148  return pLocations.size();
149  }
150 
151  //------------------------------------------------------------------------
153  //------------------------------------------------------------------------
154  Location &At( uint32_t index )
155  {
156  return pLocations[index];
157  }
158 
159  //------------------------------------------------------------------------
161  //------------------------------------------------------------------------
163  {
164  return pLocations.begin();
165  }
166 
167  //------------------------------------------------------------------------
169  //------------------------------------------------------------------------
171  {
172  return pLocations.begin();
173  }
174 
175  //------------------------------------------------------------------------
177  //------------------------------------------------------------------------
179  {
180  return pLocations.end();
181  }
182 
183  //------------------------------------------------------------------------
185  //------------------------------------------------------------------------
187  {
188  return pLocations.end();
189  }
190 
191  //------------------------------------------------------------------------
193  //------------------------------------------------------------------------
194  void Add( const Location &location )
195  {
196  pLocations.push_back( location );
197  }
198 
199  //------------------------------------------------------------------------
201  //------------------------------------------------------------------------
202  bool ParseServerResponse( const char *data );
203 
204  private:
205  bool ProcessLocation( std::string &location );
207  };
208 
209  //----------------------------------------------------------------------------
211  //----------------------------------------------------------------------------
212  class XRootDStatus: public Status
213  {
214  public:
215  //------------------------------------------------------------------------
217  //------------------------------------------------------------------------
218  XRootDStatus( uint16_t st = 0,
219  uint16_t code = 0,
220  uint32_t errN = 0,
221  const std::string &message = "" ):
222  Status( st, code, errN ),
223  pMessage( message ) {}
224 
225  //------------------------------------------------------------------------
227  //------------------------------------------------------------------------
228  XRootDStatus( const Status &st,
229  const std::string &message = "" ):
230  Status( st ),
231  pMessage( message ) {}
232 
233  //------------------------------------------------------------------------
235  //------------------------------------------------------------------------
236  const std::string &GetErrorMessage() const
237  {
238  return pMessage;
239  }
240 
241  //------------------------------------------------------------------------
243  //------------------------------------------------------------------------
244  void SetErrorMessage( const std::string &message )
245  {
246  pMessage = message;
247  }
248 
249  //------------------------------------------------------------------------
251  //------------------------------------------------------------------------
252  std::string ToStr() const
253  {
254  if( code == errErrorResponse )
255  {
256  std::ostringstream o;
257  o << "[ERROR] Server responded with an error: [" << errNo << "] ";
258  o << pMessage << std::endl;
259  return o.str();
260  }
261  std::string str = ToString();
262  if( !pMessage.empty() )
263  str += ": " + pMessage;
264  return str;
265  }
266 
267  private:
268  std::string pMessage;
269  };
270 
271  //----------------------------------------------------------------------------
273  //----------------------------------------------------------------------------
275 
276  //----------------------------------------------------------------------------
278  //----------------------------------------------------------------------------
280  {
281  public:
282  //------------------------------------------------------------------------
284  //------------------------------------------------------------------------
286  {
292  };
293 
294  //------------------------------------------------------------------------
296  //------------------------------------------------------------------------
297  ProtocolInfo( uint32_t version, uint32_t hostInfo ):
298  pVersion( version ), pHostInfo( hostInfo ) {}
299 
300  //------------------------------------------------------------------------
302  //------------------------------------------------------------------------
303  uint32_t GetVersion() const
304  {
305  return pVersion;
306  }
307 
308  //------------------------------------------------------------------------
310  //------------------------------------------------------------------------
311  uint32_t GetHostInfo() const
312  {
313  return pHostInfo;
314  }
315 
316  //------------------------------------------------------------------------
318  //------------------------------------------------------------------------
319  bool TestHostInfo( uint32_t flags )
320  {
321  return pHostInfo & flags;
322  }
323 
324  private:
325  uint32_t pVersion;
326  uint32_t pHostInfo;
327  };
328 
329  //----------------------------------------------------------------------------
331  //----------------------------------------------------------------------------
332  class StatInfo
333  {
334  public:
335  //------------------------------------------------------------------------
337  //------------------------------------------------------------------------
338  enum Flags
339  {
349  };
350 
351  //------------------------------------------------------------------------
353  //------------------------------------------------------------------------
354  StatInfo();
355 
356  //------------------------------------------------------------------------
358  //------------------------------------------------------------------------
359  StatInfo( const std::string &id, uint64_t size, uint32_t flags,
360  uint64_t modTime);
361 
362  //------------------------------------------------------------------------
364  //------------------------------------------------------------------------
365  const std::string GetId() const
366  {
367  return pId;
368  }
369 
370  //------------------------------------------------------------------------
372  //------------------------------------------------------------------------
373  uint64_t GetSize() const
374  {
375  return pSize;
376  }
377 
378  //------------------------------------------------------------------------
380  //------------------------------------------------------------------------
381  uint32_t GetFlags() const
382  {
383  return pFlags;
384  }
385 
386  //------------------------------------------------------------------------
388  //------------------------------------------------------------------------
389  bool TestFlags( uint32_t flags ) const
390  {
391  return pFlags & flags;
392  }
393 
394  //------------------------------------------------------------------------
396  //------------------------------------------------------------------------
397  uint64_t GetModTime() const
398  {
399  return pModTime;
400  }
401 
402  //------------------------------------------------------------------------
404  //------------------------------------------------------------------------
405  std::string GetModTimeAsString() const
406  {
407  char ts[256];
408  time_t modTime = pModTime;
409  tm *t = gmtime( &modTime );
410  strftime( ts, 255, "%F %T", t );
411  return ts;
412  }
413 
414  //------------------------------------------------------------------------
416  //------------------------------------------------------------------------
417  bool ParseServerResponse( const char *data );
418 
419  private:
420 
421  //------------------------------------------------------------------------
422  // Normal stat
423  //------------------------------------------------------------------------
424  std::string pId;
425  uint64_t pSize;
426  uint32_t pFlags;
427  uint64_t pModTime;
428  };
429 
430  //----------------------------------------------------------------------------
432  //----------------------------------------------------------------------------
434  {
435  public:
436  //------------------------------------------------------------------------
438  //------------------------------------------------------------------------
439  StatInfoVFS();
440 
441  //------------------------------------------------------------------------
443  //------------------------------------------------------------------------
444  uint64_t GetNodesRW() const
445  {
446  return pNodesRW;
447  }
448 
449  //------------------------------------------------------------------------
451  //------------------------------------------------------------------------
452  uint64_t GetFreeRW() const
453  {
454  return pFreeRW;
455  }
456 
457  //------------------------------------------------------------------------
459  //------------------------------------------------------------------------
460  uint8_t GetUtilizationRW() const
461  {
462  return pUtilizationRW;
463  }
464 
465  //------------------------------------------------------------------------
467  //------------------------------------------------------------------------
468  uint64_t GetNodesStaging() const
469  {
470  return pNodesStaging;
471  }
472 
473  //------------------------------------------------------------------------
475  //------------------------------------------------------------------------
476  uint64_t GetFreeStaging() const
477  {
478  return pFreeStaging;
479  }
480 
481  //------------------------------------------------------------------------
483  //------------------------------------------------------------------------
484  uint8_t GetUtilizationStaging() const
485  {
486  return pUtilizationStaging;
487  }
488 
489  //------------------------------------------------------------------------
491  //------------------------------------------------------------------------
492  bool ParseServerResponse( const char *data );
493 
494  private:
495 
496  //------------------------------------------------------------------------
497  // kXR_vfs stat
498  //------------------------------------------------------------------------
499  uint64_t pNodesRW;
500  uint64_t pFreeRW;
501  uint32_t pUtilizationRW;
502  uint64_t pNodesStaging;
503  uint64_t pFreeStaging;
505  };
506 
507  //----------------------------------------------------------------------------
509  //----------------------------------------------------------------------------
511  {
512  public:
513 
514  //------------------------------------------------------------------------
516  //------------------------------------------------------------------------
517  class ListEntry
518  {
519  public:
520  //--------------------------------------------------------------------
522  //--------------------------------------------------------------------
523  ListEntry( const std::string &hostAddress,
524  const std::string &name,
525  StatInfo *statInfo = 0):
526  pHostAddress( hostAddress ),
527  pName( name ),
528  pStatInfo( statInfo )
529  {}
530 
531  //--------------------------------------------------------------------
533  //--------------------------------------------------------------------
535  {
536  delete pStatInfo;
537  }
538 
539  //--------------------------------------------------------------------
541  //--------------------------------------------------------------------
542  const std::string &GetHostAddress() const
543  {
544  return pHostAddress;
545  }
546 
547  //--------------------------------------------------------------------
549  //--------------------------------------------------------------------
550  const std::string &GetName() const
551  {
552  return pName;
553  }
554 
555  //--------------------------------------------------------------------
557  //--------------------------------------------------------------------
559  {
560  return pStatInfo;
561  }
562 
563  //--------------------------------------------------------------------
565  //--------------------------------------------------------------------
566  const StatInfo *GetStatInfo() const
567  {
568  return pStatInfo;
569  }
570 
571  //--------------------------------------------------------------------
573  //--------------------------------------------------------------------
574  void SetStatInfo( StatInfo *info )
575  {
576  pStatInfo = info;
577  }
578 
579  private:
580  std::string pHostAddress;
581  std::string pName;
583  };
584 
585  //------------------------------------------------------------------------
587  //------------------------------------------------------------------------
588  DirectoryList();
589 
590  //------------------------------------------------------------------------
592  //------------------------------------------------------------------------
593  ~DirectoryList();
594 
595  //------------------------------------------------------------------------
597  //------------------------------------------------------------------------
598  typedef std::vector<ListEntry*> DirList;
599 
600  //------------------------------------------------------------------------
602  //------------------------------------------------------------------------
603  typedef DirList::iterator Iterator;
604 
605  //------------------------------------------------------------------------
607  //------------------------------------------------------------------------
608  typedef DirList::const_iterator ConstIterator;
609 
610  //------------------------------------------------------------------------
612  //------------------------------------------------------------------------
613  void Add( ListEntry *entry )
614  {
615  pDirList.push_back( entry );
616  }
617 
618  //------------------------------------------------------------------------
620  //------------------------------------------------------------------------
621  ListEntry *At( uint32_t index )
622  {
623  return pDirList[index];
624  }
625 
626  //------------------------------------------------------------------------
628  //------------------------------------------------------------------------
630  {
631  return pDirList.begin();
632  }
633 
634  //------------------------------------------------------------------------
636  //------------------------------------------------------------------------
638  {
639  return pDirList.begin();
640  }
641 
642  //------------------------------------------------------------------------
644  //------------------------------------------------------------------------
646  {
647  return pDirList.end();
648  }
649 
650  //------------------------------------------------------------------------
652  //------------------------------------------------------------------------
654  {
655  return pDirList.end();
656  }
657 
658  //------------------------------------------------------------------------
660  //------------------------------------------------------------------------
661  uint32_t GetSize() const
662  {
663  return pDirList.size();
664  }
665 
666  //------------------------------------------------------------------------
668  //------------------------------------------------------------------------
669  const std::string &GetParentName() const
670  {
671  return pParent;
672  }
673 
674  //------------------------------------------------------------------------
676  //------------------------------------------------------------------------
677  void SetParentName( const std::string &parent )
678  {
679  size_t pos = parent.find( '?' );
680  pParent = pos == std::string::npos ? parent : parent.substr( 0, pos );
681  if( !pParent.empty() && pParent[pParent.length()-1] != '/' )
682  pParent += "/";
683  }
684 
685  //------------------------------------------------------------------------
687  //------------------------------------------------------------------------
688  bool ParseServerResponse( const std::string &hostId,
689  const char *data );
690 
691  //------------------------------------------------------------------------
693  //------------------------------------------------------------------------
694  bool ParseServerResponse( const std::string &hostId,
695  const char *data,
696  bool isDStat );
697 
698  //------------------------------------------------------------------------
700  //------------------------------------------------------------------------
701  static bool HasStatInfo( const char *data );
702 
703  private:
705  std::string pParent;
706 
707  static const std::string dStatPrefix;
708  };
709 
710  //----------------------------------------------------------------------------
712  //----------------------------------------------------------------------------
713  class OpenInfo
714  {
715  public:
716  //------------------------------------------------------------------------
718  //------------------------------------------------------------------------
719  OpenInfo( const uint8_t *fileHandle,
720  uint64_t sessionId,
721  StatInfo *statInfo = 0 ):
722  pSessionId(sessionId), pStatInfo( statInfo )
723  {
724  memcpy( pFileHandle, fileHandle, 4 );
725  }
726 
727  //------------------------------------------------------------------------
729  //------------------------------------------------------------------------
731  {
732  delete pStatInfo;
733  }
734 
735  //------------------------------------------------------------------------
737  //------------------------------------------------------------------------
738  void GetFileHandle( uint8_t *fileHandle ) const
739  {
740  memcpy( fileHandle, pFileHandle, 4 );
741  }
742 
743  //------------------------------------------------------------------------
745  //------------------------------------------------------------------------
746  const StatInfo *GetStatInfo() const
747  {
748  return pStatInfo;
749  }
750 
751  //------------------------------------------------------------------------
752  // Get session ID
753  //------------------------------------------------------------------------
754  uint64_t GetSessionId() const
755  {
756  return pSessionId;
757  }
758 
759  private:
760  uint8_t pFileHandle[4];
761  uint64_t pSessionId;
763  };
764 
765  //----------------------------------------------------------------------------
767  //----------------------------------------------------------------------------
768  struct ChunkInfo
769  {
770  //--------------------------------------------------------------------------
772  //--------------------------------------------------------------------------
773  ChunkInfo( uint64_t off = 0, uint32_t len = 0, void *buff = 0 ):
774  offset( off ), length( len ), buffer(buff) {}
775 
776  uint64_t offset;
777  uint32_t length;
778  void *buffer;
779  };
780 
781  //----------------------------------------------------------------------------
783  //----------------------------------------------------------------------------
784  typedef std::vector<ChunkInfo> ChunkList;
785 
786  //----------------------------------------------------------------------------
788  //----------------------------------------------------------------------------
790  {
791  public:
792  //------------------------------------------------------------------------
794  //------------------------------------------------------------------------
796 
797  //------------------------------------------------------------------------
799  //------------------------------------------------------------------------
800  uint32_t GetSize() const
801  {
802  return pSize;
803  }
804 
805  //------------------------------------------------------------------------
807  //------------------------------------------------------------------------
808  void SetSize( uint32_t size )
809  {
810  pSize = size;
811  }
812 
813  //------------------------------------------------------------------------
815  //------------------------------------------------------------------------
817  {
818  return pChunks;
819  }
820 
821  //------------------------------------------------------------------------
823  //------------------------------------------------------------------------
824  const ChunkList &GetChunks() const
825  {
826  return pChunks;
827  }
828 
829  private:
831  uint32_t pSize;
832  };
833 
834  //----------------------------------------------------------------------------
835  // List of URLs
836  //----------------------------------------------------------------------------
837  struct HostInfo
838  {
840  flags(0), protocol(0), loadBalancer(false) {}
841  HostInfo( const URL &u, bool lb = false ):
842  flags(0), protocol(0), loadBalancer(lb), url(u) {}
843  uint32_t flags;
844  uint32_t protocol;
847  };
848 
849  typedef std::vector<HostInfo> HostList;
850 
851  //----------------------------------------------------------------------------
853  //----------------------------------------------------------------------------
855  {
856  public:
857  virtual ~ResponseHandler() {}
858 
859  //------------------------------------------------------------------------
867  //------------------------------------------------------------------------
868  virtual void HandleResponseWithHosts( XRootDStatus *status,
869  AnyObject *response,
870  HostList *hostList )
871  {
872  delete hostList;
873  HandleResponse( status, response );
874  }
875 
876  //------------------------------------------------------------------------
883  //------------------------------------------------------------------------
884  virtual void HandleResponse( XRootDStatus *status,
885  AnyObject *response )
886  {
887  (void)status; (void)response;
888  }
889  };
890 }
891 
892 #endif // __XRD_CL_XROOTD_RESPONSES_HH__
Write access is allowed.
Definition: XrdClXRootDResponses.hh:347
uint32_t pUtilizationStaging
Definition: XrdClXRootDResponses.hh:504
const std::string & GetAddress() const
Get address.
Definition: XrdClXRootDResponses.hh:80
ListEntry(const std::string &hostAddress, const std::string &name, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:523
Definition: XProtocol.hh:203
virtual ~ResponseHandler()
Definition: XrdClXRootDResponses.hh:857
#define kXR_isServer
Definition: XProtocol.hh:87
Definition: XrdClAnyObject.hh:32
AccessType
Describes the allowed access type for the file at given location.
Definition: XrdClXRootDResponses.hh:54
const std::string & GetErrorMessage() const
Get error message.
Definition: XrdClXRootDResponses.hh:236
#define kXR_attrProxy
Definition: XProtocol.hh:89
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
uint64_t pNodesStaging
Definition: XrdClXRootDResponses.hh:502
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:582
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
Definition: XProtocol.hh:205
Directory list.
Definition: XrdClXRootDResponses.hh:510
AccessType GetAccessType() const
Get access type.
Definition: XrdClXRootDResponses.hh:96
uint64_t pFreeStaging
Definition: XrdClXRootDResponses.hh:503
Meta attribute.
Definition: XrdClXRootDResponses.hh:289
uint64_t pFreeRW
Definition: XrdClXRootDResponses.hh:500
uint64_t GetFreeRW() const
Get size of the largest contiguous area of free r/w space (in MB)
Definition: XrdClXRootDResponses.hh:452
uint64_t GetNodesStaging() const
Get number of nodes that can provide staging space.
Definition: XrdClXRootDResponses.hh:468
Definition: XProtocol.hh:206
std::string ToString() const
Create a string representation.
uint32_t GetHostInfo() const
Get host info.
Definition: XrdClXRootDResponses.hh:311
Object stat info.
Definition: XrdClXRootDResponses.hh:332
Definition: XrdClXRootDResponses.hh:344
ConstIterator End() const
Get the end iterator.
Definition: XrdClXRootDResponses.hh:653
const uint16_t errErrorResponse
Definition: XrdClStatus.hh:101
uint32_t pUtilizationRW
Definition: XrdClXRootDResponses.hh:501
static bool HasStatInfo(const char *data)
Returns true if data contain stat info.
#define kXR_attrMeta
Definition: XProtocol.hh:88
bool IsManager() const
Check whether the location is a manager.
Definition: XrdClXRootDResponses.hh:112
ConstIterator Begin() const
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:637
LocationInfo()
Constructor.
HostInfo()
Definition: XrdClXRootDResponses.hh:839
Back up copy exists.
Definition: XrdClXRootDResponses.hh:348
server node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:48
Manager.
Definition: XrdClXRootDResponses.hh:287
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
uint64_t GetSize() const
Get size (in bytes)
Definition: XrdClXRootDResponses.hh:373
Definition: XProtocol.hh:202
const std::string & GetHostAddress() const
Get host address.
Definition: XrdClXRootDResponses.hh:542
void Add(ListEntry *entry)
Add an entry to the list - takes ownership.
Definition: XrdClXRootDResponses.hh:613
XRootDStatus(const Status &st, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:228
bool IsServer() const
Check whether the location is a server.
Definition: XrdClXRootDResponses.hh:104
std::string pId
Definition: XrdClXRootDResponses.hh:424
std::string pMessage
Definition: XrdClXRootDResponses.hh:268
Path location info.
Definition: XrdClXRootDResponses.hh:37
uint16_t code
Error type, or additional hints on what to do.
Definition: XrdClStatus.hh:137
uint64_t pModTime
Definition: XrdClXRootDResponses.hh:427
void SetErrorMessage(const std::string &message)
Set the error message.
Definition: XrdClXRootDResponses.hh:244
std::vector< Location > LocationList
List of locations.
Definition: XrdClXRootDResponses.hh:126
Location.
Definition: XrdClXRootDResponses.hh:63
uint8_t pFileHandle[4]
Definition: XrdClXRootDResponses.hh:760
uint64_t GetNodesRW() const
Get number of nodes that can provide read/write space.
Definition: XrdClXRootDResponses.hh:444
Iterator Begin()
Get the begin iterator.
Definition: XrdClXRootDResponses.hh:629
LocationType pType
Definition: XrdClXRootDResponses.hh:119
Procedure execution status.
Definition: XrdClStatus.hh:109
bool ParseServerResponse(const std::string &hostId, const char *data)
Parse server response and fill up the object.
ChunkList & GetChunks()
Get chunks.
Definition: XrdClXRootDResponses.hh:816
StatInfo * GetStatInfo()
Get the stat info object.
Definition: XrdClXRootDResponses.hh:558
Definition: XProtocol.hh:204
void SetParentName(const std::string &parent)
Set name of the parent directory.
Definition: XrdClXRootDResponses.hh:677
Information returned by file open operation.
Definition: XrdClXRootDResponses.hh:713
#define kXR_isManager
Definition: XProtocol.hh:86
~OpenInfo()
Destructor.
Definition: XrdClXRootDResponses.hh:730
Definition: XProtocol.hh:200
Iterator End()
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:178
void * buffer
length of the chunk
Definition: XrdClXRootDResponses.hh:778
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
Definition: XrdClXRootDResponses.hh:218
Protocol response.
Definition: XrdClXRootDResponses.hh:279
const ChunkList & GetChunks() const
Get chunks.
Definition: XrdClXRootDResponses.hh:824
uint64_t GetFreeStaging() const
Get size of the largest contiguous area of free staging space (in MB)
Definition: XrdClXRootDResponses.hh:476
read access is allowed
Definition: XrdClXRootDResponses.hh:56
uint64_t pSessionId
Definition: XrdClXRootDResponses.hh:761
uint32_t GetFlags() const
Get flags.
Definition: XrdClXRootDResponses.hh:381
bool ProcessLocation(std::string &location)
ListEntry * At(uint32_t index)
Get an entry at given index.
Definition: XrdClXRootDResponses.hh:621
const StatInfo * GetStatInfo() const
Get the stat info.
Definition: XrdClXRootDResponses.hh:746
uint8_t GetUtilizationRW() const
Get percentage of the partition utilization represented by FreeRW.
Definition: XrdClXRootDResponses.hh:460
Definition: XrdClXRootDResponses.hh:837
Definition: XProtocol.hh:199
uint32_t GetSize() const
Get number of locations.
Definition: XrdClXRootDResponses.hh:146
OpenInfo(const uint8_t *fileHandle, uint64_t sessionId, StatInfo *statInfo=0)
Constructor.
Definition: XrdClXRootDResponses.hh:719
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:849
DirList::iterator Iterator
Directory listing iterator.
Definition: XrdClXRootDResponses.hh:603
const std::string & GetParentName() const
Get parent directory name.
Definition: XrdClXRootDResponses.hh:669
DirList pDirList
Definition: XrdClXRootDResponses.hh:704
LocationList pLocations
Definition: XrdClXRootDResponses.hh:206
uint32_t flags
Host type.
Definition: XrdClXRootDResponses.hh:843
bool TestHostInfo(uint32_t flags)
Test host info flags.
Definition: XrdClXRootDResponses.hh:319
HostTypes
Types of XRootD servers.
Definition: XrdClXRootDResponses.hh:285
ChunkInfo(uint64_t off=0, uint32_t len=0, void *buff=0)
Constructor.
Definition: XrdClXRootDResponses.hh:773
const StatInfo * GetStatInfo() const
Get the stat info object.
Definition: XrdClXRootDResponses.hh:566
uint32_t length
offset in the file
Definition: XrdClXRootDResponses.hh:777
LocationList::iterator Iterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:131
manager node where the file is online
Definition: XrdClXRootDResponses.hh:45
const std::string GetId() const
Get id.
Definition: XrdClXRootDResponses.hh:365
Describe a data chunk for vector read.
Definition: XrdClXRootDResponses.hh:768
Request status.
Definition: XrdClXRootDResponses.hh:212
const std::string & GetName() const
Get file name.
Definition: XrdClXRootDResponses.hh:550
Definition: XrdClAnyObject.hh:25
std::string pHostAddress
Definition: XrdClXRootDResponses.hh:580
void SetStatInfo(StatInfo *info)
Set the stat info object (and transfer the ownership)
Definition: XrdClXRootDResponses.hh:574
LocationType GetType() const
Get location type.
Definition: XrdClXRootDResponses.hh:88
ProtocolInfo(uint32_t version, uint32_t hostInfo)
Constructor.
Definition: XrdClXRootDResponses.hh:297
uint32_t pFlags
Definition: XrdClXRootDResponses.hh:426
server node where the file is online
Definition: XrdClXRootDResponses.hh:47
uint32_t pSize
Definition: XrdClXRootDResponses.hh:831
uint32_t protocol
Version of the protocol the host is speaking.
Definition: XrdClXRootDResponses.hh:844
Supervisor attribute.
Definition: XrdClXRootDResponses.hh:291
VFS stat info.
Definition: XrdClXRootDResponses.hh:433
ChunkList pChunks
Definition: XrdClXRootDResponses.hh:830
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
~DirectoryList()
Destructor.
std::string pAddress
Definition: XrdClXRootDResponses.hh:118
Iterator End()
Get the end iterator.
Definition: XrdClXRootDResponses.hh:645
ConstIterator Begin() const
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:170
void SetSize(uint32_t size)
Set size.
Definition: XrdClXRootDResponses.hh:808
manager node where the file is pending to be online
Definition: XrdClXRootDResponses.hh:46
Location & At(uint32_t index)
Get the location at index.
Definition: XrdClXRootDResponses.hh:154
Flags
Flags.
Definition: XrdClXRootDResponses.hh:338
#define kXR_attrSuper
Definition: XProtocol.hh:90
Vector read info.
Definition: XrdClXRootDResponses.hh:789
uint32_t GetVersion() const
Get version info.
Definition: XrdClXRootDResponses.hh:303
HostInfo(const URL &u, bool lb=false)
Definition: XrdClXRootDResponses.hh:841
Handle an async response.
Definition: XrdClXRootDResponses.hh:854
Location(const std::string &address, LocationType type, AccessType access)
Constructor.
Definition: XrdClXRootDResponses.hh:70
uint64_t offset
Definition: XrdClXRootDResponses.hh:776
StatInfo * pStatInfo
Definition: XrdClXRootDResponses.hh:762
AccessType pAccess
Definition: XrdClXRootDResponses.hh:120
std::string pParent
Definition: XrdClXRootDResponses.hh:705
uint32_t GetSize() const
Get the size of the listing.
Definition: XrdClXRootDResponses.hh:661
virtual void HandleResponse(XRootDStatus *status, AnyObject *response)
Definition: XrdClXRootDResponses.hh:884
Neither a file nor a directory.
Definition: XrdClXRootDResponses.hh:342
uint64_t pNodesRW
Definition: XrdClXRootDResponses.hh:499
#define access(a, b)
Definition: XrdPosix.hh:39
URL representation.
Definition: XrdClURL.hh:30
virtual void HandleResponseWithHosts(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition: XrdClXRootDResponses.hh:868
uint32_t errNo
Errno, if any.
Definition: XrdClStatus.hh:138
uint32_t GetSize() const
Get Size.
Definition: XrdClXRootDResponses.hh:800
This is a directory.
Definition: XrdClXRootDResponses.hh:341
Read access is allowed.
Definition: XrdClXRootDResponses.hh:346
Buffer BinaryDataInfo
Binary buffer.
Definition: XrdClXRootDResponses.hh:274
Proxy attribute.
Definition: XrdClXRootDResponses.hh:290
static const std::string dStatPrefix
Definition: XrdClXRootDResponses.hh:707
Data server.
Definition: XrdClXRootDResponses.hh:288
write access is allowed
Definition: XrdClXRootDResponses.hh:57
uint32_t pVersion
Definition: XrdClXRootDResponses.hh:325
void GetFileHandle(uint8_t *fileHandle) const
Get the file handle (4bytes)
Definition: XrdClXRootDResponses.hh:738
uint32_t pHostInfo
Definition: XrdClXRootDResponses.hh:326
std::string pName
Definition: XrdClXRootDResponses.hh:581
StatInfo()
Constructor.
LocationType
Describes the node type and file status for a given location.
Definition: XrdClXRootDResponses.hh:43
~ListEntry()
Destructor.
Definition: XrdClXRootDResponses.hh:534
bool ParseServerResponse(const char *data)
Parse server response and fill up the object.
StatInfoVFS()
Constructor.
uint64_t pSize
Definition: XrdClXRootDResponses.hh:425
DirList::const_iterator ConstIterator
Directory listing const iterator.
Definition: XrdClXRootDResponses.hh:608
DirectoryList()
Constructor.
std::string GetModTimeAsString() const
Get modification time.
Definition: XrdClXRootDResponses.hh:405
std::string ToStr() const
Convert to string.
Definition: XrdClXRootDResponses.hh:252
void Add(const Location &location)
Add a location.
Definition: XrdClXRootDResponses.hh:194
Executable/searchable bit set.
Definition: XrdClXRootDResponses.hh:340
VectorReadInfo()
Constructor.
Definition: XrdClXRootDResponses.hh:795
uint64_t GetModTime() const
Get modification time (in seconds since epoch)
Definition: XrdClXRootDResponses.hh:397
bool loadBalancer
Was the host used as a load balancer.
Definition: XrdClXRootDResponses.hh:845
uint64_t GetSessionId() const
Definition: XrdClXRootDResponses.hh:754
std::vector< ListEntry * > DirList
Directory listing.
Definition: XrdClXRootDResponses.hh:598
File is not online (ie. on disk)
Definition: XrdClXRootDResponses.hh:343
uint8_t GetUtilizationStaging() const
Get percentage of the partition utilization represented by FreeStaging.
Definition: XrdClXRootDResponses.hh:484
ConstIterator End() const
Get the location end iterator.
Definition: XrdClXRootDResponses.hh:186
LocationList::const_iterator ConstIterator
Iterator over locations.
Definition: XrdClXRootDResponses.hh:136
Iterator Begin()
Get the location begin iterator.
Definition: XrdClXRootDResponses.hh:162
Binary blob representation.
Definition: XrdClBuffer.hh:33
Directory entry.
Definition: XrdClXRootDResponses.hh:517
Definition: XProtocol.hh:201
bool TestFlags(uint32_t flags) const
Test flags.
Definition: XrdClXRootDResponses.hh:389