![]() |
XRootD
|
#include <XrdCmsRedirLocal.hh>
Public Member Functions | |
XrdCmsRedirLocal (XrdSysLogger *Logger, int opMode, int myPort, XrdOss *theSS) | |
Constructor. More... | |
~XrdCmsRedirLocal () | |
Destructor. More... | |
void | Added (const char *path, int Pend=0) |
int | Configure (const char *cfn, char *Parms, XrdOucEnv *EnvInfo) |
Configure the nativeCmsFinder. More... | |
int | Forward (XrdOucErrInfo &Resp, const char *cmd, const char *arg1=0, const char *arg2=0, XrdOucEnv *Env1=0, XrdOucEnv *Env2=0) |
int | isRemote () |
void | loadConfig (const char *filename) |
int | Locate (XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *EnvInfo) |
XrdOucTList * | Managers () |
int | Prepare (XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0) |
int | Release (int n=1) |
void | Removed (const char *path) |
int | Reserve (int n=1) |
int | Resource (int n) |
void | Resume (int Perm=1) |
int | Space (XrdOucErrInfo &Resp, const char *path, XrdOucEnv *EnvInfo) |
void | Suspend (int Perm=1) |
![]() | |
XrdCmsClient (Persona acting) | |
virtual | ~XrdCmsClient () |
Destructor. More... | |
virtual void | Utilization (unsigned int util, bool alert=false) |
Public Attributes | |
bool | httpRedirect |
std::string | localroot |
XrdCmsClient * | nativeCmsFinder |
used to forward requests to CmsFinder with regular implementation More... | |
bool | readOnlyredirect |
XrdSysError | Say |
Additional Inherited Members | |
![]() | |
enum | Persona { amLocal , amRemote , amTarget } |
![]() | |
Persona | myPersona |
Definition at line 44 of file XrdCmsRedirLocal.hh.
XrdCmsRedirLocal::XrdCmsRedirLocal | ( | XrdSysLogger * | Logger, |
int | opMode, | ||
int | myPort, | ||
XrdOss * | theSS | ||
) |
Constructor.
Definition at line 34 of file XrdCmsRedirLocal.cc.
References XrdGlobal::Logger, XrdSysError::logger(), and Say.
XrdCmsRedirLocal::~XrdCmsRedirLocal | ( | ) |
|
inlinevirtual |
Notify the cms of a newly added file or a file whose state has changed on a data server node.
path | The logical file name. |
Pend | When true, the file is scheduled to be present in the future (e.g. copied in). |
Reimplemented from XrdCmsClient.
Definition at line 54 of file XrdCmsRedirLocal.hh.
References XrdCmsClient::Added(), and nativeCmsFinder.
|
virtual |
Configure the nativeCmsFinder.
Implements XrdCmsClient.
Definition at line 50 of file XrdCmsRedirLocal.cc.
References XrdCmsClient::Configure(), XrdSysError::Emsg(), loadConfig(), localroot, nativeCmsFinder, and Say.
|
inlinevirtual |
Relay a meta-operation to all nodes in the cluster.
This method is only used on manager nodes and is enabled by the ofs.forward directive.
Resp | Object where messages are to be returned. |
cmd | The operation being performed (see table below). If it starts with a '+' then a response (2way) is needed. Otherwise, a best-effort is all that is all that is required and success can always be returned. |
arg1 | 1st argument to cmd. |
arg2 | 2nd argument to cmd, which may be null if none exists. |
Env1 | Associated environmental information for arg1 (e.g., cgi info which can be retrieved by Env1->Env(<len>)). |
Env2 | Associated environmental information for arg2 (e.g., cgi info which can be retrieved by Env1->Env(<len>)). |
cmd arg1 arg2 cmd arg1 arg2 -------- ------ ------ -------- ------ ------ [+]chmod <path> <mode %o> [+]rmdir <path> 0 [+]mkdir <path> <mode %o> [+]mv <oldp> <newp> [+]mkpath <path> <mode %o> [+]trunc <path> <size %lld> [+]rm <path> 0
Reimplemented from XrdCmsClient.
Definition at line 57 of file XrdCmsRedirLocal.hh.
References XrdCmsClient::Forward(), and nativeCmsFinder.
|
inlinevirtual |
Check if this client is configured for a manager node.
Reimplemented from XrdCmsClient.
Definition at line 61 of file XrdCmsRedirLocal.hh.
References XrdCmsClient::isRemote(), and nativeCmsFinder.
void XrdCmsRedirLocal::loadConfig | ( | const char * | filename | ) |
Definition at line 68 of file XrdCmsRedirLocal.cc.
References XrdCms::Config, httpRedirect, localroot, open(), and readOnlyredirect.
Referenced by Configure().
|
virtual |
Preconditions: Writing must be enabled via xrdcmsredirlocal.readonlyredirect false Client has urlRedirSupport Client has localredirect capability Flag is one of: SFS_O_RDONLY, SFS_O_RDWR, SFS_O_WRONLY, SFS_O_CREAT, SFS_O_TRUNC [Only HTTP] Flag may also be SFS_O_STAT in case of read access [Only HTTP] xrdcmsredirlocal.httpRedirect is true in the config Locate the file, get Client IP and target IP. 1) If both are private, redirect to local does apply. set ErrInfo of param Resp and return SFS_REDIRECT. 2) Not both are private, redirect to local does NOT apply. return nativeCmsFinder->Locate, for normal redirection procedure
@Param Resp: Either set manually here or passed to nativeCmsFinder->Locate @Param path: The path of the file, passed to nativeCmsFinder->Locate @Param flags: The open flags, passed to nativeCmsFinder->Locate @Param EnvInfo: Contains the secEnv, which contains the addressInfo of the Client. Checked to see if redirect to local conditions apply
Implements XrdCmsClient.
Definition at line 122 of file XrdCmsRedirLocal.cc.
References XrdSecEntity::addrInfo, XrdNetAddrInfo::Dialect(), XrdOucEnv::Env(), XrdOucErrInfo::getErrInfo(), XrdOucErrInfo::getErrText(), XrdOucErrInfo::getUCap(), httpRedirect, XrdNetAddrInfo::isPrivate(), localroot, XrdCmsClient::Locate(), nativeCmsFinder, readOnlyredirect, XrdOucEnv::secEnv(), XrdNetAddr::Set(), XrdOucErrInfo::setErrInfo(), SFS_O_RDONLY, SFS_REDIRECT, XrdOucEI::uLclF, and XrdOucEI::uUrlOK.
|
inlinevirtual |
Obtain the list of cmsd's being used by a manager node along with their associated index numbers, origin 1.
Reimplemented from XrdCmsClient.
Definition at line 62 of file XrdCmsRedirLocal.hh.
References XrdCmsClient::Managers(), and nativeCmsFinder.
|
inlinevirtual |
Start the preparation of a file for future processing.
Resp | Object where message or response is to be returned. |
pargs | Information on which and how to prepare the file. |
Info | Associated environmental information. |
Reimplemented from XrdCmsClient.
Definition at line 63 of file XrdCmsRedirLocal.hh.
References Info, nativeCmsFinder, and XrdCmsClient::Prepare().
|
inlinevirtual |
Increases the amount of resource available. When transitioning from a a non-positive to a positive resource amount, perform a resume so that additional clients may be dispatched to this data server.
n | The value to add to the resources available (default 1). The total amount is capped by the amount specified by Resource(). |
Reimplemented from XrdCmsClient.
Definition at line 71 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Release().
|
inlinevirtual |
Notify the cmsd that a file or directory has been deleted. It is only called called on a data server node.
path | The logical file name that was removed. |
Reimplemented from XrdCmsClient.
Definition at line 66 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Removed().
|
inlinevirtual |
Decreases the amount of resources available. When the available resources becomes non-positive, perform a temporary suspend to prevent additional clients from being dispatched to this data server.
n | The value by which resources are decreased (default 1). |
Reimplemented from XrdCmsClient.
Definition at line 70 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Reserve().
|
inlinevirtual |
Enables the Reserve() & Release() methods.
n | a positive integer that specifies the amount of resource units that are available. It may be reset at any time. |
Reimplemented from XrdCmsClient.
Definition at line 69 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Resource().
|
inlinevirtual |
Resume service after a suspension.
Perm | When true the resume persist across server restarts. Otherwise, it is treated as a temporary request. |
Reimplemented from XrdCmsClient.
Definition at line 67 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Resume().
|
virtual |
Space Calls nativeCmsFinder->Space
Implements XrdCmsClient.
Definition at line 219 of file XrdCmsRedirLocal.cc.
References nativeCmsFinder, and XrdCmsClient::Space().
|
inlinevirtual |
Suspend service.
Perm | When true the suspend persist across server restarts. Otherwise, it is treated as a temporary request. |
Reimplemented from XrdCmsClient.
Definition at line 68 of file XrdCmsRedirLocal.hh.
References nativeCmsFinder, and XrdCmsClient::Suspend().
bool XrdCmsRedirLocal::httpRedirect |
Definition at line 78 of file XrdCmsRedirLocal.hh.
Referenced by loadConfig(), and Locate().
std::string XrdCmsRedirLocal::localroot |
Definition at line 79 of file XrdCmsRedirLocal.hh.
Referenced by Configure(), loadConfig(), and Locate().
XrdCmsClient* XrdCmsRedirLocal::nativeCmsFinder |
used to forward requests to CmsFinder with regular implementation
Definition at line 76 of file XrdCmsRedirLocal.hh.
Referenced by ~XrdCmsRedirLocal(), Added(), Configure(), Forward(), isRemote(), Locate(), Managers(), Prepare(), Release(), Removed(), Reserve(), Resource(), Resume(), Space(), and Suspend().
bool XrdCmsRedirLocal::readOnlyredirect |
Definition at line 77 of file XrdCmsRedirLocal.hh.
Referenced by loadConfig(), and Locate().
XrdSysError XrdCmsRedirLocal::Say |
Definition at line 80 of file XrdCmsRedirLocal.hh.
Referenced by XrdCmsRedirLocal(), and Configure().