Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TXProofMgr.h
Go to the documentation of this file.
1// @(#)root/proofx:$Id$
2// Author: G. Ganis, Nov 2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TXProofMgr
13#define ROOT_TXProofMgr
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TXProofMgr //
19// //
20// The PROOF manager interacts with the PROOF server coordinator to //
21// create or destroy a PROOF session, attach to or detach from //
22// existing one, and to monitor any client activity on the cluster. //
23// At most one manager instance per server is allowed. //
24// //
25//////////////////////////////////////////////////////////////////////////
26
27#include "TProofMgr.h"
28#include "TUrl.h"
29#include "TXHandler.h"
30
31//
32// XPROOF client version: increase whenever a non backward compatible
33// change occur
34// ->1 first version being tested by ALICE
36
37class TStopwatch;
38class TXSocket;
39
40class TXProofMgr : public TProofMgr, public TXHandler {
41
42private:
43
44 TXSocket *fSocket; // Connection to XRD
45
46 Int_t Init(Int_t loglevel = -1);
47
48 void CpProgress(const char *pfx, Long64_t bytes,
49 Long64_t size, TStopwatch *watch, Bool_t cr = kFALSE);
50 TObjString *Exec(Int_t action,
51 const char *what, const char *how, const char *where);
52
53public:
54 TXProofMgr(const char *url, Int_t loglevel = -1, const char *alias = "");
55 ~TXProofMgr() override;
56
57 Bool_t HandleInput(const void *) override;
58 Bool_t HandleError(const void *in = 0) override;
59
60 Bool_t IsValid() const override { return fSocket; }
61 void SetInvalid() override;
62
63 TProof *AttachSession(Int_t id, Bool_t gui = kFALSE) override
64 { return TProofMgr::AttachSession(id, gui); }
65 TProof *AttachSession(TProofDesc *d, Bool_t gui = kFALSE) override;
66 void DetachSession(Int_t, Option_t * = "") override;
67 void DetachSession(TProof *, Option_t * = "") override;
68 const char *GetMssUrl(Bool_t = kFALSE) override;
69 TProofLog *GetSessionLogs(Int_t ridx = 0, const char *stag = 0,
70 const char *pattern = "-v \"| SvcMsg\"",
71 Bool_t rescan = kFALSE) override;
72 Bool_t MatchUrl(const char *url) override;
73 void ShowROOTVersions() override;
74 TList *QuerySessions(Option_t *opt = "S") override;
75 TObjString *ReadBuffer(const char *file, Long64_t ofs, Int_t len) override;
76 TObjString *ReadBuffer(const char *file, const char *pattern) override;
77 Int_t Reset(Bool_t hard = kFALSE, const char *usr = 0) override;
78 Int_t SendMsgToUsers(const char *msg, const char *usr = 0) override;
79 Int_t SetROOTVersion(const char *tag) override;
80 void ShowWorkers() override;
81
82 // Remote file system actions
83 Int_t Cp(const char *src, const char *dst = 0, const char *opts = 0) override;
84 void Find(const char *what = "~/", const char *how = "-type f", const char *where = 0) override;
85 void Grep(const char *what, const char *how = 0, const char *where = 0) override;
86 void Ls(const char *what = "~/", const char *how = 0, const char *where = 0) override;
87 void More(const char *what, const char *how = 0, const char *where = 0) override;
88 Int_t Rm(const char *what, const char *how = 0, const char *where = 0) override;
89 void Tail(const char *what, const char *how = 0, const char *where = 0) override;
90 Int_t Md5sum(const char *what, TString &sum, const char *where = 0) override;
91 Int_t Stat(const char *what, FileStat_t &st, const char *where = 0) override;
92
93 Int_t GetFile(const char *remote, const char *local, const char *opt = 0) override;
94 Int_t PutFile(const char *local, const char *remote, const char *opt = 0) override;
95
96 ClassDefOverride(TXProofMgr,0) // XrdProofd PROOF manager interface
97};
98
99#endif
#define d(i)
Definition RSha256.hxx:102
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
const Int_t kXPROOF_Protocol
Definition TXProofMgr.h:35
A doubly linked list.
Definition TList.h:38
Collectable string class.
Definition TObjString.h:28
Implementation of the PROOF session log handler.
Definition TProofLog.h:32
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
Definition TProofMgr.h:43
virtual TProof * AttachSession(Int_t, Bool_t=kFALSE)
Dummy version provided for completeness.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition TProof.h:316
Stopwatch class.
Definition TStopwatch.h:28
Basic string class.
Definition TString.h:139
Handler of asynchronous events for XProofD sockets.
Definition TXHandler.h:28
Implementation of the functionality provided by TProofMgr in the case of a xproofd-based session.
Definition TXProofMgr.h:40
void Ls(const char *what="~/", const char *how=0, const char *where=0) override
Run 'ls' on the nodes.
void Tail(const char *what, const char *how=0, const char *where=0) override
Run 'tail' on the nodes.
Int_t Reset(Bool_t hard=kFALSE, const char *usr=0) override
Send a cleanup request for the sessions associated with the current user.
~TXProofMgr() override
Destructor: close the connection.
void CpProgress(const char *pfx, Long64_t bytes, Long64_t size, TStopwatch *watch, Bool_t cr=kFALSE)
Print file copy progress.
Bool_t IsValid() const override
Definition TXProofMgr.h:60
void ShowWorkers() override
Show available workers.
TList * QuerySessions(Option_t *opt="S") override
Get list of sessions accessible to this manager.
void SetInvalid() override
Invalidate this manager by closing the connection.
void ShowROOTVersions() override
Display what ROOT versions are available on the cluster.
TXSocket * fSocket
Definition TXProofMgr.h:44
Int_t Md5sum(const char *what, TString &sum, const char *where=0) override
Run 'md5sum' on one of the nodes.
void DetachSession(Int_t, Option_t *="") override
Detach session with 'id' from its proofserv.
Int_t SendMsgToUsers(const char *msg, const char *usr=0) override
Send a message to connected users.
Int_t GetFile(const char *remote, const char *local, const char *opt=0) override
Get file 'remote' into 'local' from the master.
TProof * AttachSession(Int_t id, Bool_t gui=kFALSE) override
Dummy version provided for completeness.
Definition TXProofMgr.h:63
void More(const char *what, const char *how=0, const char *where=0) override
Run 'more' on the nodes.
Int_t Cp(const char *src, const char *dst=0, const char *opts=0) override
Copy files in/out of the sandbox.
Int_t SetROOTVersion(const char *tag) override
Set the default ROOT version to be used.
Int_t Rm(const char *what, const char *how=0, const char *where=0) override
Run 'rm' on the nodes.
Int_t PutFile(const char *local, const char *remote, const char *opt=0) override
Put file 'local'to 'remote' to the master If opt is "force", the file, if it exists remotely,...
Int_t Stat(const char *what, FileStat_t &st, const char *where=0) override
Run 'stat' on one of the nodes.
Bool_t HandleError(const void *in=0) override
Handle error on the input socket.
Int_t Init(Int_t loglevel=-1)
Do real initialization: open the connection and set the relevant variables.
TObjString * Exec(Int_t action, const char *what, const char *how, const char *where)
Execute 'action' (see EAdminExecType in 'XProofProtocol.h') at 'where' (default master),...
Bool_t HandleInput(const void *) override
Handle asynchronous input on the socket.
const char * GetMssUrl(Bool_t=kFALSE) override
Gets the URL to be prepended to paths when accessing the MSS associated with the connected cluster,...
void Grep(const char *what, const char *how=0, const char *where=0) override
Run 'grep' on the nodes.
Bool_t MatchUrl(const char *url) override
Checks if 'url' refers to the same user@host:port entity as the URL in memory.
void Find(const char *what="~/", const char *how="-type f", const char *where=0) override
Run 'find' on the nodes.
TObjString * ReadBuffer(const char *file, Long64_t ofs, Int_t len) override
Read, via the coordinator, 'len' bytes from offset 'ofs' of 'file'.
TProofLog * GetSessionLogs(Int_t ridx=0, const char *stag=0, const char *pattern="-v \"| SvcMsg\"", Bool_t rescan=kFALSE) override
Get logs or log tails from last session associated with this manager instance.
High level handler of connections to XProofD.
Definition TXSocket.h:59
Definition file.py:1
static const char * what
Definition stlLoader.cc:6
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2345