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
28class GapiUI;
29class TGridJob;
31class TMap;
32
33
34class TAlien : public TGrid {
35
36public:
37 enum { kSTDOUT = 0, kSTDERR = 1 , kOUTPUT = 2, kENVIR = 3 };
39
40private:
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
57public:
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);
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
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kFALSE
Definition: RtypesCore.h:101
long Long_t
Definition: RtypesCore.h:54
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
Definition: TAlien.h:34
TAlien(const char *gridurl, const char *uid=0, const char *passwd=0, const char *options=0)
Definition: TAlien.cxx:89
virtual TGridJob * Submit(const char *jdl)
Submit a command to AliEn. Returns 0 in case of error.
Definition: TAlien.cxx:230
void Shell()
Start an interactive AliEn shell.
Definition: TAlien.cxx:208
GapiUI * fGc
Definition: TAlien.h:45
virtual Bool_t ResubmitById(TString jobid)
Resubmit a specific job.
Definition: TAlien.cxx:334
virtual TGridResult * LocateSites()
Definition: TAlien.cxx:374
CatalogType
Definition: TAlien.h:38
@ kDirectory
Definition: TAlien.h:38
@ kFailed
Definition: TAlien.h:38
@ kCollection
Definition: TAlien.h:38
@ kFile
Definition: TAlien.h:38
UInt_t GetNColumns(UInt_t stream)
Definition: TAlien.cxx:442
virtual TGridResult * OpenDataset(const char *lfn, const char *options="")
Definition: TAlien.cxx:408
void Stdout()
Definition: TAlien.cxx:381
virtual TGridJobStatusList * Ps(const char *options, Bool_t verbose=kTRUE)
Get job status list.
Definition: TAlien.cxx:289
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
virtual TGridResult * ListPackages(const char *alienpackagedir="/alice/packages")
List packages in the specified directory.
Definition: TAlien.cxx:744
virtual const char * GetHomeDirectory()
Definition: TAlien.h:85
const char * GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:435
virtual Bool_t Rm(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:618
virtual Bool_t KillById(TString jobid)
Kill a specific job.
Definition: TAlien.cxx:323
virtual TGridResult * Ls(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:451
virtual CatalogType Type(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
returns the type of the given lfn
Definition: TAlien.cxx:685
virtual TGridResult * GetCollection(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:727
virtual Bool_t Rmdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:552
TString Escape(const char *input)
Escape " by \".
Definition: TAlien.cxx:216
virtual TGridCollection * OpenCollectionQuery(TGridResult *queryresult, Bool_t nogrouping=kFALSE)
Factory function fo a TAlienCollection based on a gGrid Query.
Definition: TAlien.cxx:676
void Stderr()
Definition: TAlien.cxx:390
TString fPwd
Definition: TAlien.h:46
virtual Bool_t Cd(const char *ldn="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:460
@ kSTDERR
Definition: TAlien.h:37
@ kSTDOUT
Definition: TAlien.h:37
@ kOUTPUT
Definition: TAlien.h:37
@ kENVIR
Definition: TAlien.h:37
virtual TGridJDL * GetJDLGenerator()
Create a Alien JDL.
Definition: TAlien.cxx:281
TMap * GetColumn(UInt_t stream=0, UInt_t column=0)
Definition: TAlien.cxx:416
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
const char * GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:428
virtual Int_t Mkdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:520
virtual TGridCollection * OpenCollection(const char *collectionfile, UInt_t maxentries=kTRUE)
Factory function for a TAlienCollection based on an XML file.
Definition: TAlien.cxx:645
virtual TGridResult * Query(const char *path, const char *pattern, const char *conditions="", const char *options="")
Definition: TAlien.cxx:399
virtual ~TAlien()
do we need to delete fGc ? (rdm)
Definition: TAlien.cxx:199
virtual const char * Pwd(Bool_t verbose=kFALSE)
Definition: TAlien.cxx:487
TString fHome
Definition: TAlien.h:47
Definition: TGrid.h:44
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
static const std::string pattern("pattern")