XRootD
Loading...
Searching...
No Matches
XrdThrottle::Configuration Class Reference

#include <XrdThrottleConfig.hh>

Collaboration diagram for XrdThrottle::Configuration:

Public Member Functions

 Configuration (XrdSysError &log, XrdOucEnv *env)
int Configure (const std::string &config_file)
const std::string & GetFileSystemLibrary () const
long long GetLoadshedFreq () const
const std::string & GetLoadshedHost () const
long long GetLoadshedPort () const
long long GetMaxConn () const
long long GetMaxOpen () const
long long GetMaxWait () const
long long GetThrottleConcurrency () const
long long GetThrottleDataRate () const
long long GetThrottleIOPSRate () const
long long GetThrottleRecomputeIntervalMS () const
int GetTraceLevels () const
const std::string & GetUserConfigFile () const

Detailed Description

Definition at line 37 of file XrdThrottleConfig.hh.

Constructor & Destructor Documentation

◆ Configuration()

XrdThrottle::Configuration::Configuration ( XrdSysError & log,
XrdOucEnv * env )
inline

Definition at line 39 of file XrdThrottleConfig.hh.

40 : m_env(env), m_log(log)
41 {}

Member Function Documentation

◆ Configure()

int Configuration::Configure ( const std::string & config_file)

Definition at line 41 of file XrdThrottleConfig.cc.

42{
43 XrdOucEnv myEnv;
44 XrdOucStream Config(&m_log, getenv("XRDINSTANCE"), &myEnv, "(Throttle Config)> ");
45 int cfgFD;
46 if (config_file.empty()) {
47 m_log.Say("No filename specified.");
48 return 1;
49 }
50 if ((cfgFD = open(config_file.c_str(), O_RDONLY)) < 0) {
51 m_log.Emsg("Config", errno, "Unable to open configuration file", config_file.c_str());
52 return 1;
53 }
54 Config.Attach(cfgFD);
55 static const char *cvec[] = { "*** throttle (ofs) plugin config:", 0 };
56 Config.Capture(cvec);
57
58 char *var, *val;
59 int NoGo = 0;
60 while( (var = Config.GetMyFirstWord()) )
61 {
62 if (!strcmp("throttle.fslib", var)) {
63 val = Config.GetWord();
64 if (!val || !val[0]) {m_log.Emsg("Config", "fslib not specified."); continue;}
65 m_fslib = val;
66 }
67 TS_Xeq("throttle.max_open_files", xmaxopen);
68 TS_Xeq("throttle.max_active_connections", xmaxconn);
69 TS_Xeq("throttle.throttle", xthrottle);
70 TS_Xeq("throttle.loadshed", xloadshed);
71 TS_Xeq("throttle.max_wait_time", xmaxwait);
72 TS_Xeq("throttle.trace", xtrace);
73 TS_Xeq("throttle.userconfig", xuserconfig);
74 if (NoGo)
75 {
76 m_log.Emsg("Config", "Throttle configuration failed.");
77 return 1;
78 }
79 }
80 return 0;
81}
#define TS_Xeq(x, m)
Definition XrdConfig.cc:160
#define open
Definition XrdPosix.hh:76
XrdCmsConfig Config

References open, and TS_Xeq.

◆ GetFileSystemLibrary()

const std::string & XrdThrottle::Configuration::GetFileSystemLibrary ( ) const
inline

Definition at line 50 of file XrdThrottleConfig.hh.

50{ return m_fslib; }

◆ GetLoadshedFreq()

long long XrdThrottle::Configuration::GetLoadshedFreq ( ) const
inline

Definition at line 64 of file XrdThrottleConfig.hh.

64{ return m_loadshed_freq; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetLoadshedHost()

const std::string & XrdThrottle::Configuration::GetLoadshedHost ( ) const
inline

Definition at line 54 of file XrdThrottleConfig.hh.

54{ return m_loadshed_hostname; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetLoadshedPort()

long long XrdThrottle::Configuration::GetLoadshedPort ( ) const
inline

Definition at line 59 of file XrdThrottleConfig.hh.

59{ return m_loadshed_port; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetMaxConn()

long long XrdThrottle::Configuration::GetMaxConn ( ) const
inline

Definition at line 72 of file XrdThrottleConfig.hh.

72{ return m_max_conn; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetMaxOpen()

long long XrdThrottle::Configuration::GetMaxOpen ( ) const
inline

Definition at line 68 of file XrdThrottleConfig.hh.

68{ return m_max_open; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetMaxWait()

long long XrdThrottle::Configuration::GetMaxWait ( ) const
inline

Definition at line 77 of file XrdThrottleConfig.hh.

77{ return m_max_wait; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetThrottleConcurrency()

long long XrdThrottle::Configuration::GetThrottleConcurrency ( ) const
inline

Definition at line 81 of file XrdThrottleConfig.hh.

81{ return m_throttle_concurrency_limit; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetThrottleDataRate()

long long XrdThrottle::Configuration::GetThrottleDataRate ( ) const
inline

Definition at line 85 of file XrdThrottleConfig.hh.

85{ return m_throttle_data_rate; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetThrottleIOPSRate()

long long XrdThrottle::Configuration::GetThrottleIOPSRate ( ) const
inline

Definition at line 89 of file XrdThrottleConfig.hh.

89{ return m_throttle_iops_rate; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetThrottleRecomputeIntervalMS()

long long XrdThrottle::Configuration::GetThrottleRecomputeIntervalMS ( ) const
inline

Definition at line 93 of file XrdThrottleConfig.hh.

93{ return m_throttle_recompute_interval_ms; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetTraceLevels()

int XrdThrottle::Configuration::GetTraceLevels ( ) const
inline

Definition at line 97 of file XrdThrottleConfig.hh.

97{ return m_trace_levels; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

◆ GetUserConfigFile()

const std::string & XrdThrottle::Configuration::GetUserConfigFile ( ) const
inline

Definition at line 101 of file XrdThrottleConfig.hh.

101{ return m_user_config_file; }

Referenced by XrdThrottleManager::FromConfig().

Here is the caller graph for this function:

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