Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of SyncConsumer, added synchronization between consumers in BaseFilter class #149

Merged
merged 11 commits into from
Feb 11, 2016

Conversation

skonefal
Copy link
Contributor

@skonefal skonefal commented Feb 3, 2016

Ready for review.

Added virtually inherited class above Consumers and Producers to add synchronization barrier.
Serenity framework is now hardened.

In each "addConsumer" function, the consumer is informed that it will receive objects from producer.
In each "consume" event, FilterBase counts number of products that has came from producers, and when this number is equals to number of expected products - allProductsReady() function is invoked. In the end, cleanup() function is invoked.

In each producer constructor we now count number of products that should be produced in each iteration. Pipeline must go forward.

Removal of SyncConsumer class. It's functionality is not inside Consumer.

Try<Nothing> _consume(const T& in) {
newProductForConsumption();
// let derived class consume the product
Try<Nothing> result = consume(in);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we store the products in the consumer itself (append to list of products)?

@bwplotka
Copy link
Contributor

bwplotka commented Feb 3, 2016

LGTM! Great job. (: Please add some diagram of inheritance in our doc

* Every component should produce all it's products in the iteration.
* Components must not throw exceptions.

## Pipeline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you plan to have here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should put some considerations for Serenity developers.

@skonefal skonefal changed the title Added synchronization between consumers in BaseFilter class Removal of SyncConsumer, added synchronization between consumers in BaseFilter class Feb 8, 2016
Contentions());
return Nothing();
produceResults(corrections.get(), Contentions());
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed return.

// this->reset();
// If allProductsReady didn't produced all products - log error.
if (notAllProductsProduced()) {
// TODO(skonefal): Make '<<' virutal, so we could log component name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/virutal/virtual/

@bwplotka
Copy link
Contributor

bwplotka commented Feb 8, 2016

Good job, small nits and we are good to go!

skonefal and others added 4 commits February 9, 2016 13:01
Signed-off-by: bplotka <bwplotka@gmail.com>
Signed-off-by: bplotka <bwplotka@gmail.com>
Removed reason of build error in gcc 4.8.4
bwplotka added a commit that referenced this pull request Feb 11, 2016
Removal of SyncConsumer, added synchronization between consumers in BaseFilter class
@bwplotka bwplotka merged commit b12dcaa into mesosphere:master Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants