19 const
string& tableName,
20 const
string& vldSuffix,
22 fMultConnector(cascader),
24 fMetaValid(tableName+vldSuffix),
27 fDBProxy(*cascader,tableName,&fMetaData,&fMetaValid,
this),
29 fTableName(tableName),
30 fTableRow(tableRow->CreateTableRow())
34 this->RefreshMetaData();
35 fExists = fDBProxy.TableExists();
36 fCanL2Cache = tableRow->CanL2Cache();
38 cout <<
"FairDbTableProxy: Can L2 cache " << this->GetRowName() << endl;
40 cout <<
"Creating FairDbTableProxy "
41 << fTableName.c_str() <<
" at " <<
this
42 << ( fExists ?
" (table exists)"
43 :
" (table missing)" )
67 Bool_t findFullTimeWindow)
97 UInt_t numPresent = 0;
98 UInt_t numRequired = 0;
100 for ( Int_t rowNo = 1; rowNo <= maxRow; ++rowNo ) {
103 else if ( ! vrec.
IsGap() ) { ++numRequired; }
105 if ( numRequired < numPresent )
106 cout <<
"Skipping search of L2 cache; already have "
107 << numPresent <<
" aggregates, and only require a further "
108 << numRequired << endl;
130 const string& fillOpts)
133 std::ostringstream os;
136 ) { os <<
" and Task = " << task; }
137 os <<
';' << data <<
';' << fillOpts;
138 string sqlQualifiers = os.str();
141 cout <<
"Extended query: sqlQualifiers: " << sqlQualifiers << endl;
223 if ( res ) {
return res; }
227 unsigned int seqNo = vrec.
GetSeqNo();
240 cout <<
"Unable to satisfy FairDbValidityRec keyed query:" << endl
243 <<
" not by this FairDbTableProxy ("
308 if ( ! vrecOvlay.IsGap() ) {
309 time_t overlaySecs = vrecOvlay.GetCreationDate().
GetSec();
313 cout <<
"Looking for overlay creation date for: "
314 << vrec <<
"found it would overlap: "
315 << vrecOvlay <<
" so overlay creation date set to "
316 << ovlayTS.AsString(
"s") << endl;
325 cout <<
"Request to restore query result " <<
name
328 string cacheFileName;
332 +
name +
".dbi_cache";
335 cout <<
"Caching disabled or cannot open "
340 static bool warnOnce =
true;
343 <<
" WARNING: Reading from the Level 2 cache has been activated.\n"
344 <<
" ******* This should only be used for development and never for production !!!\n\n\n";
348 cout <<
"Restoring query result from " << bf.GetFileName() << endl;
352 unsigned numRowsRest = 0;
353 unsigned numRowsIgn = 0;
354 UInt_t numNonAgg = 0;
357 while ( numNonAgg-- ) {
358 if ( ! bf.IsOK() ) {
break; }
367 cout <<
"Fix up L2 cache FairDbValidityRec, by replacing: " << vrec
374 numRowsRest += result->GetNumRows();
377 }
else { numRowsIgn += result->GetNumRows(); }
379 cout <<
" a total of " << numRowsRest <<
" were restored ("
380 << numRowsIgn <<
" ignored - already in memory)" << endl;
385 return numRowsRest > 0;
392 cout <<
"Request to save query result as " << name
394 <<
" can be saved? " << res.
CanSave() << endl;
397 string cacheFileName;
401 + name +
".dbi_cache";
404 cout <<
"Saving query result (" << res.
GetNumRows()
405 <<
" rows) to " << bf.GetFileName() << endl;
410 if ( dynamic_cast<FairDbResultNonAgg*>(&res) ) {
411 UInt_t numNonAgg = 1;
417 cout <<
"Caching disabled or cannot open "
418 << bf.GetFileName() << endl;