Loading...
Searching...
No Matches
XrdSsiProvider Class Referenceabstract

`#include <XrdSsiProvider.hh>`

Inheritance diagram for XrdSsiProvider:
Collaboration diagram for XrdSsiProvider:

## Public Types

enum | CTL_Cmd { CTL_None = 0 }
enum | rStat { notPresent = 0 , isPresent , isPending }
enum | tmoType { connect_N =0 , connect_T , idleClose , request_T , response_T , stream_T }

## Public Member Functions

| XrdSsiProvider ()
| Constructor.
virtual int | Control (CTL_Cmd cmd, const void *argP, void *&resP)
virtual XrdSsiService * | GetService (XrdSsiErrInfo &eInfo, const std::string &contact, int oHold=256)
int | GetVersion ()
virtual bool | Init (XrdSsiLogger *logP, XrdSsiCluster *clsP, std::string cfgFn, std::string parms, int argc, char **argv)=0
virtual rStat | QueryResource (const char *rName, const char *contact=0)=0
virtual void | ResourceAdded (const char *rName)
virtual void | ResourceRemoved (const char *rName)
virtual void | SetCBThreads (int cbNum, int ntNum=0)
virtual bool | SetConfig (XrdSsiErrInfo &eInfo, std::string &optname, int optvalue)
virtual void | SetSpread (short ssz)
virtual void | SetTimeout (tmoType what, int tmoval)

## Static Public Attributes

static const int | SsiVersion = 0x00010000

## Protected Member Functions

virtual | ~XrdSsiProvider ()
| Destructor. The providor object cannot be and never is explicitly deleted.

## Detailed Description

Definition at line 88 of file XrdSsiProvider.hh.

## Member Enumeration Documentation

## CTL_Cmd

enum XrdSsiProvider::CTL_Cmd

Issue a control operation (future).

Parameters

  cmd | The control command.
  argP | The operational argument cast to a void pointer.
  resP | A reference to the pointer to hold the operational result object if any.

Returns
  Upon success 0 is returned and if a resutt is returned is must cast to te correct pointer type and deleted,when no longer needed. Upon failure, -errno is returned.

Enumerator
CTL_None |

Definition at line 105 of file XrdSsiProvider.hh.

{CTL_None = 0};
XrdSsiProvider::CTL_None
@ CTL_None
Definition XrdSsiProvider.hh:105

## rStat

enum XrdSsiProvider::rStat

Obtain the status of a resource. Client-side: This method can be called to obtain the availability of a resource relative to a particular endpoint. Server-Side: When configured via oss.statlib directive, this is called server-side by the XrdSsiCluster object to see if the resource can be provided by the providor via a service object. This method is also used server-side to determine resource status.

Parameters

  rName | Pointer to the resource name.
  contact | the point of first contact that would be used to process the request relative to the resource (see ProcessRequest()). A nil pointer indicates a query for availibity at the local node (e.g. a query for local resource availability).

Returns
  One of the rStat enums, as follows: notPresent - resource not present on this node. isPresent - resource is present and can be immediately used, if necessary. isPending - resource is present but is not in an immediately usable state, access may wait.

Enumerator
notPresent |
isPresent |
isPending |

Definition at line 203 of file XrdSsiProvider.hh.

{notPresent = 0, isPresent, isPending};
XrdSsiProvider::notPresent
@ notPresent
Definition XrdSsiProvider.hh:203
XrdSsiProvider::isPending
@ isPending
Definition XrdSsiProvider.hh:203
XrdSsiProvider::isPresent
@ isPresent
Definition XrdSsiProvider.hh:203

## tmoType

enum XrdSsiProvider::tmoType

Set default global timeouts. By default, all timeouts are set to infinity.

Parameters

  what | One of the enums below specifying the timeout is to be set.
  tmoval | The timeout valid in seconds. A value of <= 0 is ignored.

Enumerator
connect_N | Number of times to try connection (client).
connect_T | Time to wait for a connection (client).
idleClose | Time before an idle socket is closed (client).
request_T | Time to wait for a request to finsish(client).
response_T | Time for client to wait for a resp (Server).
stream_T | Time to wait for socket activity (Client).

Definition at line 310 of file XrdSsiProvider.hh.

