xrootd
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
XrdSsiProvider Class Referenceabstract

#include <XrdSsiProvider.hh>

Public Types

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

Public Member Functions

virtual XrdSsiServiceGetService (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 void SetTimeout (tmoType what, int tmoval)
 
 XrdSsiProvider ()
 Constructor. More...
 

Static Public Attributes

static const int SsiVersion = 0x00010000
 

Protected Member Functions

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

Member Enumeration Documentation

◆ 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
rNamePointer to the resource name.
contactthe 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 

◆ tmoType

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

Parameters
whatOne of the enums below specifying the timeout is to be set.
tmovalThe 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)

Constructor & Destructor Documentation

◆ XrdSsiProvider()

XrdSsiProvider::XrdSsiProvider ( )
inline

Constructor.

◆ ~XrdSsiProvider()

virtual XrdSsiProvider::~XrdSsiProvider ( )
inlineprotectedvirtual

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

Member Function Documentation

◆ GetService()

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

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

Parameters
eInfothe object where error status is to be placed.
contactthe 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. This is a null string if the call is being made server-side. Note that only one service object is obtained by a server.
oHoldthe 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.

References XrdSsiErrInfo::Set().

◆ GetVersion()

int XrdSsiProvider::GetVersion ( )
inline

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
logPpointer to the logger object for message routing.
clsPpointer 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).
cfgFnfile path to the the conifiguration file.
parmsconifiguration parameters, if any.
argcThe count of command line arguments (always >= 1).
argvPointer 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.

◆ QueryResource()

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

◆ ResourceAdded()

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

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
rNamePointer to the resource name that was added.

◆ ResourceRemoved()

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

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
rNamePointer to the resource name that was removed.

◆ SetCBThreads()

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

Set the maximum number of threads for handling callbacks (client-side only). When the maximum is reached, callbacks wait until an in-progress callback completes. This method must be called prior to calling GetService(). This method has no meaning server-side and is ignored.

Parameters
cbNumThe maximum number of threads to be used for callbacks and sets the maximum number of active callbacks (default 300). The maximum value is 32767. Note that the nproc ulimit is final arbiter of the actual number of threads to use.
ntNumThe maximum number of threads to be used to handle network traffic. The minimum is 3, the default is 10% of cbNum but no more than 100.

◆ SetTimeout()

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

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.

Referenced by GetVersion().


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