LCOV - code coverage report
Current view: top level - STEER/CDB - AliCDBGrid.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 18 22.2 %
Date: 2016-06-14 17:26:59 Functions: 6 38 15.8 %

          Line data    Source code
       1             : #ifndef ALICDBGRID_H
       2             : #define ALICDBGRID_H
       3             : 
       4             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       5             :  * See cxx source for full Copyright notice                               */
       6             : 
       7             : /////////////////////////////////////////////////////////////////////
       8             : //                                                                 //
       9             : //  class AliCDBGrid                                               //
      10             : //  access class to a DataBase in an AliEn storage                 //
      11             : //                                                                 //
      12             : /////////////////////////////////////////////////////////////////////
      13             : 
      14             : #include "AliCDBStorage.h"
      15             : #include "AliCDBManager.h"
      16             : #include "AliCDBMetaData.h"
      17             : 
      18             : class AliCDBGrid: public AliCDBStorage {
      19             :   friend class AliCDBGridFactory;
      20             : 
      21             :   public:
      22             : 
      23           0 :   virtual Bool_t IsReadOnly() const {return kFALSE;}
      24           0 :   virtual Bool_t HasSubVersion() const {return kFALSE;}
      25             :   virtual Bool_t Contains(const char* path) const;
      26             :   virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
      27             :   virtual void SetRetry(Int_t nretry, Int_t initsec);
      28           0 :   virtual void SetMirrorSEs(const char* mirrors) {fMirrorSEs=mirrors;}
      29           0 :   virtual const char* GetMirrorSEs() const {return fMirrorSEs;}
      30             : 
      31             : 
      32             :   protected:
      33             : 
      34             :   virtual AliCDBEntry*  GetEntry(const AliCDBId& queryId);
      35             :   virtual AliCDBId*     GetEntryId(const AliCDBId& queryId);
      36             :   virtual TList*                GetEntries(const AliCDBId& queryId);
      37             :   virtual Bool_t          PutEntry(AliCDBEntry* entry, const char* mirrors="");
      38             :   virtual TList*                GetIdListFromFile(const char* fileName);
      39             : 
      40             :   private:
      41             : 
      42             :   AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder,
      43             :       const char *se, const char* cacheFolder, Bool_t operateDisconnected,
      44             :       Long64_t cacheSize, Long_t cleanupInterval);
      45             : 
      46             :   virtual ~AliCDBGrid();
      47             : 
      48             :   AliCDBGrid(const AliCDBGrid& db);
      49             :   AliCDBGrid& operator = (const AliCDBGrid& db);
      50             : 
      51             :   Bool_t FilenameToId(TString& filename, AliCDBId& id);
      52             : 
      53             :   Bool_t PrepareId(AliCDBId& id);
      54             :   AliCDBId* GetId(const TObjArray& validFileIds, const AliCDBId& query);
      55             :   AliCDBEntry* GetEntryFromFile(TString& filename, AliCDBId* dataId);
      56             :   Bool_t PutInCvmfs(TString &fullFilename, TFile *cdbFile) const;
      57             : 
      58             :   // TODO  use AliEnTag classes!
      59             :   Bool_t AddTag(TString& foldername, const char* tagname);
      60             :   Bool_t TagFileId(TString& filename, const AliCDBId* id);
      61             :   Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
      62             :   Bool_t TagShortLived(TString& filename, Bool_t value);
      63             : 
      64             :   void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBMetaData* md, TString& result) const;
      65             : 
      66             :   virtual void QueryValidFiles();
      67             : 
      68             :   TString    fGridUrl;   // Grid Url ("alien://aliendb4.cern.ch:9000")
      69             :   TString    fUser;      // User
      70             :   TString    fDBFolder;    // path of the DB folder
      71             :   TString    fSE;                // Storage Element
      72             :   TString    fMirrorSEs;         // Mirror Storage Elements
      73             :   TString    fCacheFolder; // local cache folder
      74             :   Bool_t     fOperateDisconnected; // Operate disconnected flag
      75             :   Long64_t   fCacheSize;           // local cache size (in bytes)
      76             :   Long_t     fCleanupInterval;     // local cache cleanup interval
      77             : 
      78         128 :   ClassDef(AliCDBGrid, 0)      // access class to a DataBase in an AliEn storage
      79             : };
      80             : 
      81             : /////////////////////////////////////////////////////////////////////
      82             : //                                                                 //
      83             : //  class AliCDBGridFactory                                        //
      84             : //                                                                 //
      85             : /////////////////////////////////////////////////////////////////////
      86             : 
      87          32 : class AliCDBGridFactory: public AliCDBStorageFactory {
      88             : 
      89             :   public:
      90             : 
      91             :     virtual Bool_t Validate(const char* gridString);
      92             :     virtual AliCDBParam* CreateParameter(const char* gridString);
      93           0 :     virtual ~AliCDBGridFactory(){}
      94             : 
      95             :   protected:
      96             :     virtual AliCDBStorage* Create(const AliCDBParam* param);
      97             : 
      98         386 :     ClassDef(AliCDBGridFactory, 0);
      99             : };
     100             : 
     101             : /////////////////////////////////////////////////////////////////////
     102             : //                                                                 //
     103             : //  class AliCDBGridParam                                          //
     104             : //                                                                 //
     105             : /////////////////////////////////////////////////////////////////////
     106             : 
     107           0 : class AliCDBGridParam: public AliCDBParam {
     108             : 
     109             :   public:
     110             :     AliCDBGridParam();
     111             :     AliCDBGridParam(const char* gridUrl, const char* user,
     112             :         const char* dbFolder, const char* se,
     113             :         const char* cacheFolder, Bool_t operateDisconnected,
     114             :         Long64_t cacheSize, Long_t cleanupInterval);
     115             : 
     116             :     virtual ~AliCDBGridParam();
     117             : 
     118           0 :     const TString& GridUrl() const {return fGridUrl;}
     119           0 :     const TString& GetUser() const {return fUser;}
     120           0 :     const TString& GetDBFolder() const {return fDBFolder;}
     121           0 :     const TString& GetSE()   const {return fSE;}
     122           0 :     const TString& GetCacheFolder() const {return fCacheFolder;}
     123           0 :     Bool_t  GetOperateDisconnected() const {return fOperateDisconnected;}
     124           0 :     Long64_t  GetCacheSize() const {return fCacheSize;}
     125           0 :     Long_t  GetCleanupInterval() const {return fCleanupInterval;}
     126             : 
     127             :     virtual AliCDBParam* CloneParam() const;
     128             : 
     129             :     virtual ULong_t Hash() const;
     130             :     virtual Bool_t IsEqual(const TObject* obj) const;
     131             : 
     132             :   private:
     133             :     TString  fGridUrl;     // Grid url "Host:port"
     134             :     TString  fUser;           // User
     135             :     TString  fDBFolder;    // path of the DB folder
     136             :     TString  fSE;             // Storage Element
     137             :     TString  fCacheFolder; // Cache folder
     138             :     Bool_t   fOperateDisconnected; // Operate disconnected flag
     139             :     Long64_t fCacheSize;           // local cache size (in bytes)
     140             :     Long_t   fCleanupInterval;     // local cache cleanup interval
     141             : 
     142         128 :     ClassDef(AliCDBGridParam, 0);
     143             : };
     144             : 
     145             : 
     146             : #endif

Generated by: LCOV version 1.11