TXProofMgr.h

Go to the documentation of this file.
00001 // @(#)root/proofx:$Id: TXProofMgr.h 30171 2009-09-15 13:43:12Z ganis $
00002 // Author: G. Ganis, Nov 2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TXProofMgr
00013 #define ROOT_TXProofMgr
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TXProofMgr                                                           //
00019 //                                                                      //
00020 // The PROOF manager interacts with the PROOF server coordinator to     //
00021 // create or destroy a PROOF session, attach to or detach from          //
00022 // existing one, and to monitor any client activity on the cluster.     //
00023 // At most one manager instance per server is allowed.                  //
00024 //                                                                      //
00025 //////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TProofMgr
00028 #include "TProofMgr.h"
00029 #endif
00030 #ifndef ROOT_TUrl
00031 #include "TUrl.h"
00032 #endif
00033 #ifndef ROOT_TXHandler
00034 #include "TXHandler.h"
00035 #endif
00036 
00037 //
00038 // XPROOF client version: increase whenever a non backward compatible
00039 // change occur
00040 //  ->1      first version being tested by ALICE
00041 const Int_t kXPROOF_Protocol = 1; 
00042 
00043 class TStopwatch;
00044 class TXSocket;
00045 
00046 class TXProofMgr : public TProofMgr, public TXHandler {
00047 
00048 private:
00049 
00050    TXSocket   *fSocket; // Connection to XRD
00051 
00052    Int_t Init(Int_t loglevel = -1);
00053 
00054    void CpProgress(const char *pfx, Long64_t bytes,
00055                    Long64_t size, TStopwatch *watch, Bool_t cr = kFALSE);
00056    TObjString *Exec(Int_t action,
00057                     const char *what, const char *how, const char *where);
00058 
00059 public:
00060    TXProofMgr(const char *url, Int_t loglevel = -1, const char *alias = "");
00061    virtual ~TXProofMgr();
00062 
00063    Bool_t      HandleInput(const void *);
00064    Bool_t      HandleError(const void *in = 0);
00065 
00066    Bool_t      IsValid() const { return fSocket; }
00067    void        SetInvalid();
00068 
00069    TProof     *AttachSession(Int_t id, Bool_t gui = kFALSE)
00070                       { return TProofMgr::AttachSession(id, gui); }
00071    TProof     *AttachSession(TProofDesc *d, Bool_t gui = kFALSE);
00072    void        DetachSession(Int_t, Option_t * = "");
00073    void        DetachSession(TProof *, Option_t * = "");
00074    TProofLog  *GetSessionLogs(Int_t ridx = 0, const char *stag = 0,
00075                               const char *pattern = "-v \"| SvcMsg\"");
00076    Bool_t      MatchUrl(const char *url);
00077    void        ShowROOTVersions();
00078    TList      *QuerySessions(Option_t *opt = "S");
00079    TObjString *ReadBuffer(const char *file, Long64_t ofs, Int_t len);
00080    TObjString *ReadBuffer(const char *file, const char *pattern);
00081    Int_t       Reset(Bool_t hard = kFALSE, const char *usr = 0);
00082    Int_t       SendMsgToUsers(const char *msg, const char *usr = 0);
00083    void        SetROOTVersion(const char *tag);
00084    void        ShowWorkers();
00085 
00086    // Remote file system actions
00087    Int_t       Cp(const char *src, const char *dst = 0, const char *opts = 0);
00088    void        Find(const char *what = "~/", const char *how = "-type f", const char *where = 0);
00089    void        Grep(const char *what, const char *how = 0, const char *where = 0);
00090    void        Ls(const char *what = "~/", const char *how = 0, const char *where = 0);
00091    void        More(const char *what, const char *how = 0, const char *where = 0);
00092    Int_t       Rm(const char *what, const char *how = 0, const char *where = 0);
00093    void        Tail(const char *what, const char *how = 0, const char *where = 0);
00094    Int_t       Md5sum(const char *what, TString &sum, const char *where = 0);
00095    Int_t       Stat(const char *what, FileStat_t &st, const char *where = 0);
00096 
00097    Int_t       GetFile(const char *remote, const char *local, const char *opt = 0);
00098    Int_t       PutFile(const char *local, const char *remote, const char *opt = 0);
00099 
00100    ClassDef(TXProofMgr,0)  // XrdProofd PROOF manager interface
00101 };
00102 
00103 #endif

Generated on Tue Jul 5 14:52:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1