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

Enrich ApiJobStore to support filtering #23

Merged
merged 1 commit into from
Sep 8, 2016

Conversation

venisa
Copy link

@venisa venisa commented Aug 31, 2016

ApiJobStore now supports filtering JobRows
Added filtering logic to HashJobStore
Added ApiJobStoreFilter which stores filter information like the JobField to be inspected, the values to be compared and the filter operation to be performed.

@venisa venisa added the WIP label Aug 31, 2016
@venisa venisa force-pushed the Enrich-the-ApiJobStore-interface branch from eba614c to 1099084 Compare August 31, 2016 16:18
@venisa
Copy link
Author

venisa commented Aug 31, 2016

@archolewa @cdeszaq @dayamr Please review

@venisa venisa force-pushed the Enrich-the-ApiJobStore-interface branch 2 times, most recently from 74e935d to 60ac75a Compare August 31, 2016 20:56
* This method takes a Set of ApiJobStoreFilters, ANDS them by default, and returns a cold observable that emits a
* stream of JobRows which satisfy the given filter.
* <p>
* Every field may not be filterable for every implementation of the `ApiJobStore` as the efficiency of filtering is
Copy link
Contributor

Choose a reason for hiding this comment

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

Should replace the markdown style backticks with the JavaDoc {@code ...}. I too wish that JavaDocs supported Markdown, but alas this is not Elixir (also I think Java predates Markdown).

@archolewa
Copy link
Contributor

Finished my first pass.

@venisa venisa added this to the vn clean milestone Sep 2, 2016
@venisa venisa force-pushed the Enrich-the-ApiJobStore-interface branch from 3e9bd60 to 77c7dbb Compare September 2, 2016 16:25
@venisa venisa force-pushed the Enrich-the-ApiJobStore-interface branch from 77c7dbb to 5a62c89 Compare September 2, 2016 16:28
@venisa venisa removed the NEED REBASE label Sep 2, 2016
@venisa
Copy link
Author

venisa commented Sep 2, 2016

@archolewa Addressed all comments

}

/**
* This method checks if the given JobRow satisfies the given JobRowFilter and returnd true if it does.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo. returnd should be returns.

* This method takes a Set of JobRowFilters, ANDS them by default, and returns a cold observable that emits a
* stream of JobRows which satisfy the given filter.
* <p>
* Every field may not be filterable for every implementation of the {@code ApiJobStore} as the efficiency of
Copy link
Contributor

Choose a reason for hiding this comment

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

'Any of the fields may be not' would be slightly clearer than 'Every field may not be'. As written it seems to mean that sometimes all the fields are not filterable and sometimes they are all filterable.

@michael-mclawhorn
Copy link
Contributor

michael-mclawhorn commented Sep 7, 2016

I'm happy with this. 👍 Once the issue with the mobstor reference is cleaned up.

* filtering is dependent on the backing store. An IllegalArgumentException is thrown if filtering on any given
* field is not supported.
*
* @param jobRowFilters A List of JobRowFilters where each JobRowFilter contains the JobField to be
Copy link
Collaborator

@cdeszaq cdeszaq Sep 7, 2016

Choose a reason for hiding this comment

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

Note: The type is Set but this calls it a List. Which should it be?

Copy link
Author

Choose a reason for hiding this comment

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

Set


@Override
public Observable<JobRow> getFilteredRows(Set<JobRowFilter> jobRowFilter)
throws IllegalArgumentException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can unwrap.

Also, we should probably document what this will return, since the NoOp version is a little odd, in general, and it may not be clear what filtering on the NoOp store would do.

@venisa venisa force-pushed the Enrich-the-ApiJobStore-interface branch from e2e6688 to 6623363 Compare September 7, 2016 19:07
@archolewa
Copy link
Contributor

Ticket to address @cdeszaq's concerns about pagination in the ApiJobStore: #36

@archolewa archolewa force-pushed the Enrich-the-ApiJobStore-interface branch from 0bc0bd7 to ec2c7d0 Compare September 8, 2016 19:16
@archolewa archolewa merged commit ec2c7d0 into master Sep 8, 2016
@venisa venisa deleted the Enrich-the-ApiJobStore-interface branch September 8, 2016 19:27
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.

4 participants