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

Recipe creation for split and union #49

Open
queeniema opened this issue Mar 3, 2016 · 7 comments
Open

Recipe creation for split and union #49

queeniema opened this issue Mar 3, 2016 · 7 comments

Comments

@queeniema
Copy link

I intend to write up recipes for:

  • How to split a stream
  • How to union a stream

Recipe ideas can be found here: https://github.com/quarks-edge/quarks/wiki/Quarks-Receipe-Ideas

@ddebrunner
Copy link
Collaborator

+1

It would be great if the recipes were driven from use-cases, rather than just the mechanics of split or union. That is I want to do X and how I do X is by using split.

@queeniema
Copy link
Author

@ddebrunner That's a good idea, do you have any thoughts on use cases that would apply here? I think that these recipes should be geared towards Quarks beginners. So, for split, I was thinking of something along the lines of:

Suppose you have a stream of random integers between 0 (inclusive) and 100 (exclusive), and you would like to separate them by the last digit of each number. For instance, all numbers ending in 8 would be contained in a single stream, and likewise with all numbers ending in 9. We can easily achieve this using split.

@ddebrunner
Copy link
Collaborator

I think that example is still just mechanics.

If you look at split here it has a nice example of splitting by log message severity type.

http://ibmstreams.github.io/streamsx.topology/doc/javadoc/com/ibm/streamsx/topology/TStream.html#split-int-com.ibm.streamsx.topology.function.ToIntFunction-

So the use case is I want to apply different analyics to log messages based upon their severity.

@ddebrunner ddebrunner changed the title Recipe creation Recipe creation for split and union Mar 4, 2016
@queeniema
Copy link
Author

What are your thoughts on these examples?

split

Suppose doctors at a hospital would like to monitor patients' states using a bedside heart monitor. They would like to apply different analytics to the monitor readings based on the severity category of the blood pressure readings. For instance, if a patient is in hypertensive crisis (due to extremely high blood pressure), the doctors may want to analyze the patient's heart rate to determine risk of a stroke.

In this instance, we can use split to separate blood pressure readings by category (five in total) and perform additional analytics based those categories.

union

Suppose an electric utility would like to gather electricity meter readings from all of its customers in the New England region of the United States.

In this case, we can use union to combine readings from each of the six states to analyze energy usage and patterns.

@ddebrunner
Copy link
Collaborator

Maybe add union to the split recipe rather than two, so having split the streams to do different processing to create alerts then union them to have a single stream that delivers alerts?

@queeniema
Copy link
Author

Okay, I will add union to the split recipe. That is, for each blood pressure category, generate an alerts stream. Union those alert streams into a single stream containing all alerts, and finally use sink to print out the alerts.

Should the two bullet points on the recipe ideas page be merged into one to reflect this change?

@chanskw
Copy link
Collaborator

chanskw commented Mar 7, 2016

Hi, wondering if we have a template on creating these recipes? If we are to create more recipe, is there a format we should follow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants