48 PDB(kPacketizer,1)
Info(
"TPacketizerMulti",
49 "enter (first %lld, num %lld)", first, num);
56 if (!dset || !wrks || !input || !st) {
57 Error(
"TPacketizerMulti",
"invalid inputs: dset:%p wrks:%p input:%p st:%p",
58 dset, wrks, input, st);
62 fPacketizers =
new TList;
65 TNamed *progTimerFlag =
new TNamed(
"PROOF_StartProgressTimer",
"no");
66 input->Add(progTimerFlag);
72 if ((packetizer = CreatePacketizer(dset, wrks, first, num, input, st))) {
73 fPacketizers->Add(packetizer);
76 Error(
"TPacketizerMulti",
"problems initializing packetizer for single dataset");
77 input->Remove(progTimerFlag);
83 TIter nxds(dset->GetListOfElements());
85 while ((ds = (
TDSet *)nxds())) {
86 if ((packetizer = CreatePacketizer(ds, wrks, first, num, input, st))) {
87 fPacketizers->
Add(packetizer);
90 Error(
"TPacketizerMulti",
"problems initializing packetizer for dataset '%s'", ds->GetName());
95 input->Remove(progTimerFlag);
99 if (fPacketizers->GetSize() <= 0) {
100 Error(
"TPacketizerMulti",
"no valid packetizer could be initialized - aborting");
104 Info(
"TPacketizerMulti",
"%d packetizer(s) have been successfully initialized (%lld events in total)",
105 fPacketizers->GetSize(), fTotalEntries);
107 TIter nxp(fPacketizers);
113 fPacketizersIter =
new TIter(fPacketizers);
118 Error(
"TPacketizerMulti",
"could not point to the first valid packetizer");
119 fPacketizers->SetOwner(
kTRUE);
126 fAssignedPack =
new TMap;
131 PDB(kPacketizer,1)
Info(
"TPacketizerMulti",
"done");
166 if (lastPacketizer && lastPacketizer !=
fCurrent) {
168 Info(
"GetNextPacket",
"%s: asking old packetizer %p ... ", wrk->
GetOrdinal(), lastPacketizer);
169 if ((elem = lastPacketizer->
GetNextPacket(wrk, r)))
return elem;
174 if (oldstat && curstat)
190 TMap *oldStats = (lastPacketizer && lastPacketizer ==
fCurrent) ? lastPacketizer->GetSlaveStats() : 0;
198 if (oldstat && curstat)
215 Info(
"GetNextPacket",
"assigned packetizer %p to %s (check: %p)",
222 Error(
"GetNextPacket",
"Processed too many entries!");
242 if (!dset || !wrks || !input || !st) {
243 Error(
"CreatePacketizer",
"invalid inputs: dset:%p wrks:%p input:%p st:%p",
244 dset, wrks, input, st);
250 Error(
"CreatePacketizer",
"dataset is empty: protocol error?");
255 TList *listOfMissingFiles = 0;
264 if (!(listOfMissingFiles = (
TList *) input->
FindObject(
"MissingFiles"))) {
266 listOfMissingFiles =
new TList;
268 input->
Add(listOfMissingFiles);
274 Error(
"CreatePacketizer",
"no files from the data set were found - skipping");
280 packetizername =
"TPacketizer";
282 Info(
"CreatePacketizer",
"using alternate packetizer: %s", packetizername.
Data());
288 Error(
"CreatePacketizer",
"class '%s' not found", packetizername.
Data());
293 callEnv.
InitWithPrototype(cl, cl->GetName(),
"TDSet*,TList*,Long64_t,Long64_t,TList*,TProofProgressStatus*");
295 Error(
"CreatePacketizer",
"cannot find correct constructor for '%s'", cl->GetName());
314 Error(
"CreatePacketizer",
"cannot construct '%s'", cl->GetName());
319 Error(
"CreatePacketizer",
320 "instantiated packetizer object '%s' is invalid", cl->GetName());
327 TIter nxe(dset->GetListOfElements());
331 dset->Remove(elem,
kFALSE);
TFileInfo * GetFileInfo(const char *type="TTree")
Return the content of this element in the form of a TFileInfo.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TObject * GetParameter(const char *par) const
Get specified parameter.
Bool_t TestBit(UInt_t f) const
This class implements a data set to be used for PROOF processing.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
const char * GetOrdinal() const
Long64_t GetEntries() const
TList * GetListOfElements() const
virtual Bool_t HandleTimer(TTimer *timer)
Send progress message to client.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Manages an element of a TDSet.
This class allows to do multiple runs in the same query; each run can be a, for example, different dataset or the same dataset with entry list.
TVirtualPacketizer * CreatePacketizer(TDSet *dset, TList *wrks, Long64_t first, Long64_t num, TList *input, TProofProgressStatus *st)
Create a packetizer for dataset 'dset' Return null on failure.
The TNamed class is the base class for all named ROOT classes.
TMap * GetSlaveStats() const
TDSetElement * GetNextPacket(TSlave *wrk, TMessage *r)
Get next packet from the current packetizer.
void Info(const char *location, const char *msgfmt,...)
Method or function calling interface.
void Error(const char *location, const char *msgfmt,...)
TProofProgressStatus * fProgressStatus
Long64_t GetTotalEntries() const
void SetValue(TObject *val)
void SetTotalEntries(Long64_t ent)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
The ROOT global object gROOT contains a list of all defined classes.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
The packetizer is a load balancing object created for each query.
Class used by TMap to store (key,value) pairs.
void ResetParam()
Reset parameter list. To be used before the first call the SetParam().
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
virtual TDSetElement * GetNextPacket(TSlave *sl, TMessage *r)
Get next packet.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
TVirtualPacketizer * fCurrent
void Lookup(Bool_t removeMissing=kFALSE, TList **missingFiles=0)
Resolve the end-point URL for the current elements of this data set If the removeMissing option is se...
virtual Bool_t Add(const char *file, const char *objname=0, const char *dir=0, Long64_t first=0, Long64_t num=-1, const char *msd=0)
Add file to list of files to be analyzed.
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
virtual ~TPacketizerMulti()
Destructor.
virtual void Add(TObject *obj)
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void SetParam(Long_t l)
Add a long method parameter.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
TProofProgressStatus * GetProgressStatus()
virtual Int_t GetSize() const
Class describing a PROOF worker server.
Container class for processing statistics.
const char * Data() const