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

[HWKMETRICS-802] Validate when scheduled jobs has null values #1007

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

rubenvp8510
Copy link
Contributor

No description provided.

@rubenvp8510 rubenvp8510 changed the title [HWKMETRICS-802] Validate when scheduled jobs has null values (#1006) [HWKMETRICS-802] Validate when scheduled jobs has null values Dec 17, 2018
@rubenvp8510 rubenvp8510 force-pushed the HWKMETRICS-802 branch 3 times, most recently from 17d7418 to 2831bab Compare December 17, 2018 20:37
"slice [%s]", jobId, timeSlice.getTime()));
// First check if the job exists
return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId))
.isEmpty()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll comment on this PR as the other one were you presented the question was merged already. I'm not sure what you try to achieve here, since if the previous part does not emit anything, then there's nothing to flatMap in the next section either. So why transform the end event to a boolean?

Copy link
Contributor Author

@rubenvp8510 rubenvp8510 Dec 18, 2018

Choose a reason for hiding this comment

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

I want to validate if the findByIdAndSlice statement returns empty, just for logging purposes. In the case of non-empty I will execute the updateStatus statement, is in this case when I need to use flatMap.

Essentially I'm transforming a boolean to emitted rows from updateStatus only if the boolean true, otherwise, I'm returning an empty observable. I'm using the flatMap to flat the Observable returned by updateStatus.

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

.switchIfEmpty(Observable.empty().doOnComplete(() -> logger.info("Nothing was found!")) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mm yeah, something like that :)

@rubenvp8510 rubenvp8510 force-pushed the HWKMETRICS-802 branch 3 times, most recently from f1ff9ed to 03719e5 Compare December 21, 2018 04:08
@rubenvp8510 rubenvp8510 reopened this Dec 21, 2018
@rubenvp8510 rubenvp8510 merged commit a320c3e into hawkular:release/0.29.0 Dec 21, 2018
rubenvp8510 added a commit to rubenvp8510/hawkular-metrics that referenced this pull request Dec 21, 2018
rubenvp8510 added a commit to rubenvp8510/hawkular-metrics that referenced this pull request Jan 7, 2019
rubenvp8510 added a commit to rubenvp8510/hawkular-metrics that referenced this pull request Jan 8, 2019
rubenvp8510 added a commit that referenced this pull request Jan 30, 2019
* Validate when scheduled jobs has null values (#1007)

* Release 0.28.8.Final
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants