--Are we missing something?There seems no problem with the corresponding IntentCompiler class; it is not distributed.Hi,We need to write an external intent class and submit to IntentService, which uses a fixed serializer based on KryoNamespaces.API. ONOS version is 1.8.2.
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.
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 pool2017-04-28 21:16 GMT+03:00 Yi Tseng <y...@onlab.us>:One problem is to change serializer for IntentStore, we need to make sure all serializer from all ONOS nodes changed before we submit new Intents.Hi Hadi,Sorry for late reply,I understand your idea.
Basically we need to do some modification of current KryoNamespace and IntentStore; allows them register new Intent class in runtime.So we need to design another mechanism to handle it.--YiOn Tue, Apr 25, 2017 at 10:55 PM, Hadi Kahraman <hadi.k...@gmail.com> wrote:ThanksClasses implementing Externalizable are serialized by their own methods.Consistent hash codes prevent problems arise from accidental swapping of registration order of classes (class ids swap).I used this technique successfully 15 years ago (I am 59 now) for both a distributed class registry and a fast serializer replacing java serialization.Assuming that Kryo class ids can be large and randomly distributed integers, ids can be calculated from full class names instead of assigning manually.Hi Jordan,How can we use serialization service for this specific case?I understand that Kryo registration ids must be consistent across the cluster (interoperability) and through versions (backward compatibility).
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.