{connect_N=0,
connect_T,
idleClose,
request_T,
response_T,
stream_T
};
XrdSsiProvider::idleClose
@ idleClose
Time before an idle socket is closed (client).
Definition XrdSsiProvider.hh:312
XrdSsiProvider::stream_T
@ stream_T
Time to wait for socket activity (Client).
Definition XrdSsiProvider.hh:315
XrdSsiProvider::connect_T
@ connect_T
Time to wait for a connection (client).
Definition XrdSsiProvider.hh:311
XrdSsiProvider::request_T
@ request_T
Time to wait for a request to finsish(client).
Definition XrdSsiProvider.hh:313
XrdSsiProvider::response_T
@ response_T
Time for client to wait for a resp (Server).
Definition XrdSsiProvider.hh:314
XrdSsiProvider::connect_N
@ connect_N
Number of times to try connection (client).
Definition XrdSsiProvider.hh:310

## Constructor & Destructor Documentation

## XrdSsiProvider()

XrdSsiProvider::XrdSsiProvider | ( |  | ) |

inline

Constructor.

Definition at line 324 of file XrdSsiProvider.hh.

{}

## ~XrdSsiProvider()

virtual XrdSsiProvider::~XrdSsiProvider | ( |  | ) |

inline protected virtual

Destructor. The providor object cannot be and never is explicitly deleted.

Definition at line 331 of file XrdSsiProvider.hh.

{}

## Member Function Documentation

## Control()

virtual int XrdSsiProvider::Control | ( | CTL_Cmd | cmd,
|  | const void * | argP,
|  | void *& | resP )

inline virtual

Definition at line 107 of file XrdSsiProvider.hh.

{(void)cmd; (void)argP; (void)resP;
return (cmd == CTL_None ? 0 : -ENOTSUP);
}

References CTL_None.

## GetService()

virtual XrdSsiService * XrdSsiProvider::GetService | ( | XrdSsiErrInfo & | eInfo,
|  | const std::string & | contact,
|  | int | oHold = 256 )

inline virtual

Obtain a service object (client-side or server-side).

Parameters

  eInfo | the object where error status is to be placed.

  contact

  the point of first contact when processing a request. The contact may be "host:port" where "host" is a DNS name, an IPV4 address (i.e. d.d.d.d), or an IPV6 address (i.e. [x:x:x:x:x:x]), and "port" is either a numeric port number or the service name assigned to the port number. You may specify more than one contact by separating each with a comma (e.g. host1:port,host2:port,...). Each host must be equivalent with respect to request processing. This is a null string if the call is being made server-side. Note that only one service object is obtained by a server.

  oHold | the maximum number of request objects that should be held in reserve for future calls.

Returns
  =0 A service object could not be created, eInfo has the reason.
  !0 Pointer to a service object.

Reimplemented in XrdSsiClientProvider.

Definition at line 134 of file XrdSsiProvider.hh.

{eInfo.Set("Service not implemented!", ENOTSUP);
return 0;
}
XrdSsiErrInfo::Set
void Set(const char *eMsg=0, int eNum=0, int eArg=0)
Definition XrdSsiErrInfo.hh:103

References XrdSsiErrInfo::Set().

Here is the call graph for this function:

## GetVersion()

int XrdSsiProvider::GetVersion | ( |  | ) |

inline

Definition at line 149 of file XrdSsiProvider.hh.

{return SsiVersion;}
XrdSsiProvider::SsiVersion
static const int SsiVersion
Definition XrdSsiProvider.hh:147

References SsiVersion.

## Init()

virtual bool XrdSsiProvider::Init | ( | XrdSsiLogger * | logP,
|  | XrdSsiCluster * | clsP,
|  | std::string | cfgFn,
|  | std::string | parms,
|  | int | argc,
|  | char ** | argv )

pure virtual

Initialize server-side processing. This method is invoked prior to any other method in the XrdSsiProvider object.

Parameters

  logP | pointer to the logger object for message routing.
  clsP | pointer to the cluster management object. This pointer is nil when a service object is being obtained by an unclustered system (i.e. a stand-alone server).
  cfgFn | file path to the the conifiguration file.
  parms | conifiguration parameters, if any.
  argc | The count of command line arguments (always >= 1).
  argv | Pointer to a null terminated array of tokenized command line arguments. These arguments are taken from the command line after the "-+xrdssi" option (see invoking xrootd), if present. The first argument is always the same as argv[0] in main().

Returns
  true Initialization succeeded.
  =0 Initialization failed. The method should include an error message in the log indicating why initialization failed.

Implemented in XrdSsiClientProvider.

## QueryResource()

virtual rStat XrdSsiProvider::QueryResource | ( | const char * | rName,
|  | const char * | contact = 0 )

pure virtual

Implemented in XrdSsiClientProvider.

## ResourceAdded()

virtual void XrdSsiProvider::ResourceAdded | ( | const char * | rName | ) |

