Uh oh!
There was an error while loading. Please reload this page.
SPARK-11193 - Use Java ConcurrentHashMap instead of SynchronizedMap trait in order to avoid ClassCastException due to KryoSerializer in KinesisReceiver - #10203
Conversation
EugenCepoi
commented
Dec 8, 2015
Why don't you just replace the use of SynchronizedMap in KinesisReceiver with a ConcurrentHashMap instead? |
jbonofre
commented
Dec 8, 2015
There are two things:
Thought ? |
EugenCepoi
commented
Dec 8, 2015
That problem actually applies to all types for which Kryo provides a default ser/de. Mostly because kryo will try to deserialize to the type known during registration and this syntax |
jbonofre
commented
Dec 8, 2015
Good point. Let me upgrade KinesisReceiver to use Java ConcurrentHashMap implementation in this PR. We will see what the others think about this. |
srowen
commented
Dec 9, 2015
Yes, the simpler solution is better here. Use |
jbonofre
commented
Dec 9, 2015
All right. I'm updating the PR. Maybe it could make sense to inform people who use Kryo that the SynchronizedMap trait is "lost". WDYT ? |
313517f to
caa4363Comparejbonofre
commented
Dec 9, 2015
PR rebased and updated to use Java ConcurrentHashMap. I removed the change on the KryoSeralizer to deal with SynchronizedMap trait. |
There was a problem hiding this comment.
This can be simplified to just Option(shardIdToLatestStoredSeqNum.get(shardId))
There was a problem hiding this comment.
Good point Sean. Let me improve this !
Thanks !
srowen
commented
Dec 9, 2015
Aside from the two instances of that comment, looks OK |
There was a problem hiding this comment.
You can drop the return keyword
There was a problem hiding this comment.
Good catch, I forgot this cleanup. Thanks !
EugenCepoi
commented
Dec 9, 2015
Looks good |
There was a problem hiding this comment.
I don't think you need to fix this -- but I think the style convention is to use () when the invocation has a side effect and I'd argue that constructors always do. I should have said it earlier but don't know that it's worth changing as the original call didn't either.
There was a problem hiding this comment.
Oh, thanks for this reminder Sean. You are right, I used the same syntax as in the original code. Let me know if you want I change this.
There was a problem hiding this comment.
It's probably always a good idea to use ConcurrentHashMap instead of the mixed-in trait. The typesafe people themselves deprecated the trait and said it's unreliable and recommended that users use java's map instead.
SparkQA
commented
Dec 9, 2015
Test build #2190 has finished for PR 10203 at commit
|
srowen
commented
Dec 10, 2015
@jbonofre can you update the title to reflect the change? possibly description too |
SparkQA
commented
Dec 10, 2015
Test build #2194 has started for PR 10203 at commit |
jbonofre
commented
Dec 10, 2015
Sure. You mean the PR title or also the commit comment ? |
srowen
commented
Dec 10, 2015
PR title/description. The squashed commit gets a new message and the squashed commit descriptions look OK anyway. |
jbonofre
commented
Dec 10, 2015
All right, let me do it. |
9cad42d to
67aa4e6Compareandrewor14
commented
Dec 11, 2015
retest this please. The changes here LGTM |
jbonofre
commented
Dec 11, 2015
Thanks @andrewor14 (again ;)). Let me retest it. |
…dMap trait in order to avoid Kryo serializer issue
jbonofre
commented
Dec 11, 2015
Tests OK on my box. The Jenkins test failure doesn't look related. |
SparkQA
commented
Dec 11, 2015
Test build #2208 has finished for PR 10203 at commit
|
srowen
commented
Dec 12, 2015
Merged to master/1.6 |
…rait in order to avoid ClassCastException due to KryoSerializer in KinesisReceiver Author: Jean-Baptiste Onofré <jbonofre@apache.org> Closes#10203 from jbonofre/SPARK-11193. (cherry picked from commit 03138b6) Signed-off-by: Sean Owen <sowen@cloudera.com>
No description provided.