Skip to content

Conversation

@swegner
Copy link
Contributor

@swegner swegner commented Apr 5, 2016

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace "<Jira issue #>" in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

@swegner
Copy link
Contributor Author

swegner commented Apr 5, 2016

R: @bjchambers

public void populateDisplayData(DisplayData.Builder builder) {
builder
.add("numQuantiles", numQuantiles)
.add("comparer", compareFn.getClass());
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we want to also use the compareFn.toString(). I'm thinking about cases where a user may have constructed a comparator by wrapping one or more actual comparators. In that case, just knowing the class of the outer comparator may not be complete information. Also happy to defer until this becomes a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's defer until this is an issue. In most cases comparators won't implement toString(), so the additional display data would be redundant and not as nicely formatted as compareFn.getClass(). I'd rather give an explicit was for comparators to register display data.

Perhaps we could inspect (compareFn instanceof HasDisplayData)-- but, let's save that until we have a use-case.

@kennknowles
Copy link
Member

The conflicts prevent test run. Probably want to rebase and push to kick them.

@swegner swegner force-pushed the displaydata-combine branch from c6edc08 to 40b8abd Compare April 11, 2016 22:36
@swegner swegner force-pushed the displaydata-combine branch from 7dcf68a to fcdc0c3 Compare April 14, 2016 18:06
@swegner
Copy link
Contributor Author

swegner commented Apr 14, 2016

I've addressed all feedback so far. Please take another look. @bjchambers

*/
private final long sampleSize;

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

"The the" -> "The"

Copy link
Contributor

Choose a reason for hiding this comment

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

also, the comma seems unnecessary

String baseNamespace = combineFnEntries.getKey().getName();
for (int i = 0; i < combineFns.size(); i++) {
HasDisplayData combineFn = combineFns.get(i);
String namespace = String.format("%s$%d", baseNamespace, i + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it matters, but we may want to use something other than $, since that is already used for anonymous inner classes. Maybe #? Although at that point, we've already gone to the point of having the path (in this case the path is just a number).

@bjchambers
Copy link
Contributor

A few minor comments, then LGTM.

@swegner
Copy link
Contributor Author

swegner commented Apr 15, 2016

I've addressed all feedback so far. Please take another look. @bjchambers

@bjchambers
Copy link
Contributor

LGTM

@asfgit asfgit closed this in eb682a8 Apr 15, 2016
@dhalperi dhalperi mentioned this pull request Apr 15, 2016
@swegner swegner deleted the displaydata-combine branch April 20, 2016 16:50
@swegner
Copy link
Contributor Author

swegner commented May 16, 2016

Backported via GoogleCloudPlatform/DataflowJavaSDK#216

iemejia referenced this pull request in iemejia/beam Jan 12, 2018
mareksimunek pushed a commit to mareksimunek/beam that referenced this pull request May 9, 2018
…-from-reduce-by-key

apache#121 allow multiple elements from reduce by key
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
* feat: create AsyncIter class for mocking

* fix: type error on mocked return on batch_get_documents
FuRyanf pushed a commit to FuRyanf/beam that referenced this pull request Sep 3, 2024
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.

3 participants