3 #ifndef __ARC_BROKER_H__ 4 #define __ARC_BROKER_H__ 11 #include <arc/Utils.h> 12 #include <arc/compute/EntityRetriever.h> 13 #include <arc/compute/JobDescription.h> 14 #include <arc/compute/BrokerPlugin.h> 18 class ExecutionTarget;
166 bool isValid(
bool alsoCheckJobDescription =
true)
const;
177 std::string proxyIssuerCA;
199 : b(&b), rejectEndpoints(rejectEndpoints), current(targets.first.begin()) {}
202 : b(&b), rejectEndpoints(rejectEndpoints), current(targets.first.begin()) {
set(j); }
205 : b(&b), rejectEndpoints(rejectEndpoints), current(targets.first.begin()) {
addEntities(csList); }
208 : b(&b), rejectEndpoints(rejectEndpoints), current(targets.first.begin()) {
set(j);
addEntities(csList); }
212 void addEntity(
const ExecutionTarget& et);
214 void addEntity(
const ComputingServiceType& cs);
216 void addEntities(
const std::list<ComputingServiceType>&);
219 void reset() { current = targets.first.begin(); }
223 bool endOfList()
const {
return current == targets.first.end(); }
238 void clear() { targets.first.clear(); targets.second.clear(); }
248 void set(
const Broker& newBroker) { b = &newBroker; sort(); }
252 void setRejectEndpoints(
const std::list<URL>& newRejectEndpoints) { rejectEndpoints = newRejectEndpoints; }
260 std::list<URL> rejectEndpoints;
262 std::pair< std::list<ExecutionTarget>, std::list<ExecutionTarget> > targets;
263 std::list<ExecutionTarget>::iterator current;
270 #endif // __ARC_BROKER_H__ Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
User configuration class
Definition: UserConfig.h:196
const ExecutionTarget & operator*() const
Returns current target.
Definition: Broker.h:226
void addEntities(const std::list< ComputingServiceType > &)
Add a list of ComputingServiceTypes and rank them according to the Broker.
Broker & operator=(const Broker &b)
Assignment operator. BrokerPlugin copying is handled automatically.
bool next()
Advance to the next target. Returns false if the current target is the last one.
Definition: Broker.h:221
void reset()
Reset to the first target in the ranked list.
Definition: Broker.h:219
bool match(const ExecutionTarget &et) const
Returns true if the ExecutionTarget is allowed by BrokerPlugin.
A Broker filters and ranks acceptable targets for job submission.
Definition: Broker.h:43
ExecutionTargetSorter(const Broker &b, const std::list< ComputingServiceType > &csList, const std::list< URL > &rejectEndpoints=std::list< URL >())
Constructor passing list of targets.
Definition: Broker.h:204
Wrapper around Broker functionality.
Definition: Broker.h:195
A logger class.
Definition: Logger.h:493
bool isValid(bool alsoCheckJobDescription=true) const
Returns true if the BrokerPlugin loaded by this Broker is valid.
ExecutionTargetSorter(const Broker &b, const JobDescription &j, const std::list< ComputingServiceType > &csList, const std::list< URL > &rejectEndpoints=std::list< URL >())
Constructor passing JobDescription and list of targets.
Definition: Broker.h:207
Wrapper for pointer with automatic destruction and multiple references.
Definition: Utils.h:183
const ExecutionTarget * operator->() const
Returns pointer to current target.
Definition: Broker.h:230
void setRejectEndpoints(const std::list< URL > &newRejectEndpoints)
Set a list of endpoints to reject when matching.
Definition: Broker.h:252
Definition: JobDescription.h:842
void addEntity(const ExecutionTarget &et)
Add an ExecutionTarget and rank it according to the Broker.
ExecutionTargetSorter(const Broker &b, const std::list< URL > &rejectEndpoints=std::list< URL >())
Basic constructor.
Definition: Broker.h:198
const ExecutionTarget & getCurrentTarget() const
Returns current target.
Definition: Broker.h:228
ExecutionTargetSorter(const Broker &b, const JobDescription &j, const std::list< URL > &rejectEndpoints=std::list< URL >())
Constructor passing JobDescription.
Definition: Broker.h:201
void registerJobSubmission()
Register that job was submitted to current target.
Broker(const UserConfig &uc, const std::string &name="")
Construct a new broker and load the BrokerPlugin of the given type.
bool operator()(const ExecutionTarget &lhs, const ExecutionTarget &rhs) const
Used to sort targets. Returns true if lhs<rhs according to BrokerPlugin.
Handles loading of the required BrokerPlugin plugin.
Definition: BrokerPlugin.h:68
const JobDescription & getJobDescription() const
Get the JobDescription set by set().
Definition: Broker.h:170
static bool genericMatch(const ExecutionTarget &et, const JobDescription &j, const Arc::UserConfig &)
Perform a match between the given target and job.
const std::list< ExecutionTarget > & getNonMatchingTargets() const
Get list of non-matching targets.
Definition: Broker.h:235
const std::list< ExecutionTarget > & getMatchingTargets() const
Get sorted list of matching targets.
Definition: Broker.h:233
ExecutionTarget.
Definition: ExecutionTarget.h:494
bool endOfList() const
Returns true if current target is last in the list.
Definition: Broker.h:223
void clear()
Clear lists of targets.
Definition: Broker.h:238
~Broker()
Destructor. BrokerPlugin unloading is handled automatically.
A general concept of an object which can consume entities use by the retrievers to return results...
Definition: EntityRetriever.h:34
void set(const JobDescription &_j) const
Set the JobDescription to use during brokering.