XRootD
XrdXrootdGStream Class Reference

#include <XrdXrootdGStream.hh>

+ Inheritance diagram for XrdXrootdGStream:
+ Collaboration diagram for XrdXrootdGStream:

Public Member Functions

 XrdXrootdGStream (XrdXrootdGSReal &gsRef)
 
void Flush ()
 
uint32_t GetDictID (const char *text, bool isPath=false)
 
bool HasHdr ()
 
bool Insert (const char *data, int dlen)
 
bool Insert (int dlen)
 
char * Reserve (int dlen)
 
int SetAutoFlush (int afsec)
 
int Space ()
 

Static Public Attributes

static const int MaxDataLen = 65280
 The larest amount of data that can be inserted in a single call to GStream. More...
 

Protected Member Functions

 ~XrdXrootdGStream ()
 Destructor. This stream should never be directly deleted. More...
 

Detailed Description

Definition at line 43 of file XrdXrootdGStream.hh.

Constructor & Destructor Documentation

◆ XrdXrootdGStream()

XrdXrootdGStream::XrdXrootdGStream ( XrdXrootdGSReal gsRef)
inline

Constructor

Parameters
gsRefrefrence to the G-Stream implementation.

Definition at line 158 of file XrdXrootdGStream.hh.

158 : gStream(gsRef) {}

◆ ~XrdXrootdGStream()

XrdXrootdGStream::~XrdXrootdGStream ( )
inlineprotected

Destructor. This stream should never be directly deleted.

Definition at line 166 of file XrdXrootdGStream.hh.

166 {}

Member Function Documentation

◆ Flush()

void XrdXrootdGStream::Flush ( )

Flush any pending monitoring messages to the data collector. Also, see the related SetAutoFlush() method.

Definition at line 38 of file XrdXrootdGStream.cc.

38 {gStream.Flush();}

References XrdXrootdGSReal::Flush().

+ Here is the call graph for this function:

◆ GetDictID()

uint32_t XrdXrootdGStream::GetDictID ( const char *  text,
bool  isPath = false 
)

Obtain a dictionary ID to map a string to an integer ID. The mapping is automatically sent to the monitor collector for future use using the 'd' or 'i' mapping identifier.

Parameters
text-> the null terminated string to be assigned an ID. The text must be less than or equal to 1024 characters.
isPathwhen true the text specified a file system path and identified as a XROOTD_MON_MAPPATH item. Otherwise, it is identified as a XROOTD_MON_MAPINFO item.
Returns
the integer identifier assigned to the string information. The returned value is in network byte order!

Definition at line 44 of file XrdXrootdGStream.cc.

45  {return gStream.GetDictID(text, isPath);}
uint32_t GetDictID(const char *text, bool isPath=false)

References XrdXrootdGSReal::GetDictID().

+ Here is the call graph for this function:

◆ HasHdr()

bool XrdXrootdGStream::HasHdr ( )

Check if payload is fronted by a header.

Returns
true payload is fronted by a header.
false payload is not fronted by a header. GetDictID() mappings are not sent and must be manually included inline.

Definition at line 51 of file XrdXrootdGStream.cc.

52  {return gStream.HasHdr();}

References XrdXrootdGSReal::HasHdr().

+ Here is the call graph for this function:

◆ Insert() [1/2]

bool XrdXrootdGStream::Insert ( const char *  data,
int  dlen 
)

Insert information into the G-Stream.

Parameters
data-> to null-terminated text to be included in the G-Stream.
dlenthe length of the text including the null character. Requires that (8 <= dlen <= MaxDataLen); defined below.
Returns
true data included.
false data rejected; invalid length or is not null terminated.

Definition at line 58 of file XrdXrootdGStream.cc.

59  {return gStream.Insert(data, dlen);}
bool Insert(const char *data, int dlen)

References XrdXrootdGSReal::Insert().

Referenced by XrdXrootdTpcMon::Report().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Insert() [2/2]

bool XrdXrootdGStream::Insert ( int  dlen)

Insert information into the G-Stream using the data placed in the buffer space obtained by a previous call to Reserve(). Upon return, this object is unlocked.

Parameters
dlenthe number of bytes actually present in the buffer. The text must end with a null byte and dlen must be 8 <= dlen <= dlen used in the previous Reserve() call.
Returns
true data included.
false data rejected; invalid length or no buffer outstanding.

Definition at line 61 of file XrdXrootdGStream.cc.

61 {return gStream.Insert(dlen);}

References XrdXrootdGSReal::Insert().

+ Here is the call graph for this function:

◆ Reserve()

char * XrdXrootdGStream::Reserve ( int  dlen)

Obtain a buffer space for information. This object is locked and no other thread can insert information until the buffer is inserted using Insert().

Parameters
dlenthe number of bytes required to be available for use. Requires that (8 <= dlen <= MaxDataLen); defined below.
Returns
!0 pointer to a dlen sized buffer.
=0 invalid length specified or a buffer is outstanding.

Definition at line 67 of file XrdXrootdGStream.cc.

67 {return gStream.Reserve(dlen);}
char * Reserve(int dlen)

References XrdXrootdGSReal::Reserve().

+ Here is the call graph for this function:

◆ SetAutoFlush()

int XrdXrootdGStream::SetAutoFlush ( int  afsec)

Set autoflush time interval (or disable it). Disabling autoflush may be useful when data is periodically generated at a low rate and manual flushing would produce more consistent results.

Parameters
afsecNumber of seconds between autoflushing. A zero or negative value disables autoflush. The default is 600 seconds (i.e. 10 minutes) subject to what is specified via the xrootd.monitor flush directive. Positive values less that 60 are considered to be 60.
Returns
The previous auto-flush setting.

Definition at line 73 of file XrdXrootdGStream.cc.

74  {if (afsec < 0) afsec = 0;
75  else if (afsec < 60) afsec = 60;
76  return gStream.SetAutoFlush(afsec);
77  }
int SetAutoFlush(int afsec)

References XrdXrootdGSReal::SetAutoFlush().

+ Here is the call graph for this function:

◆ Space()

int XrdXrootdGStream::Space ( )

Get the amount of buffer space remaining.

Returns
The maximum number of bytes that can be inserted at time of call.

Definition at line 83 of file XrdXrootdGStream.cc.

84  {return gStream.Space();}

References XrdXrootdGSReal::Space().

+ Here is the call graph for this function:

Member Data Documentation

◆ MaxDataLen

const int XrdXrootdGStream::MaxDataLen = 65280
static

The larest amount of data that can be inserted in a single call to GStream.

Definition at line 150 of file XrdXrootdGStream.hh.

Referenced by XrdXrootdGSReal::Insert(), and XrdXrootdGSReal::Reserve().


The documentation for this class was generated from the following files: