xrootdlib.structs.XrdXrootdMon.redir module

Redir = typing.Union[xrootdlib.structs.XrdXrootdMon.redir.Redirect, xrootdlib.structs.XrdXrootdMon.redir.ServerIdent, xrootdlib.structs.XrdXrootdMon.redir.WindowMark]

Type of records in the r stream

class Redirect(type: xrootdlib.structs.XrdXrootdMon.redir.XROOTD_MON, subtype: xrootdlib.structs.XrdXrootdMon.redir.XROOTD_MON, dent: int, port: int, dictid: int, server: bytes, path: bytes)

Bases: object

XrdXrootdMonRedir representing a redirect record

Parameters:
  • type – the type of the record, i.e. REDIRECT or `REDLOCAL
  • subtype – the requested operation, i.e. CHMOD, LOCALTE, …
  • dent – size of the struct in bytes plus one
  • port – port to which the client was redirected
  • dictid – client identifier (see Map)
  • server – hostname or address of the target server
  • path – path of the file on the target server
arg0
arg1
dent
dictid
classmethod from_buffer(buffer: bytes)
local

Whether the redirection target is the same server

path
port
server
size
struct_parser = <Struct object>
subtype
type
class RedirectArg0View(redirect: xrootdlib.structs.XrdXrootdMon.redir.Redirect)

Bases: object

dent
port
type
class RedirectArg1View(redirect: xrootdlib.structs.XrdXrootdMon.redir.Redirect)

Bases: object

dictid
path
server
serverpath
class ServerIdent(sid: int)

Bases: object

XrdXrootdMonRedir representing a server identification record

Parameters:sid – server identifier (see Map)
classmethod from_buffer(buffer: bytes)
sid
size = 8
struct_parser = <Struct object>
type = 240
class WindowMark(timestamp: int, prev_duration: int)

Bases: object

XrdXrootdMonRedir representing a window timing mark

Parameters:
  • timestamp – timestamp when the current window started
  • prev_duration – duration of the previous window

Note that windows are usually not adjacent: the WindowMark signifies the beginning of a new window. The previous window may have been closed an arbitrary time before.

To get the time range covered by a window, the prev_duration of the next window is required:

# window => tuple(start, end)
window_range[i] = (
    window_marks[i].timestamp,
    window_marks[i].timestamp + window_marks[i+1].prev_duration
)
arg0
arg1
classmethod from_buffer(buffer: bytes)
prev_duration
size = 8
struct_parser = <Struct object>
timestamp
type = 0
class WindowMarkArg0View(window: xrootdlib.structs.XrdXrootdMon.redir.WindowMark)

Bases: object

type
window
class WindowMarkArg1View(window: xrootdlib.structs.XrdXrootdMon.redir.WindowMark)

Bases: object

window
class XROOTD_MON

Bases: int, enum.Enum

XROOTD_MON_XYZ constants for the r-stream

CHMOD = 1

Change file mode

LOCATE = 2

Locate file or directory

MKDIR = 7

Create a directory or path

MV = 8

Rename a file or directory

OPENC = 4

Open file for creation

OPENDIR = 3

Open director for reading

OPENR = 5

Open file for reading

OPENW = 6

Open file for writing

PREP = 9

Prepare request

QUERY = 10

Query information request

REDIRECT = 128

Redirect event generated by cmsd

REDLOCAL = 144

Redirect event generated by xrootd

REDSID = 240

Server identification

REDTIME = 0

Window timing mark

RM = 11

Remove a file

RMDIR = 12

Remove a directory

STAT = 13

Stat a file or directory

TRUNC = 14

Truncate a file