XRootD
Loading...
Searching...
No Matches
XrdCmsSelect.hh
Go to the documentation of this file.
1#ifndef __CMS_SELECT_HH
2#define __CMS_SELECT_HH
3/******************************************************************************/
4/* */
5/* X r d C m s S e l e c t . h h */
6/* */
7/* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <netinet/in.h>
34
35#include "XrdCms/XrdCmsKey.hh"
36
37/******************************************************************************/
38/* C l a s s X r d C m s S e l e c t */
39/******************************************************************************/
40
41class XrdCmsRRQInfo;
42
44{
45public:
46XrdCmsKey Path; // In: Path to select or lookup in the cache
47XrdCmsRRQInfo *InfoP; // In: Fast redirect routing
48SMask_t nmask; // In: Nodes to avoid
49SMask_t smask; // Out: Nodes selected
50struct iovec *iovP; // In: Prepare notification I/O vector
51int iovN; // In: Prepare notification I/O vector count
52int Opts; // In: One or more of the following enums
53unsigned int AltHash; // In: Alternate hash for affinity when UseAH set
55
56enum {Write = 0x00010, // File will be open in write mode (select & cache)
57 NewFile = 0x00020, // File will be created may not exist (select)
58 Online = 0x00040, // Only consider online files (select & prep)
59 Trunc = 0x00080, // File will be truncated (Select only)
60 Create = 0x000A0, // Create file, truncate if exists
61 Defer = 0x00100, // Do not select a server now (prep only)
62 Peers = 0x00200, // Peer clusters may be selected (select only)
63 Refresh = 0x00400, // Cache should be refreshed (all)
64 Asap = 0x00800, // Respond as soon as possible (locate only)
65 noBind = 0x01000, // Do not new bind file to a server (select only)
66 isMeta = 0x02000, // Only inode information being changed(select only)
67 Freshen = 0x04000, // Freshen access times (prep only)
68 Replica = 0x08000, // File will be replicated (w/ Create) (select only)
69 NoTryLim= 0x10000, // Do not apply the retry limit
70 MWFiles = 0x20000, // Multiwrite files allowed (select only)
71 Advisory= 0x40000, // Cache A/D is advisory (no delay) (have & cache)
72 Pending = 0x80000, // File being staged (have & cache)
73 ifWant = 0x0000f, // XrdNetIF::ifType encoding location
74
75 Pack = 0x00100000, // Packed selection
76 UseRef = 0x00200000, // Selection by reference count only
77 isDir = 0x00400000, // This selection is for a directory
78 UseAH = 0x08000000 // Use alternate hash for affinity
79 };
80
81struct {SMask_t wf; // Out: Writable locations
82 SMask_t hf; // Out: Existing locations
83 SMask_t pf; // Out: Pending locations
84 SMask_t bf; // Out: Bounced locations
85 } Vec;
86
87static const int SelDSZ = 256;
88
89struct {int Port; // Out: Target node port number
90 char Data[SelDSZ]; // Out: Target node or error message
91 int DLen; // Out: Length of Data including null byte
93
94 XrdCmsSelect(int opts=0, char *thePath=0, int thePLen=0)
95 : Path(thePath,thePLen), InfoP(0), smask(0), Opts(opts)
96 {Resp.Port = 0; *Resp.Data = '\0'; Resp.DLen = 0;}
98};
99
100/******************************************************************************/
101/* C l a s s X r d C m s S e l e c t e d */
102/******************************************************************************/
103
104class XrdCmsSelected // Argument to List() after select or locate
105{
106public:
107
108static const int IdentSize = 264;
109
112int Id;
113int IdentLen; // 12345678901234567890123456
114char Ident[IdentSize]; // [::123.123.123.123]:123456
118int Shrin; // Share intervals used
119char Share; // Share
120char RoleID; // Role Identifier
121char Rsvd[2];
122int Status; // One of the following
123
124enum {Disable = 0x0001,
125 NoStage = 0x0002,
126 Offline = 0x0004,
127 Suspend = 0x0008,
128 isRW = 0x0010,
129 isMangr = 0x0100
130 };
131
133
135};
136
137/******************************************************************************/
138/* C l a s s X r d C m s S e l e c t o r */
139/******************************************************************************/
140
142{
143public:
144const char *reason;
145 int delay;
146 short nPick;
150 bool xFull;
151 bool xNoNet;
152 bool xOff;
153 bool xOvld;
154 bool xSusp;
155
156inline void Reset() {reason = 0; delay = 0; nPick = 0;
157 xFull = xNoNet = xOff = xOvld = xSusp = false;
158 }
159};
160#endif
unsigned long long SMask_t
struct myOpts opts
struct iovec * iovP
struct XrdCmsSelect::@84 Vec
XrdCmsSelect(int opts=0, char *thePath=0, int thePLen=0)
static const int SelDSZ
struct XrdCmsSelect::@85 Resp
XrdCmsRRQInfo * InfoP
XrdCmsKey Path
unsigned int AltHash
XrdCmsSelected(XrdCmsSelected *np=0)
static const int IdentSize
char Ident[IdentSize]
XrdCmsSelected * next
const char * reason