[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...
Manik Surtani
manik at jboss.org
Wed May 23 06:28:57 EDT 2007
User: msurtani
Date: 07/05/23 06:28:57
Modified: src/org/jboss/cache/loader AbstractCacheLoader.java
AsyncCacheLoader.java ManagedConnectionFactory.java
Log:
Initiated a bunch of performance fixes, including replacing CopyOnWriteArraySets with org.jboss.cache.util.concurrent.ConcurrentHashSet.
Also ran an imports optimiser on the code base - there were a lot of unused imports floating about.
Revision Changes Path
1.24 +5 -5 JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- AbstractCacheLoader.java 30 Jan 2007 00:11:38 -0000 1.23
+++ AbstractCacheLoader.java 23 May 2007 10:28:57 -0000 1.24
@@ -6,6 +6,8 @@
*/
package org.jboss.cache.loader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
@@ -17,8 +19,6 @@
import org.jboss.cache.marshall.NodeDataExceptionMarker;
import org.jboss.cache.marshall.NodeDataMarker;
import org.jboss.cache.util.MapCopy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
1.28 +13 -13 JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsyncCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- AsyncCacheLoader.java 9 Feb 2007 19:21:28 -0000 1.27
+++ AsyncCacheLoader.java 23 May 2007 10:28:57 -0000 1.28
@@ -17,9 +17,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.BlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -329,7 +328,8 @@
{
log.trace("run0");
int i = queue.drainTo(mods, config.getBatchSize());
- if (i == 0) {
+ if (i == 0)
+ {
Modification m = queue.take();
mods.add(m);
}
1.4 +12 -6 JBossCache/src/org/jboss/cache/loader/ManagedConnectionFactory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ManagedConnectionFactory.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ManagedConnectionFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ManagedConnectionFactory.java 5 Mar 2007 21:10:43 -0000 1.3
+++ ManagedConnectionFactory.java 23 May 2007 10:28:57 -0000 1.4
@@ -9,9 +9,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.sql.DataSource;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
@@ -42,7 +42,10 @@
{
ctx = new InitialContext();
dataSource = (DataSource) ctx.lookup(datasourceName);
- if (log.isTraceEnabled()) { log.trace("Datasource lookup for " + datasourceName + " succeded: " + dataSource);}
+ if (log.isTraceEnabled())
+ {
+ log.trace("Datasource lookup for " + datasourceName + " succeded: " + dataSource);
+ }
}
catch (NamingException e)
{
@@ -68,7 +71,10 @@
throws SQLException
{
Connection connection = dataSource.getConnection();
- if (log.isTraceEnabled()) { log.trace("Connection checked out: " + connection); }
+ if (log.isTraceEnabled())
+ {
+ log.trace("Connection checked out: " + connection);
+ }
return connection;
}
More information about the jboss-cvs-commits
mailing list