-
Notifications
You must be signed in to change notification settings - Fork 73
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
Encountered unregistered class ID #16
Comments
00:29 TRACE: [kryo] Register class ID 1028558732: no.ks.svarut.bruker.BrukerOpprettet (com.esotericsoftware.kryo.ser Its my classes that get these ids. |
Can you enable |
I updated README to be more explicit about initialization of Kryo and assigning the same class IDs on both sides |
I wanted to use the default method, without specifying mappings or classes. Let kryo write classnames and object. |
One important thing to realize is: |
Isn't it therefore kryo writes the complete class name in the data, when calling writeClassAndObject? Thats what we use when we write classes to our database with kryo. No registration og classes. |
Not quite. The story goes like this: But if your deserializer (e.g. a receiving actor) was receiving some other messages before it could happen that it has seen some other classes in the meantime and assigned the same IDs to them. And now, when it receives something with your class those IDs are occupied already. Therefore, I really suggest that you initialize Kryo exactly in the same way on all sides. BTW, the reason why Kryo always writes classnames into a database for you is probably due to the fact, that you create a new Kryo instance every time you serialize. This way, for this fresh Kryo instance your class is always a fist time :-) But in this library, as it is supposed to be a high-performance one, we do pooling of Kryo instances, because creating Kryo instances for each operation is too expensive. I really suggest you try to register your typical objects in your custom initializer. It is easy (because you do not need to explicitly enumerate all classes as it is the case with "mappings" and "classes" sections) and it will automatically register all classes used by the object graph represented by this object and its sub-objects. |
I think it just wrote the classname the first time to the database. We read the classes in sequence every time :) I will have to register all the classes, thanks for all the help. |
No problem. Let me know if it works for you. |
Now using explicit registration and my kryo-init class for registering classes. Seems to work perfectly. I had huge performance issues with networking until i found the throughput parameter on the default dispatcher. Throughput is now 10000. |
Very cool. Can you quantify how much faster it is for your use-cases? BTW, if you want to make it even faster, the Unsafe-based Input/Output streams in 2.22-SNAPSHOT can give a significant performance boost. BTW, it would be nice if you could report on the Akka mailing list that it works for you now and what kind of performance improvement you got. This could be useful to promote this library :-) |
Just saw your comment on the mailing list. Thanks a lot! |
5-6 min join time in my cluster when i burst messages across. With throuput 10000 its down to 2min. Profiling shows insignificant time in kryo. Its akka and networkstack that uses cputime. |
In order to pre-register most if not all required Bio-Formats classes so that bfmemo files are stable between JVM restarts, we print out classes during Memoization. Output from the full repo job as well as OMERO should be combined together. See: * altoo-ag/akka-kryo-serialization#16 (comment) * https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala#L82 * http://stackoverflow.com/questions/12277193/automatic-class-registration-in-kryo
In order to pre-register most if not all required Bio-Formats classes so that bfmemo files are stable between JVM restarts, we print out classes during Memoization. Output from the full repo job as well as OMERO should be combined together. See: * altoo-ag/akka-kryo-serialization#16 (comment) * https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala#L82 * http://stackoverflow.com/questions/12277193/automatic-class-registration-in-kryo
im registering all my classes upon serialization with scala i have "serialization required" true. and it serializes fine. but when deserializing on another machine that runs java, i get the im trying to figure out how to use the custom initializers and give them a try. |
In order to pre-register most if not all required Bio-Formats classes so that bfmemo files are stable between JVM restarts, we print out classes during Memoization. Output from the full repo job as well as OMERO should be combined together. See: * altoo-ag/akka-kryo-serialization#16 (comment) * https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala#L82 * http://stackoverflow.com/questions/12277193/automatic-class-registration-in-kryo
Hi
I get this exception when sending messages across two nodes.
we use deault strategy and we have logged that kryo uses writeClassAndObject and readClassAndObject.
This is in a akkacluser and there are messages going back and fort with java serialization and google protbuf.
any ideas?
AkkaConfig:
actor {
provider = "akka.cluster.ClusterActorRefProvider"
exception:
com.esotericsoftware.kryo.KryoException: Encountered unregistered class ID: 720389982
at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:119)
at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:656)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:767)
at com.romix.akka.serialization.kryo.KryoBasedSerializer.fromBinary(KryoSerializer.scala:279)
at com.romix.akka.serialization.kryo.KryoSerializer.fromBinary(KryoSerializer.scala:135)
The text was updated successfully, but these errors were encountered: