JBoss Cache SVN: r6824 - core/branches/1.4.X/src/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 03:47:38 -0400 (Thu, 02 Oct 2008)
New Revision: 6824
Modified:
core/branches/1.4.X/src/org/jboss/cache/loader/JDBCCacheLoader.java
Log:
Fixed broken cl
Modified: core/branches/1.4.X/src/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/loader/JDBCCacheLoader.java 2008-10-01 15:10:23 UTC (rev 6823)
+++ core/branches/1.4.X/src/org/jboss/cache/loader/JDBCCacheLoader.java 2008-10-02 07:47:38 UTC (rev 6824)
@@ -365,7 +365,7 @@
*/
public void put(Fqn name, Map attributes) throws Exception
{
- put(name, attributes, true);
+ put(name, attributes, false);
}
public void put(List modifications) throws Exception
@@ -924,7 +924,7 @@
- final void put(Fqn name, Map attributes, boolean override) throws Exception
+ final void put(Fqn name, Map attributes, boolean erase) throws Exception
{
// JBCACHE-769 -- make a defensive copy
Map attrs = (attributes == null ? null : new HashMap(attributes));
@@ -935,7 +935,7 @@
Map oldNode = loadNode(name);
if(oldNode != null)
{
- if(!override && oldNode != NULL_NODE_IN_ROW && attrs != null)
+ if(!erase && oldNode != NULL_NODE_IN_ROW && attrs != null)
{
Map newOne = new HashMap(oldNode);
if(attrs != null) newOne.putAll(attrs);
16 years, 2 months
JBoss Cache SVN: r6823 - core/branches/1.4.X/tests/functional/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-01 11:10:23 -0400 (Wed, 01 Oct 2008)
New Revision: 6823
Modified:
core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
Log:
Commented out unnecessary test
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-10-01 14:21:25 UTC (rev 6822)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-10-01 15:10:23 UTC (rev 6823)
@@ -14,8 +14,11 @@
/**
* @author Mircea.Markus(a)jboss.com
*/
-public class IsolationLevelReadUncommitedTest extends TestCase {
+// --- Why was this test added in the first place? It was added in r.5178 by mmarkus. Does this pertain to any specific JIRA? - Manik (Oct 2008)
+
+public class IsolationLevelReadUncommitedTest {/*extends TestCase {
+
private TreeCache cache = null;
private Transaction startTransaction() throws SystemException, NotSupportedException
@@ -55,6 +58,7 @@
*
* the key/value added bu tx should be in the cache still, and should not be affected by tx1 rollback.
*/
+ /*
public void testInterlacedTx() throws Exception
{
Transaction tx = startTransaction();
@@ -97,5 +101,5 @@
throw new RuntimeException();
}
}
- }
+ } */
}
\ No newline at end of file
16 years, 3 months
JBoss Cache SVN: r6822 - in core/branches/2.2.X: src/test/java/org/jboss/cache/profiling and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-01 10:21:25 -0400 (Wed, 01 Oct 2008)
New Revision: 6822
Modified:
core/branches/2.2.X/pom.xml
core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java
core/branches/2.2.X/src/test/resources/log4j.xml
Log:
Updated pom
Modified: core/branches/2.2.X/pom.xml
===================================================================
--- core/branches/2.2.X/pom.xml 2008-10-01 14:20:42 UTC (rev 6821)
+++ core/branches/2.2.X/pom.xml 2008-10-01 14:21:25 UTC (rev 6822)
@@ -14,7 +14,7 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-common-parent</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
@@ -27,7 +27,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.3.GA</version>
+ <version>2.6.4.GA</version>
</dependency>
<!-- For the JTA 1.1 API; consuming projects can safely
@@ -419,7 +419,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.3.GA</version>
+ <version>2.6.4.GA</version>
</dependency>
<!-- Replaces javax.transaction/jta -->
<dependency>
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-10-01 14:20:42 UTC (rev 6821)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-10-01 14:21:25 UTC (rev 6822)
@@ -17,6 +17,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
/**
* Test to use with a profiler to profile replication. To be used in conjunction with ProfileSlaveTest.
@@ -38,10 +39,10 @@
Test configuration options
*/
protected static final long NUM_OPERATIONS = 1000000; // DURATION is replaced with a fixed number of operations instead.
- protected static final int NUM_THREADS = 1;
+ protected static final int NUM_THREADS = 25;
protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
protected static final int MAX_DEPTH = 3;
- protected static final int MAX_OVERALL_NODES = 200;
+ protected static final int MAX_OVERALL_NODES = 50;
protected static final int WARMUP_LOOPS = 20000;
protected static final boolean USE_SLEEP = false; // throttle generation a bit
@@ -53,7 +54,7 @@
Log log = LogFactory.getLog(ProfileTest.class);
- @Test(enabled = false)
+ @Test(enabled = true)
public void testLocalModePess() throws Exception
{
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
@@ -243,27 +244,31 @@
startup();
}
- private void doTest() throws Exception
+private void doTest() throws Exception
{
ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS);
- // Executor exec = new DirectExecutor();
- long startTime = System.currentTimeMillis();
log.warn("Starting test");
int i;
long print = NUM_OPERATIONS / 10;
+
+ AtomicLong durationPuts = new AtomicLong();
+ AtomicLong durationGets = new AtomicLong();
+ AtomicLong durationRemoves = new AtomicLong();
+
+ long stElapsed = System.nanoTime();
for (i = 0; i < NUM_OPERATIONS; i++)
{
MyRunnable r = null;
switch (i % 3)
{
case 0:
- r = new Putter(i);
+ r = new Putter(i, durationPuts);
break;
case 1:
- r = new Getter(i);
+ r = new Getter(i, durationGets);
break;
case 2:
- r = new Remover(i);
+ r = new Remover(i, durationRemoves);
break;
}
if (i % print == 0)
@@ -275,12 +280,28 @@
log.warn("Finished generating runnables; awaiting executor completion");
// wait for executors to complete!
exec.shutdown();
- exec.awaitTermination(((long) i), TimeUnit.SECONDS); // wait up to 1 sec for each call?
- long duration = System.currentTimeMillis() - startTime;
- log.warn("Finished test. " + printDuration(duration));
- log.warn("Throughput: " + (NUM_OPERATIONS * 1000 / duration) + " operations per second (roughly equal numbers of PUT, GET and REMOVE)");
+ while (!exec.awaitTermination(((long) i), TimeUnit.SECONDS)) {Thread.sleep(1);} // wait up to 1 sec for each call?
+ long elapsedTimeNanos = System.nanoTime() - stElapsed;
+
+ log.warn("Finished test. " + printDuration((long) toMillis(elapsedTimeNanos)));
+ log.warn("Throughput: " + ((double) NUM_OPERATIONS * 1000 / toMillis(elapsedTimeNanos)) + " operations per second (roughly equal numbers of PUT, GET and REMOVE)");
+ log.warn("Average GET time: " + printAvg(durationGets.get()));
+ log.warn("Average PUT time: " + printAvg(durationPuts.get()));
+ log.warn("Average REMOVE time: " + printAvg(durationRemoves.get()));
}
+ private String printAvg(long totalNanos)
+ {
+ double nOps = (double) (NUM_OPERATIONS / 3);
+ double avg = ((double) totalNanos) / nOps;
+ double avgMicros = avg / 1000;
+ return avgMicros + " �s";
+ }
+
+ private double toMillis(long nanos)
+ {
+ return ((double) nanos / (double) 1000000);
+ }
enum Mode
{
PUT, GET, REMOVE
@@ -290,53 +311,61 @@
{
int id;
Mode mode;
+ AtomicLong duration;
-
public void run()
{
String k = getRandomString();
Fqn f = fqns.get(r.nextInt(MAX_OVERALL_NODES));
+ long d = 0, st = 0;
switch (mode)
{
case PUT:
+ st = System.nanoTime();
cache.put(f, k, getRandomString());
- // cache.put(BELAS_FQN, BELAS_KEY, new byte[10000]);
+ d = System.nanoTime() - st;
break;
case GET:
- // cache.get(BELAS_FQN, BELAS_KEY);
+ st = System.nanoTime();
cache.get(f, k);
+ d = System.nanoTime() - st;
break;
case REMOVE:
- // cache.remove(BELAS_FQN, BELAS_KEY);
+ st = System.nanoTime();
cache.remove(f, k);
+ d = System.nanoTime() - st;
break;
}
+ duration.getAndAdd(d);
}
}
private class Putter extends MyRunnable
{
- private Putter(int id)
+ private Putter(int id, AtomicLong duration)
{
this.id = id;
+ this.duration = duration;
mode = Mode.PUT;
}
}
private class Getter extends MyRunnable
{
- private Getter(int id)
+ private Getter(int id, AtomicLong duration)
{
this.id = id;
+ this.duration = duration;
mode = Mode.GET;
}
}
private class Remover extends MyRunnable
{
- private Remover(int id)
+ private Remover(int id, AtomicLong duration)
{
this.id = id;
+ this.duration = duration;
mode = Mode.REMOVE;
}
}
Modified: core/branches/2.2.X/src/test/resources/log4j.xml
===================================================================
--- core/branches/2.2.X/src/test/resources/log4j.xml 2008-10-01 14:20:42 UTC (rev 6821)
+++ core/branches/2.2.X/src/test/resources/log4j.xml 2008-10-01 14:21:25 UTC (rev 6822)
@@ -66,8 +66,8 @@
<!-- ======================= -->
<root>
- <appender-ref ref="FILE"/>
- <!--<appender-ref ref="CONSOLE"/>-->
+ <!--<appender-ref ref="FILE"/>-->
+ <appender-ref ref="CONSOLE"/>
</root>
</log4j:configuration>
16 years, 3 months
JBoss Cache SVN: r6821 - in core/tags/2.2.1.CR1: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-01 10:20:42 -0400 (Wed, 01 Oct 2008)
New Revision: 6821
Modified:
core/tags/2.2.1.CR1/pom.xml
core/tags/2.2.1.CR1/src/main/java/org/jboss/cache/Version.java
Log:
Modified: core/tags/2.2.1.CR1/pom.xml
===================================================================
--- core/tags/2.2.1.CR1/pom.xml 2008-10-01 14:15:10 UTC (rev 6820)
+++ core/tags/2.2.1.CR1/pom.xml 2008-10-01 14:20:42 UTC (rev 6821)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>2.2.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>2.2.1.CR1</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
@@ -14,7 +14,7 @@
<parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-common-parent</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
@@ -27,7 +27,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.3.GA</version>
+ <version>2.6.4.GA</version>
</dependency>
<!-- For the JTA 1.1 API; consuming projects can safely
@@ -412,14 +412,14 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>2.2.0-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>2.2.1.CR1-JBossAS</jbosscache-core-version>
<defaultTestGroup>functional,unit</defaultTestGroup>
</properties>
<dependencies>
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.3.GA</version>
+ <version>2.6.4.GA</version>
</dependency>
<!-- Replaces javax.transaction/jta -->
<dependency>
Modified: core/tags/2.2.1.CR1/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/2.2.1.CR1/src/main/java/org/jboss/cache/Version.java 2008-10-01 14:15:10 UTC (rev 6820)
+++ core/tags/2.2.1.CR1/src/main/java/org/jboss/cache/Version.java 2008-10-01 14:20:42 UTC (rev 6821)
@@ -11,10 +11,10 @@
@Immutable
public class Version
{
- public static final String version = "2.2.0-SNAPSHOT";
+ public static final String version = "2.2.1.CR1";
public static final String codename = "Poblano";
//public static final String cvs = "$Id: Version.java 4592 2007-10-10 16:44:36Z manik.surtani(a)jboss.com $";
- static final byte[] version_id = {'0', '2', '2', '0', 'S'};
+ static final byte[] version_id = {'0', '2', '2', '1', 'C', '1'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
16 years, 3 months
JBoss Cache SVN: r6820 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-01 10:15:10 -0400 (Wed, 01 Oct 2008)
New Revision: 6820
Added:
core/tags/2.2.1.CR1/
Log:
Copied: core/tags/2.2.1.CR1 (from rev 6819, core/branches/2.2.X)
16 years, 3 months
JBoss Cache SVN: r6819 - core/branches/1.4.X/src/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-01 06:22:37 -0400 (Wed, 01 Oct 2008)
New Revision: 6819
Modified:
core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java
Log:
JBCACHE-1412: Marshaller uses equals() to test object equality instead of identity when performing reference counting
Modified: core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java 2008-09-30 14:49:46 UTC (rev 6818)
+++ core/branches/1.4.X/src/org/jboss/cache/marshall/TreeCacheMarshaller140.java 2008-10-01 10:22:37 UTC (rev 6819)
@@ -109,7 +109,7 @@
public Object objectFromStream(ObjectInputStream in) throws Exception
{
Object retValue;
- Map refMap = new IdentityHashMap();
+ Map refMap = new HashMap();
if (useRegionBasedMarshalling)
{
16 years, 3 months