<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"> <div><BR>---------- Forwarded message ----------<BR>From: Abhishek <<A href="mailto:abhishek.pareek@yahoo.com">abhishek.pareek@yahoo.com</A>><BR>To: <A href="mailto:memcached@lists.danga.com">memcached@lists.danga.com </A><BR>Date: Fri, 11 Aug 2006 05:43:39 -0700 (PDT)<BR>Subject: Need different types of caches</div> <div> </div> <div><BR>Hi,<BR>I was trying my hand on memcache - java version, experimenting a little bit. What i cannot understand is how do I keep different types of caches on memcache. I tried creating two separate SocketIOPool connections with same server address but different ports. See below :- <BR>public MemCacheImpl() {<BR> String[] serverlist = {"<A onclick="return top.js.OpenExtLink(window,event,this)" href="http://172.16.2.82:11211/"
target=_blank>172.16.2.82:11211</A>"};<BR> String[] serverlist2 = {" <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://172.16.2.82:11212/" target=_blank>172.16.2.82:11212</A>"};<BR><BR> // initialize the pool for memcache servers<BR> SockIOPool pool = SockIOPool.getInstance();<BR> SockIOPool pool2 = SockIOPool.getInstance();<BR> pool.setServers(serverlist);<BR> pool2.setServers(serverlist2);<BR><BR><BR> pool.setInitConn(5);<BR> pool.setMinConn (5);<BR> pool.setMaxConn(50);<BR>
pool.setMaintSleep(30);<BR><BR> pool.setNagle(false);<BR> pool.initialize();<BR> //for pool2<BR> pool2.setInitConn(5);<BR> pool2.setMinConn (5);<BR> pool2.setMaxConn(50);<BR> pool2.setMaintSleep(30);<BR><BR> pool2.setNagle(false);<BR> pool2.initialize();<BR><BR> }<BR>It gave an exception as ++++++ trying to initialize an already initialized pool. <BR><BR>By different types of caches I mean I need to store PersonCache, ProjectCache in memcache. Currently I have these caches as implementation of Maps. But I want that a key of particular map(cache) goes into one
memcache server. How can I do that? <BR>ie.<BR>PersonCache = Map <BR>Key = personID<BR>value = PersonValueObject<BR><BR>ProjectCache = Map<BR>Key = projectID<BR>Value = ProjectValueObject<BR><BR>Now, If I have two memcache servers running on different ports as mentioned above, how do I designate an Element(key-value) of PersonCache to go to only server1 and Element of ProjectCache to go to server2 ?? <BR><BR>Can u pls tell me how can I create different caches on memcache? Also how can I create different configuration of SocketIOPool (s), so that they act as 'different caches' ??<BR><BR>Regards,<BR>Abbey.<BR><BR><BR></div> <div> <HR SIZE=1> Yahoo! Messenger with Voice. <A onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com" target=_blank>Make PC-to-Phone Calls </A>to the US (and 30+ countries) for 2¢/min or less. <div></div><BR> <div></div>
<div></div></BLOCKQUOTE><BR><p> 
        
        
                <hr size=1></hr>
Here's a new way to find what you're looking for - <a href="http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/">Yahoo! Answers</a> <BR>
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. <a href="http://in.rd.yahoo.com/mail/in/messengertagline/*http://in.messenger.yahoo.com">Get it NOW</a>