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>
109 : DataManagingProductResolver(bd, iDefaultStatus) {}
112 void setOrMergeProduct(std::shared_ptr<WrapperBase> prod,
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,
190 : DataManagingProductResolver(bd, iDefaultStatus) {
195 void putProduct(std::unique_ptr<WrapperBase> edp)
const override;
204 : ProducedProductResolver(bd,
ProductStatus::NotPut), worker_(nullptr), prefetchRequested_(
false) {}
210 bool skipCurrentProcess,
215 bool skipCurrentProcess,
221 void putProduct(std::unique_ptr<WrapperBase> edp)
const override;
238 bool skipCurrentProcess,
243 bool skipCurrentProcess,
254 mutable std::atomic<bool> prefetchRequested_ =
false;
265 realProduct_.connectTo(iOther, iParentPrincipal);
270 bool skipCurrentProcess,
273 return realProduct_.resolveProduct(principal, skipCurrentProcess, sra, mcc);
277 bool skipCurrentProcess,
281 realProduct_.prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc);
288 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
304 std::shared_ptr<BranchDescription const>
bd_;
323 void unsafe_setWrapperAndProvenance()
const;
330 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
366 bool skipCurrentProcess,
371 bool skipCurrentProcess,
375 void putProduct(std::unique_ptr<WrapperBase> edp)
const final;
393 : SwitchBaseProductResolver(std::
move(bd), realProduct) {}
397 bool skipCurrentProcess,
402 bool skipCurrentProcess,
414 :
ProductResolverBase(), realProduct_(nullptr), bd_(bd), provRetriever_(nullptr), parentPrincipal_(nullptr) {}
417 realProduct_ = &iOther;
418 parentPrincipal_ = iParentPrincipal;
423 bool skipCurrentProcess,
432 skipCurrentProcess =
false;
433 return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
437 bool skipCurrentProcess,
447 skipCurrentProcess =
false;
448 realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
452 return realProduct_->unscheduledWasNotRun();
453 throwNullRealProduct();
460 iSkipCurrentProcess =
false;
461 return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
473 void throwNullRealProduct()
const;
476 std::shared_ptr<BranchDescription const>
bd_;
485 std::vector<bool>
const& ambiguous,
490 void tryPrefetchResolverAsync(
unsigned int iProcessingIndex,
492 bool skipCurrentProcess,
496 tbb::task_group*)
const;
498 bool dataValidFromResolver(
unsigned int iProcessingIndex,
500 bool iSkipCurrentProcess) const;
502 void prefetchFailed(
unsigned int iProcessingIndex,
504 bool iSkipCurrentProcess,
505 std::exception_ptr iExceptPtr) const;
508 unsigned int unsetIndexValue() const;
510 bool skipCurrentProcess,
515 bool skipCurrentProcess,
538 bool skipCurrentProcess,
565 bool skipCurrentProcess,
570 bool skipCurrentProcess,
ProductData const & getProductData() const final
Provenance const & provenance() const
std::string const & resolvedModuleLabel_() const final
void setProductProvenanceRetriever_(ProductProvenanceRetriever const *provRetriever) final
DataManagingOrAliasProductResolver const & realProduct() const
Provenance const * provenance() const
WaitingTaskList & waitingTasks() const
bool unscheduledWasNotRun_() const override
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
unsigned int ProductResolverIndex
std::shared_ptr< BranchDescription const > const & branchDescription() const
AliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
void checkType(WrapperBase const &prod) const
ParentProcessProductResolver(std::shared_ptr< BranchDescription const > bd)
WaitingTaskList m_waitingTasks
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_
void resetProductData_(bool deleteEarly) override
bool productUnavailable_() const final
UnscheduledProductResolver(std::shared_ptr< BranchDescription const > bd)
virtual bool unscheduledWasNotRun_() const =0
void setProductID_(ProductID const &pid) final
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
DataManagingOrAliasProductResolver()
BranchDescription const & branchDescription_() const final
std::atomic< bool > prefetchRequested_
ProductStatus status() const
virtual void setupUnscheduled(UnscheduledConfigurator const &)
bool productResolved_() const final
DataManagingProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
bool singleProduct_() const final
WaitingTaskList skippingWaitingTasks_
virtual ProductData const & getProductData() const =0
ProductProvenance const * productProvenance() const
bool unscheduledWasNotRun() const
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const override
ProducedProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
std::atomic< bool > prefetchRequested_
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
bool productUnavailable() const
WaitingTaskList waitingTasks_
void connectTo(ProductResolverBase const &, Principal const *) final
bool singleProduct_() const final
ParentContext const & parent() const
DataManagingOrAliasProductResolver & realProduct_
void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
void throwProductDeletedException() const
Principal const * parentPrincipal_
virtual void prefetchAsync_(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const =0
deep_tau::DeepTauBase::BasicDiscriminator bd
WaitingTaskList waitingTasks_
ProducedProductResolver::ProductStatus ProductStatus
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
bool productWasDeleted_() const final
virtual bool isFromCurrentProcess() const =0
ProductResolverBase const * realProduct_
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
bool productResolved_() const final
std::atomic< unsigned int > lastSkipCurrentCheckIndex_
Provenance const * provenance_() const final
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
BranchType const & branchType() const
std::string const & resolvedModuleLabel_() const final
SwitchAliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
ProductProvenance const * productProvenancePtr_() const final
std::atomic< bool > prefetchRequested_
std::atomic< unsigned int > lastCheckIndex_
BranchDescription const & branchDescription_() const override
bool productWasDeleted_() const override
ProducedProductResolver::ProductStatus ProductStatus
ProductProvenance const * productProvenancePtr_() const final
void setProduct(std::unique_ptr< WrapperBase > edp) const
BranchDescription const & branchDescription_() const override
std::atomic< bool > skippingPrefetchRequested_
std::atomic< ProductStatus > theStatus_
std::vector< bool > ambiguous_
Resolution resolveProductImpl(FUNC resolver) const
virtual void setMergeableRunProductMetadata_(MergeableRunProductMetadata const *)
virtual void retrieveAndMerge_(Principal const &principal, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
ProductStatus defaultStatus() const
void setMergeableRunProductMetadataInProductData(MergeableRunProductMetadata 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
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
Transition transition() const
ProductData const & getProductData() const final
bool productWasDeleted_() const override
std::string const & resolvedModuleLabel_() const override
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
Provenance const * provenance_() const final
bool productUnavailable_() const override
ProducedProductResolver::ProductStatus ProductStatus
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
GlobalContext const * globalContext() const
PuttableProductResolver(std::shared_ptr< BranchDescription const > bd)
SingleChoiceNoProcessProductResolver(ProductResolverIndex iChoice)
WaitingTaskList waitingTasks_
std::string const & moduleLabel() const
void prefetchAsync_(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
Provenance const * provenance_() const final
bool productUnavailable_() const final
ProductResolverIndex realResolverIndex_
Provenance const * provenance_() const final
void setFailedStatus() const