Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Jean-Baptiste Onofré
Thanks guys for the details and update. I'm updating my WriteFn and Coder accordingly. Regards JB On 06/20/2017 05:52 PM, Lukasz Cwik wrote: Filed https://issues.apache.org/jira/browse/BEAM-2482 for updating CodedValueMutationDetector On Tue, Jun 20, 2017 at 8:29 AM, Kenneth Knowles wrote:

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Lukasz Cwik
Filed https://issues.apache.org/jira/browse/BEAM-2482 for updating CodedValueMutationDetector On Tue, Jun 20, 2017 at 8:29 AM, Kenneth Knowles wrote: > Replacing full encoding with structural value is a good way to provide an > opportunity for a fast past. File a starter JIRA? > > The equals che

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Kenneth Knowles
Replacing full encoding with structural value is a good way to provide an opportunity for a fast past. File a starter JIRA? The equals check should be retained since it will sometimes be even faster, and structural value falls back to full encoding. On Tue, Jun 20, 2017 at 8:19 AM, Lukasz Cwik w

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Lukasz Cwik
I think the mutation detector could be updated to use the coder's structural value and the coder could then provide a structural value which wraps the message and does the equality comparison however it chooses. https://github.com/apache/beam/blob/01b3f87f977d44eac23eb5488074bbc638858a9d/sdks/java/

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Lukasz Cwik
Either Java object equality or its coder needs to be deterministic for that check to hold. On Tue, Jun 20, 2017 at 7:49 AM, Reuven Lax wrote: > Him > > That is only a fast path. If equals returns false, it then encodes the > values to a byte array and checks the byte array for equality. So as lo

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Reuven Lax
Him That is only a fast path. If equals returns false, it then encodes the values to a byte array and checks the byte array for equality. So as long as you havev a correct coder, this should work. On Tue, Jun 20, 2017 at 2:06 AM, Jean-Baptiste Onofré wrote: > Hi Kenn, > > I checked in MutationD

Re: Does a PCollection element class override equals() ?

2017-06-20 Thread Jean-Baptiste Onofré
Hi Kenn, I checked in MutationDetectors, and we use the CodedValueMutationDetector(T value, Coder coder). To verify mutation, we use the verifyUnmodified() method calling verifyUnmodifiedThrowingCheckedExceptions(). In the verifyUnmodifiedThrowingCheckedExceptions() method, basically, we do

Re: Does a PCollection element class override equals() ?

2017-06-19 Thread Jean-Baptiste Onofré
Thanks Kenn, let me investigate a bit if I can do something on the coder side. Regards JB On 06/19/2017 07:57 AM, Kenneth Knowles wrote: Last I checked, equals() was used only as a shortcut. If the two are not equals() then their encoded forms should be checked. If neither equals() nor the cod

Re: Does a PCollection element class override equals() ?

2017-06-18 Thread Kenneth Knowles
Last I checked, equals() was used only as a shortcut. If the two are not equals() then their encoded forms should be checked. If neither equals() nor the coder can work for this, you will have a bad time. On Sun, Jun 18, 2017 at 10:14 PM, Jean-Baptiste Onofré wrote: > Hi team, > > The direct run