[Dev] Custom serialization in hazelcast is not working
Hi, I'm using custom serialization in hazelcast for a tree map. I set serialization properties to hazelcast instance in the code like following. this.hazelcastInstance = hazelcastInstance; SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new MessageIDTreeSetStreamSerializer()).setTypeClass(new TreeSetLong().getClass()); hazelcastInstance.getConfig().getSerializationConfig().addSerializerConfig(sc); But when a treeset is put in to a hazelcast map the write method in my custom serilizer is not getting called. Does anybody has any idea about this? Is it possible to add custom serializers to Treesets and Hashmaps? Thank you, Sajini -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Can you first write a simple standalone class with your serializer and see whether it gets called? Just write a simple class with a main method. On Mon, Dec 8, 2014 at 1:59 PM, Sajini De Silva saj...@wso2.com wrote: Hi, I'm using custom serialization in hazelcast for a tree map. I set serialization properties to hazelcast instance in the code like following. this.hazelcastInstance = hazelcastInstance; SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new MessageIDTreeSetStreamSerializer()).setTypeClass(new TreeSetLong().getClass()); hazelcastInstance.getConfig().getSerializationConfig().addSerializerConfig(sc); But when a treeset is put in to a hazelcast map the write method in my custom serilizer is not getting called. Does anybody has any idea about this? Is it possible to add custom serializers to Treesets and Hashmaps? Thank you, Sajini -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Hi Azeez, My standalone application is working fine for TreeSetLong. I have the same hazelcast dependency in my standalone application also. Thank you, Sajini. On Mon, Dec 8, 2014 at 2:30 PM, Afkham Azeez az...@wso2.com wrote: Can you first write a simple standalone class with your serializer and see whether it gets called? Just write a simple class with a main method. On Mon, Dec 8, 2014 at 1:59 PM, Sajini De Silva saj...@wso2.com wrote: Hi, I'm using custom serialization in hazelcast for a tree map. I set serialization properties to hazelcast instance in the code like following. this.hazelcastInstance = hazelcastInstance; SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new MessageIDTreeSetStreamSerializer()).setTypeClass(new TreeSetLong().getClass()); hazelcastInstance.getConfig().getSerializationConfig().addSerializerConfig(sc); But when a treeset is put in to a hazelcast map the write method in my custom serilizer is not getting called. Does anybody has any idea about this? Is it possible to add custom serializers to Treesets and Hashmaps? Thank you, Sajini -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Standalone application code is shown below. SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); On Mon, Dec 8, 2014 at 2:43 PM, Sajini De Silva saj...@wso2.com wrote: Hi Azeez, My standalone application is working fine for TreeSetLong. I have the same hazelcast dependency in my standalone application also. Thank you, Sajini. On Mon, Dec 8, 2014 at 2:30 PM, Afkham Azeez az...@wso2.com wrote: Can you first write a simple standalone class with your serializer and see whether it gets called? Just write a simple class with a main method. On Mon, Dec 8, 2014 at 1:59 PM, Sajini De Silva saj...@wso2.com wrote: Hi, I'm using custom serialization in hazelcast for a tree map. I set serialization properties to hazelcast instance in the code like following. this.hazelcastInstance = hazelcastInstance; SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new MessageIDTreeSetStreamSerializer()).setTypeClass(new TreeSetLong().getClass()); hazelcastInstance.getConfig().getSerializationConfig().addSerializerConfig(sc); But when a treeset is put in to a hazelcast map the write method in my custom serilizer is not getting called. Does anybody has any idea about this? Is it possible to add custom serializers to Treesets and Hashmaps? Thank you, Sajini -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Still its working. On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez az...@wso2.com wrote: On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Change HazelcastClusteringAgent#init method to include the following and see whether the sysouts are getting printed. primaryHazelcastConfig.addMapConfig(mapConfig); SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new StreamSerializerTreeSetLong() { @Override public void write(ObjectDataOutput objectDataOutput, TreeSetLong longs) throws IOException { System.out.println(TreeSet StreamSerializer#write called); } @Override public TreeSetLong read(ObjectDataInput objectDataInput) throws IOException { System.out.println(TreeSet StreamSerializer#read called); return null; } @Override public int getTypeId() { return 0; } @Override public void destroy() { System.out.println(TreeSet StreamSerializer#destroy called); } }).setTypeClass(new TreeSetLong().getClass()); primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc); On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva saj...@wso2.com wrote: Still its working. On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez az...@wso2.com wrote: On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
Hi Azeez, I tested the above scenario and when the above code segment is added to HazelcastClusteringAgent, the sysout are printed. Thank you, Sajini On Mon, Dec 8, 2014 at 3:39 PM, Afkham Azeez az...@wso2.com wrote: Change HazelcastClusteringAgent#init method to include the following and see whether the sysouts are getting printed. primaryHazelcastConfig.addMapConfig(mapConfig); SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new StreamSerializerTreeSetLong() { @Override public void write(ObjectDataOutput objectDataOutput, TreeSetLong longs) throws IOException { System.out.println(TreeSet StreamSerializer#write called); } @Override public TreeSetLong read(ObjectDataInput objectDataInput) throws IOException { System.out.println(TreeSet StreamSerializer#read called); return null; } @Override public int getTypeId() { return 0; } @Override public void destroy() { System.out.println(TreeSet StreamSerializer#destroy called); } }).setTypeClass(new TreeSetLong().getClass()); primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc); On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva saj...@wso2.com wrote: Still its working. On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez az...@wso2.com wrote: On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919blog: **http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
could we have this in next kernel release? will make our life easy (with the MB time line) :) On Tue, Dec 9, 2014 at 10:07 AM, Sajini De Silva saj...@wso2.com wrote: Hi Azeez, I tested the above scenario and when the above code segment is added to HazelcastClusteringAgent, the sysout are printed. Thank you, Sajini On Mon, Dec 8, 2014 at 3:39 PM, Afkham Azeez az...@wso2.com wrote: Change HazelcastClusteringAgent#init method to include the following and see whether the sysouts are getting printed. primaryHazelcastConfig.addMapConfig(mapConfig); SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new StreamSerializerTreeSetLong() { @Override public void write(ObjectDataOutput objectDataOutput, TreeSetLong longs) throws IOException { System.out.println(TreeSet StreamSerializer#write called); } @Override public TreeSetLong read(ObjectDataInput objectDataInput) throws IOException { System.out.println(TreeSet StreamSerializer#read called); return null; } @Override public int getTypeId() { return 0; } @Override public void destroy() { System.out.println(TreeSet StreamSerializer#destroy called); } }).setTypeClass(new TreeSetLong().getClass()); primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc); On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva saj...@wso2.com wrote: Still its working. On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez az...@wso2.com wrote: On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- Ramith Jayasinghe Technical Lead WSO2 Inc., http://wso2.com lean.enterprise.middleware E: ram...@wso2.com P: +94 777542851 ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Custom serialization in hazelcast is not working
I can provide an extension point to the kernel. On Tue, Dec 9, 2014 at 10:38 AM, Ramith Jayasinghe ram...@wso2.com wrote: could we have this in next kernel release? will make our life easy (with the MB time line) :) On Tue, Dec 9, 2014 at 10:07 AM, Sajini De Silva saj...@wso2.com wrote: Hi Azeez, I tested the above scenario and when the above code segment is added to HazelcastClusteringAgent, the sysout are printed. Thank you, Sajini On Mon, Dec 8, 2014 at 3:39 PM, Afkham Azeez az...@wso2.com wrote: Change HazelcastClusteringAgent#init method to include the following and see whether the sysouts are getting printed. primaryHazelcastConfig.addMapConfig(mapConfig); SerializerConfig sc = new SerializerConfig(); sc.setImplementation(new StreamSerializerTreeSetLong() { @Override public void write(ObjectDataOutput objectDataOutput, TreeSetLong longs) throws IOException { System.out.println(TreeSet StreamSerializer#write called); } @Override public TreeSetLong read(ObjectDataInput objectDataInput) throws IOException { System.out.println(TreeSet StreamSerializer#read called); return null; } @Override public int getTypeId() { return 0; } @Override public void destroy() { System.out.println(TreeSet StreamSerializer#destroy called); } }).setTypeClass(new TreeSetLong().getClass()); primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc); On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva saj...@wso2.com wrote: Still its working. On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez az...@wso2.com wrote: On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva saj...@wso2.com wrote: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); config.getSerializationConfig().addSerializerConfig(sc); HazelcastInstance primaryHazelcastInstance= Hazelcast.newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance.getMap(testMap); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); Change the code as follows see whether it still works. Most probably it won't work: SerializerConfig sc = new SerializerConfig() .setImplementation(new TreeMapSerializer()) .setTypeClass(new TreeSetLong().getClass()); Config config = new Config(); HazelcastInstance primaryHazelcastInstance= Hazelcast. newHazelcastInstance(config); IMapString, TreeSetLong testMap = primaryHazelcastInstance. getMap(testMap); config.getSerializationConfig().addSerializerConfig(sc); TreeSetLong slotIdSet = new TreeSetLong(); slotIdSet.add(Long.valueOf(1212121)); slotIdSet.add(Long.valueOf(3413131)); -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez* http://twitter.com/afkham_azeez *linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729 -- Ramith Jayasinghe Technical Lead WSO2 Inc., http://wso2.com lean.enterprise.middleware E: ram...@wso2.com P: +94 777542851 -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94