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 <[email protected]> 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 StreamSerializer<TreeSet<Long>>() { > @Override > public void write(ObjectDataOutput objectDataOutput, > TreeSet<Long> longs) throws IOException { > System.out.println("TreeSet StreamSerializer#write > called"); > } > > @Override > public TreeSet<Long> 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 TreeSet<Long>().getClass()); > > primaryHazelcastConfig.getSerializationConfig().addSerializerConfig(sc); > > > On Mon, Dec 8, 2014 at 3:00 PM, Sajini De Silva <[email protected]> wrote: > >> Still its working. >> >> On Mon, Dec 8, 2014 at 2:54 PM, Afkham Azeez <[email protected]> wrote: >> >>> >>> On Mon, Dec 8, 2014 at 2:50 PM, Sajini De Silva <[email protected]> wrote: >>> >>>> SerializerConfig sc = new SerializerConfig() >>>> .setImplementation(new TreeMapSerializer()) >>>> .setTypeClass(new TreeSet<Long>().getClass()); >>>> Config config = new Config(); >>>> config.getSerializationConfig().addSerializerConfig(sc); >>>> HazelcastInstance primaryHazelcastInstance= >>>> Hazelcast.newHazelcastInstance(config); >>>> IMap<String, TreeSet<Long>> testMap = >>>> primaryHazelcastInstance.getMap("testMap"); >>>> >>>> TreeSet<Long> slotIdSet = new TreeSet<Long>(); >>>> 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 TreeSet<Long>().getClass()); >>> Config config = new Config(); >>> >>> HazelcastInstance primaryHazelcastInstance= Hazelcast. >>> newHazelcastInstance(config); >>> IMap<String, TreeSet<Long>> testMap = primaryHazelcastInstance. >>> getMap("testMap"); >>> config.getSerializationConfig().addSerializerConfig(sc); >>> >>> TreeSet<Long> slotIdSet = new TreeSet<Long>(); >>> 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: **[email protected]* <[email protected]> >>> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: * >>> *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: [email protected] >> 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: **[email protected]* <[email protected]> > * 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: [email protected] Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva Phone: +94 712797729
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
