1 #ifndef FWCore_Framework_ProductResolvers_h 2 #define FWCore_Framework_ProductResolvers_h 33 class MergeableRunProductMetadata;
34 class ProductProvenanceRetriever;
67 void setProduct(std::unique_ptr<WrapperBase> edp)
const;
68 void setProduct(std::shared_ptr<WrapperBase> edp)
const;
73 template <
bool callResolver,
typename FUNC>
112 void setOrMergeProduct(std::shared_ptr<WrapperBase>
prod,
124 assert(not bd->produced());
133 bool skipCurrentProcess,
135 ModuleCallingContext
const* mcc)
const override;
137 Principal
const& principal,
138 bool skipCurrentProcess,
141 ModuleCallingContext
const* mcc)
const override;
144 MergeableRunProductMetadata
const* mergeableRunProductMetadata)
const override;
163 assert(not bd->produced());
164 assert(not bd->onDemand());
168 void putProduct(std::unique_ptr<WrapperBase> edp)
const override;
169 void putOrMergeProduct(std::unique_ptr<WrapperBase>
prod)
const override;
172 bool skipCurrentProcess,
177 bool skipCurrentProcess,
195 void putProduct(std::unique_ptr<WrapperBase> edp)
const override;
210 bool skipCurrentProcess,
215 bool skipCurrentProcess,
238 bool skipCurrentProcess,
243 bool skipCurrentProcess,
254 mutable std::atomic<bool> prefetchRequested_ =
false;
265 void putProduct(std::unique_ptr<WrapperBase> edp)
const override;
267 bool skipCurrentProcess,
272 bool skipCurrentProcess,
285 mutable std::atomic<bool> prefetchRequested_ =
false;
296 realProduct_.connectTo(iOther, iParentPrincipal);
301 bool skipCurrentProcess,
304 return realProduct_.resolveProduct(principal, skipCurrentProcess, sra, mcc);
308 bool skipCurrentProcess,
312 realProduct_.prefetchAsync(waitTask, principal, skipCurrentProcess,
token, sra, mcc);
319 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
335 std::shared_ptr<BranchDescription const>
bd_;
354 void unsafe_setWrapperAndProvenance()
const;
361 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
397 bool skipCurrentProcess,
402 bool skipCurrentProcess,
406 void putProduct(std::unique_ptr<WrapperBase> edp)
const final;
428 bool skipCurrentProcess,
433 bool skipCurrentProcess,
445 :
ProductResolverBase(), realProduct_(nullptr), bd_(bd), provRetriever_(nullptr), parentPrincipal_(nullptr) {}
448 realProduct_ = &iOther;
449 parentPrincipal_ = iParentPrincipal;
454 bool skipCurrentProcess,
463 skipCurrentProcess =
false;
464 return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
468 bool skipCurrentProcess,
478 skipCurrentProcess =
false;
479 realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess,
token, sra, mcc);
483 return realProduct_->unscheduledWasNotRun();
484 throwNullRealProduct();
491 iSkipCurrentProcess =
false;
492 return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
504 void throwNullRealProduct()
const;
507 std::shared_ptr<BranchDescription const>
bd_;
516 std::vector<bool>
const& ambiguous,
521 void tryPrefetchResolverAsync(
unsigned int iProcessingIndex,
523 bool skipCurrentProcess,
527 oneapi::tbb::task_group*)
const;
529 bool dataValidFromResolver(
unsigned int iProcessingIndex,
531 bool iSkipCurrentProcess)
const;
533 void prefetchFailed(
unsigned int iProcessingIndex,
535 bool iSkipCurrentProcess,
536 std::exception_ptr iExceptPtr)
const;
539 unsigned int unsetIndexValue()
const;
541 bool skipCurrentProcess,
546 bool skipCurrentProcess,
569 bool skipCurrentProcess,
596 bool skipCurrentProcess,
601 bool skipCurrentProcess,
ProductData const & getProductData() const final
virtual void retrieveAndMerge_(Principal const &principal, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
std::string const & resolvedModuleLabel_() const final
bool unscheduledWasNotRun_() const override
void setProductProvenanceRetriever_(ProductProvenanceRetriever const *provRetriever) final
bool unscheduledWasNotRun_() const override
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
bool unscheduledWasNotRun_() const override
unsigned int ProductResolverIndex
ProductProvenance const * productProvenance() const
virtual Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const =0
ProducedProductResolver::ProductStatus ProductStatus
ProductStatus const defaultStatus_
std::shared_ptr< BranchDescription const > bd_
Provenance const & provenance() const
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
void resetProductData_(bool deleteEarly) override
SwitchAliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
GlobalContext const * globalContext() const
bool productUnavailable_() const final
virtual bool unscheduledWasNotRun_() const =0
void setProductID_(ProductID const &pid) final
ParentProcessProductResolver(std::shared_ptr< BranchDescription const > bd)
void checkType(WrapperBase const &prod) const
DataManagingOrAliasProductResolver()
BranchDescription const & branchDescription_() const final
std::atomic< bool > prefetchRequested_
ProductStatus status() const
virtual void setupUnscheduled(UnscheduledConfigurator const &)
WaitingTaskList & waitingTasks() const
bool productResolved_() const final
AliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
Provenance const * provenance() const
bool singleProduct_() const final
WaitingTaskList skippingWaitingTasks_
virtual ProductData const & getProductData() const =0
void setFailedStatus() const
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const override
ProductProvenanceRetriever const * provRetriever_
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
ProductData const & getProductData() const final
bool productResolved_() const final
WaitingTaskList waitingTasks_
void connectTo(ProductResolverBase const &, Principal const *) final
bool singleProduct_() const final
DataManagingOrAliasProductResolver & realProduct_
Principal const * parentPrincipal_
virtual void prefetchAsync_(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const =0
WaitingTaskList waitingTasks_
ProducedProductResolver::ProductStatus ProductStatus
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
bool productWasDeleted_() const final
virtual bool isFromCurrentProcess() const =0
ProductResolverBase const * realProduct_
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
bool productUnavailable() const
std::string const & moduleLabel() const
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
bool productResolved_() const final
ProductProvenance const * productProvenancePtr_() const final
std::atomic< unsigned int > lastSkipCurrentCheckIndex_
Provenance const * provenance_() const final
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
DataManagingOrAliasProductResolver const & realProduct() const
std::string const & resolvedModuleLabel_() const final
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
#define CMS_THREAD_GUARD(_var_)
DataManagingProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
std::atomic< bool > prefetchRequested_
std::atomic< unsigned int > lastCheckIndex_
BranchDescription const & branchDescription_() const override
bool unscheduledWasNotRun() const
UnscheduledProductResolver(std::shared_ptr< BranchDescription const > bd)
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
bool productWasDeleted_() const override
ProducedProductResolver::ProductStatus ProductStatus
ProductProvenance const * productProvenancePtr_() const final
BranchDescription const & branchDescription_() const override
std::atomic< bool > skippingPrefetchRequested_
std::atomic< ProductStatus > theStatus_
std::vector< bool > ambiguous_
virtual void setMergeableRunProductMetadata_(MergeableRunProductMetadata const *)
ProducedProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
void setMergeableRunProductMetadataInProductData(MergeableRunProductMetadata const *)
ProductStatus defaultStatus() const
void prefetchAsync_(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
bool unscheduledWasNotRun_() const final
DataManagingOrAliasProductResolver & realProduct_
BranchDescription const & branchDescription_() const final
PuttableProductResolver(std::shared_ptr< BranchDescription const > bd)
Transition transition() const
std::vector< ProductResolverIndex > matchingHolders_
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
bool productUnavailable_() const override
std::string const & resolvedModuleLabel_() const override
ProductData const & getProductData() const final
bool productWasDeleted_() const override
std::string const & resolvedModuleLabel_() const override
void setProduct(std::unique_ptr< WrapperBase > edp) const
Provenance const * provenance_() const final
bool productUnavailable_() const override
ProducedProductResolver::ProductStatus ProductStatus
Resolution resolveProductImpl(FUNC resolver) const
void resetProductData_(bool deleteEarly) override=0
std::shared_ptr< BranchDescription const > bd_
bool unscheduledWasNotRun_() const final
bool unscheduledWasNotRun_() const override
std::atomic< bool > & prefetchRequested() const
void throwProductDeletedException() const
SingleChoiceNoProcessProductResolver(ProductResolverIndex iChoice)
void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
WaitingTaskList waitingTasks_
void prefetchAsync_(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
Provenance const * provenance_() const final
BranchType const & branchType() const
bool productUnavailable_() const final
ProductResolverIndex realResolverIndex_
ParentContext const & parent() const
Provenance const * provenance_() const final
std::shared_ptr< BranchDescription const > const & branchDescription() const