--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+unsubscribe@onosproject.org.
To post to this group, send email to onos...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/onos-dev/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/CAPHQ%2BV%2Bk8G9po7czOJXRa9ZEJYHhSZrrgq%2BLXBjbH639fhubPw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To post to this group, send email to onos...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/onos-dev/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/CANbTR4QD5fnahnrK8T%3Dn0mFtgtiZy6wv%3DK2yBCSbrz8ez2AYhw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/CANbTR4QD5fnahnrK8T%3Dn0mFtgtiZy6wv%3DK2yBCSbrz8ez2AYhw%40mail.gmail.com.
I think dynamic type registration usage pattern is something like this:Hi Yi,I was on a short vacation.
- Intent subsystem starts with a default set of types
- An application registers its specific intent classes with IntentService when it activates
- Application submits its intents
How will things work? Let me describe with a basic pseudo-code below. Does it make sense?
-------------------- EXISTING ---------------------------------KryoNamespace.Builder.nextId (BASE_ID) // add exisiting types to blocks, then set base id
KryoNamespace.Builder.register (Class<?>...) // add to list of types
...
KryoNamespace.Builder.build():
   add types to list of blocks // each block has a base id
   new KryoNamespace (blocks, ...).populate(1)
KryoNamespace.populate (1):
   release (create()) // 1 instance only
KryoNamespace.create:
   kryo = new Kryo()
   // I don't know how InstantiatorStartegy effects things
   for each block:
       id = block.base
       for each type in block:
           kryo.register (class, serializer, id++)
   return kryo
KryoNamespace.release (kryo):
   kryoPool.release (kryo) // put kryo instance into the pool
-------------------- MODIFIED ---------------------------------
... // blocks are not needed anymore
           kryo.register (class, serializer, crc64(class.getName().getBytes))
...KryoNamespace.register (Class<?>...) // new method chain: IntentManager -> IntentStore -> KryoNamespace
   loop: // modify all kryo instances in place, serializer automatically recognizes newly registered classes
       kryo = kryoPool.borrow
       kryo.register (class, crc64(class.getName().getBytes))
       stash kryo
   release all kryo instances in the stash back to the pool
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/CAPHQ%2BVJrnb_RXvOznd1pKkMnK9ifAEWcyjOwmDKZQ1OSM6rhtA%40mail.gmail.com.