Logo ROOT  
Reference Guide
TAlien.h
Go to the documentation of this file.
1 // @(#)root/alien:$Id$
2 // Author: Andreas Peters 5/5/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_TAlien
13 #define ROOT_TAlien
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TAlien //
19 // //
20 // Class defining interface to TAlien GRID services. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TGrid.h"
25 
26 #include "TList.h"
27 
28 class GapiUI;
29 class TGridJob;
30 class TGridJobStatusList;
31 class TMap;
32 
33 
34 class TAlien : public TGrid {
35 
36 public:
37  enum { kSTDOUT = 0, kSTDERR = 1 , kOUTPUT = 2, kENVIR = 3 };
39 
40 private:
41  // Stream content types.
42  // The streams are originally defined in the CODEC.h of
43  // the external gapiUI library.
44 
45  GapiUI *fGc; // the GapiUI object implementing the communication layer
46  TString fPwd; // working directory
47  TString fHome; // home directory with alien:// prefix
48 
49  TGridResult *Command(const char *command, bool interactive = kFALSE,
50  UInt_t stream = kOUTPUT);
51  virtual TGridResult *Query(const char *path, const char *pattern,
52  const char *conditions = "", const char *options = "");
53 
54  virtual TGridResult *LocateSites();
55  virtual TGridResult *OpenDataset(const char *lfn, const char *options = "");
56 
57 public:
58  TAlien(const char *gridurl, const char *uid=0, const char *passwd=0,
59  const char *options=0);
60  virtual ~TAlien();
61 
62  void Shell(); // start an interactive ALIEN shell
63 
64  void Stdout(); // print the stdout of the last executed command
65  void Stderr(); // print the stderr of the last executed command
66 
67  TMap *GetColumn(UInt_t stream=0, UInt_t column=0);
68  UInt_t GetNColumns(UInt_t stream);
69 
70  const char *GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row);
71  const char *GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row);
72 
73  TString Escape(const char *input);
74  virtual TGridJob *Submit(const char *jdl); // submit a grid job
75  virtual TGridJDL *GetJDLGenerator(); // get a AliEn grid JDL object
76  virtual TGridCollection* OpenCollection(const char* collectionfile, UInt_t maxentries = kTRUE);
77  virtual TGridCollection* OpenCollectionQuery(TGridResult * queryresult, Bool_t nogrouping = kFALSE);
78  virtual TGridJobStatusList* Ps(const char* options, Bool_t verbose = kTRUE);
79  virtual Bool_t KillById(TString jobid);
80  virtual Bool_t ResubmitById(TString jobid);
81 
82  //--- Catalogue Interface
83  virtual TGridResult *Ls(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
84  virtual const char *Pwd(Bool_t verbose=kFALSE);
85  virtual const char *GetHomeDirectory() { return fHome.Data(); }
86  virtual Bool_t Cd(const char *ldn="", Bool_t verbose=kFALSE);
87  virtual Int_t Mkdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
88  virtual Bool_t Rmdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
89  virtual Bool_t Register(const char *lfn, const char *turl, Long_t size=-1,
90  const char *se=0, const char *guid=0, Bool_t verbose=kFALSE);
91  virtual Bool_t Rm(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE);
92  virtual CatalogType Type(const char* lfn, Option_t* option = "", Bool_t verbose=kFALSE);
93  virtual TGridResult* GetCollection(const char* lfn, Option_t* option = "", Bool_t verbose=kFALSE);
94 
95  //--- Software Packages
96  virtual TGridResult* ListPackages(const char* alienpackagedir="/alice/packages");
97  ClassDef(TAlien,0) // Interface to Alien GRID services
98 };
99 
100 #endif
TAlien::GetStreamFieldValue
const char * GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:428
TAlien::GetCollection
virtual TGridResult * GetCollection(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:727
TAlien::fGc
GapiUI * fGc
Definition: TAlien.h:45
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TAlien::Stdout
void Stdout()
Definition: TAlien.cxx:381
TAlien::Command
TGridResult * Command(const char *command, bool interactive=kFALSE, UInt_t stream=kOUTPUT)
Execute AliEn command. Returns 0 in case or error.
Definition: TAlien.cxx:345
TAlien::Escape
TString Escape(const char *input)
Escape " by \".
Definition: TAlien.cxx:216
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGridCollection
Definition: TGridCollection.h:34
TAlien::kDirectory
@ kDirectory
Definition: TAlien.h:38
TString::Data
const char * Data() const
Definition: TString.h:369
TAlien::GetColumn
TMap * GetColumn(UInt_t stream=0, UInt_t column=0)
Definition: TAlien.cxx:416
TAlien::Rmdir
virtual Bool_t Rmdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:552
Int_t
int Int_t
Definition: RtypesCore.h:45
TAlien::kSTDERR
@ kSTDERR
Definition: TAlien.h:37
TAlien::CatalogType
CatalogType
Definition: TAlien.h:38
TAlien
Definition: TAlien.h:34
TList.h
TAlien::fPwd
TString fPwd
Definition: TAlien.h:46
TAlien::GetHomeDirectory
virtual const char * GetHomeDirectory()
Definition: TAlien.h:85
passwd
Definition: TWinNTSystem.h:47
TAlien::kFile
@ kFile
Definition: TAlien.h:38
TString
Basic string class.
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
bool
TAlien::~TAlien
virtual ~TAlien()
do we need to delete fGc ? (rdm)
Definition: TAlien.cxx:199
TAlien::Type
virtual CatalogType Type(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
returns the type of the given lfn
Definition: TAlien.cxx:685
TGridJob
Definition: TGridJob.h:31
TGrid
Definition: TGrid.h:44
TAlien::kSTDOUT
@ kSTDOUT
Definition: TAlien.h:37
TGrid.h
TAlien::GetStreamFieldKey
const char * GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:435
TAlien::OpenCollection
virtual TGridCollection * OpenCollection(const char *collectionfile, UInt_t maxentries=kTRUE)
Factory function for a TAlienCollection based on an XML file.
Definition: TAlien.cxx:645
TAlien::OpenDataset
virtual TGridResult * OpenDataset(const char *lfn, const char *options="")
Definition: TAlien.cxx:408
TGridResult
Definition: TGridResult.h:31
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
TAlien::kOUTPUT
@ kOUTPUT
Definition: TAlien.h:37
TAlien::Ps
virtual TGridJobStatusList * Ps(const char *options, Bool_t verbose=kTRUE)
Get job status list.
Definition: TAlien.cxx:289
TAlien::Pwd
virtual const char * Pwd(Bool_t verbose=kFALSE)
Definition: TAlien.cxx:487
TAlien::LocateSites
virtual TGridResult * LocateSites()
Definition: TAlien.cxx:374
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGridJobStatusList
Definition: TGridJobStatusList.h:30
Long_t
long Long_t
Definition: RtypesCore.h:54
TAlien::Shell
void Shell()
Start an interactive AliEn shell.
Definition: TAlien.cxx:208
TAlien::Query
virtual TGridResult * Query(const char *path, const char *pattern, const char *conditions="", const char *options="")
Definition: TAlien.cxx:399
TAlien::OpenCollectionQuery
virtual TGridCollection * OpenCollectionQuery(TGridResult *queryresult, Bool_t nogrouping=kFALSE)
Factory function fo a TAlienCollection based on a gGrid Query.
Definition: TAlien.cxx:676
unsigned int
TAlien::ListPackages
virtual TGridResult * ListPackages(const char *alienpackagedir="/alice/packages")
List packages in the specified directory.
Definition: TAlien.cxx:744
TAlien::kCollection
@ kCollection
Definition: TAlien.h:38
TAlien::GetJDLGenerator
virtual TGridJDL * GetJDLGenerator()
Create a Alien JDL.
Definition: TAlien.cxx:281
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TAlien::Submit
virtual TGridJob * Submit(const char *jdl)
Submit a command to AliEn. Returns 0 in case of error.
Definition: TAlien.cxx:230
TAlien::Cd
virtual Bool_t Cd(const char *ldn="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:460
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
TGridJDL
Definition: TGridJDL.h:32
TAlien::Rm
virtual Bool_t Rm(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:618
TAlien::KillById
virtual Bool_t KillById(TString jobid)
Kill a specific job.
Definition: TAlien.cxx:323
TAlien::ResubmitById
virtual Bool_t ResubmitById(TString jobid)
Resubmit a specific job.
Definition: TAlien.cxx:334
TAlien::kFailed
@ kFailed
Definition: TAlien.h:38
TAlien::Ls
virtual TGridResult * Ls(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:451
TAlien::kENVIR
@ kENVIR
Definition: TAlien.h:37
TAlien::GetNColumns
UInt_t GetNColumns(UInt_t stream)
Definition: TAlien.cxx:442
TAlien::TAlien
TAlien(const char *gridurl, const char *uid=0, const char *passwd=0, const char *options=0)
Definition: TAlien.cxx:89
TAlien::Register
virtual Bool_t Register(const char *lfn, const char *turl, Long_t size=-1, const char *se=0, const char *guid=0, Bool_t verbose=kFALSE)
Definition: TAlien.cxx:583
TAlien::Mkdir
virtual Int_t Mkdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:520
TAlien::fHome
TString fHome
Definition: TAlien.h:47
TAlien::Stderr
void Stderr()
Definition: TAlien.cxx:390
ROOT::TMetaUtils::propNames::pattern
static const std::string pattern("pattern")
TMap
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40