inline virtual

Notify provider that a resource was added to this node. This method is called by the cmsd process in response to calling XrdSsiCluster::Added() in the xrootd process. This method only is invoked on resource storage nodes (i.e. all.role server).

Parameters

  rName | Pointer to the resource name that was added.

Definition at line 218 of file XrdSsiProvider.hh.

{}

## ResourceRemoved()

virtual void XrdSsiProvider::ResourceRemoved | ( | const char * | rName | ) |

inline virtual

Notify provider that a resource was removed from this node. This method is called by the cmsd process in response to calling XrdSsiCluster::Removed() in the xrootd process. This method only is invoked on resource storage nodes (i.e. all.role server).

Parameters

  rName | Pointer to the resource name that was removed.

Definition at line 229 of file XrdSsiProvider.hh.

{}

## SetCBThreads()

virtual void XrdSsiProvider::SetCBThreads | ( | int | cbNum,
|  | int | ntNum = 0 )

inline virtual

Set thread values. This call is deprecated. You should use SetConfig(). This method has no meaning server-side and is ignored.

Parameters

  cbNum | Equivalent to SetConfig("cbThreads", cbNum).
  ntNum | Equivalent to SetConfig("netThreads", ntNum).

Reimplemented in XrdSsiClientProvider.

Definition at line 239 of file XrdSsiProvider.hh.

{(void)cbNum; (void)ntNum;}

## SetConfig()

virtual bool XrdSsiProvider::SetConfig | ( | XrdSsiErrInfo & | eInfo,
|  | std::string & | optname,
|  | int | optvalue )

inline virtual

Set a configuration option for execution behaviour.

Parameters

  eInfo | The object where error status is to be placed.
  optname | The name of the option (see table below).
  optvalue | The value to be set for the option.

Returns
  true Option set.
  false Option not set, eInfo holds the reason.

Note
  All calls to SetConfig() must occur before GetService() is called.

The following table list the currently supported keynames and what the value actually does. These options only apply to the client. The options must be set before calling GetService().

cbThreads The maximum number of threads to be used for callbacks and sets the maximum number of active callbacks (default 300). set a value between 1 and 32767. Note: the nproc ulimit is final arbiter of the actual number of threads to use. hiResTime enables the use of a high resolution timer in log message timestamps. The optvalue is immaterial as this simply sets feature on and once set on cannot be set off. netThreads The maximum number of threads to be used to handle network traffic. The minimum is 3, the default is 10% of cbThreads but no more than 100. pollers The number network interrupt pollers to run. Larger values allow the initial fielding of more interrupts. Care must be taken to not overrun netThreads. The default is 3. The suggested maximum is the number of cores. reqDispatch Request dispatch algorithm to use when contact has multiple endpoints. Choose one of: < 0: Random choice each time. = 0: Use DNS order. > 0: Round robbin (the default).

Reimplemented in XrdSsiClientProvider.

Definition at line 279 of file XrdSsiProvider.hh.

{(void)optname; (void)optvalue; return 0;}

## SetSpread()

virtual void XrdSsiProvider::SetSpread | ( | short | ssz | ) |

inline virtual

Set the client-size request spread size.

Parameters

  ssz

  The spread value which may be <0, -0, or >0: >0 The maximum number of connections to use to to handle requests. No more or less are used until reset. =0 Turns on auto-tuning using curent setting. The initial default is 4. The size is automatically increased to accomodate the number of simultaeous requests. <0 Turns on auto-tuning using curent setting using the abs(sval) as the new spread value. The size is The size is automatically increased to accomodate the number of simultaeous requests.

Note
  This method may be called at any time. An abs(ssz) value > 1024 is set to 1024. Auto-tuning must be requested; it's not the default.

Reimplemented in XrdSsiClientProvider.

Definition at line 301 of file XrdSsiProvider.hh.

{(void)ssz;}

## SetTimeout()

virtual void XrdSsiProvider::SetTimeout | ( | tmoType | what,
|  | int | tmoval )

inline virtual

Reimplemented in XrdSsiClientProvider.

Definition at line 318 of file XrdSsiProvider.hh.

{(void)what; (void)tmoval;}

## Member Data Documentation

## SsiVersion

const int XrdSsiProvider::SsiVersion = 0x00010000

static

Obtain the version of the abstract class used by underlying implementation. The version returned must match the version compiled in the loading library. If it does not, initialization fails.

Definition at line 147 of file XrdSsiProvider.hh.

Referenced by GetVersion().

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

- XrdSsiProvider.hh