Giter Club home page Giter Club logo

Comments (11)

DanySK avatar DanySK commented on August 30, 2024

Apparently an object is not serializable: how does Ignite serialize?

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

As far I underdand, it uses it's Binary Marshaller

from alchemist.

DanySK avatar DanySK commented on August 30, 2024

Can you deepen the reason why it does refuse to serialize? It looks like it's failing at serializing Kotlin's lambda expressions - maybe we can program it?

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

Ok, I'll try to debug

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

Most of the serialization exceptions seem to origin from classes whose fields in some ways end up dealing with org.danilopianini.jirf.FunctionEdge. I guess the problem may be that it does not implement Serializable.

Other classes with similar issue are:

  • org.danilopianini.jirf.FactoryImpl
  • it.unibo.alchemist.loader.m2m.Context
  • org.jgrapht.graph.DefaultDirectedGraph (although this one extends a class who does implement Serializable)
  • it.unibo.alchemist.loader.m2m.SimulationModel$fromMap$3

And then there's another kind of exception regarding which I could not find so many information.

java.lang.UnsupportedOperationException: can't get field offset on a hidden class: private final kotlin.jvm.functions.Function1 it.unibo.alchemist.loader.m2m.ObjectFactory$$Lambda$145/0x0000000801176228.arg$1

from alchemist.

DanySK avatar DanySK commented on August 30, 2024

Okay, we must change the way we serialize, then, it's too much stuff to make Serializable. Also, it may be the case that Ignite internally does not use the Java serialization (and would be right in doing so).
We should send away only the environment, and the environment should not bring a Java Implicit Reflective Factory within, nor the YAML-to-Alchemist model-to-model stuff.

I think that the "strange thing" you see is a Kotlin default argument value.

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

I tried to avoid sending away the Loader by making the field in which it is stored transient and store in each RemoteSimulation an InitializedEnvironment. Most of the previous exceptions are gone, but now there's a problem with the serialization of classes with companion objects. Here's the error log.

from alchemist.

DanySK avatar DanySK commented on August 30, 2024

Can we replace the serializer of ignite with something else?

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

Yes, there's a method to set a (i believe custom) Marshaller but, it is deprecated:

Deprecated. Since 2.1. Some Ignite features will not work if non-null marshaller is set (IgniteCache.withKeepBinary(), .NET, CPP, ODBC)
Sets marshaller to use within grid.

Javadoc

from alchemist.

kelvin-olaiya avatar kelvin-olaiya commented on August 30, 2024

Okay, we must change the way we serialize, then, it's too much stuff to make Serializable. Also, it may be the case that Ignite internally does not use the Java serialization (and would be right in doing so). We should send away only the environment, and the environment should not bring a Java Implicit Reflective Factory within, nor the YAML-to-Alchemist model-to-model stuff.

@DanySK I'm working on the distribution of simulations, still having issues with serialization. I'm avoiding using the default Java serialization by using protocol buffers. The doubt that I now have is: to be able to serialize any Environment and/or Exporter (contained in an InitializedEnvironment) using protobuf, or any other framework, I should define a custom serializer for every specific implementation, right? (It seems to me like it would take a lot of effort, I want to be sure I'm not taking the wrong path).

from alchemist.

DanySK avatar DanySK commented on August 30, 2024

I think that you should have your custom exporter and throw errors if any other is being used

from alchemist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.