Skip to content

[BEAM-2482] CodedValueMutationDetector should use the coders structural value#3406

Closed
evindj wants to merge 5 commits intoapache:masterfrom
evindj:Beam2482
Closed

[BEAM-2482] CodedValueMutationDetector should use the coders structural value#3406
evindj wants to merge 5 commits intoapache:masterfrom
evindj:Beam2482

Conversation

@evindj
Copy link
Contributor

@evindj evindj commented Jun 20, 2017

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.
  • 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.

@evindj evindj closed this Jun 20, 2017
@evindj evindj reopened this Jun 20, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 70.591% when pulling 02088c8 on evindj:Beam2482 into 698b89e on apache:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 70.608% when pulling 02088c8 on evindj:Beam2482 into 698b89e on apache:master.

@davorbonaci
Copy link
Member

R: @tgroh

@tgroh, would you mind taking a look here please?

Copy link
Member

@tgroh tgroh left a comment

Choose a reason for hiding this comment

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

Can you revert all of the additional changes?

I also am not sure if this is a desirable change. See the comment. When @lukecwik is back he may have more opinions.

}
// ArrayList, which will then be re-encoded in a bounded format. So we get a structural value
// from a coder and used that to check if the byte array[] are the same. The structuralValue()
// method of the Coder returns a StructuralByteArray object.
Copy link
Member

Choose a reason for hiding this comment

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

This is not always the case; the Coder can understand that it has an object with a good equals method, and return the object directly.

I'm not sure if I agree that this is a desired change. We'll already have compared the final state of the original object to its clone in the original state, and the clone of the original object to the clone of original object in its final state, so we've already done what is appreciably a fast path, and now are checking the most generous possible "equality" in terms of java.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @lukecwik Please I would like to have your point of view here, do not worry about additional changes I'll revert them

Copy link
Member

Choose a reason for hiding this comment

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

The jira issue could be worded better but my intent was we should rely only on the structural value comparison and drop all the other checks which are occurring within this method. Contractually the coder is required to return a value with a good equals method (not needing the usage of deep equals or cloning).

@evindj
Copy link
Contributor Author

evindj commented Jul 26, 2017

I had too much trouble trying to revert some of the changes here. I decided to finally just close this PR and open a new one.

@evindj evindj closed this Jul 26, 2017
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.

5 participants