JBoss Cache SVN: r5071 - benchmarks/CacheTests/trunk.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 11:40:41 -0500 (Tue, 08 Jan 2008)
New Revision: 5071
Modified:
benchmarks/CacheTests/trunk/tmp.sh
Log:
ns
Modified: benchmarks/CacheTests/trunk/tmp.sh
===================================================================
--- benchmarks/CacheTests/trunk/tmp.sh 2008-01-08 16:40:28 UTC (rev 5070)
+++ benchmarks/CacheTests/trunk/tmp.sh 2008-01-08 16:40:41 UTC (rev 5071)
@@ -7,4 +7,4 @@
CP=./classes:$CP
-java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=192.168.2.5 -classpath ${CP} perf.SessionTestCoherence -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=192.168.2.5 -classpath ${CP} -javaagent:lib/jboss-aop.jar -Djboss.aop.path=./pojocache-aop.xml perf.SessionTestPC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
17 years
JBoss Cache SVN: r5070 - benchmarks/CacheTests/trunk.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 11:40:28 -0500 (Tue, 08 Jan 2008)
New Revision: 5070
Modified:
benchmarks/CacheTests/trunk/tc.sh
Log:
ns
Modified: benchmarks/CacheTests/trunk/tc.sh
===================================================================
--- benchmarks/CacheTests/trunk/tc.sh 2008-01-08 16:40:18 UTC (rev 5069)
+++ benchmarks/CacheTests/trunk/tc.sh 2008-01-08 16:40:28 UTC (rev 5070)
@@ -9,4 +9,4 @@
-../terracotta-2.5.0/bin/dso-java.sh -Dtc.config=./tc5-config.xml perf.SessionTest -factory perf.terracotta.SessionFactoryTC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+../terracotta-2.5.0/bin/dso-java.sh -Dtc.config=./tc5-config.xml -Djava.net.preferIPv4Stack=true perf.SessionTest -factory perf.terracotta.SessionFactoryTC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
17 years
JBoss Cache SVN: r5069 - benchmarks/CacheTests/trunk.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 11:40:18 -0500 (Tue, 08 Jan 2008)
New Revision: 5069
Modified:
benchmarks/CacheTests/trunk/run.sh
Log:
ns
Modified: benchmarks/CacheTests/trunk/run.sh
===================================================================
--- benchmarks/CacheTests/trunk/run.sh 2008-01-08 16:40:06 UTC (rev 5068)
+++ benchmarks/CacheTests/trunk/run.sh 2008-01-08 16:40:18 UTC (rev 5069)
@@ -7,4 +7,4 @@
CP=./classes:$CP
-java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} perf.SessionTest -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+java -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} perf.SessionTest -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
17 years
JBoss Cache SVN: r5068 - benchmarks/CacheTests/trunk.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 11:40:06 -0500 (Tue, 08 Jan 2008)
New Revision: 5068
Modified:
benchmarks/CacheTests/trunk/pc.sh
Log:
ns
Modified: benchmarks/CacheTests/trunk/pc.sh
===================================================================
--- benchmarks/CacheTests/trunk/pc.sh 2008-01-08 15:46:04 UTC (rev 5067)
+++ benchmarks/CacheTests/trunk/pc.sh 2008-01-08 16:40:06 UTC (rev 5068)
@@ -7,4 +7,4 @@
CP=./classes:$CP
-java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} -javaagent:lib/jboss-aop.jar -Djboss.aop.path=./pojocache-aop.xml perf.SessionTest -factory perf.pojocache.SessionFactoryPC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+java -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} -javaagent:lib/jboss-aop.jar -Djboss.aop.path=./pojocache-aop.xml perf.SessionTest -factory perf.pojocache.SessionFactoryPC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
17 years
JBoss Cache SVN: r5067 - benchmarks/CacheTests/trunk/src/perf.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 10:46:04 -0500 (Tue, 08 Jan 2008)
New Revision: 5067
Modified:
benchmarks/CacheTests/trunk/src/perf/SessionTest.java
Log:
ns
Modified: benchmarks/CacheTests/trunk/src/perf/SessionTest.java
===================================================================
--- benchmarks/CacheTests/trunk/src/perf/SessionTest.java 2008-01-08 15:38:10 UTC (rev 5066)
+++ benchmarks/CacheTests/trunk/src/perf/SessionTest.java 2008-01-08 15:46:04 UTC (rev 5067)
@@ -69,12 +69,19 @@
}
/** Create NUM_SESSIONS sessions with NUM_ATTRS attributes of SIZE size. Total size is multiplication of the 3 */
- private static void init(Session session, int num_attrs, int size) throws NamingException {
- for(int j=0; j < num_attrs; j++) {
- byte[] buf=session.getAttribute(j);
- if(buf == null)
- session.setAttribute(j, new byte[size]);
+ private void init(Session session, int num_attrs, int size) throws NamingException {
+ try {
+ tx.begin();
+ for(int j=0; j < num_attrs; j++) {
+ byte[] buf=session.getAttribute(j);
+ if(buf == null)
+ session.setAttribute(j, new byte[size]);
+ }
+ tx.commit();
}
+ catch(Exception ex) {
+ try {tx.rollback();} catch(SystemException e) {}
+ }
}
private void loop(Session session, int session_id, int num_requests, int num_attrs, int size) {
@@ -141,7 +148,7 @@
public static void main(String[] args) throws Exception {
int session_id=-1;
- int num_requests=1000;
+ int num_requests=100000;
int num_attrs=100;
int size=1000;
int write_percentage=10; // percent
17 years
JBoss Cache SVN: r5066 - in core/trunk/src: test/java/org/jboss/cache/replicated and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-08 10:38:10 -0500 (Tue, 08 Jan 2008)
New Revision: 5066
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java
Log:
Refactored a lot of unnecessary code in CacheImpl
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-08 15:13:15 UTC (rev 5065)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-08 15:38:10 UTC (rev 5066)
@@ -11,7 +11,6 @@
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Option;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.InterceptorChainFactory;
@@ -20,7 +19,6 @@
import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.invocation.NodeInvocationDelegate;
import org.jboss.cache.invocation.RemoteCacheInvocationDelegate;
-import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.lock.LockStrategyFactory;
@@ -131,7 +129,7 @@
* Set<Fqn> of Fqns of the topmost node of internal regions that should
* not included in standard state transfers.
*/
- private Set<Fqn> internalFqns = new HashSet<Fqn>();
+ private final Set<Fqn> internalFqns = new HashSet<Fqn>();
/**
* Marshaller if register to handle marshalling
@@ -163,11 +161,6 @@
*/
private BuddyManager buddyManager;
- /**
- * State transfer manager. Do not access this field directly -- use the getter
- */
- private StateTransferManager stateTransferManager;
-
private RemoteCacheInvocationDelegate remoteDelegate;
/**
@@ -195,7 +188,7 @@
/**
* Constructs an uninitialized CacheImpl.
*/
- protected CacheImpl() throws Exception
+ protected CacheImpl()
{
this(new Configuration());
}
@@ -203,7 +196,7 @@
/**
* Constructs an uninitialized CacheImpl.
*/
- protected CacheImpl(Configuration configuration) throws Exception
+ protected CacheImpl(Configuration configuration)
{
this.configuration = configuration;
this.componentRegistry = new ComponentRegistry(configuration);
@@ -223,7 +216,7 @@
@Inject
private void injectDependencies(Notifier notifier, RegionManager regionManager, TransactionManager transactionManager, Marshaller marshaller,
- TransactionTable transactionTable, StateTransferManager stateTransferManager, NodeFactory nodeFactory,
+ TransactionTable transactionTable, NodeFactory nodeFactory,
CacheSPI spi, CacheMessageListener messageListener, @ComponentName("remoteDelegate")RemoteCacheInvocationDelegate remoteDelegate,
Interceptor interceptorChain, BuddyManager buddyManager)
{
@@ -231,7 +224,6 @@
this.regionManager = regionManager;
this.transactionManager = transactionManager;
this.transactionTable = transactionTable;
- this.stateTransferManager = stateTransferManager;
this.nodeFactory = nodeFactory;
this.spi = spi;
this.messageListener = messageListener;
@@ -298,24 +290,6 @@
return transactionTable;
}
- /**
- * Returns the contents of the TransactionTable as a string.
- */
- public String dumpTransactionTable()
- {
- return transactionTable.toString(true);
- }
-
- /**
- * Returns the underlying cache loader in use.
- */
- public CacheLoader getCacheLoader()
- {
- if (cacheLoaderManager == null)
- return null;
- return cacheLoaderManager.getCacheLoader();
- }
-
private void setUseReplQueue(boolean flag)
{
if (flag)
@@ -339,7 +313,6 @@
}
}
-
/**
* Returns the replication queue.
*/
@@ -843,13 +816,6 @@
componentRegistry.stop();
- // before closing the channel stop the buddy manager
-// if (buddyManager != null && buddyManager.isEnabled())
-// {
-// log.debug("stop(): stopping buddy manager");
-// buddyManager.stop();
-// }
-
if (channel != null)
{
log.info("stop(): closing the channel");
@@ -879,16 +845,6 @@
repl_queue.stop();
}
- // now done in the CLM
-// if (cacheLoaderManager != null)
-// {
-// log.debug("stop(): stopping cache loader manager");
-// cacheLoaderManager.stopCacheLoader();
-// }
-
- // now done in the region manager
-// if (regionManager.isUsingEvictions()) regionManager.stopEvictionThread();
-
if (notifier != null)
{
notifier.notifyCacheStopped(spi, spi.getInvocationContext());
@@ -910,42 +866,8 @@
return cacheStatus;
}
- /* ----------------------- End of MBeanSupport ----------------------- */
- /* ----------------------- Start of buddy replication specific methods ------------*/
-
/**
- * Sets the buddy replication configuration element
- *
- * @param config
- */
-// private void setBuddyReplicationConfig(BuddyReplicationConfig config)
-// {
-// if (config != null)
-// {
-// buddyManager = new BuddyManager(config);
-// if (!buddyManager.isEnabled())
-// {
-// buddyManager = null;
-// }
-// else
-// {
-// internalFqns.add(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
-// }
-// }
-// }
-
- /**
- * Retrieves the Buddy Manager configured.
- *
- * @return null if buddy replication is not enabled.
- */
- public BuddyManager getBuddyManager()
- {
- return buddyManager;
- }
-
- /**
* Returns a Set<Fqn> of Fqns of the topmost node of internal regions that
* should not included in standard state transfers. Will include
* {@link BuddyManager#BUDDY_BACKUP_SUBTREE} if buddy replication is
@@ -958,24 +880,7 @@
return Collections.unmodifiableSet(internalFqns);
}
- /* ----------------------- End of buddy replication specific methods ------------*/
-
/**
- * Loads the indicated Fqn, plus all parents recursively from the
- * CacheLoader. If no CacheLoader is present, this is a no-op
- *
- * @param fqn
- * @throws Exception
- */
- public void load(String fqn) throws Exception
- {
- if (cacheLoaderManager != null)
- {
- cacheLoaderManager.preload(Fqn.fromString(fqn), true, true);
- }
- }
-
- /**
* Returns the address of the coordinator or null if there is no
* coordinator.
* Waits until the membership view is updated.
@@ -1027,7 +932,7 @@
}
// Recursively remove any children
- Set children = getChildrenNames(subtree);
+ Set children = spi.getChildrenNames(subtree);
if (children != null)
{
for (Object s : children)
@@ -1099,29 +1004,6 @@
// ----------- End Marshalling and State Transfer -----------------------
/**
- * @param fqn fqn String name to retrieve from cache
- * @return DataNode corresponding to the fqn. Null if does not exist. No guarantees wrt replication,
- * cache loading are given if the underlying node is modified
- */
- public Node get(String fqn) throws CacheException
- {
- return get(Fqn.fromString(fqn));
- }
-
- /**
- * Returns a DataNode corresponding to the fully qualified name or null if
- * does not exist.
- * No guarantees wrt replication, cache loading are given if the underlying node is modified
- *
- * @param fqn name of the DataNode to retreive
- */
- public Node get(Fqn<?> fqn) throws CacheException
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.getNodeMethodLocal_id, fqn);
- return (Node) invokeMethod(m, true);
- }
-
- /**
* Returns the raw data of the node; called externally internally.
*/
public Node _get(Fqn<?> fqn) throws CacheException
@@ -1139,19 +1021,6 @@
return n.getDataDirect();
}
- /**
- * Retrieves a defensively copied data map of the underlying node.
- *
- * @param fqn
- * @return map of data, or an empty map
- * @throws CacheException
- */
- public Map getData(Fqn<?> fqn) throws CacheException
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.getDataMapMethodLocal_id, fqn);
- return (Map) invokeMethod(m, true);
- }
-
public Set _getKeys(Fqn<?> fqn) throws CacheException
{
NodeSPI n = findNode(fqn);
@@ -1163,31 +1032,6 @@
return new HashSet(keys);
}
- /**
- * Finds a node given its name and returns the value associated with a given key in its <code>data</code>
- * map. Returns null if the node was not found in the cache or the key was not found in the hashmap.
- *
- * @param fqn The fully qualified name of the node.
- * @param key The key.
- */
- public Object get(String fqn, Object key) throws CacheException
- {
- return get(Fqn.fromString(fqn), key);
- }
-
-
- /**
- * Finds a node given its name and returns the value associated with a given key in its <code>data</code>
- * map. Returns null if the node was not found in the cache or the key was not found in the hashmap.
- *
- * @param fqn The fully qualified name of the node.
- * @param key The key.
- */
- public Object get(Fqn<?> fqn, Object key) throws CacheException
- {
- return get(fqn, key, true);
- }
-
public Object _get(Fqn<?> fqn, Object key, boolean sendNodeEvent) throws CacheException
{
InvocationContext ctx = spi.getInvocationContext();
@@ -1207,13 +1051,6 @@
return n.getDirect(key);
}
-
- protected Object get(Fqn<?> fqn, Object key, boolean sendNodeEvent) throws CacheException
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, fqn, key, sendNodeEvent);
- return invokeMethod(m, true);
- }
-
/**
* Checks whether a given node exists in current in-memory state of the cache.
* Does not acquire any locks in doing so (result may be dirty read). Does
@@ -1286,8 +1123,7 @@
/**
- * Checks whether a given key exists in the given node. Does not interact with CacheLoader, so the behavior is
- * different from {@link #get(Fqn,Object)}
+ * Checks whether a given key exists in the given node. Does not interact with the interceptor stack.
*
* @param fqn The fully qualified name of the node
* @param key
@@ -1299,284 +1135,6 @@
return n != null && n.getKeysDirect().contains(key);
}
-
- /**
- * Adds a new node to the cache and sets its data. If the node doesn not yet exist, it will be created.
- * Also, parent nodes will be created if not existent. If the node already has data, then the new data
- * will override the old one. If the node already existed, a nodeModified() notification will be generated.
- * Otherwise a nodeCreated() motification will be emitted.
- *
- * @param fqn The fully qualified name of the new node
- * @param data The new data. May be null if no data should be set in the node.
- */
- public void put(String fqn, Map data) throws CacheException
- {
- put(Fqn.fromString(fqn), data);
- }
-
- /**
- * Sets a node's data. If the node does not yet exist, it will be created.
- * Also, parent nodes will be created if not existent. If the node already has data, then the new data
- * will override the old one. If the node already existed, a nodeModified() notification will be generated.
- * Otherwise a nodeCreated() motification will be emitted.
- *
- * @param fqn The fully qualified name of the new node
- * @param data The new data. May be null if no data should be set in the node.
- */
- public void put(Fqn<?> fqn, Map data) throws CacheException
- {
- put(fqn, data, false);
- }
-
- public void put(Fqn<?> fqn, Map data, boolean erase) throws CacheException
- {
- GlobalTransaction tx = getCurrentTransaction();
- MethodCall m;
- if (erase)
- {
- m = MethodCallFactory.create(MethodDeclarations.putDataEraseMethodLocal_id, tx, fqn, data, true, true);
- }
- else
- {
- m = MethodCallFactory.create(MethodDeclarations.putDataMethodLocal_id, tx, fqn, data, true);
- }
- invokeMethod(m, true);
- }
-
- /**
- * Adds a key and value to a given node. If the node doesn't exist, it will be created. If the node
- * already existed, a nodeModified() notification will be generated. Otherwise a
- * nodeCreated() motification will be emitted.
- *
- * @param fqn The fully qualified name of the node
- * @param key The key
- * @param value The value
- * @return Object The previous value (if any), if node was present
- */
- public Object put(String fqn, Object key, Object value) throws CacheException
- {
- return put(Fqn.fromString(fqn), key, value);
- }
-
- /**
- * Adds a key and value to a given node. If the node doesn't exist, it will be created. If the node
- * already existed, a nodeModified() notification will be generated. Otherwise a
- * nodeCreated() motification will be emitted.
- *
- * @param fqn The fully qualified name of the node
- * @param key The key
- * @param value The value
- * @return Object The previous value (if any), if node was present
- */
- public Object put(Fqn<?> fqn, Object key, Object value) throws CacheException
- {
- GlobalTransaction tx = getCurrentTransaction();
- MethodCall m = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal_id, tx, fqn, key, value, true);
- return invokeMethod(m, true);
- }
-
- /**
- * Removes the node from the cache.
- *
- * @param fqn The fully qualified name of the node.
- */
- public void remove(String fqn) throws CacheException
- {
- remove(Fqn.fromString(fqn));
- }
-
- /**
- * Removes the node from the cache.
- *
- * @param fqn The fully qualified name of the node.
- */
- public boolean remove(Fqn fqn) throws CacheException
- {
- GlobalTransaction tx = getCurrentTransaction();
- // special case if we are removing the root. Remove all children instead.
- if (fqn.isRoot())
- {
- boolean result = true;
- // we need to preserve options
- InvocationContext ctx = spi.getInvocationContext();
- Option o = ctx.getOptionOverrides();
- for (Object childName : _getChildrenNames(fqn))
- {
- ctx.setOptionOverrides(o);
- result = remove(new Fqn<Object>(fqn, childName)) && result;
- }
-
- return result;
- }
- else
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal_id, tx, fqn, true);
- Object retval = invokeMethod(m, true);
- return retval != null && (Boolean) retval;
- }
- }
-
- /**
- * Called by eviction policy provider. Note that eviction is done only in
- * local mode, that is, it doesn't replicate the node removal. This will
- * cause the replication nodes to not be synchronizing, which is fine since
- * the value will be fetched again when {@link #get} returns null. After
- * that, the contents will be in sync.
- *
- * @param fqn Will remove everythign assoicated with this fqn.
- * @throws CacheException
- */
- public void evict(Fqn fqn) throws CacheException
- {
- if (fqn.isRoot())
- {
- // special treatment for root eviction
- // we need to preserve options
- InvocationContext ctx = spi.getInvocationContext();
- Option o = ctx.getOptionOverrides();
- for (Object childName : _getChildrenNames(fqn))
- {
- ctx.setOptionOverrides(o);
- evict(new Fqn<Object>(fqn, childName));
- }
- }
- else
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal_id, fqn);
- invokeMethod(m, true);
- }
- }
-
- /**
- * Removes <code>key</code> from the node's hashmap
- *
- * @param fqn The fullly qualified name of the node
- * @param key The key to be removed
- * @return The previous value, or null if none was associated with the given key
- */
- public Object remove(String fqn, Object key) throws CacheException
- {
- return remove(Fqn.fromString(fqn), key);
- }
-
- /**
- * Removes <code>key</code> from the node's hashmap
- *
- * @param fqn The fullly qualified name of the node
- * @param key The key to be removed
- * @return The previous value, or null if none was associated with the given key
- */
- public Object remove(Fqn<?> fqn, Object key) throws CacheException
- {
- GlobalTransaction tx = getCurrentTransaction();
- MethodCall m = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal_id, tx, fqn, key, true);
- return invokeMethod(m, true);
- }
-
- /**
- * Lock a given node (or the entire subtree starting at this node)
- * @param fqn The FQN of the node
- * @param owner The owner. This is simply a key into a hashtable, and can be anything, e.g.
- * a GlobalTransaction, the current thread, or a special object. If null, it is set to Thread.currentThread()
- * @param lock_type The type of lock (RO, RW). Needs to be of type DataNode.LOCK_TYPE_READ or DataNode.LOCK_TYPE_WRITE
- * @param lock_recursive If true, the entire subtree is locked, else only the given node
- * @throws CacheException If node doesn't exist, a NodeNotExistsException is throw. Other exceptions are
- * LockingException, TimeoutException and UpgradeException
- */
- // public void lock(Fqn fqn, Object owner, int lock_type, boolean lock_recursive) throws CacheException {
- //
- // }
-
- /**
- * Unlock a given node (or the entire subtree starting at this node)
- * @param fqn The FQN of the node
- * @param owner The owner. This is simply a key into a hashtable, and can be anything, e.g.
- * a GlobalTransaction, the current thread, or a special object. If null, it is set to Thread.currentThread()
- * @param unlock_recursive If true, the entire subtree is unlocked, else only the given node
- * @param force Release the lock even if we're not the owner
- */
- // public void unlock(Fqn fqn, Object owner, boolean unlock_recursive, boolean force) {
- //
- // }
-
- /**
- * Releases all locks for this node and the entire node subtree.
- */
- public void releaseAllLocks(String fqn)
- {
- releaseAllLocks(Fqn.fromString(fqn));
- }
-
- /**
- * Releases all locks for this node and the entire node subtree.
- */
- public void releaseAllLocks(Fqn fqn)
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.releaseAllLocksMethodLocal_id, fqn);
- try
- {
- invokeMethod(m, true);
- }
- catch (CacheException e)
- {
- log.error("failed releasing all locks for " + fqn, e);
- }
- }
-
- /**
- * Prints a representation of the node defined by <code>fqn</code>.
- * Output includes name, fqn and data.
- */
- public String print(String fqn)
- {
- return print(Fqn.fromString(fqn));
- }
-
- /**
- * Prints a representation of the node defined by <code>fqn</code>.
- * Output includes name, fqn and data.
- */
- public String print(Fqn fqn)
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.printMethodLocal_id, fqn);
- Object retval = null;
- try
- {
- retval = invokeMethod(m, true);
- }
- catch (Throwable e)
- {
- retval = e;
- }
- if (retval != null)
- {
- return retval.toString();
- }
- else
- {
- return "";
- }
- }
-
- /**
- * Returns all children of a given node. Returns an empty set if there are no children.
- * The set is unmodifiable.
- *
- * @param fqn The fully qualified name of the node
- * @return Set an unmodifiable set of children names, Object.
- */
- public <E> Set<E> getChildrenNames(Fqn<E> fqn) throws CacheException
- {
- MethodCall m = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal_id, fqn);
- Set<E> retval = null;
- retval = (Set<E>) invokeMethod(m, true);
- if (retval != null)
- retval = Collections.unmodifiableSet(new HashSet<E>(retval));
- else
- retval = Collections.emptySet();
- return retval;
- }
-
@SuppressWarnings("unchecked")
public <E> Set<E> _getChildrenNames(Fqn<E> fqn) throws CacheException
{
@@ -1805,7 +1363,7 @@
if ((preferredMode = spi.getInvocationContext().getOptionOverrides().getGroupRequestMode()) > -1)
modeToUse = preferredMode;
- RspList rsps = null;
+ RspList rsps;
List retval;
Vector<Address> validMembers;
@@ -1814,7 +1372,6 @@
return null;
}
- validMembers = null;
if (mbrs != null)
validMembers = new Vector<Address>(mbrs);
else
@@ -2172,7 +1729,7 @@
NodeSPI n;
NodeSPI parent_node;
- MethodCall undo_op = null;
+ MethodCall undo_op;
if (trace)
{
@@ -2292,8 +1849,8 @@
public Object _remove(GlobalTransaction tx, Fqn fqn, Object key, boolean create_undo_ops)
throws CacheException
{
- MethodCall undo_op = null;
- Object old_value = null;
+ MethodCall undo_op;
+ Object old_value;
if (trace)
{
@@ -2581,21 +2138,6 @@
}
/**
- * Evicts a key/value pair from a node's attributes. Note that this is <em>local</em>, will not be replicated.
- * @param fqn
- * @param key
- * @throws CacheException
- */
- // public void _evict(Fqn fqn, Object key) throws CacheException {
- // if(!exists(fqn)) return;
- // boolean create_undo_ops = false;
- // boolean sendNodeEvent = false;
- // boolean eviction=true;
- // _removeData(null, fqn, create_undo_ops, sendNodeEvent, eviction);
- // }
-
-
- /**
* Compensating method to {@link #_remove(GlobalTransaction,Fqn,boolean)}.
*/
public void _addChild(GlobalTransaction gtx, Fqn parent_fqn, Object child_name, Node cn, boolean undoOps)
@@ -2642,49 +2184,6 @@
/**
- * Replicates changes across to other nodes in the cluster. Invoked by the
- * ReplicationInterceptor. Calls need to be forwarded to the
- * ReplicationInterceptor in this interceptor chain. This method will later
- * be moved entirely into the ReplicationInterceptor.
- */
- public Object _replicate(MethodCall method_call) throws Throwable
- {
- try
- {
- Object retVal = invokeMethod(method_call, false);
- // we only need to return values for a set of remote calls; not every call.
- if (MethodDeclarations.returnValueForRemoteCall(method_call.getMethodId()))
- {
- return retVal;
- }
- else
- {
- return null;
- }
- }
- catch (Throwable ex)
- {
- if (method_call.getMethodId() != MethodDeclarations.putForExternalReadMethodLocal_id
- || method_call.getMethodId() != MethodDeclarations.putForExternalReadVersionedMethodLocal_id)
- {
- if (!MethodDeclarations.isBuddyGroupOrganisationMethod(method_call.getMethodId()) && log.isWarnEnabled())
- log.warn("replication failure with method_call " + method_call + " exception", ex);
- throw ex;
- }
- else return null;
-
- }
- }
-
- /**
- * Replicates a list of method calls.
- */
- public void _replicate(List<MethodCall> methodCalls) throws Throwable
- {
- for (MethodCall methodCall : methodCalls) _replicate(methodCall);
- }
-
- /**
* Used with buddy replication's data gravitation interceptor. If marshalling is necessary, ensure that the cache is
* configured to use {@link org.jboss.cache.config.Configuration#useRegionBasedMarshalling} and the {@link org.jboss.cache.Region}
* pertaining to the Fqn passed in is activated, and has an appropriate ClassLoader.
@@ -2882,42 +2381,6 @@
}
/**
- * Returns the CacheLoaderManager.
- */
- public CacheLoaderManager getCacheLoaderManager()
- {
- return cacheLoaderManager;
- }
-
- /**
- * Sets the CacheLoaderManager.
- */
- public void setCacheLoaderManager(CacheLoaderManager cacheLoaderManager)
- {
- this.cacheLoaderManager = cacheLoaderManager;
- }
-
- /**
- * @return an instance of {@link Notifier} which has been configured with this instance of CacheImpl.
- */
- public Notifier getNotifier()
- {
- return notifier;
- }
-
- /**
- * New API to efficiently relocate a node
- *
- * @since 2.0.0
- */
- public void move(Fqn<?> nodeToMove, Fqn<?> newParent)
- {
- // this needs to be passed up the interceptor chain
- MethodCall m = MethodCallFactory.create(MethodDeclarations.moveMethodLocal_id, nodeToMove, newParent);
- invokeMethod(m, true);
- }
-
- /**
* Called by reflection
*
* @param newParentFqn
@@ -3019,7 +2482,6 @@
{
channel.disconnect();
channel.close();
-// channel.disconnect();
}
}
@@ -3132,7 +2594,7 @@
private boolean isValid(Transaction tx)
{
if (tx == null) return false;
- int status = -1;
+ int status;
try
{
status = tx.getStatus();
@@ -3237,36 +2699,7 @@
return gtx;
}
-
- private void blockUntilCacheStarts() throws InterruptedException
- {
- int pollFrequencyMS = 100;
- long startupWaitTime = configuration.getStateRetrievalTimeout();
- long giveUpTime = System.currentTimeMillis() + startupWaitTime;
-
- while (System.currentTimeMillis() < giveUpTime)
- {
- if (cacheStatus.allowInvocations()) break;
- Thread.sleep(pollFrequencyMS);
- }
-
- }
-
/**
- * Invokes a method against this object. Contains the logger_ic for handling
- * the various use cases, e.g. mode (local, repl_async, repl_sync),
- * transaction (yes or no) and locking (yes or no).
- * <p/>
- * Only sets originLocal on the invocation context IF this is explicitly passed in as <tt>false</tt>
- * If passed in as <tt>true</tt> then it is not set; but whatever default exists in the invocation
- * context is used. For example, it may be set prior to calling invokeMethod()
- */
- protected Object invokeMethod(MethodCall m, boolean originLocal) throws CacheException
- {
- throw new UnsupportedOperationException("DEPRECATED and should not be used!!");
- }
-
- /**
* Returns an object suitable for use in node locking, either the current
* transaction or the current thread if there is no transaction.
*/
@@ -3402,50 +2835,6 @@
return toReturn;
}
-// private void initialiseCacheLoaderManager() throws CacheException
-// {
-// if (cacheLoaderManager == null)
-// {
-// cacheLoaderManager = new CacheLoaderManager();
-// }
-// cacheLoaderManager.setConfig(configuration.getCacheLoaderConfig(), spi);
-// }
-
- /**
- * Sets the CacheLoader to use.
- * Provided for backwards compatibility.
- *
- * @param loader
- * @deprecated only provided for backward compat
- */
-// @Deprecated
-// public void setCacheLoader(CacheLoader loader)
-// {
-// log.warn("Using deprecated config method setCacheLoader. This element will be removed in future, please use CacheLoaderConfiguration instead.");
-//
-// try
-// {
-// if (cacheLoaderManager == null) initialiseCacheLoaderManager();
-// }
-// catch (Exception e)
-// {
-// log.warn("Problem setting cache loader. Perhaps your cache loader config has not been set yet?");
-// }
-// cacheLoaderManager.setCacheLoader(loader);
-// }
-
- /**
- * Purges the contents of all configured {@link CacheLoader}s
- */
- public void purgeCacheLoaders() throws Exception
- {
- if (cacheLoaderManager != null) cacheLoaderManager.purgeLoaders(true);
- }
-
- // ---------------------------------------------------------------
- // END: Methods to provide backward compatibility with older cache loader config settings
- // ---------------------------------------------------------------
-
private void initialiseChannelAndRpcDispatcher() throws CacheException
{
channel = configuration.getRuntimeConfig().getChannel();
@@ -3499,7 +2888,6 @@
// always use the InactiveRegionAwareRpcDispatcher - exceptions due to regions not being active should not propagate to remote
// nodes as errors. - Manik
disp = new InactiveRegionAwareRpcDispatcher(channel, messageListener, new MembershipListenerAdaptor(), remoteDelegate);
- // disp = new RpcDispatcher(channel, ml, this, this);
disp.setRequestMarshaller(marshaller);
disp.setResponseMarshaller(marshaller);
@@ -3538,44 +2926,9 @@
return modifiable == null ? null : Collections.unmodifiableList(modifiable);
}
- public void addCacheListener(Object listener)
- {
- getNotifier().addCacheListener(listener);
- }
-
- public void addCacheListener(Fqn<?> region, Object listener)
- {
- throw new UnsupportedOperationException("Not implemented in this release");
- }
-
- public void removeCacheListener(Object listener)
- {
- // BES 2007/5/23 workaround to avoid NPE while we decide whether
- // to remove notifier in destroy()
- Notifier n = getNotifier();
- if (n != null)
- n.removeCacheListener(listener);
- }
-
- public void removeCacheListener(Fqn<?> region, Object listener)
- {
- throw new UnsupportedOperationException("Not implemented in this release");
- }
-
- public Set<Object> getCacheListeners()
- {
- return getNotifier().getCacheListeners();
- }
-
- public Set<Object> getCacheListeners(Fqn<?> region)
- {
- throw new UnsupportedOperationException("Not implemented in this release");
- }
-
private List<Interceptor> getInterceptors()
{
- InterceptorChainFactory icf = componentRegistry.getComponent(InterceptorChainFactory.class);
- return icf.asList(interceptorChain);
+ return InterceptorChainFactory.asList(interceptorChain);
}
private void setInterceptorChain(Interceptor startOfNewChain)
@@ -3663,36 +3016,6 @@
return getConfiguration().getClusterName();
}
- public void evict(Fqn<?> fqn, boolean recursive)
- {
- //this method should be called by eviction thread only, so no transaction - expected (sec param is false)
- Node node = peek(fqn, false);
- if (node != null && node.isResident())
- {
- return;
- }
- if (recursive)
- {
- if (node != null)
- {
- evictChildren((NodeSPI) node);
- }
- }
- else
- {
- evict(fqn);
- }
- }
-
- private void evictChildren(NodeSPI n)
- {
- for (Object child : n.getChildrenDirect())
- {
- evictChildren((NodeSPI) child);
- }
- evict(n.getFqn());
- }
-
public Region getRegion(Fqn<?> fqn, boolean createIfAbsent)
{
return regionManager.getRegion(fqn, createIfAbsent);
@@ -3703,35 +3026,8 @@
return regionManager.removeRegion(fqn);
}
- public boolean removeNode(Fqn<?> fqn)
- {
- return remove(fqn);
- }
-
- public void putForExternalRead(Fqn<?> fqn, Object key, Object value)
- {
- // if the node exists then this should be a no-op.
- if (!exists(fqn))
- {
- spi.getInvocationContext().getOptionOverrides().setFailSilently(true);
- GlobalTransaction tx = getCurrentTransaction();
- MethodCall m = MethodCallFactory.create(MethodDeclarations.putForExternalReadMethodLocal_id, tx, fqn, key, value);
- invokeMethod(m, true);
- }
- else
- {
- if (log.isDebugEnabled())
- log.debug("putForExternalRead() called with Fqn " + fqn + " and this node already exists. This method is hence a no op.");
- }
- }
-
public void _putForExternalRead(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
{
_put(gtx, fqn, key, value, true);
}
-
- public boolean isStarted()
- {
- return getCacheStatus() == CacheStatus.STARTED;
- }
}
Modified: core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java 2008-01-08 15:13:15 UTC (rev 5065)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/SyncReplTxTest.java 2008-01-08 15:38:10 UTC (rev 5066)
@@ -11,7 +11,6 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -1337,56 +1336,4 @@
}
- @CacheListener
- static class TransactionAborterListener
- {
-
- TransactionManager callbackTM;
- Object mutex = new Object();
- Exception ex;
-
- TransactionAborterListener(CacheImpl cache)
- {
- callbackTM = cache.getTransactionManager();
- cache.getNotifier().addCacheListener(this);
- }
-
- @NodeModified
- public void nodeModified(NodeEvent ne)
- {
- if (!ne.isPre())
- {
- synchronized (mutex)
- {
- try
- {
- Transaction tx = callbackTM.getTransaction();
- if (tx != null && tx.getStatus() == Status.STATUS_ACTIVE)
- {
- // this will rollback the transaction
- tx.setRollbackOnly();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- if (ex == null)
- {
- ex = e;
- }
- }
- }
- }
- }
-
- Exception getCallbackException()
- {
- synchronized (mutex)
- {
- return ex;
- }
- }
-
- }
-
}
17 years
JBoss Cache SVN: r5065 - in core/trunk/src: main/java/org/jboss/cache/factories and 7 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-08 10:13:15 -0500 (Tue, 08 Jan 2008)
New Revision: 5065
Removed:
core/trunk/src/main/java/org/jboss/cache/factories/CacheLoaderConfigFactory.java
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryUnitTest.java
core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/CorruptedFileCacheLoader.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
Log:
Fixed failing state transfer issues plus cache startup changes wrt component registry
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -517,54 +517,11 @@
configureLogCategory();
componentRegistry.wire();
-
- // initialise the node factory and set this in the runtime.
-// NodeFactory nf;
-// if ((nf = configuration.getRuntimeConfig().getNodeFactory()) == null)
-// {
-// nf = new NodeFactory(this);
-// configuration.getRuntimeConfig().setNodeFactory(nf);
-// }
-// else
-// {
-// // don't create a new one each and every time. After stopping and starting the cache, the old NodeFactory may still be valid.
-// nf.init();
-// }
-
-// if (notifier == null)
-// notifier = new Notifier(this);
-
correctRootNodeType();
-// if (configuration.getCacheLoaderConfig() != null && cacheLoaderManager == null)
-// {
-// initialiseCacheLoaderManager();
-// }
- // first set up the Buddy Manager and an RPCManager
-// if (configuration.getCacheMode() != Configuration.CacheMode.LOCAL)
-// {
- //getConfiguration().getRuntimeConfig().setRPCManager(new RPCManagerImpl(this));
-// setBuddyReplicationConfig(configuration.getBuddyReplicationConfig());
-// }
- // build interceptor chain
-// try
-// {
-// interceptor_chain = InterceptorChainFactory.getInstance().buildInterceptorChain(configuration, componentRegistry);
-// }
-// catch (Exception e)
-// {
-// throw new CacheException("Unable to build interceptor chain", e);
-// }
-
-
setUseReplQueue(configuration.isUseReplQueue());
setIsolationLevel(configuration.getIsolationLevel());
- //createEvictionPolicy();
-
- // now done inside the regionManager
- //regionManager.setDefaultInactive(configuration.isInactiveOnStartup());
-
cacheStatus = CacheStatus.CREATED;
}
@@ -626,20 +583,11 @@
*/
private void internalStart() throws CacheException, IllegalArgumentException
{
- // re-wire all dependencies in case stuff has changed since the cache was created?
- // TODO: Do we really need to nuke old deps? :/
- CacheSPI spi = componentRegistry.getComponent(CacheSPI.class);
+ // re-wire all dependencies in case stuff has changed since the cache was created
// remove the Interceptor.class component though, since it may pertain to an old config
componentRegistry.unregisterComponent(Interceptor.class);
- // re-do the bootstrap sequence
- componentRegistry.registerComponent(configuration);
- componentRegistry.registerComponent(this);
- componentRegistry.registerComponent(CacheSPI.class.getName(), spi);
- componentRegistry.registerComponent(Cache.class.getName(), spi);
- componentRegistry.registerComponent(componentRegistry);
-
componentRegistry.updateDependencies();
componentRegistry.wireDependencies(root);
@@ -656,20 +604,6 @@
correctRootNodeType();
-// createTransactionManager();
-
- // cache loaders should be initialised *before* any state transfers take place to prevent
- // exceptions involving cache loaders not being started. - Manik
- // create cache loader
-
- // now done in the CLM
-// if (cacheLoaderManager != null)
-// {
-// cacheLoaderManager.startCacheLoader();
-// }
- // now that we have a TM we can init the interceptor chain
-// InterceptorChainFactory.getInstance().initialiseInterceptors(interceptor_chain, this);
-
switch (configuration.getCacheMode())
{
case LOCAL:
@@ -905,7 +839,7 @@
cacheStatus = CacheStatus.STOPPING;
// if this is called from a source other than the shutdown hook, deregister the shutdown hook.
- if (!invokedFromShutdownHook) Runtime.getRuntime().removeShutdownHook(shutdownHook);
+ if (!invokedFromShutdownHook && shutdownHook != null) Runtime.getRuntime().removeShutdownHook(shutdownHook);
componentRegistry.stop();
@@ -3646,7 +3580,7 @@
private void setInterceptorChain(Interceptor startOfNewChain)
{
- componentRegistry.registerComponent(Interceptor.class.getName(), startOfNewChain);
+ componentRegistry.registerComponent(Interceptor.class.getName(), startOfNewChain, Interceptor.class);
}
public synchronized void addInterceptor(Interceptor i, int position)
@@ -3712,7 +3646,7 @@
if (found)
{
- componentRegistry.registerComponent(i);
+ componentRegistry.registerComponent(i, Interceptor.class);
interceptors.add(++position, i);
setInterceptorChain(factory.correctInterceptorChaining(interceptors));
}
Modified: core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -135,8 +135,8 @@
this.configuration = configuration;
// make sure we set the CacheImpl and CacheSPI instance in the component registry.
- componentRegistry.registerComponent(cache);
- componentRegistry.registerComponent(CacheSPI.class.getName(), spi);
+ componentRegistry.registerComponent(cache, CacheImpl.class);
+ componentRegistry.registerComponent(CacheSPI.class.getName(), spi, CacheSPI.class);
}
public Cache<K, V> createCache(InputStream is) throws ConfigurationException
Deleted: core/trunk/src/main/java/org/jboss/cache/factories/CacheLoaderConfigFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CacheLoaderConfigFactory.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CacheLoaderConfigFactory.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -1,21 +0,0 @@
-package org.jboss.cache.factories;
-
-import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.factories.annotations.DefaultFactoryFor;
-
-/**
- * Factory class to create cache loader managers
- *
- * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
- * @since 2.1.0
- */
-@DefaultFactoryFor(classes = {CacheLoaderConfig.class})
-public class CacheLoaderConfigFactory extends ComponentFactory
-{
- @Override
- @SuppressWarnings("unchecked")
- protected <T> T construct(String componentName, Class<T> componentType)
- {
- return (T) configuration.getCacheLoaderConfig();
- }
-}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -14,6 +14,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
+import org.jboss.cache.invocation.RemoteCacheInvocationDelegate;
import org.jboss.cache.util.BeanUtils;
import org.jboss.cache.util.reflect.ClasspathScanner;
import org.jboss.cache.util.reflect.ReflectionUtil;
@@ -83,14 +84,14 @@
public ComponentRegistry(Configuration configuration)
{
// bootstrap.
- registerComponent(this);
- registerComponent(configuration);
+ registerComponent(this, ComponentRegistry.class);
+ registerComponent(configuration, Configuration.class);
}
/**
* Adds a singleton instance to the registry. Note that if an instance of this component already exists in the
* registry it is overwritten. The instance is registered under type <tt>component.getClass()</tt>. If the component
- * implements an interface or extends an abstract class, it may make more sense to use {@link #registerComponent(String, Object)}
+ * implements an interface or extends an abstract class, it may make more sense to use {@link #registerComponent(String, Object, Class)}
* <p/>
* The status of the component is updated th the overall state of the registry, which may involve calling of methods annotated
* with {@link org.jboss.cache.factories.annotations.Inject}, {@link org.jboss.cache.factories.annotations.Start} or
@@ -99,9 +100,9 @@
*
* @param component component to add to the registry.
*/
- public void registerComponent(Object component)
+ public void registerComponent(Object component, Class type)
{
- registerComponent(component.getClass().getName(), component);
+ registerComponent(component.getClass().getName(), component, type);
}
/**
@@ -116,13 +117,22 @@
* @param name name of the instance
* @param component component to add
*/
- public void registerComponent(String name, Object component)
+ public void registerComponent(String name, Object component, Class type)
{
// this will make sure all dependent components are stopped or set to CONSTRUCTED so they can be re-wired later.
- Component c = new Component(name, component);
+ Component c = new Component(name, component, type);
Component old = componentLookup.get(name);
+ if (log.isTraceEnabled())
+ log.trace("Registering component " + c + " under name " + name + " replacing old component " + old);
if (old != null)
{
+ // if they are equal don't bother
+ if (old.instance.equals(component))
+ {
+ if (log.isTraceEnabled())
+ log.trace("Attempting to register a component equal to one that already exists under the same name (" + name + "). Not doing anything.");
+ return;
+ }
// unregister the old component so that components that depend on it can be stopped if necessary
unregisterComponent(name);
// components that depended on the old component should now depend on the new one.
@@ -256,32 +266,34 @@
if (component != null)
{
- registerComponent(componentNameToUse, component);
+ registerComponent(componentNameToUse, component, componentClass);
}
else if (attemptedFactoryConstruction)
{
- registerNullComponent(componentNameToUse);
+ if (log.isTraceEnabled()) log.trace("Registering a null for component " + componentNameToUse);
+ registerNullComponent(componentNameToUse, componentClass);
}
}
return component;
}
// registers a special "null" component that has no dependencies.
- void registerNullComponent(String componentName)
+ void registerNullComponent(String componentName, Class type)
{
- registerComponent(componentName, NULL_COMPONENT);
+ registerComponent(componentName, NULL_COMPONENT, type);
}
private boolean isNonBootstrap(Class<?> componentClass)
{
return !(componentClass.equals(CacheSPI.class) || componentClass.equals(CacheImpl.class) || componentClass.equals(Cache.class)
- || componentClass.equals(ComponentRegistry.class));
+ || componentClass.equals(ComponentRegistry.class) || componentClass.equals(Configuration.class));
}
@SuppressWarnings("unchecked")
<T> T getFromConfiguration(Class<T> componentClass)
{
- //if (log.isDebugEnabled()) log.debug("Looking in configuration for an instance of " + componentClass + " that may have been injected from an external source.");
+ if (log.isDebugEnabled())
+ log.debug("Looking in configuration for an instance of " + componentClass + " that may have been injected from an external source.");
Method getter = BeanUtils.getterMethod(Configuration.class, componentClass);
T returnValue = null;
@@ -328,8 +340,20 @@
public void updateDependencies()
{
State originalState = overallState;
- moveComponentsToState(overallState == STARTED ? CONSTRUCTED : STOPPED);
+ moveComponentsToState(overallState == STARTED ? STOPPED : CONSTRUCTED);
moveComponentsToState(originalState);
+ // re- add a few key components - this is a hack for now
+ CacheImpl ci = getComponent(CacheImpl.class);
+ CacheSPI rcid = getComponent("remoteDelegate", RemoteCacheInvocationDelegate.class);
+ CacheSPI spi = getComponent(CacheSPI.class.getName(), CacheSPI.class);
+
+ unregisterComponent(CacheImpl.class);
+ unregisterComponent(CacheSPI.class.getName());
+ unregisterComponent("remoteDelegate");
+
+ registerComponent(CacheImpl.class.getName(), ci, CacheImpl.class);
+ registerComponent(CacheSPI.class.getName(), spi, CacheSPI.class);
+ registerComponent("remoteDelegate", rcid, RemoteCacheInvocationDelegate.class);
}
/**
@@ -464,7 +488,7 @@
if (cf != null)
{
// we simply register this factory. Registration will take care of constructing any dependencies.
- registerComponent(cf);
+ registerComponent(cf, cfClass);
}
}
@@ -677,6 +701,7 @@
{
Object instance;
String name;
+ Class type;
State state = CONSTRUCTED;
Set<Dependency> dependencies = new HashSet<Dependency>(3);
Set<Dependency> dependencyFor = new HashSet<Dependency>(3);
@@ -690,10 +715,11 @@
* @param name name of component
* @param instance component instance
*/
- public Component(String name, Object instance)
+ public Component(String name, Object instance, Class type)
{
this.instance = instance;
this.name = name;
+ this.type = type;
// now scan the instance for all dependencies.
List<Method> injectionMethods = ReflectionUtil.getAllMethods(instance.getClass(), Inject.class);
@@ -707,7 +733,7 @@
*/
Dependency asDependency()
{
- if (me == null) me = new Dependency(name, null);
+ if (me == null) me = new Dependency(name, type);
return me;
}
@@ -753,6 +779,12 @@
for (Dependency d : dependentComponents)
{
Component c = componentLookup.get(d.name);
+// if (c == null && increase)
+// {
+// if (log.isTraceEnabled()) log.trace(name + " depends on " + d.name + " (type "+d.type+") but it does not exist in the registry, attempting to create.");
+// getOrCreateComponent(d.name, d.type);
+// c = componentLookup.get(d.name);
+// }
if (c != null)
{
if (isShallowCyclic(c))
@@ -764,10 +796,21 @@
{
// of we are "moving up" - only do this if the component is lower than what is needed.
if ((increase && newState.isGreaterThan(c.state)) || (!increase && newState.isLessThan(c.state)))
+ {
+ if (c.name.endsWith("CacheLoaderManager"))
+ {
+ boolean itrue = true;
+ }
c.changeState(newState);
+ }
}
}
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace(name + " depends on " + d.name + " (type " + d.type + ") but it does not exist in the registry");
+ }
}
// NOW we update our state.
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -65,7 +65,7 @@
i = clazz.newInstance();
// componentRegistry.wireDependencies(i);
// add this interceptor as a NAMED component into the registry
- componentRegistry.registerComponent(clazz.getName(), i);
+ componentRegistry.registerComponent(clazz.getName(), i, clazz);
}
else
{
@@ -608,7 +608,7 @@
// now set the 'last' pointer.
Interceptor i = setLastInterceptorPointer(first, last);
// re-register this interceptor
- componentRegistry.registerComponent(Interceptor.class.getName(), i);
+ componentRegistry.registerComponent(Interceptor.class.getName(), i, Interceptor.class);
return i;
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoaderManager.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -70,14 +70,33 @@
private boolean fetchPersistentState;
private Configuration configuration;
+ @Inject
+ private void injectDependencies(CacheSPI cache, Configuration configuration)
+ {
+ this.config = configuration.getCacheLoaderConfig();
+ this.cache = cache;
+ this.configuration = configuration;
+
+ if (config != null)
+ {
+ try
+ {
+ loader = createCacheLoader();
+ }
+ catch (Exception e)
+ {
+ throw new CacheException("Unable to create cache loaders", e);
+ }
+ }
+ }
+
/**
- * Sets a configuration object and creates a cacheloader accordingly.
+ * Sets a configuration object and creates a cacheloader accordingly. Primarily used for testing.
*
* @param config
* @param cache
* @throws CacheException
*/
- @Inject
public void setConfig(CacheLoaderConfig config, CacheSPI cache, Configuration configuration) throws CacheException
{
this.config = config == null ? configuration.getCacheLoaderConfig() : config;
Modified: core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/main/java/org/jboss/cache/util/BeanUtils.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -44,6 +44,7 @@
*/
public static String getterName(Class componentClass)
{
+ if (componentClass == null) return null;
StringBuilder sb = new StringBuilder("get");
sb.append(componentClass.getSimpleName());
return sb.toString();
@@ -57,6 +58,7 @@
*/
public static String setterName(Class componentClass)
{
+ if (componentClass == null) return null;
StringBuilder sb = new StringBuilder("set");
sb.append(componentClass.getSimpleName());
return sb.toString();
@@ -81,6 +83,10 @@
//if (log.isTraceEnabled()) log.trace("Unable to find method " + getterName(componentClass) + " in class " + target);
return null;
}
+ catch (NullPointerException e)
+ {
+ return null;
+ }
}
/**
@@ -101,5 +107,9 @@
//if (log.isTraceEnabled()) log.trace("Unable to find method " + setterName(componentClass) + " in class " + target);
return null;
}
+ catch (NullPointerException e)
+ {
+ return null;
+ }
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -171,7 +171,7 @@
// inject a mock RPC manager so that we can test whether calls made are sync or async.
//cache1.getConfiguration().getRuntimeConfig().setRPCManager(rpcManager);
- TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), rpcManager);
+ TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), rpcManager, RPCManager.class);
// invalidations will not trigger any rpc call sfor PFER
if (!isUsingInvalidation())
@@ -189,7 +189,7 @@
verify(rpcManager);
// cleanup
- TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), originalRpcManager);
+ TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), originalRpcManager, RPCManager.class);
cache1.removeNode(fqn);
}
@@ -244,7 +244,7 @@
}
};
- TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), barfingRpcManager);
+ TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), barfingRpcManager, RPCManager.class);
cache1.getConfiguration().getRuntimeConfig().setRPCManager(barfingRpcManager);
try
Modified: core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -78,7 +78,7 @@
public void testNamedComponents()
{
- cr.registerComponent("blah", new Object());
+ cr.registerComponent("blah", new Object(), Object.class);
Object namedComponent1 = cr.getOrCreateComponent("blah", Object.class);
Object namedComponent2 = cr.getOrCreateComponent("blah", Object.class);
Modified: core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryUnitTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryUnitTest.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryUnitTest.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -25,9 +25,9 @@
public void testChangingComponentState()
{
- cr.registerComponent("c2", new C2());
- cr.registerComponent("c1", new C1());
- cr.registerComponent("c3", new C3());
+ cr.registerComponent("c2", new C2(), C2.class);
+ cr.registerComponent("c1", new C1(), C1.class);
+ cr.registerComponent("c3", new C3(), C3.class);
ComponentRegistry.Component c1 = cr.componentLookup.get("c1");
ComponentRegistry.Component c2 = cr.componentLookup.get("c2");
Modified: core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -518,7 +518,7 @@
// This will replace the previous interceptor chain in the component registry
// as well as update dependencies!
- cr.registerComponent(Interceptor.class.getName(), interceptor);
+ cr.registerComponent(Interceptor.class.getName(), interceptor, Interceptor.class);
}
/**
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -40,11 +40,11 @@
ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- cr.registerComponent(interceptor);
+ cr.registerComponent(interceptor, OptimisticCreateIfNotExistsInterceptor.class);
Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
- cr.registerComponent(nodeInterceptor);
+ cr.registerComponent(nodeInterceptor, OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
- cr.registerComponent(dummy);
+ cr.registerComponent(dummy, MockInterceptor.class);
interceptor.setNext(nodeInterceptor);
nodeInterceptor.setNext(dummy);
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/CorruptedFileCacheLoader.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/CorruptedFileCacheLoader.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/CorruptedFileCacheLoader.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -1,6 +1,9 @@
package org.jboss.cache.statetransfer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
+import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.loader.FileCacheLoader;
import java.io.IOException;
@@ -8,8 +11,23 @@
public class CorruptedFileCacheLoader extends FileCacheLoader
{
+ private Log log = LogFactory.getLog(CorruptedFileCacheLoader.class);
+ private CacheLoaderConfig.IndividualCacheLoaderConfig cfg;
@Override
+ public void setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
+ {
+ this.cfg = base;
+ super.setConfig(base);
+ }
+
+ @Override
+ public CacheLoaderConfig.IndividualCacheLoaderConfig getConfig()
+ {
+ return cfg;
+ }
+
+ @Override
public void loadState(Fqn subtree, ObjectOutputStream os) throws Exception
{
throw new IOException("see StateTransfer200Test#testCacheLoaderFailure()");
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/FailedStateTransferTest.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -61,9 +61,9 @@
// inject our own message listener and re-wire deps
ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
- cr.unregisterComponent(CacheMessageListener.class);
- cr.registerComponent(new SecretiveStateCacheMessageListener());
- cr.updateDependencies();
+// cr.unregisterComponent(CacheMessageListener.class);
+ cr.registerComponent(CacheMessageListener.class.getName(), new SecretiveStateCacheMessageListener(), CacheMessageListener.class);
+// cr.updateDependencies();
cache.start();
@@ -80,9 +80,9 @@
// inject our own message listener and re-wire deps
cr = TestingUtil.extractComponentRegistry(recipient);
- cr.unregisterComponent(CacheMessageListener.class);
- cr.registerComponent(new SecretiveStateCacheMessageListener());
- cr.updateDependencies();
+ //cr.unregisterComponent(CacheMessageListener.class);
+ cr.registerComponent(CacheMessageListener.class.getName(), new SecretiveStateCacheMessageListener(), CacheMessageListener.class);
+ //cr.updateDependencies();
try
{
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -93,7 +93,7 @@
@SuppressWarnings("null")
public void testCacheLoaderFailure() throws Exception
{
- CacheSPI<Object, Object> cache1 = createCache("cache1", false, false, "org.jboss.cache.statetransfer.CorruptedFileCacheLoader", false, true);
+ CacheSPI<Object, Object> cache1 = createCache("cache1", false, false, CorruptedFileCacheLoader.class.getName(), false, true);
cache1.put(A_B, "name", JOE);
cache1.put(A_B, "age", TWENTY);
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-01-08 15:01:40 UTC (rev 5064)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransferTestBase.java 2008-01-08 15:13:15 UTC (rev 5065)
@@ -134,7 +134,7 @@
}
if (cacheLoaderClass != null && cacheLoaderClass.length() > 0)
{
- configureCacheLoader(c, cacheLoaderClass, cacheID, useMarshalling, cacheLoaderAsync);
+ configureCacheLoader(c, cacheLoaderClass, cacheID, cacheLoaderAsync);
}
// tree.setConfiguration(c);
//c.setLockAcquisitionTimeout(60000);
@@ -198,14 +198,13 @@
protected void configureCacheLoader(Configuration c,
String cacheID,
- boolean useExtended,
boolean async)
throws Exception
{
- configureCacheLoader(c, "org.jboss.cache.loader.FileCacheLoader", cacheID, useExtended, async);
+ configureCacheLoader(c, "org.jboss.cache.loader.FileCacheLoader", cacheID, async);
}
- protected void configureCacheLoader(Configuration c, String cacheloaderClass, String cacheID, boolean useExtended,
+ protected void configureCacheLoader(Configuration c, String cacheloaderClass, String cacheID,
boolean async) throws Exception
{
if (cacheloaderClass != null)
17 years
JBoss Cache SVN: r5064 - benchmarks/CacheTests/trunk/src/perf.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 10:01:40 -0500 (Tue, 08 Jan 2008)
New Revision: 5064
Modified:
benchmarks/CacheTests/trunk/src/perf/SessionTest.java
Log:
ns
Modified: benchmarks/CacheTests/trunk/src/perf/SessionTest.java
===================================================================
--- benchmarks/CacheTests/trunk/src/perf/SessionTest.java 2008-01-08 14:49:43 UTC (rev 5063)
+++ benchmarks/CacheTests/trunk/src/perf/SessionTest.java 2008-01-08 15:01:40 UTC (rev 5064)
@@ -144,7 +144,7 @@
int num_requests=1000;
int num_attrs=100;
int size=1000;
- int write_percentage=20; // percent
+ int write_percentage=10; // percent
String factory="perf.jbosscache.SessionFactoryJBC";
for(int i=0; i < args.length; i++) {
17 years
JBoss Cache SVN: r5063 - cache-bench-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-08 09:49:43 -0500 (Tue, 08 Jan 2008)
New Revision: 5063
Modified:
cache-bench-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
Log:
added session simulator test + refactoring
Modified: cache-bench-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
===================================================================
--- cache-bench-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java 2008-01-08 14:29:07 UTC (rev 5062)
+++ cache-bench-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java 2008-01-08 14:49:43 UTC (rev 5063)
@@ -1,5 +1,7 @@
package org.cachebench.cachewrappers;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.cachebench.CacheWrapper;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
@@ -13,10 +15,13 @@
public class JBossCache200Wrapper implements CacheWrapper
{
private Cache cache;
+ private Log log = LogFactory.getLog(JBossCache200Wrapper.class);
public void init(Map parameters) throws Exception
{
+ log.info("Creating cache with the following configuration: " + parameters);
cache = DefaultCacheFactory.getInstance().createCache((String)parameters.get("config"));
+ log.info("Running cache with following config:" + cache.getConfiguration());
}
public void setUp() throws Exception
17 years
JBoss Cache SVN: r5062 - benchmarks/CacheTests/trunk.
by jbosscache-commits@lists.jboss.org
Author: bela(a)jboss.com
Date: 2008-01-08 09:29:07 -0500 (Tue, 08 Jan 2008)
New Revision: 5062
Modified:
benchmarks/CacheTests/trunk/pc.sh
benchmarks/CacheTests/trunk/run.sh
Log:
ns
Modified: benchmarks/CacheTests/trunk/pc.sh
===================================================================
--- benchmarks/CacheTests/trunk/pc.sh 2008-01-08 14:28:09 UTC (rev 5061)
+++ benchmarks/CacheTests/trunk/pc.sh 2008-01-08 14:29:07 UTC (rev 5062)
@@ -7,4 +7,4 @@
CP=./classes:$CP
-java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=192.168.2.5 -classpath ${CP} -javaagent:lib/jboss-aop.jar -Djboss.aop.path=./pojocache-aop.xml perf.SessionTest -factory perf.pojocache.SessionFactoryPC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} -javaagent:lib/jboss-aop.jar -Djboss.aop.path=./pojocache-aop.xml perf.SessionTest -factory perf.pojocache.SessionFactoryPC -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
Modified: benchmarks/CacheTests/trunk/run.sh
===================================================================
--- benchmarks/CacheTests/trunk/run.sh 2008-01-08 14:28:09 UTC (rev 5061)
+++ benchmarks/CacheTests/trunk/run.sh 2008-01-08 14:29:07 UTC (rev 5062)
@@ -7,4 +7,4 @@
CP=./classes:$CP
-java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=192.168.2.5 -classpath ${CP} perf.SessionTest -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
+java -Dlog4j.configuration=file:${HOME}/log4j.properties -Djgroups.bind_addr=$MYTESTIP_1 -classpath ${CP} perf.SessionTest -num_requests 100000 -num_attrs 100 -size 1000 -id 1 $*
17 years