Class: CoverageProcessor

.processors. CoverageProcessor

This processor is used to ensure coverage of subscriptions or queries run locally, but based on data coming from remote default source. It sends graphdefs to the remote data source to get enough data and be able to execute the query locally.


new CoverageProcessor(logger, registry, transactionMgr)

Parameters:
Name Type Description
logger olympe.logging.Channel
registry olympe.dc.query.SubscriptionRegistry
transactionMgr olympe.dc.transaction.TransactionManager

Methods


ensureListCoverage(subscription, callback)

For subscriptions with a remote destination, we need to ensure their coverage before plugin the subscription in the local database and booting it. This method takes care of this.

To do so, we extracts graphdefs from the transformers of the subscription which act as a description of paths in the graph that must be covered to ensure the listdef subscription can be processed locally. For each of them, loop over the existing graphdefs subscriptions to check whether they cover the path or not. For each non covered path, a graphdef is emitted. Thru the callbacks mechanisms, we then wait until receiving a graphdef result for each non covered path. Once all paths are covered, we finally boot the subscription

Parameters:
Name Type Description
subscription olympe.dc.query.Subscription
callback function

ensureQueryCoverage(query, isSubscription, callback)

Parameters:
Name Type Description
query olympe.dc.Query
isSubscription boolean
callback function