#ifndef ROOT_TPacketizerProgressive
#define ROOT_TPacketizerProgressive
#ifndef ROOT_TVirtualPacketizer
#include "TVirtualPacketizer.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TMap
#include "TMap.h"
#endif
#ifndef ROOT_TUrl
#include "TUrl.h"
#endif
#ifndef ROOT_TDSet
#include "TDSet.h"
#endif
#ifndef ROOT_TSlave
#include "TSlave.h"
#endif
#ifndef ROOT_TObjString
#include "TObjString.h"
#endif
#ifndef ROOT_TTimer
#include "TTimer.h"
#endif
class TMessage;
class TPacketizerProgressive : public TVirtualPacketizer {
public:
class TFileStat;
class TFileNode : public TObject {
private:
TString fNodeName;
TList *fFiles;
TObject *fUnAllocFileNext;
TList *fActFiles;
TObject *fActFileNext;
Int_t fMySlaveCnt;
Int_t fSlaveCnt;
public:
TFileNode(const char *name);
~TFileNode() { delete fFiles; delete fActFiles; }
void IncMySlaveCnt() { fMySlaveCnt++; }
void IncSlaveCnt(const char *slave) { if (fNodeName != slave) fSlaveCnt++; }
void DecSlaveCnt(const char *slave) { if (fNodeName != slave) fSlaveCnt--; R__ASSERT(fSlaveCnt >= 0); }
Int_t GetSlaveCnt() const { return fMySlaveCnt + fSlaveCnt; }
Int_t GetNumberOfActiveFiles() const { return fActFiles->GetSize(); }
Bool_t IsSortable() const { return kTRUE; }
const char *GetName() const { return fNodeName; }
void Add(TDSetElement *elem);
TFileStat *GetNextUnAlloc();
TFileStat *GetNextActive();
void RemoveActive(TFileStat *file);
Bool_t HasActiveFiles() { if (fActFiles->GetSize()) return kTRUE; return kFALSE; }
Bool_t HasUnAllocFiles() {if (fUnAllocFileNext) return kTRUE; return kFALSE; }
Int_t Compare(const TObject *other) const;
void Print(Option_t *opt ="") const;
void Reset();
};
class TFileStat : public TObject {
private:
Bool_t fIsDone;
TFileNode *fNode;
TDSetElement *fElement;
Long64_t fNextEntry;
public:
TFileStat(TFileNode *node, TDSetElement *elem);
Bool_t IsDone() const { return fIsDone; }
void SetDone() { fIsDone = kTRUE; }
TFileNode *GetNode() const { return fNode; }
TDSetElement *GetElement() const { return fElement; }
Long64_t GetNextEntry() const { return fNextEntry; }
void MoveNextEntry(Long64_t step) { fNextEntry += step; }
};
class TSlaveStat : public TObject {
private:
TSlave *fSlave;
TFileNode *fFileNode;
TFileStat *fCurFile;
TDSetElement *fCurElem;
Long64_t fProcessed;
public:
TSlaveStat(TSlave *slave);
TFileNode *GetFileNode() const { return fFileNode; }
TFileStat *GetCurrentFile() const { return fCurFile; }
TDSetElement *GetCurrentElement() const { return fCurElem; }
const char *GetName() const { return fSlave->GetName(); }
Long64_t GetEntriesProcessed() const { return fProcessed; }
void SetFileNode(TFileNode *node) { fFileNode = node; }
void SetCurrentFile(TFileStat *file) { fCurFile = file; }
void SetCurrentElement(TDSetElement* elem) { fCurElem = elem; }
void IncEntriesProcessed(Long64_t n) { fProcessed += n; }
};
private:
enum {
kSlaveHostConnLim = 2,
kNonSlaveHostConnLim = 2,
kEntryListSize = 5
};
TDSet *fDset;
TList *fSlaves;
TList *fSlavesRemaining;
Long64_t fFirstEvent;
Long64_t fTotalEvents;
Long64_t fEntriesSeen;
Long64_t fFilesOpened;
Long64_t fEstTotalEntries;
Long64_t fEntriesProcessed;
TMap *fSlaveStats;
THashTable *fNewFileSlaves;
TList *fUnAllocSlaves;
TList *fUnAllocNonSlaves;
TList *fActiveSlaves;
TList *fActiveNonSlaves;
TList *fLastEntrySizes;
Long64_t fPacketSize;
TTimer *fProgress;
TPacketizerProgressive();
TPacketizerProgressive(const TPacketizerProgressive&);
void RecalculatePacketSize(Long64_t newCount);
TFileStat *GetNextActive(TSlaveStat *stat);
TFileStat *GetNextUnAlloc(TSlaveStat *stat);
TDSetElement *BuildPacket(TSlaveStat *stat, Long64_t num);
void Init();
virtual Bool_t HandleTimer(TTimer *timer);
public:
TPacketizerProgressive(TDSet *dset, TList *slaves,
Long64_t first, Long64_t num,
TList *input);
virtual ~TPacketizerProgressive();
Long64_t GetEntriesProcessed() const { return fEntriesProcessed; }
Long64_t GetEntriesProcessed(TSlave *s) const;
TDSetElement *GetNextPacket(TSlave *s, TMessage *r);
ClassDef(TPacketizerProgressive, 0);
};
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.