You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by David Wood <da...@us.ibm.com> on 2011/06/13 15:10:47 UTC
JCS as shared memory in MANET and problem with put/get.
Hi,
I've split the following question out into a separate thread. I'm
considering using JCS 1.3 for a distributed registry in a Mobile
Adhoc Network (MANET), with the following requirements:
1) No central server
2) More than one JVM per ip address
3) Single config file (desirable, but not absolutely required)
There may be more, but those are the ones that I think cause the most
trouble. So the first question: Can JCS do this (particularly 2)? I've
looked at the UDP discovery and Lateral TCP, which together suggest that
it can.
I've create a test case which I'm having trouble with (see code below).
Unfortunately, the put() does not seem to be shared with the get()er. (I
first run the put()er, then start the get()er). Thoughts?
String cfg1 = "/dsm-jcs1.ccf";
String cfg2 = "/dsm-jcs2.ccf";
if (argv.length > 0) {
JCS.setConfigFilename(cfg2);
JCS jcs = JCS.getInstance("DSM");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
} else {
JCS.setConfigFilename(cfg1);
JCS jcs = JCS.getInstance("DSM");
System.out.println("Placing entry me=here");
jcs.put("me", "here");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
try {
System.out.println("Sleeping 1000 seconds");
Thread.sleep(1000*1000);
} catch (InterruptedException e) {
;
}
}
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)
Re: JCS as shared memory in MANET and problem with put/get.
Posted by David Wood <da...@us.ibm.com>.
Not sure why but the cfg files were not included...
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)
From: David Wood/Watson/IBM@IBMUS
To: jcs-users@jakarta.apache.org
Date: 06/13/2011 09:13 AM
Subject: JCS as shared memory in MANET and problem with put/get.
Hi,
I've split the following question out into a separate thread. I'm
considering using JCS 1.3 for a distributed registry in a Mobile
Adhoc Network (MANET), with the following requirements:
1) No central server
2) More than one JVM per ip address
3) Single config file (desirable, but not absolutely required)
There may be more, but those are the ones that I think cause the most
trouble. So the first question: Can JCS do this (particularly 2)? I've
looked at the UDP discovery and Lateral TCP, which together suggest that
it can.
I've create a test case which I'm having trouble with (see code below).
Unfortunately, the put() does not seem to be shared with the get()er. (I
first run the put()er, then start the get()er). Thoughts?
String cfg1 = "/dsm-jcs1.ccf";
String cfg2 = "/dsm-jcs2.ccf";
if (argv.length > 0) {
JCS.setConfigFilename(cfg2);
JCS jcs = JCS.getInstance("DSM");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
} else {
JCS.setConfigFilename(cfg1);
JCS jcs = JCS.getInstance("DSM");
System.out.println("Placing entry me=here");
jcs.put("me", "here");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
try {
System.out.println("Sleeping 1000 seconds");
Thread.sleep(1000*1000);
} catch (InterruptedException e) {
;
}
}
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org
Re: JCS as shared memory in MANET and problem with put/get.
Posted by David Wood <da...@us.ibm.com>.
Not sure why the cfg files are not being included but here they are
pasted...
##### dsm-jcs1.ccf
jcs.default=LTCP
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.
lru.LRUMemoryCache
# UDP discovery for
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp
.LateralTCPCacheFactory
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tcp
.TCPLateralCacheAttributes
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
jcs.auxiliary.LTCP.attributes.AllowGet=true
jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8
jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
#### dsm-jcs2.ccf
jcs.default=LTCP
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.
lru.LRUMemoryCache
# UDP discovery for
jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp
.LateralTCPCacheFactory
jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tcp
.TCPLateralCacheAttributes
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1111
jcs.auxiliary.LTCP.attributes.AllowGet=true
jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8
jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)
From: David Wood/Watson/IBM@IBMUS
To: jcs-users@jakarta.apache.org
Date: 06/13/2011 09:13 AM
Subject: JCS as shared memory in MANET and problem with put/get.
Hi,
I've split the following question out into a separate thread. I'm
considering using JCS 1.3 for a distributed registry in a Mobile
Adhoc Network (MANET), with the following requirements:
1) No central server
2) More than one JVM per ip address
3) Single config file (desirable, but not absolutely required)
There may be more, but those are the ones that I think cause the most
trouble. So the first question: Can JCS do this (particularly 2)? I've
looked at the UDP discovery and Lateral TCP, which together suggest that
it can.
I've create a test case which I'm having trouble with (see code below).
Unfortunately, the put() does not seem to be shared with the get()er. (I
first run the put()er, then start the get()er). Thoughts?
String cfg1 = "/dsm-jcs1.ccf";
String cfg2 = "/dsm-jcs2.ccf";
if (argv.length > 0) {
JCS.setConfigFilename(cfg2);
JCS jcs = JCS.getInstance("DSM");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
} else {
JCS.setConfigFilename(cfg1);
JCS jcs = JCS.getInstance("DSM");
System.out.println("Placing entry me=here");
jcs.put("me", "here");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
try {
System.out.println("Sleeping 1000 seconds");
Thread.sleep(1000*1000);
} catch (InterruptedException e) {
;
}
}
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org