<div><br><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><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>
<p>
<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. 
<p></p><br></p>