SFrame 3.6
|
Singleton class managing the PROOF connection(s) More...
#include <core/include/SProofManager.h>
Public Member Functions | |
~SProofManager () | |
Destructor that deletes the open connections. | |
TProof * | Open (const TString &url, const TString ¶m="") throw ( SError ) |
Function to open/access a PROOF connection. | |
Bool_t | IsConfigured (const TString &url, const TString ¶m="") const |
Function to check if a PROOF server connection is configured already. | |
void | SetConfigured (const TString &url, const TString ¶m="", Bool_t state=kTRUE) throw ( SError ) |
Set a given PROOF server to "configured" state. | |
void | Cleanup () |
Function deleting all the open PROOF connections. | |
Static Public Member Functions | |
static SProofManager * | Instance () |
Singleton accessor function. |
Singleton class managing the PROOF connection(s)
When handling PROOF (PQ2) datasets, the code needs to access the PROOF server in multiple places. Since the PROOF connection needs some time to properly terminate after deleting the appropriate objects, and of course SFrame should not sit waiting until that happens, it's just easier to keep the connections open.
The Open(...) function can be user pretty similarly to TProof::Open(...). The advantage of this function is that it remembers which connections are already open, and it also deletes them when instructed (or when deleted).
Definition at line 43 of file SProofManager.h.
SProofManager::~SProofManager | ( | ) |
Destructor that deletes the open connections.
The destructor cleans up the open connections by calling the Cleanup() function internally.
Definition at line 32 of file SProofManager.cxx.
References Cleanup().
void SProofManager::Cleanup | ( | ) |
Function deleting all the open PROOF connections.
This function can be used to clean up the PROOF connections. Even if it's only called at the termination of the sframe_main program, it's still very much needed. PROOF has the habit of producing a crash at the very last moment in the application if the user doesn't delete its objects properly.
The function first retrieves and prints all the worker logs from all the connections, then it does the cleanup.
Definition at line 233 of file SProofManager.cxx.
Referenced by ~SProofManager().
SProofManager * SProofManager::Instance | ( | ) | [static] |
Singleton accessor function.
This function should be used to access the single existing object.
Definition at line 42 of file SProofManager.cxx.
Referenced by SCycleController::ExecuteNextCycle().
Bool_t SProofManager::IsConfigured | ( | const TString & | url, |
const TString & | param = "" |
||
) | const |
Function to check if a PROOF server connection is configured already.
This function is used to decide if a given PROOF server has already been configured (packages uploaded, compiled and loaded). This helps avoid having to wait while packages load multiple times in a job that runs many separately configured cycles.
url | Name of the PROOF server |
param | Additional parameters given to TProof::Open(...) |
kTRUE
if the server is already configured, or kFALSE
if it's not Definition at line 174 of file SProofManager.cxx.
References REPORT_ERROR.
Referenced by SCycleController::ExecuteNextCycle().
TProof * SProofManager::Open | ( | const TString & | url, |
const TString & | param = "" |
||
) | throw ( SError ) |
Function to open/access a PROOF connection.
This function can be used basically in the same way as one would use TProof::Open(...).
The function first looks at its internal cache to see if the connection is already open, and if it is, it just returns the cached TProof object. If the connection is not yet available, it creates it using TProof::Open(...), and adds the created object to its internal cache.
url | Name of the PROOF server |
param | Additional parameters given to TProof::Open(...) |
Definition at line 64 of file SProofManager.cxx.
References DEBUG, SLogger::endmsg(), INFO, REPORT_ERROR, REPORT_VERBOSE, SError::SkipCycle, and WARNING.
void SProofManager::SetConfigured | ( | const TString & | url, |
const TString & | param = "" , |
||
Bool_t | state = kTRUE |
||
) | throw ( SError ) |
Set a given PROOF server to "configured" state.
This function can be used to set the "configured state" of a PROOF server connection. "Configured" means that all necessary PAR packages have already been uploaded to, compiled and loaded on the server.
url | Name of the PROOF server |
param | Additional parameters given to TProof::Open(...) |
state | Configuration state (kTRUE for configured, kFALSE for not configured.) |
Definition at line 201 of file SProofManager.cxx.
References REPORT_FATAL, and SError::StopExecution.
Referenced by SCycleController::ExecuteNextCycle().