JBoss Cache SVN: r6816 - core/trunk/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-30 05:31:13 -0400 (Tue, 30 Sep 2008)
New Revision: 6816
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
stuff
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-30 07:43:42 UTC (rev 6815)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-30 09:31:13 UTC (rev 6816)
@@ -36,7 +36,7 @@
{
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
- cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setConcurrencyLevel(5000);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
cache.start();
waitForTest();
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-30 07:43:42 UTC (rev 6815)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-30 09:31:13 UTC (rev 6816)
@@ -39,16 +39,13 @@
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 WARMUP_LOOPS = 20000;
protected static final boolean USE_SLEEP = false; // throttle generation a bit
- protected static final Fqn BELAS_FQN = Fqn.fromString("/a/b/c");
- protected static final String BELAS_KEY = "bela";
-
private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
private Random r = new Random();
@@ -84,7 +81,7 @@
{
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
- cache.getConfiguration().setConcurrencyLevel(500);
+ cache.getConfiguration().setConcurrencyLevel(5000);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
runCompleteTest();
}
16 years, 3 months
JBoss Cache SVN: r6815 - in benchmarks/benchmark-fwk/trunk: cache-products/ehcache-1.5.0 and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-30 03:43:42 -0400 (Tue, 30 Sep 2008)
New Revision: 6815
Added:
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
Modified:
benchmarks/benchmark-fwk/trunk/TODO
benchmarks/benchmark-fwk/trunk/build.xml
benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java
Log:
updated stuff
Modified: benchmarks/benchmark-fwk/trunk/TODO
===================================================================
--- benchmarks/benchmark-fwk/trunk/TODO 2008-09-30 07:33:29 UTC (rev 6814)
+++ benchmarks/benchmark-fwk/trunk/TODO 2008-09-30 07:43:42 UTC (rev 6815)
@@ -1,4 +1,4 @@
-1. JBoss Cache 1.4.1 breaks during warmup
-2. ReplicationOccursTest doesn't always work - reports false errors.
- - it relies on cache.getReplicatedData(); most likely that is the cause of the problem, refere to javadoc
-3. Replace cluster.sh, runNode.sh, killNode.sh and cache-product/product-x.y.z/config.sh with Ant scripts to make them cross-platform.
+1. Replace cluster.sh, runNode.sh, killNode.sh and cache-product/product-x.y.z/config.sh with Ant scripts to make them cross-platform.
+2. status email notifications - will allow one not to tail logs all the time/from time to time to look for issues
+3. move scripts to an bin dir, as there are too many of them arround
+4. warmup should only be performed if session replication passes
\ No newline at end of file
Modified: benchmarks/benchmark-fwk/trunk/build.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/build.xml 2008-09-30 07:33:29 UTC (rev 6814)
+++ benchmarks/benchmark-fwk/trunk/build.xml 2008-09-30 07:43:42 UTC (rev 6815)
@@ -86,7 +86,7 @@
</javac>
</target>
- <target name="compile.module.ehcache141" depends="compile.module.framework"
+ <target name="compile.module.ehcache159" depends="compile.module.framework"
description="Compile module ehcache-1.5.0; production classes">
<mkdir dir="./classes/production/ehcache-1.5.0"/>
<javac destdir="./classes/production/ehcache-1.5.0" debug="${compiler.debug}"
@@ -190,6 +190,20 @@
</javac>
</target>
+ <target name="compile.module.pojocache220" depends="compile.module.framework"
+ description="Compile module pojocache-2.2.0; production classes">
+ <mkdir dir="./classes/production/pojocache-2.2.0"/>
+ <javac destdir="./classes/production/pojocache-2.2.0" debug="${compiler.debug}"
+ nowarn="${compiler.generate.no.warnings}" fork="true">
+ <classpath>
+ <fileset dir="./cache-products/pojocache-2.2.0/lib" includes="*.jar"/>
+ <pathelement location="./lib/commons-logging.jar"/>
+ <pathelement location="${framework.output.dir}"/>
+ </classpath>
+ <src path="./cache-products/pojocache-2.2.0/src"/>
+ </javac>
+ </target>
+
<target name="compile.module.whirlycache101" depends="compile.module.framework"
description="Compile module whirlycache-1.0.1; production classes">
<mkdir dir="./classes/production/whirlycache-1.0.1"/>
@@ -223,7 +237,7 @@
</target>
<target name="all"
- depends="clean, compile.module.framework, compile.module.jbosscache140, compile.module.jbosscache200, compile.module.jbosscache210, compile.module.jbosscache220, compile.module.terracotta250, compile.module.ehcache141, compile.module.whirlycache101, compile.module.jbosscache300, compile.module.coherence331"
+ depends="clean, compile.module.framework, compile.module.jbosscache140, compile.module.jbosscache200, compile.module.pojocache220, compile.module.jbosscache210, compile.module.jbosscache220, compile.module.terracotta250, compile.module.ehcache159, compile.module.whirlycache101, compile.module.jbosscache300, compile.module.coherence331"
description="build all"/>
<target name="checkClusterAddresses" depends="compile.module.framework"
Added: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml 2008-09-30 07:43:42 UTC (rev 6815)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="CacheBenchmarkFwk" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="file://$MODULE_DIR$/../../../products/ehcache-1.5.0/javadocs" />
+ </JAVADOC>
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ <javadoc-paths>
+ <root url="jar://$MODULE_DIR$/../../../products/ehcache-1.5.0/ehcache-1.5.0-javadoc.zip!/" />
+ </javadoc-paths>
+ </component>
+</module>
+
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java 2008-09-30 07:33:29 UTC (rev 6814)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java 2008-09-30 07:43:42 UTC (rev 6815)
@@ -30,7 +30,7 @@
}
catch (Throwable e)
{
- log.warn("Exception on cache warmup", e);
+ log.trace("Exception on cache warmup", e);
}
}
16 years, 3 months
JBoss Cache SVN: r6814 - in benchmarks/benchmark-fwk/trunk/cache-products: pojocache-2.2.0 and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-30 03:33:29 -0400 (Tue, 30 Sep 2008)
New Revision: 6814
Added:
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/
benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
Log:
added pojocache data
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml 2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This is a variant of jboss-aop.xml.
+-->
+<aop>
+ <!-- If a POJO has a Replicable annotation, it will be asepectized. -->
+
+ <!--
+ Supports inheritance and polymorphism. It can either be a concrete class
+ or an interface. All sub-classes or interface implementors will be instrumeneted.
+ -->
+ <prepare expr="field(* $instanceof{(a)org.jboss.cache.pojo.annotation.Replicable}->*)" />
+
+ <!-- Work around that ensures annotated classes which do not access fields are instrumented -->
+ <introduction expr="class($instanceof{(a)org.jboss.cache.pojo.annotation.Replicable})"/>
+
+ <!-- Array support -->
+ <!-- Comment entire section to disable -->
+ <arrayreplacement expr="class($instanceof{(a)org.jboss.cache.pojo.annotation.Replicable})"/>
+ <interceptor name="pojocache-array" class="org.jboss.cache.pojo.interceptors.dynamic.ArrayInterceptor"/>
+ <introduction expr="class($instanceof{(a)org.jboss.cache.pojo.annotation.Replicable})">
+ <interfaces>org.jboss.cache.pojo.impl.ArrayInterceptable</interfaces>
+ </introduction>
+ <arraybind name="pojocache-array" type="READ_WRITE">
+ <interceptor-ref name="pojocache-array"/>
+ </arraybind>
+</aop>
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml 2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample TreeCache Service Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=TreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+ <!--
+ Isolation level : SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <!--
+ Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ INVALIDATION_ASYNC
+ INVALIDATION_SYNC
+ -->
+ <attribute name="CacheMode">REPL_SYNC</attribute>
+
+ <!--
+ Just used for async repl: use a replication queue
+ -->
+ <attribute name="UseReplQueue">false</attribute>
+
+ <!--
+ Replication interval for replication queue (in ms)
+ -->
+ <attribute name="ReplQueueInterval">0</attribute>
+
+ <!--
+ Max number of elements which trigger replication
+ -->
+ <attribute name="ReplQueueMaxElements">0</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+ cluster in order to find each other.
+ -->
+ <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+ <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS. -->
+ <!--
+ <depends>jgroups.mux:name=Multiplexer</depends>
+ <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+ <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+ -->
+
+ <!-- JGroups protocol stack properties.
+ ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+ -->
+ <attribute name="ClusterConfig">
+ <config>
+ <UDP mcast_addr="228.10.10.10"
+ mcast_port="45588"
+ tos="8"
+ ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000"
+ mcast_recv_buf_size="25000000"
+ mcast_send_buf_size="640000"
+ loopback="false"
+ discard_incompatible_packets="true"
+ max_bundle_size="64000"
+ max_bundle_timeout="30"
+ use_incoming_packet_handler="true"
+ ip_ttl="2"
+ enable_bundling="false"
+ enable_diagnostics="false"
+
+ use_concurrent_stack="true"
+
+ thread_naming_pattern="pl"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="1"
+ thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="30000"
+ thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="10"
+ thread_pool.rejection_policy="Run"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="4"
+ oob_thread_pool.keep_alive_time="10000"
+ oob_thread_pool.queue_enabled="true"
+ oob_thread_pool.queue_max_size="10"
+ oob_thread_pool.rejection_policy="Run"/>
+
+ <PING timeout="2000" num_initial_members="3"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD timeout="10000" max_tries="5" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK max_xmit_size="60000"
+ use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="5000"
+ join_retry_timeout="2000" shun="false"
+ view_bundling="true" view_ack_collection_timeout="5000"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+ <!-- <pbcast.STATE_TRANSFER/> -->
+ <pbcast.FLUSH timeout="0"/>
+ </config>
+ </attribute>
+
+
+ <!--
+ Whether or not to fetch state on joining a cluster
+ NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
+ -->
+ <attribute name="FetchInMemoryState">true</attribute>
+
+ <!--
+ The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members in a clustered environment
+ -->
+ <attribute name="StateRetrievalTimeout">15000</attribute>
+
+ <!--
+ Number of milliseconds to wait until all responses for a
+ synchronous call have been received.
+ -->
+ <attribute name="SyncReplTimeout">15000</attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+ <!--
+ Indicate whether to use region based marshalling or not. Set this to true if you are running under a scoped
+ class loader, e.g., inside an application server. Default is "false".
+ -->
+ <attribute name="UseRegionBasedMarshalling">true</attribute>
+ </mbean>
+
+
+ <!-- Uncomment to get a graphical view of the TreeCache MBean above -->
+ <!-- <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
+ <!-- <depends>jboss.cache:service=TreeCache</depends>-->
+ <!-- <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
+ <!-- </mbean>-->
+
+
+</server>
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh 2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/pojocache-2.2.0"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+CLASSPATH=$CLASSPATH:./classes/production/pojocache-2.2.0
+CLASSPATH=$CLASSPATH:$THIS_DIR/conf
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -javaagent:$THIS_DIR/lib/jboss-aop.jar -Djboss.aop.path=$THIS_DIR/conf/pojocache-aop.xml -Djava.net.preferIPv4Stack=true -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.PojoCache220Wrapper"
+
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
===================================================================
(Binary files differ)
Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java 2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,92 @@
+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;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.marshall.NodeData;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+public class PojoCache220Wrapper implements CacheWrapper
+{
+ private PojoCache cache;
+ private Log log = LogFactory.getLog(PojoCache220Wrapper.class);
+ private Map replicatedData;
+
+ public void init(Map parameters) throws Exception
+ {
+ log.info("Creating pojo cache with the following configuration: " + parameters);
+ String configFile = (String) parameters.get("config");
+ URL url = Thread.currentThread().getContextClassLoader().getResource(configFile);
+ log.info("Loading cache with config file: " + url);
+ cache = PojoCacheFactory.createCache(configFile);
+ boolean isCoordinator = cache.getCache().getMembers().indexOf(cache.getCache().getLocalAddress()) == 0;
+ if (isCoordinator)
+ {
+ replicatedData = new HashMap();
+ cache.attach("/data", replicatedData);
+ }
+ else
+ {
+ for (int i = 0; i < 10; i++)
+ {
+ replicatedData = (Map) cache.find("/data");
+ if (replicatedData != null) break;
+ log.info("This is not the coordinator, sleeping for a second before trying to refetched the map.");
+ Thread.sleep(1000);
+ }
+ }
+ replicatedData = (Map) cache.find("/data");
+ }
+
+ public void setUp() throws Exception
+ {
+ }
+
+ public void tearDown() throws Exception
+ {
+ cache.stop();
+ }
+
+ public void put(List<String> path, Object key, Object value) throws Exception
+ {
+ replicatedData.put(key, value);
+ }
+
+ public Object get(List<String> path, Object key) throws Exception
+ {
+ return replicatedData.get(key);
+ }
+
+ public void empty() throws Exception
+ {
+ //not removing root because there it fails with buddy replication: http://jira.jboss.com/jira/browse/JBCACHE-1241
+ replicatedData.clear();
+ }
+
+ public int getNumMembers()
+ {
+ return cache.getCache().getMembers().size();
+ }
+
+ public String getInfo()
+ {
+ return "n/a info for pojocache";
+ }
+
+ public Object getReplicatedData(List<String> path, String key) throws Exception
+ {
+ //we assume that full replication is in use!!!
+ return replicatedData.get(key);
+ }
+}
16 years, 3 months
JBoss Cache SVN: r6813 - in searchable/trunk: src/main/java/org/jboss/cache/search and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-09-29 10:16:28 -0400 (Mon, 29 Sep 2008)
New Revision: 6813
Modified:
searchable/trunk/pom.xml
searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
Log:
Trying to get pojocache compatibility
Modified: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml 2008-09-27 23:31:53 UTC (rev 6812)
+++ searchable/trunk/pom.xml 2008-09-29 14:16:28 UTC (rev 6813)
@@ -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-searchable-version>1.0.0.CR1</jbosscache-searchable-version>
+ <jbosscache-searchable-version>1.0.0-SNAPSHOT</jbosscache-searchable-version>
<!-- By default only generate Javadocs when we package the module. -->
<javadocPhase>package</javadocPhase>
</properties>
@@ -40,11 +40,11 @@
<version>1.0.4</version>
</dependency>
-<!-- <dependency>
+ <dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-pojo</artifactId>
<version>2.2.0.CR7</version>
- </dependency> -->
+ </dependency>
<!-- Test dependencies -->
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-09-27 23:31:53 UTC (rev 6812)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-09-29 14:16:28 UTC (rev 6813)
@@ -1,72 +1,72 @@
-///*
-// * JBoss, Home of Professional Open Source
-// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
-// * by the @authors tag. See the copyright.txt in the distribution for a
-// * full listing of individual contributors.
-// *
-// * This is free software; you can redistribute it and/or modify it
-// * under the terms of the GNU Lesser General Public License as
-// * published by the Free Software Foundation; either version 2.1 of
-// * the License, or (at your option) any later version.
-// *
-// * This software is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// * Lesser General Public License for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public
-// * License along with this software; if not, write to the Free
-// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-// * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-// */
-//
-//package org.jboss.cache.search;
-//
-//import org.hibernate.search.backend.TransactionContext;
-//import org.jboss.cache.pojo.notification.event.Event;
-//
-//import javax.transaction.Synchronization;
-//import javax.transaction.Transaction;
-//
-///**
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//public class PojoTransactionContext implements TransactionContext
-//{
-// Event event;
-//
-// public PojoTransactionContext(Event event)
-// {
-// if (event == null) throw new NullPointerException("event cannot be null");
-// this.event = event;
-//
-// }
-// public boolean isTransactionInProgress()
-// {
-// return (event.getContext().getTransaction() != null);
-//
-// }
-//
-// public Object getTransactionIdentifier()
-// {
-// return event.getContext().getTransaction();
-// }
-//
-// public void registerSynchronization(Synchronization synchronization)
-// {
-// Transaction transaction = event.getContext().getTransaction();
-//
-// if (transaction != null)
-// {
-//
-// try
-// {
-// transaction.registerSynchronization(synchronization);
-// }
-// catch (Exception e)
-// {
-// throw new RuntimeException(e);
-// }
-// }
-// }
-//}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.cache.search;
+
+import org.hibernate.search.backend.TransactionContext;
+import org.jboss.cache.pojo.notification.event.Event;
+
+import javax.transaction.Synchronization;
+import javax.transaction.Transaction;
+
+/**
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+public class PojoTransactionContext implements TransactionContext
+{
+ Event event;
+
+ public PojoTransactionContext(Event event)
+ {
+ if (event == null) throw new NullPointerException("event cannot be null");
+ this.event = event;
+
+ }
+ public boolean isTransactionInProgress()
+ {
+ return (event.getContext().getTransaction() != null);
+
+ }
+
+ public Object getTransactionIdentifier()
+ {
+ return event.getContext().getTransaction();
+ }
+
+ public void registerSynchronization(Synchronization synchronization)
+ {
+ Transaction transaction = event.getContext().getTransaction();
+
+ if (transaction != null)
+ {
+
+ try
+ {
+ transaction.registerSynchronization(synchronization);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-09-27 23:31:53 UTC (rev 6812)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-09-29 14:16:28 UTC (rev 6813)
@@ -18,7 +18,7 @@
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+ */
package org.jboss.cache.search;
@@ -27,6 +27,7 @@
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheStatus;
+import org.jboss.cache.pojo.PojoCache;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -35,23 +36,24 @@
/**
* Factory class used to create the searchable-cache like so: -
- *
* <p/>
- * SearchableCache searchableCache = SearchableCacheFactory.createSearchableCache(coreCache, class[]);
+ * <p/>
+ * SearchableCache searchableCache = SearchableCacheFactory.createSearchableCache(coreCache, class[]);
+ * <p/>
+ * <p/>
*
- * <p/>
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class SearchableCacheFactory
{
private static final Log log = LogFactory.getLog(SearchableCacheFactory.class);
-
+
/**
* Creates a searchable cache from a cache object and a class array, without the properties object.
*
- * @param c - the Cache
- * @param classes - Class array to be added
+ * @param c - the Cache
+ * @param classes - Class array to be added
* @return a SearchableCache
*/
public SearchableCache createSearchableCache(Cache<?, ?> c, Class... classes)
@@ -62,18 +64,18 @@
/**
* This method creates a searchable cache as well but requires the properties object.
*
- * @param c - the Cache
+ * @param c - the Cache
* @param properties - java.util.properties
- * @param classes - a class array
+ * @param classes - a class array
* @return a SearchableCache
*/
public SearchableCache createSearchableCache(Cache<?, ?> c, Properties properties, Class... classes)
{
+
//validate the classes first. make sure the correct annotations are put in.
validateClasses(classes);
-
// assume cache is already created and running.
// otherwise, start the cache!!
if (c.getCacheStatus() != CacheStatus.STARTED)
@@ -92,30 +94,93 @@
// set classes in the cfg
SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
-// boolean isPojoCache = c instanceof PojoCache; keep this for later usage
- // Step 2: Add cache listener to listen for events happening in the cache.
- //SearchableListener listener = isPojoCache ? new SearchablePojoListener(searchFactory) : new SearchableCoreListener(searchFactory);
- SearchableCoreListener listener = new SearchableCoreListener(searchFactory);
- c.addCacheListener(listener);
+ // Okay, create the core listener
+ SearchableCoreListener coreListener = new SearchableCoreListener(searchFactory);
+ c.addCacheListener(coreListener);
-
- // step 3: create the searchable cache delegate.
+ //Create the searchableCache and pass it on.
SearchableCache sc = new SearchableCacheImpl(c, searchFactory);
return sc;
}
+ /**
+ * This method creates a searchable cache as well but requires the properties object.
+ *
+ * @param pojo - the pojoCache
+ * @param properties - java.util.properties
+ * @param classes - a class array
+ * @return a SearchableCache
+ */
+
+ public SearchableCache createSearchableCache(PojoCache pojo, Properties properties, Class... classes)
+ {
+
+ System.out.println("create searchable cache called with pojo cache");
+ //TODO: Ask Manik and/or Jason if there is a way to directly check if the pojo cache is started or not
+ validateClasses(classes);
+
+ Cache coreCache = pojo.getCache();
+
+ if (coreCache.getCacheStatus() != CacheStatus.STARTED)
+ {
+ if (log.isInfoEnabled()) log.info("Cache not started. Starting cache first.");
+ pojo.start();
+ }
+
+ if (classes.length == 0)
+ {
+ if (log.isWarnEnabled()) log.warn("You haven't passed in any classes to index. Is this an error?");
+ }
+
+ // step 1: create hibernate search searchFactory
+ SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
+ // set classes in the cfg
+
+ SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
+
+ //Now create the pojoListener
+ SearchablePojoListener pojoListener = new SearchablePojoListener(searchFactory);
+ pojo.addListener(pojoListener);
+
+ //TODO: - This could be a break point. But it should not be.
+ SearchableCache sc = new SearchableCacheImpl(coreCache, searchFactory);
+ return sc;
+ }
+
+ /**
+ * Creates a searchable cache from a cache object and a class array, without the properties object.
+ *
+ * @param pojo - the pojoCache
+ * @param classes - Class array to be added
+ * @return a SearchableCache
+ */
+
+
+ public SearchableCache createSearchableCache(PojoCache pojo, Class... classes)
+ {
+ return createSearchableCache(pojo, null, classes);
+ }
+
+ //This is to check that both the @ProvidedId is present and the the @DocumentId is not present. This is because
+ // don't want both of these 2 annotations used at the same time.
private void validateClasses(Class... classes)
{
- for(Class c: classes)
+ for (Class c : classes)
{
- if (!c.isAnnotationPresent(org.hibernate.search.annotations.ProvidedId.class)) throw new IllegalArgumentException ("There is no provided id on " + c.getName() + " class");
+ if (!c.isAnnotationPresent(org.hibernate.search.annotations.ProvidedId.class))
+ {
+ throw new IllegalArgumentException("There is no provided id on " + c.getName() + " class");
+ }
- for(Field field: c.getFields())
+ for (Field field : c.getFields())
{
- if (field.getAnnotation(org.hibernate.search.annotations.DocumentId.class) != null) throw new IllegalArgumentException("Please remove the documentId annotation in " + c.getName());
+ if (field.getAnnotation(org.hibernate.search.annotations.DocumentId.class) != null)
+ {
+ throw new IllegalArgumentException("Please remove the documentId annotation in " + c.getName());
+ }
}
}
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-09-27 23:31:53 UTC (rev 6812)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-09-29 14:16:28 UTC (rev 6813)
@@ -1,100 +1,112 @@
-///*
-// * JBoss, Home of Professional Open Source
-// * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
-// * by the @authors tag. See the copyright.txt in the distribution for a
-// * full listing of individual contributors.
-// *
-// * This is free software; you can redistribute it and/or modify it
-// * under the terms of the GNU Lesser General Public License as
-// * published by the Free Software Foundation; either version 2.1 of
-// * the License, or (at your option) any later version.
-// *
-// * This software is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// * Lesser General Public License for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public
-// * License along with this software; if not, write to the Free
-// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-// * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-// */
-//
-//package org.jboss.cache.search;
-//
-//import org.hibernate.search.impl.SearchFactoryImpl;
-//import org.hibernate.search.backend.TransactionContext;
-//import org.hibernate.search.backend.Work;
-//import org.hibernate.search.backend.WorkType;
-//import org.hibernate.search.engine.SearchFactoryImplementor;
-//import org.jboss.cache.notifications.event.NodeModifiedEvent;
-//import org.jboss.cache.pojo.notification.annotation.*;
-//import org.jboss.cache.pojo.notification.event.AttachedEvent;
-//import org.jboss.cache.pojo.notification.event.DetachedEvent;
-//import org.jboss.cache.pojo.notification.event.Event;
-//import org.jboss.cache.pojo.PojoCache;
-//import org.jboss.cache.Fqn;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//
-//import javax.transaction.Transaction;
-//
-///**
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//
-//@PojoCacheListener
-//public class SearchablePojoListener
-//{
-// private SearchFactoryImplementor searchFactory;
-// private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
-// private String pojoKey = "pojoKey";
-//
-// public SearchablePojoListener(SearchFactoryImplementor searchFactory)
-// {
-// this.searchFactory = searchFactory;
-// }
-//
-// /**
-// * Takes in a NodeModifiedEvent and updates the Lucene indexes using methods on the NodeModifiedEvent class.
-// *
-// * @param event that has occured - or a node that has been changed. {@link org.jboss.cache.notifications.event.NodeModifiedEvent}
-// * @throws InvalidKeyException if an invalid key is given.
-// */
-//
-// @Attached
-// public void handleAttach(AttachedEvent event) throws InvalidKeyException
-// {
-// System.out.println("Pojocache.attach() called");
-// Object added = event.getSource();
-// Fqn fqn = event.getContext().getPojoCache().getInternalFqn(added);
-//
-// CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
-//
-// TransactionContext ctx = new PojoTransactionContext(event);
-//
-// searchFactory.getWorker().performWork(new Work(added, cacheEntityId.getDocumentId(), WorkType.ADD), ctx);
-// }
-//
-//
-// @Detached
-// public void handleDetach (DetachedEvent event) throws InvalidKeyException
-// {
-// Object deleted = event.getSource();
-// Fqn fqn = event.getContext().getPojoCache().getInternalFqn(deleted);
-//
-// CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
-//
-// TransactionContext ctx = new PojoTransactionContext(event);
-//
-// searchFactory.getWorker().performWork(new Work(deleted, cacheEntityId.getDocumentId(), WorkType.DELETE), ctx);
-// }
-//
-//
-// //TODO: Sort out updating Lucene for the following annotations: -
-//// @FieldModified
-//// @ListModified
-//// @ArrayModified
-//// @SetModified
-//
-//}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.cache.search;
+
+import org.hibernate.search.impl.SearchFactoryImpl;
+import org.hibernate.search.backend.TransactionContext;
+import org.hibernate.search.backend.Work;
+import org.hibernate.search.backend.WorkType;
+import org.hibernate.search.engine.SearchFactoryImplementor;
+import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.jboss.cache.notifications.annotation.NodeModified;
+import org.jboss.cache.pojo.notification.annotation.*;
+import org.jboss.cache.pojo.notification.event.AttachedEvent;
+import org.jboss.cache.pojo.notification.event.DetachedEvent;
+import org.jboss.cache.pojo.notification.event.Event;
+import org.jboss.cache.pojo.notification.NotificationContext;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.Fqn;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.transaction.Transaction;
+
+/**
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+
+@PojoCacheListener
+public class SearchablePojoListener
+{
+ private SearchFactoryImplementor searchFactory;
+ private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
+ private String pojoKey = "pojoKey";
+
+ public SearchablePojoListener(SearchFactoryImplementor searchFactory)
+ {
+ this.searchFactory = searchFactory;
+ }
+
+ /**
+ * Takes in a NodeModifiedEvent and updates the Lucene indexes using methods on the NodeModifiedEvent class.
+ *
+ * @param event that has occured - or a node that has been changed. {@link org.jboss.cache.notifications.event.NodeModifiedEvent}
+ * @throws InvalidKeyException if an invalid key is given.
+ */
+
+ @Attached
+ public void handleAttach(AttachedEvent event) throws InvalidKeyException
+ {
+ System.out.println("Pojocache.attach() called");
+ Object added = event.getSource();
+
+ System.out.println("the object is " + event.toString());
+
+ NotificationContext notificationContext = event.getContext();
+ System.out.println("notificationContext is " + notificationContext);
+
+ PojoCache pojo = notificationContext.getPojoCache();
+ System.out.println("pojo is " + pojo);
+
+ Fqn fqn = pojo.getInternalFqn(added);
+ System.out.println("Fqn is " + fqn);
+
+
+ CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
+
+ TransactionContext ctx = new PojoTransactionContext(event);
+
+ searchFactory.getWorker().performWork(new Work(added, cacheEntityId.getDocumentId(), WorkType.ADD), ctx);
+ }
+
+ @Detached
+ public void handleDetach (DetachedEvent event) throws InvalidKeyException
+ {
+ Object deleted = event.getSource();
+ Fqn fqn = event.getContext().getPojoCache().getInternalFqn(deleted);
+
+ CacheEntityId cacheEntityId = new CacheEntityId(fqn, pojoKey);
+
+ TransactionContext ctx = new PojoTransactionContext(event);
+
+ searchFactory.getWorker().performWork(new Work(deleted, cacheEntityId.getDocumentId(), WorkType.DELETE), ctx);
+ }
+
+
+ //TODO: Sort out updating Lucene for the following annotations: -
+// @FieldModified
+// @ListModified
+// @ArrayModified
+// @SetModified
+
+}
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2008-09-27 23:31:53 UTC (rev 6812)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2008-09-29 14:16:28 UTC (rev 6813)
@@ -1,188 +1,186 @@
-//package org.jboss.cache.search.blackbox;
-//
-//import org.apache.lucene.analysis.standard.StandardAnalyzer;
-//import org.apache.lucene.queryParser.ParseException;
-//import org.apache.lucene.queryParser.QueryParser;
-//import org.apache.lucene.search.Query;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//import org.jboss.cache.Cache;
-//import org.jboss.cache.DefaultCacheFactory;
-//import org.jboss.cache.Fqn;
-//import org.jboss.cache.config.Configuration;
-//import org.jboss.cache.pojo.PojoCache;
-//import org.jboss.cache.pojo.PojoCacheFactory;
-//import org.jboss.cache.search.CacheQuery;
-//import org.jboss.cache.search.SearchableCache;
-//import org.jboss.cache.search.SearchableCacheFactory;
-//import org.jboss.cache.search.helper.IndexCleanUp;
-//import org.jboss.cache.search.test.Person;
-//import org.testng.annotations.AfterMethod;
-//import org.testng.annotations.BeforeMethod;
-//import org.testng.annotations.Test;
-//
-//import java.util.List;
-//
-///**
-// * Same as LocalCacheTest except that you will use a POJO Cache instead and use pojoCache.attach() ad pojoCache.detach()
-// * instead of cache.put() and cache.remove().
-// * <p/>
-// *
-// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
-// */
-//
-//@Test(groups = "functional", enabled = false)
-//public class LocalPOJOCacheTest
-//{
-// SearchableCache searchableCache;
-// PojoCache pojo;
-// Person person1;
-// Person person2;
-// Person person3;
-// Person person4;
-// QueryParser queryParser;
-// Query luceneQuery;
-// CacheQuery cacheQuery;
-// List found;
-// private static final Log log = LogFactory.getLog(LocalPOJOCacheTest.class);
-//
-//
-// @BeforeMethod
-// public void setUp()
-// {
-// boolean toStart = false;
-// pojo = PojoCacheFactory.createCache(new Configuration(), toStart);
-// pojo.start(); // if toStart above is true, it will starts the cache automatically.
-// searchableCache = new SearchableCacheFactory().createSearchableCache(pojo.getCache(), Person.class);
-//
-// person1 = new Person();
-// person1.setName("Navin Surtani");
-// person1.setBlurb("Likes playing WoW");
-//
-// person2 = new Person();
-// person2.setName("BigGoat");
-// person2.setBlurb("Eats grass");
-//
-// person3 = new Person();
-// person3.setName("MiniGoat");
-// person3.setBlurb("Eats cheese");
-//
-// pojo.attach(Fqn.fromString("/a/b/c"), person1);
-// pojo.attach(Fqn.fromString("/a/b/d"), person2);
-// pojo.attach(Fqn.fromString("/a/b/c"), person3);
-//
-//
-// }
-//
-// @AfterMethod
-// public void tearDown()
-// {
-// if (pojo != null) pojo.stop();
-// if (searchableCache != null) searchableCache.stop();
-// IndexCleanUp.cleanUpIndexes();
-// }
-//
-// public void testSimple() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("playing");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// found = cacheQuery.list();
-//
-// }
-//
-// public void testMultipleResults() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("Eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 2;
-// assert !found.get(1).equals(person2);
-// assert !found.get(0).equals(person3);
-//
-// }
-//
-// public void testModified() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("playing");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-//// assert found.get(0).equals(person1);
-//
-// person1.setBlurb("Likes pizza");
-//
-// pojo.attach(Fqn.fromString("/a/b/c/"), person1);
-//
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("pizza");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-//
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-//// assert found.get(0).equals(person1);
-// }
-//
-// public void testAdded() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 2 : "Size of list should be 2";
-// assert found.contains(person2);
-// assert found.contains(person3);
-// assert !found.contains(person4) : "This should not contain object person4";
-//
-// person4 = new Person();
-// person4.setName("MightyGoat");
-// person4.setBlurb("Also eats grass");
-//
-// pojo.attach(Fqn.fromString("/r/a/m/"), person4);
-//
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 3 : "Size of list should be 3";
-// assert found.contains(person2);
-// assert found.contains(person3);
-// assert found.contains(person4) : "This should now contain object person4";
-// }
-//
-// public void testRemoved() throws ParseException
-// {
-// queryParser = new QueryParser("blurb", new StandardAnalyzer());
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 2;
-// assert found.contains(person2);
-// assert found.contains(person3) : "This should still contain object person3";
-//
-// pojo.detach("/a/b/d");
-//
-// luceneQuery = queryParser.parse("eats");
-// cacheQuery = searchableCache.createQuery(luceneQuery);
-// found = cacheQuery.list();
-//
-// assert found.size() == 1;
-// assert found.contains(person2);
-// assert !found.contains(person3) : "The search should not return person3";
-//
-//
-// }
-//
-//}
-//
-//
-//
+package org.jboss.cache.search.blackbox;
+
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Query;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.search.CacheQuery;
+import org.jboss.cache.search.SearchableCache;
+import org.jboss.cache.search.SearchableCacheFactory;
+import org.jboss.cache.search.helper.IndexCleanUp;
+import org.jboss.cache.search.test.Person;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+/**
+ * Same as LocalCacheTest except that you will use a POJO Cache instead and use pojoCache.attach() ad pojoCache.detach()
+ * instead of cache.put() and cache.remove().
+ * <p/>
+ *
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+ */
+
+@Test(groups = "functional", enabled = true)
+public class LocalPOJOCacheTest
+{
+ SearchableCache searchableCache;
+ PojoCache pojo;
+ Person person1;
+ Person person2;
+ Person person3;
+ Person person4;
+ QueryParser queryParser;
+ Query luceneQuery;
+ CacheQuery cacheQuery;
+ List found;
+ private static final Log log = LogFactory.getLog(LocalPOJOCacheTest.class);
+
+
+ @BeforeMethod
+ public void setUp()
+ {
+ boolean toStart = false;
+ pojo = PojoCacheFactory.createCache(new Configuration(), toStart);
+ pojo.start(); // if toStart above is true, it will starts the cache automatically.
+ searchableCache = new SearchableCacheFactory().createSearchableCache(pojo, Person.class);
+
+ person1 = new Person();
+ person1.setName("Navin Surtani");
+ person1.setBlurb("Likes playing WoW");
+
+ person2 = new Person();
+ person2.setName("BigGoat");
+ person2.setBlurb("Eats grass");
+
+ person3 = new Person();
+ person3.setName("MiniGoat");
+ person3.setBlurb("Eats cheese");
+
+ pojo.attach("/a/b/c", person1);
+ pojo.attach("/a/b/d", person2);
+ pojo.attach("/a/b/c", person3);
+
+
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ if (pojo != null) pojo.stop();
+ if (searchableCache != null) searchableCache.stop();
+ IndexCleanUp.cleanUpIndexes();
+ }
+
+ public void testSimple() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("playing");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ }
+
+ public void testMultipleResults() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("Eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 2;
+ assert !found.get(1).equals(person2);
+ assert !found.get(0).equals(person3);
+
+ }
+
+ public void testModified() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("playing");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+// assert found.get(0).equals(person1);
+
+ person1.setBlurb("Likes pizza");
+
+ pojo.attach(Fqn.fromString("/a/b/c/"), person1);
+
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("pizza");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+// assert found.get(0).equals(person1);
+ }
+
+ public void testAdded() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 2 : "Size of list should be 2";
+ assert found.contains(person2);
+ assert found.contains(person3);
+ assert !found.contains(person4) : "This should not contain object person4";
+
+ person4 = new Person();
+ person4.setName("MightyGoat");
+ person4.setBlurb("Also eats grass");
+
+ pojo.attach(Fqn.fromString("/r/a/m/"), person4);
+
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 3 : "Size of list should be 3";
+ assert found.contains(person2);
+ assert found.contains(person3);
+ assert found.contains(person4) : "This should now contain object person4";
+ }
+
+ public void testRemoved() throws ParseException
+ {
+ queryParser = new QueryParser("blurb", new StandardAnalyzer());
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 2;
+ assert found.contains(person2);
+ assert found.contains(person3) : "This should still contain object person3";
+
+ pojo.detach("/a/b/d");
+
+ luceneQuery = queryParser.parse("eats");
+ cacheQuery = searchableCache.createQuery(luceneQuery);
+ found = cacheQuery.list();
+
+ assert found.size() == 1;
+ assert found.contains(person2);
+ assert !found.contains(person3) : "The search should not return person3";
+
+
+ }
+
+}
+
+
+
16 years, 3 months
JBoss Cache SVN: r6812 - benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-27 19:31:53 -0400 (Sat, 27 Sep 2008)
New Revision: 6812
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml
Log:
writes are being done sync now
Modified: benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml 2008-09-27 10:11:11 UTC (rev 6811)
+++ benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml 2008-09-27 23:31:53 UTC (rev 6812)
@@ -10,7 +10,7 @@
<locks>
<autolock>
<method-expression>* org.cachebench.cachewrappers.TerracottaWrapper.*(..)</method-expression>
- <lock-level>write</lock-level>
+ <lock-level>synchronous-write</lock-level>
</autolock>
<autolock>
<method-expression>* org.cachebench.cachewrappers.TerracottaWrapper.get(..)</method-expression>
16 years, 3 months
JBoss Cache SVN: r6811 - in core/tags/3.0.0.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-09-27 06:11:11 -0400 (Sat, 27 Sep 2008)
New Revision: 6811
Modified:
core/tags/3.0.0.CR1/pom.xml
core/tags/3.0.0.CR1/src/main/java/org/jboss/cache/Version.java
Log:
Modified: core/tags/3.0.0.CR1/pom.xml
===================================================================
--- core/tags/3.0.0.CR1/pom.xml 2008-09-27 10:08:05 UTC (rev 6810)
+++ core/tags/3.0.0.CR1/pom.xml 2008-09-27 10:11:11 UTC (rev 6811)
@@ -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>3.0.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.0.0.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. -->
@@ -399,7 +399,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.0.0-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.0.0.CR1-JBossAS</jbosscache-core-version>
</properties>
<dependencies>
<dependency>
Modified: core/tags/3.0.0.CR1/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.0.0.CR1/src/main/java/org/jboss/cache/Version.java 2008-09-27 10:08:05 UTC (rev 6810)
+++ core/tags/3.0.0.CR1/src/main/java/org/jboss/cache/Version.java 2008-09-27 10:11:11 UTC (rev 6811)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.0-SNAPSHOT";
+ public static final String version = "3.0.0.CR1";
public static final String codename = "Naga";
//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', '3', '0', '0', 'S'};
+ static final byte[] version_id = {'0', '3', '0', '0', 'C', '1'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
16 years, 3 months
JBoss Cache SVN: r6810 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-27 06:08:05 -0400 (Sat, 27 Sep 2008)
New Revision: 6810
Added:
core/tags/3.0.0.CR1/
Log:
Copied: core/tags/3.0.0.CR1 (from rev 6809, core/trunk)
16 years, 3 months
JBoss Cache SVN: r6809 - in core/trunk/src: main/java/org/jboss/cache/commands/write and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: genman
Date: 2008-09-26 18:43:28 -0400 (Fri, 26 Sep 2008)
New Revision: 6809
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java
core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
core/trunk/src/test/java/org/jboss/cache/util/ImmutableListCopyTest.java
Log:
Code clean-up
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -144,7 +144,7 @@
*/
public void setRoot(Object root)
{
- if (root == null) throw new CacheException("Attempting to set an invalid node [" + root + "] as a root node!");
+ if (root == null) throw new CacheException("Attempting to set a null node as a root node!");
// Mega-Ugh!
if (usingMvcc && root instanceof InternalNode)
{
Modified: core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -56,7 +56,6 @@
protected LockStrategyFactory lockStrategyFactory;
CommandsFactory commandsFactory;
protected NodeFactory<K, V> nodeFactory;
- protected CacheSPI<K, V> cache;
public PessimisticUnversionedNode(Object name, Fqn fqn, Map<K, V> data, CacheSPI<K, V> cache)
{
Modified: core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManagerImpl.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -111,7 +111,7 @@
public void start()
{
if (trace) log.trace("Starting region manager");
- isUsingBR = configuration != null && configuration.getBuddyReplicationConfig() != null && configuration.getBuddyReplicationConfig().isEnabled();
+ isUsingBR = configuration.getBuddyReplicationConfig() != null && configuration.getBuddyReplicationConfig().isEnabled();
evictionConfig = configuration.getEvictionConfig();
if (evictionConfig != null && evictionConfig.isValidConfig())
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -102,13 +102,9 @@
else if (recursive)
{
Collection<Fqn> nodesToEvict = getRecursiveEvictionNodes();
-
- if (nodesToEvict != null)
+ for (Fqn aFqn : nodesToEvict)
{
- for (Fqn aFqn : nodesToEvict)
- {
- evictNode(aFqn, ctx, lookupForEviction(ctx, aFqn));
- }
+ evictNode(aFqn, ctx, lookupForEviction(ctx, aFqn));
}
return !nodesToEvict.isEmpty();
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -47,7 +47,7 @@
private Marshaller marshaller;
- private JGroupsStackParser jGroupsStackParser = new JGroupsStackParser();
+ private transient JGroupsStackParser jGroupsStackParser = new JGroupsStackParser();
private boolean invocationBatchingEnabled;
/**
Modified: core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -213,11 +213,6 @@
EvictionRegionConfig clone = (EvictionRegionConfig) super.clone();
if (evictionAlgorithmConfig != null)
{
- if (!(evictionAlgorithmConfig instanceof Cloneable))
- {
- throw new CloneNotSupportedException(evictionAlgorithmConfig + " is not Cloneable");
- }
-
if (evictionAlgorithmConfig instanceof ConfigurationComponent)
{
clone.setEvictionAlgorithmConfig((EvictionAlgorithmConfig) ((ConfigurationComponent) evictionAlgorithmConfig).clone());
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -98,7 +98,7 @@
{
this.txTable = txTable;
this.clm = clm;
- CacheMode mode = configuration.getCacheMode();
+// CacheMode mode = configuration.getCacheMode();
// usingVersionedInvalidation = mode.isInvalidation();
this.dataContainer = dataContainer;
this.notifier = notifier;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -362,7 +362,7 @@
*/
private void addToModificationList(WriteCommand command, InvocationContext ctx)
{
- Option opt = ctx.getOptionOverrides();
+ // Option opt = ctx.getOptionOverrides();
ctx.getTransactionContext().addModification(command);
if (log.isDebugEnabled()) log.debug("Adding command " + command + " to modification list");
}
Modified: core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -55,6 +55,12 @@
private static final long serialVersionUID = 10929568968966L;
private E[] elements;
private int size;
+
+ /**
+ * Constructs a new ImmutableListCopy.
+ * Required by Serialization.
+ */
+ public ImmutableListCopy() {}
/**
* Only one copy constructor since the list is immutable.
Modified: core/trunk/src/test/java/org/jboss/cache/util/ImmutableListCopyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/util/ImmutableListCopyTest.java 2008-09-26 22:07:59 UTC (rev 6808)
+++ core/trunk/src/test/java/org/jboss/cache/util/ImmutableListCopyTest.java 2008-09-26 22:43:28 UTC (rev 6809)
@@ -1,12 +1,16 @@
package org.jboss.cache.util;
-import org.testng.annotations.Test;
-
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
+import org.testng.annotations.Test;
+
@Test(groups = "unit")
public class ImmutableListCopyTest
{
@@ -149,4 +153,16 @@
assert ints.subList(1, 9).equals(list.subList(1, 9));
assert ints.subList(0, 1).equals(list.subList(0, 1));
}
+
+ static Object copy(Object o) throws Exception {
+ ByteArrayOutputStream bo = new ByteArrayOutputStream();
+ new ObjectOutputStream(bo).writeObject(o);
+ ByteArrayInputStream is = new ByteArrayInputStream(bo.toByteArray());
+ return new ObjectInputStream(is).readObject();
+ }
+
+ public void testSerialization() throws Exception {
+ List<Integer> ints = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ copy( Immutables.immutableListCopy(ints) );
+ }
}
16 years, 3 months
JBoss Cache SVN: r6808 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: genman
Date: 2008-09-26 18:07:59 -0400 (Fri, 26 Sep 2008)
New Revision: 6808
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/BdbjeTest.java
Log:
Fix test
Modified: core/trunk/src/test/java/org/jboss/cache/loader/BdbjeTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/BdbjeTest.java 2008-09-26 21:53:04 UTC (rev 6807)
+++ core/trunk/src/test/java/org/jboss/cache/loader/BdbjeTest.java 2008-09-26 22:07:59 UTC (rev 6808)
@@ -725,6 +725,7 @@
mod.setValue("four");
list.add(mod);
+ /*
Map<String, String> map = new HashMap<String, String>();
map.put("five", "six");
map.put("seven", "eight");
@@ -733,6 +734,7 @@
mod.setFqn(FQN);
mod.setData(map);
list.add(mod);
+ */
return list;
}
16 years, 3 months
JBoss Cache SVN: r6807 - in core/trunk/src: main/java/org/jboss/cache/config and 13 other directories.
by jbosscache-commits@lists.jboss.org
Author: genman
Date: 2008-09-26 17:53:04 -0400 (Fri, 26 Sep 2008)
New Revision: 6807
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/InternalNode.java
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
core/trunk/src/main/java/org/jboss/cache/config/EvictionAlgorithmConfig.java
core/trunk/src/main/java/org/jboss/cache/config/EvictionPolicyConfig.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/main/java/org/jboss/cache/loader/CacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller210.java
core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java
core/trunk/src/main/java/org/jboss/cache/notifications/annotation/CacheListener.java
core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNode.java
core/trunk/src/main/java/org/jboss/cache/util/reflect/ReflectionUtil.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedCacheAccessTest.java
Log:
Fix: "it's" == "it is", "its" == possessive
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -213,11 +213,11 @@
InternalNode peekInternalNode(Fqn f, boolean includeInvalidNodes);
/**
- * Similar to {@link #peekInternalNode(Fqn, boolean)} except that the node AND it's *direct* parent are retrieved.
+ * Similar to {@link #peekInternalNode(Fqn, boolean)} except that the node AND its *direct* parent are retrieved.
*
* @param fqn fqn to find
* @param includeInvalidNodes if true, invalid nodes are considered.
- * @return an array of InternalNodes, containing 2 elements. Element [0] is the node being peeked, and element [1] is it's direct parent.
+ * @return an array of InternalNodes, containing 2 elements. Element [0] is the node being peeked, and element [1] is its direct parent.
*/
public InternalNode[] peekInternalNodeAndDirectParent(Fqn fqn, boolean includeInvalidNodes);
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -746,13 +746,6 @@
return n;
}
- /**
- * Similar to {@link #peekInternalNode(Fqn, boolean)} except that the node AND it's *direct* parent are retrieved.
- *
- * @param fqn fqn to find
- * @param includeInvalidNodes if true, invalid nodes are considered.
- * @return an array of InternalNodes, containing 2 elements. Element [0] is the node being peeked, and element [1] is it's direct parent.
- */
public InternalNode[] peekInternalNodeAndDirectParent(Fqn fqn, boolean includeInvalidNodes)
{
if (fqn == null || fqn.size() == 0) return new InternalNode[]{rootInternal, null};
Modified: core/trunk/src/main/java/org/jboss/cache/InternalNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InternalNode.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/InternalNode.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -31,7 +31,7 @@
/**
* An internal node interface, that represents nodes that directly form the tree structure in the cache. This is as opposed
- * to {@link Node} and it's {@link NodeSPI} sub-interface, which are typically implemented by delegates which then delegate calls
+ * to {@link Node} and its {@link NodeSPI} sub-interface, which are typically implemented by delegates which then delegate calls
* to internal nodes, potentially after passing the call up an interceptor chain.
* <p/>
* All calls on an InternalNode are executed directly on the data structure. Usually, XXXDirect() calls on {@link NodeSPI}
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -22,6 +22,7 @@
package org.jboss.cache.config;
import org.jboss.cache.Version;
+import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.parsing.JGroupsStackParser;
import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.annotations.Start;
@@ -1040,4 +1041,9 @@
testImmutability("customInterceptors");
this.customInterceptors = customInterceptors;
}
+
+ public BuddyManager getConsistentHashing() {
+ return null;
+ }
+
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/EvictionAlgorithmConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/EvictionAlgorithmConfig.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/config/EvictionAlgorithmConfig.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -24,7 +24,7 @@
/**
* An interface used to configure an eviction algorithm. Replaces the deprecated {@link org.jboss.cache.config.EvictionPolicyConfig}.
* <p/>
- * In it's most basic form, it is implemented by {@link org.jboss.cache.eviction.EvictionAlgorithmConfigBase}, but
+ * In its most basic form, it is implemented by {@link org.jboss.cache.eviction.EvictionAlgorithmConfigBase}, but
* more specific eviction policies may subclass {@link org.jboss.cache.eviction.EvictionAlgorithmConfigBase} or re-implement
* this interface to provide access to more config variables.
*
Modified: core/trunk/src/main/java/org/jboss/cache/config/EvictionPolicyConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/EvictionPolicyConfig.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/config/EvictionPolicyConfig.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -27,7 +27,7 @@
/**
* This class encapsulates the configuration element for an eviction policy.
* <p/>
- * In it's most basic form, it is implemented by {@link EvictionPolicyConfigBase}, but
+ * In its most basic form, it is implemented by {@link EvictionPolicyConfigBase}, but
* more specific eviction policies may subclass or re-implement this interface
* to provide access to more config variables.
*
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -88,7 +88,7 @@
}
/**
- * Beside querying the element for it's attribute value, it will look into the value, if any, and replace the
+ * Beside querying the element for its attribute value, it will look into the value, if any, and replace the
* jboss properties(e.g. ${someValue:defaultValue}.
* <p/>
* {@link org.jboss.util.StringPropertyReplacer#replaceProperties(String)}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -874,7 +874,7 @@
}
/**
- * Blocks until the current cache instance is in it's {@link org.jboss.cache.CacheStatus#STARTED started} phase. Blocks
+ * Blocks until the current cache instance is in its {@link org.jboss.cache.CacheStatus#STARTED started} phase. Blocks
* for up to {@link org.jboss.cache.config.Configuration#getStateRetrievalTimeout()} milliseconds, throwing an IllegalStateException
* if the cache doesn't reach this state even after this maximum wait time.
*
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -100,7 +100,7 @@
@Start
protected void start()
{
- // this should only happen after the CacheLoaderManager has started, since the CacheLoaderManager only creates the CacheLoader instance in it's @Start method.
+ // this should only happen after the CacheLoaderManager has started, since the CacheLoaderManager only creates the CacheLoader instance in its @Start method.
loader = loaderManager.getCacheLoader();
optimistic = configuration.getNodeLockingScheme() == NodeLockingScheme.OPTIMISTIC;
this.setStatisticsEnabled(configuration.getExposeManagementStatistics());
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -291,7 +291,7 @@
/**
* Similar to {@link #invoke(org.jboss.cache.InvocationContext , org.jboss.cache.commands.VisitableCommand)}, but
- * constructs a invocation context on the fly, using {@link InvocationContextContainer#get()} and setting the origin local flag to it's default value.
+ * constructs a invocation context on the fly, using {@link InvocationContextContainer#get()} and setting the origin local flag to its default value.
*/
public Object invoke(VisitableCommand cacheCommand) throws Throwable
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -253,7 +253,7 @@
{
// Nodes we need to get WLs for:
- // 1) node we are moving FROM, and it's parent and ALL children. Same as removeNode.
+ // 1) node we are moving FROM, and its parent and ALL children. Same as removeNode.
List<Fqn> nodeAndChildren = helper.wrapNodesRecursivelyForRemoval(ctx, command.getFqn());
Fqn newParent = command.getTo();
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -199,7 +199,7 @@
{
// no child exists with this name; create it in the underlying data structure and then add it to the workspace.
if (trace) log.trace("Creating new child, since it doesn't exist in the cache.");
- // we put the parent node into the workspace as we are changing it's children.
+ // we put the parent node into the workspace as we are changing its children.
// at this point "workspaceNode" refers to the parent of the current node. It should never be null if
// you got this far!
if (workspaceNode.isRemoved())
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -58,7 +58,7 @@
/**
* Replication interceptor for the optimistically locked interceptor chain. Responsible for replicating
- * state to remote nodes. Unlike it's cousin, the {@link org.jboss.cache.interceptors.ReplicationInterceptor}, this interceptor
+ * state to remote nodes. Unlike its cousin, the {@link org.jboss.cache.interceptors.ReplicationInterceptor}, this interceptor
* only deals with transactional calls. Just like all things to do with Optimistic Locking, it is a requirement that
* everything is done in a transaction and the transaction context is available via {@link org.jboss.cache.InvocationContext#getTransaction()}
* and {@link org.jboss.cache.InvocationContext#getGlobalTransaction()}.
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -224,7 +224,7 @@
{
if (ctx.isLockingSuppressed()) return invokeNextInterceptor(ctx, command);
- // this call will ensure the node gets a WL and it's current parent gets RL.
+ // this call will ensure the node gets a WL and its current parent gets RL.
if (trace) log.trace("Attempting to get WL on node to be moved [" + command.getFqn() + "]");
if (command.getFqn() != null && !(configuration.getIsolationLevel() == IsolationLevel.NONE))
{
Modified: core/trunk/src/main/java/org/jboss/cache/loader/CacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/CacheLoader.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/loader/CacheLoader.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -192,7 +192,7 @@
* <li>Associate the local transaction with <code>tx</code> (tx is the key)
* <li>Execute the corresponding SQL statements against the DB (statements derived from modifications)
* </ol>
- * For non-transactional CacheLoader (e.g. file-based), the implementation could attempt to implement it's own transactional
+ * For non-transactional CacheLoader (e.g. file-based), the implementation could attempt to implement its own transactional
* logic, attempting to write data to a temp location (or memory) and writing it to the proper location upon commit.
*
* @param tx The transaction, indended to be used by implementations as an identifier of the transaction (and not necessarily a JTA {@link javax.transaction.Transaction} object)
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -72,10 +72,10 @@
private CommandsFactory commandsFactory;
/**
- * A test to check whether the cache is in it's started state. If not, calls should not be made as the channel may
+ * A test to check whether the cache is in its started state. If not, calls should not be made as the channel may
* not have properly started, blocks due to state transfers may be in progress, etc.
*
- * @return true if the cache is in it's STARTED state.
+ * @return true if the cache is in its STARTED state.
*/
protected boolean isCacheReady()
{
Modified: core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -48,7 +48,7 @@
/**
* Simple file-based CacheLoader implementation. Nodes are directories, attributes of a node is a file in the directory
* <p/>
- * The FileCacheLoader has some severe limitations which restrict it's use in a production
+ * The FileCacheLoader has some severe limitations which restrict its use in a production
* environment, or if used in such an environment, it should be used with due care and sufficient
* understanding of these limitations.
* <ul>
@@ -59,7 +59,7 @@
* </ul>
* <p/>
* As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly concurrent,
- * transactional or stressful environment, and it's use is restricted to testing.
+ * transactional or stressful environment, and its use is restricted to testing.
* <p/>
* In terms of concurrency, file systems are notoriously inconsistent in their implementations of concurrent locks. To get around
* this and to meet the <b>thread safety</b> contracts set out in {@link CacheLoader}, this implementation uses a {@link org.jboss.cache.lock.StripedLock}
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -326,7 +326,7 @@
Collection<Object> getReadOwners(NodeSPI<?, ?> node);
/**
- * Prints lock information about a node (and it's children) to a String.
+ * Prints lock information about a node (and its children) to a String.
*
* @param node node to inspect
*/
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller210.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller210.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller210.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -41,7 +41,7 @@
{
initLogger();
// disabled, since this is always disabled in JBC 2.0.0.
- // Java ObjectOutputStreams will have it's own built-in ref counting. No need to repeat this.
+ // Java ObjectOutputStreams will have its own built-in ref counting. No need to repeat this.
useRefs = false;
}
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -59,7 +59,7 @@
}
/**
- * Creates an MVCC wrapped node - either a {@link org.jboss.cache.mvcc.ReadCommittedNode} or it's subclass, a
+ * Creates an MVCC wrapped node - either a {@link org.jboss.cache.mvcc.ReadCommittedNode} or its subclass, a
* {@link org.jboss.cache.mvcc.RepeatableReadNode} based on cache configuration. If a null is passed in as the InternalNode,
* this method will return a special {@link org.jboss.cache.mvcc.NullMarkerNode} instance if using repeatable read,
* or a null if read committed.
Modified: core/trunk/src/main/java/org/jboss/cache/notifications/annotation/CacheListener.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/notifications/annotation/CacheListener.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/notifications/annotation/CacheListener.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -169,12 +169,12 @@
* <tr>
* <td valign="top">{@link TransactionCompleted}</td>
* <td valign=@"top">{@link org.jboss.cache.notifications.event.TransactionCompletedEvent}</td>
- * <td valign="top">The cache has completed it's participation in a transaction</td>
+ * <td valign="top">The cache has completed its participation in a transaction</td>
* </tr>
* <tr>
* <td valign="top">{@link BuddyGroupChanged}</td>
* <td valign=@"top">{@link org.jboss.cache.notifications.event.BuddyGroupChangedEvent}</td>
- * <td valign="top">Buddy replication is enabled and one of the buddy groups that the instance is a member of has changed it's membership.</td>
+ * <td valign="top">Buddy replication is enabled and one of the buddy groups that the instance is a member of has changed its membership.</td>
* </tr>
* <tr>
* <td valign="top">{@link NodeInvalidated}</td>
Modified: core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNode.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNode.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -68,7 +68,7 @@
void setVersion(DataVersion version);
/**
- * A node is considered modified if it's data map has changed. If children are added or removed, the node is not
+ * A node is considered modified if its data map has changed. If children are added or removed, the node is not
* considered modified - instead, see {@link #isChildrenModified()}.
*
* @return true if the data map has been modified
Modified: core/trunk/src/main/java/org/jboss/cache/util/reflect/ReflectionUtil.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/reflect/ReflectionUtil.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/main/java/org/jboss/cache/util/reflect/ReflectionUtil.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -59,7 +59,7 @@
}
/**
- * Inspects a class and it's superclasses (all the way to {@link Object} for method instances that contain a given annotation.
+ * Inspects a class and its superclasses (all the way to {@link Object} for method instances that contain a given annotation.
* This even identifies private, package and protected methods, not just public ones.
*
* @param c
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationWithCacheLoaderTest.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -279,7 +279,7 @@
assert cache0.getCacheLoaderManager().getCacheLoader().get(foo) != null : "Should exist in data owner's cache loader";
assert cache1.getCacheLoaderManager().getCacheLoader().get(backupFoo) != null : "Should exist in buddy's loader";
- // a local gravitation should occur since cache1 has foo in it's backup tree.
+ // a local gravitation should occur since cache1 has foo in its backup tree.
assertEquals("Passivated value available from buddy", "value", cache1.get(foo, "key"));
}
Modified: core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -43,7 +43,7 @@
// // test that this component appears in all dependencies' dependencyFor collection.
// for (ComponentRegistry.Component dep : component.dependencies)
// {
-// assert cr.componentLookup.get(dep.name).dependencyFor.contains(component) : "Dependency " + dep.name + " does not have component " + component.name + " in it's dependencyFor collection.";
+// assert cr.componentLookup.get(dep.name).dependencyFor.contains(component) : "Dependency " + dep.name + " does not have component " + component.name + " in its dependencyFor collection.";
// }
// }
//
@@ -52,7 +52,7 @@
// // test that this component appears in all dependencies' dependencyFor collection.
// for (ComponentRegistry.Component dep : component.dependencyFor)
// {
-// assert cr.componentLookup.get(dep.name).dependencies.contains(component) : "Dependency " + dep.name + " does not have component " + component.name + " in it's dependencies collection.";
+// assert cr.componentLookup.get(dep.name).dependencies.contains(component) : "Dependency " + dep.name + " does not have component " + component.name + " in its dependencies collection.";
// }
// }
// }
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedCacheAccessTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedCacheAccessTest.java 2008-09-26 21:38:03 UTC (rev 6806)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedCacheAccessTest.java 2008-09-26 21:53:04 UTC (rev 6807)
@@ -87,7 +87,7 @@
try
{
tm.begin();
- // read something from the cache - it should be in it's own thread.
+ // read something from the cache - it should be in its own thread.
cache.get(fqn, key);
if (write)
{
16 years, 3 months