JBoss Cache SVN: r7226 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 20:42:18 -0500 (Thu, 27 Nov 2008)
New Revision: 7226
Modified:
core/trunk/release.sh
Log:
Modified: core/trunk/release.sh
===================================================================
--- core/trunk/release.sh 2008-11-28 01:13:16 UTC (rev 7225)
+++ core/trunk/release.sh 2008-11-28 01:42:18 UTC (rev 7226)
@@ -1,12 +1,28 @@
#!/bin/bash
+###################################################################################################
+
+# CONFIGURABLE VARIABLES
+
+# Base SVN directory for this release. There should be a "tags" and "trunk" directory under this.
svnBase="https://svn.jboss.org/repos/jbosscache/core"
+
+# Name of the "tags" directory
svnTags="tags"
+
+# Where do you locally check out tags?
localTagsDir="/Users/manik/Code/jbosscache/core/tags"
+
+# Your maven2 repo to deploy built artifacts
localMvnRepoDir="/Users/manik/Code/maven2/org/jboss/cache/jbosscache-core"
+
+# Where should built documentation go?
docsDir="/Users/manik/Code/CMS/jbosscache/freezone/docs"
+###################################################################################################
+# Functions
+
help()
{
echo 'Usage: '
@@ -82,6 +98,9 @@
svn ci -m "JBoss Cache Release Script: Docs for version $ver" $ver
}
+
+### The actual script
+
ver=${1}
echo "JBoss Cache Release Script"
validate
16 years, 1 month
JBoss Cache SVN: r7225 - in searchable/trunk: src/main/java/org/jboss/cache/search and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 20:13:16 -0500 (Thu, 27 Nov 2008)
New Revision: 7225
Modified:
searchable/trunk/TODO.txt
searchable/trunk/pom.xml
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:
Modified: searchable/trunk/TODO.txt
===================================================================
--- searchable/trunk/TODO.txt 2008-11-27 23:29:25 UTC (rev 7224)
+++ searchable/trunk/TODO.txt 2008-11-28 01:13:16 UTC (rev 7225)
@@ -1,15 +1,26 @@
-1 - Fix POJO cache listener.
+Timelines:
-The class needs to be able to get the Fqn and Key from the object so that Lucene can be updated.
+1. Write a release script. :-) Refer to release.sh in the JBoss Cache Core repo as an example.
-2 - Lazy iterator.
+2. Release 1.0.0.CR2.
-So that when a large amount of hits are there, they can be loaded when required.
+Make a note of the release steps - maybe create a RELEASE.txt file with the steps you need to go through to make a release.
+This will ensure nothing is missed.
-4 - Non-string keys.
+By tomorrow (Fri 28th Nov)
-Think.
+3. Fix POJO cache listener. URGENT.
-5 - Mock objects.
+4. Make sure you have proper tests.
-6 - Think about removing the Hibernate Exceptions.
\ No newline at end of file
+5. Release CR3
+
+By Friday (5 Dec)
+
+6. Think about removing the Hibernate Exceptions.
+
+7. Profile using JProfiler
+
+8. Publish CR4/GA.
+
+By Friday (12 Dec)
Modified: searchable/trunk/pom.xml
===================================================================
--- searchable/trunk/pom.xml 2008-11-27 23:29:25 UTC (rev 7224)
+++ searchable/trunk/pom.xml 2008-11-28 01:13:16 UTC (rev 7225)
@@ -26,24 +26,28 @@
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.0.0.GA</version>
+ <!-- TODO: change to 3.0.1.GA ASAP -->
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>3.1.0.Beta1</version>
+ <!-- TODO: change to 3.1.0.GA , or at least a recent CR -->
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
+ <!-- TODO: change to 1.1.1 ASAP -->
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-pojo</artifactId>
<version>2.2.0.CR7</version>
+ <!-- TODO: change to 3.0.0.GA ASAP -->
</dependency>
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-11-27 23:29:25 UTC (rev 7224)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-11-28 01:13:16 UTC (rev 7225)
@@ -144,6 +144,7 @@
//Now create the pojoListener
SearchablePojoListener pojoListener = new SearchablePojoListener(searchFactory);
pojo.addListener(pojoListener);
+ pojo.getCache().addCacheListener(pojoListener);
//TODO: - This could be a break point. But it should not be.
SearchableCache sc = new SearchableCacheImpl(coreCache, searchFactory);
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-11-27 23:29:25 UTC (rev 7224)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-11-28 01:13:16 UTC (rev 7225)
@@ -28,13 +28,17 @@
import org.hibernate.search.backend.WorkType;
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.jboss.cache.notifications.event.NodeCreatedEvent;
import org.jboss.cache.notifications.annotation.NodeModified;
+import org.jboss.cache.notifications.annotation.CacheListener;
+import org.jboss.cache.notifications.annotation.NodeCreated;
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.pojo.impl.InternalHelper;
import org.jboss.cache.Fqn;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,17 +50,52 @@
*/
@PojoCacheListener
+@CacheListener
public class SearchablePojoListener
{
private SearchFactoryImplementor searchFactory;
private static final Log log = LogFactory.getLog(SearchablePojoListener.class);
private String pojoKey = "pojoKey";
+ private ThreadLocal<Fqn> savedFqn = new ThreadLocal<Fqn>();
+
public SearchablePojoListener(SearchFactoryImplementor searchFactory)
{
this.searchFactory = searchFactory;
}
+ @NodeModified
+ public void handleNodeModified(NodeModifiedEvent nme)
+ {
+ if (!nme.isPre()) return;
+ Fqn f = nme.getFqn();
+ System.out.println("Node modified called for Fqn " + f);
+ if (InternalHelper.isInternalNode(f))
+ {
+ System.out.println("Is internal and I dont care");
+ }
+ else
+ {
+ savedFqn.set(f);
+ }
+ }
+
+ @NodeCreated
+ public void handleNodeKreated(NodeCreatedEvent nce)
+ {
+ if (!nce.isPre()) return;
+ Fqn f = nce.getFqn();
+ System.out.println("Node kreated called for Fqn " + f);
+ if (InternalHelper.isInternalNode(f))
+ {
+ System.out.println("Is internal and I dont care");
+ }
+ else
+ {
+ savedFqn.set(f);
+ }
+ }
+
/**
* Takes in a NodeModifiedEvent and updates the Lucene indexes using methods on the NodeModifiedEvent class.
*
@@ -78,7 +117,9 @@
PojoCache pojo = notificationContext.getPojoCache();
System.out.println("pojo is " + pojo);
- Fqn fqn = pojo.getInternalFqn(added);
+// Fqn fqn = pojo.getInternalFqn(added);
+ Fqn fqn = savedFqn.get();
+ savedFqn.remove();
System.out.println("Fqn is " + fqn);
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-11-27 23:29:25 UTC (rev 7224)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2008-11-28 01:13:16 UTC (rev 7225)
@@ -29,7 +29,7 @@
* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
-@Test(groups = "functional", enabled = false)
+@Test(groups = "functional", enabled = true)
public class LocalPOJOCacheTest
{
SearchableCache searchableCache;
16 years, 1 month
JBoss Cache SVN: r7224 - enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES.
by jbosscache-commits@lists.jboss.org
Author: mospina
Date: 2008-11-27 18:29:25 -0500 (Thu, 27 Nov 2008)
New Revision: 7224
Modified:
enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Book_Info.po
Log:
New revision
Modified: enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Book_Info.po
===================================================================
--- enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Book_Info.po 2008-11-27 17:53:21 UTC (rev 7223)
+++ enterprise-docs/tags/JBoss_EAP_4_3/Cache_Pojo_Cache_Guide/es-ES/Book_Info.po 2008-11-27 23:29:25 UTC (rev 7224)
@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Book_Info\n"
+"Project-Id-Version: 1\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-21 04:57+0000\n"
"PO-Revision-Date: 2008-11-19 13:30+1000\n"
16 years, 1 month
JBoss Cache SVN: r7223 - core/tags/3.0.1.GA/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:53:21 -0500 (Thu, 27 Nov 2008)
New Revision: 7223
Modified:
core/tags/3.0.1.GA/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
Log:
Modified: core/tags/3.0.1.GA/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
===================================================================
--- core/tags/3.0.1.GA/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 17:52:43 UTC (rev 7222)
+++ core/tags/3.0.1.GA/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 17:53:21 UTC (rev 7223)
@@ -106,7 +106,7 @@
public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetChildrenNamesCommand command) throws Throwable
{
Object returnValue = super.visitGetChildrenNamesCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -114,7 +114,7 @@
public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand command) throws Throwable
{
Object returnValue = super.visitGetKeysCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -122,7 +122,7 @@
public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand command) throws Throwable
{
Object returnValue = super.visitGetNodeCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -130,7 +130,7 @@
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitGetKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -144,7 +144,7 @@
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitPutKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -152,7 +152,7 @@
public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable
{
Object returnValue = super.visitPutDataMapCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -160,7 +160,7 @@
public Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command) throws Throwable
{
Object returnValue = super.visitRemoveKeyCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -173,8 +173,8 @@
log.trace("This is a move operation; removing the FROM node from the loader, no activation processing needed.");
}
loader.remove(command.getFqn());
- removeNodeFromCacheLoader(ctx, command.getFqn().getParent());
- removeNodeFromCacheLoader(ctx, command.getTo());
+ removeNodeFromCacheLoader(ctx, command.getFqn().getParent(), true);
+ removeNodeFromCacheLoader(ctx, command.getTo(), true);
return returnValue;
}
@@ -189,38 +189,50 @@
* its attributes have been initialized, its children have been loaded,
* AND it was found in the cache loader (nodeLoaded = true).
*/
- private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn) throws Throwable
+ private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn, boolean checkIfLoaded) throws Throwable
{
// only bother with this if the node has been loaded by the cache loader previous to this call.
- if (fqn != null && wasLoadedIntoMemory(ctx, fqn))
+ if (fqn != null)
{
- NodeSPI n;
- if (((n = dataContainer.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
+ boolean remove = false;
+ if (!checkIfLoaded || wasLoadedIntoMemory(ctx, fqn))
{
- // node not null and attributes have been loaded?
- if (!n.getChildrenDirect().isEmpty())
+ NodeSPI n;
+ if (((n = dataContainer.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
{
- boolean result = childrenLoaded(n);
- if (result)
+ // node not null and attributes have been loaded?
+ if (!n.getChildrenDirect().isEmpty())
{
- log.debug("children all initialized");
+ boolean result = childrenLoaded(n);
+ if (result)
+ {
+ log.debug("children all initialized");
+ remove(fqn);
+ remove = true;
+ }
+ }
+ else if (loaderNoChildren(fqn))
+ {
+ if (log.isDebugEnabled()) log.debug("no children " + n);
remove(fqn);
+ remove = true;
}
}
- else if (loaderNoChildren(fqn))
- {
- if (log.isDebugEnabled()) log.debug("no children " + n);
- remove(fqn);
- }
}
+
+ if (!fqn.isRoot() && remove)
+ {
+ // check fqn parent, since the parent may not be needed on disk anymore
+ removeNodeFromCacheLoader(ctx, fqn.getParent(), false);
+ }
}
}
- private boolean childrenLoaded(NodeSPI<?, ?> node)
+ private boolean childrenLoaded(NodeSPI<?, ?> node) throws Exception
{
if (!node.isChildrenLoaded())
{
- return false;
+ if (loader.getChildrenNames(node.getFqn()) != null) return false;
}
for (NodeSPI child : node.getChildrenDirect())
{
16 years, 1 month
JBoss Cache SVN: r7222 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:52:43 -0500 (Thu, 27 Nov 2008)
New Revision: 7222
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
Log:
Fixed failures to do with passivation
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 17:49:26 UTC (rev 7221)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 17:52:43 UTC (rev 7222)
@@ -106,7 +106,7 @@
public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetChildrenNamesCommand command) throws Throwable
{
Object returnValue = super.visitGetChildrenNamesCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -114,7 +114,7 @@
public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand command) throws Throwable
{
Object returnValue = super.visitGetKeysCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -122,7 +122,7 @@
public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand command) throws Throwable
{
Object returnValue = super.visitGetNodeCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -130,7 +130,7 @@
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitGetKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -144,7 +144,7 @@
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitPutKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -152,7 +152,7 @@
public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable
{
Object returnValue = super.visitPutDataMapCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -160,7 +160,7 @@
public Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command) throws Throwable
{
Object returnValue = super.visitRemoveKeyCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -173,8 +173,8 @@
log.trace("This is a move operation; removing the FROM node from the loader, no activation processing needed.");
}
loader.remove(command.getFqn());
- removeNodeFromCacheLoader(ctx, command.getFqn().getParent());
- removeNodeFromCacheLoader(ctx, command.getTo());
+ removeNodeFromCacheLoader(ctx, command.getFqn().getParent(), true);
+ removeNodeFromCacheLoader(ctx, command.getTo(), true);
return returnValue;
}
@@ -189,38 +189,50 @@
* its attributes have been initialized, its children have been loaded,
* AND it was found in the cache loader (nodeLoaded = true).
*/
- private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn) throws Throwable
+ private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn, boolean checkIfLoaded) throws Throwable
{
// only bother with this if the node has been loaded by the cache loader previous to this call.
- if (fqn != null && wasLoadedIntoMemory(ctx, fqn))
+ if (fqn != null)
{
- NodeSPI n;
- if (((n = dataContainer.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
+ boolean remove = false;
+ if (!checkIfLoaded || wasLoadedIntoMemory(ctx, fqn))
{
- // node not null and attributes have been loaded?
- if (!n.getChildrenDirect().isEmpty())
+ NodeSPI n;
+ if (((n = dataContainer.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
{
- boolean result = childrenLoaded(n);
- if (result)
+ // node not null and attributes have been loaded?
+ if (!n.getChildrenDirect().isEmpty())
{
- log.debug("children all initialized");
+ boolean result = childrenLoaded(n);
+ if (result)
+ {
+ log.debug("children all initialized");
+ remove(fqn);
+ remove = true;
+ }
+ }
+ else if (loaderNoChildren(fqn))
+ {
+ if (log.isDebugEnabled()) log.debug("no children " + n);
remove(fqn);
+ remove = true;
}
}
- else if (loaderNoChildren(fqn))
- {
- if (log.isDebugEnabled()) log.debug("no children " + n);
- remove(fqn);
- }
}
+
+ if (!fqn.isRoot() && remove)
+ {
+ // check fqn parent, since the parent may not be needed on disk anymore
+ removeNodeFromCacheLoader(ctx, fqn.getParent(), false);
+ }
}
}
- private boolean childrenLoaded(NodeSPI<?, ?> node)
+ private boolean childrenLoaded(NodeSPI<?, ?> node) throws Exception
{
if (!node.isChildrenLoaded())
{
- return false;
+ if (loader.getChildrenNames(node.getFqn()) != null) return false;
}
for (NodeSPI child : node.getChildrenDirect())
{
16 years, 1 month
JBoss Cache SVN: r7221 - in core/tags/3.0.1.GA: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:49:26 -0500 (Thu, 27 Nov 2008)
New Revision: 7221
Modified:
core/tags/3.0.1.GA/pom.xml
core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java
Log:
Versioned
Modified: core/tags/3.0.1.GA/pom.xml
===================================================================
--- core/tags/3.0.1.GA/pom.xml 2008-11-27 17:47:06 UTC (rev 7220)
+++ core/tags/3.0.1.GA/pom.xml 2008-11-27 17:49:26 UTC (rev 7221)
@@ -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.1-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.0.1.GA</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. -->
@@ -443,7 +443,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.0.1-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.0.1.GA-JBossAS</jbosscache-core-version>
</properties>
<dependencies>
<dependency>
Modified: core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java 2008-11-27 17:47:06 UTC (rev 7220)
+++ core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java 2008-11-27 17:49:26 UTC (rev 7221)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.1-SNAPSHOT";
+ public static final String version = "3.0.1.GA";
public static final String codename = "Naga";
//public static final String cvs = "$Id$";
- static final byte[] version_id = {'0', '3', '0', '0', 'S'};
+ static final byte[] version_id = {'0', '3', '0', '1', 'G', 'A'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
16 years, 1 month
JBoss Cache SVN: r7220 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:47:06 -0500 (Thu, 27 Nov 2008)
New Revision: 7220
Added:
core/tags/3.0.1.GA/
Log:
retagged
Copied: core/tags/3.0.1.GA (from rev 7219, core/trunk)
16 years, 1 month
JBoss Cache SVN: r7219 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:46:46 -0500 (Thu, 27 Nov 2008)
New Revision: 7219
Removed:
core/tags/3.0.1.GA/
Log:
bad tag
16 years, 1 month
JBoss Cache SVN: r7218 - in core/trunk/src: main/java/org/jboss/cache/loader/bdbje and 3 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 12:45:46 -0500 (Thu, 27 Nov 2008)
New Revision: 7218
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/mgmt/PassivationTest.java
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
Log:
Fixed failures to do with passivation
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -106,7 +106,7 @@
public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetChildrenNamesCommand command) throws Throwable
{
Object returnValue = super.visitGetChildrenNamesCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -114,7 +114,7 @@
public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand command) throws Throwable
{
Object returnValue = super.visitGetKeysCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -122,7 +122,7 @@
public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand command) throws Throwable
{
Object returnValue = super.visitGetNodeCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -130,7 +130,7 @@
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitGetKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -144,7 +144,7 @@
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
Object returnValue = super.visitPutKeyValueCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -152,7 +152,7 @@
public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable
{
Object returnValue = super.visitPutDataMapCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -160,7 +160,7 @@
public Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command) throws Throwable
{
Object returnValue = super.visitRemoveKeyCommand(ctx, command);
- removeNodeFromCacheLoader(ctx, command.getFqn());
+ removeNodeFromCacheLoader(ctx, command.getFqn(), true);
return returnValue;
}
@@ -173,18 +173,14 @@
log.trace("This is a move operation; removing the FROM node from the loader, no activation processing needed.");
}
loader.remove(command.getFqn());
- removeNodeFromCacheLoader(ctx, command.getFqn().getParent());
- removeNodeFromCacheLoader(ctx, command.getTo());
+ removeNodeFromCacheLoader(ctx, command.getFqn().getParent(), true);
+ removeNodeFromCacheLoader(ctx, command.getTo(), true);
return returnValue;
}
private boolean wasLoadedIntoMemory(InvocationContext ctx, Fqn fqn)
{
Set<Fqn> fqnsLoaded = ctx.getFqnsLoaded();
- // make sure we wipe this in the context otherwise this will leak.
- // TODO: This should ideally be done in the InvocationContextInterceptor by calling InvocationContext.reset() on exit
- // for now, just remove this here
- ctx.setFqnsLoaded(null);
return fqnsLoaded != null && fqnsLoaded.contains(fqn);
}
@@ -193,29 +189,41 @@
* its attributes have been initialized, its children have been loaded,
* AND it was found in the cache loader (nodeLoaded = true).
*/
- private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn) throws Throwable
+ private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn, boolean checkIfLoaded) throws Throwable
{
- if (fqn != null && wasLoadedIntoMemory(ctx, fqn))
+ if (fqn != null)
{
- InternalNode n;
- if (((n = findNode(ctx, fqn)) != null) && n.isDataLoaded() && loader.exists(fqn))
+ boolean remove = false;
+ if (!checkIfLoaded || wasLoadedIntoMemory(ctx, fqn))
{
- // node not null and attributes have been loaded?
- if (n.hasChildren())
+ InternalNode n;
+ if (((n = findNode(ctx, fqn)) != null) && n.isDataLoaded() && loader.exists(fqn))
{
- boolean result = childrenLoaded(n);
- if (result)
+ // node not null and attributes have been loaded?
+ if (n.hasChildren())
{
- log.debug("children all initialized");
+ boolean result = childrenLoaded(n);
+ if (result)
+ {
+ log.debug("children all initialized");
+ remove(fqn);
+ remove = true;
+ }
+ }
+ else if (loaderNoChildren(fqn))
+ {
+ if (log.isDebugEnabled()) log.debug("no children " + n);
remove(fqn);
+ remove = true;
}
}
- else if (loaderNoChildren(fqn))
- {
- if (log.isDebugEnabled()) log.debug("no children " + n);
- remove(fqn);
- }
}
+
+ if (!fqn.isRoot() && remove)
+ {
+ // check fqn parent, since the parent may not be needed on disk anymore
+ removeNodeFromCacheLoader(ctx, fqn.getParent(), false);
+ }
}
}
@@ -232,11 +240,11 @@
}
}
- private boolean childrenLoaded(InternalNode<?, ?> node)
+ private boolean childrenLoaded(InternalNode<?, ?> node) throws Exception
{
if (!node.isChildrenLoaded())
{
- return false;
+ if (loader.getChildrenNames(node.getFqn()) != null) return false;
}
for (InternalNode child : node.getChildren())
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -208,8 +208,11 @@
if (trace) log.trace("Resetting invocation-scope options");
ctx.getOptionOverrides().reset();
+ // make sure we wipe fqns loaded in the context otherwise this will leak.
+ // TODO: This should ideally be done by calling InvocationContext.reset() on exit
+ ctx.setFqnsLoaded(null);
+
// if this is a prepare, opt prepare or
-
if (resumeSuspended)
{
txManager.resume(suspendedTransaction);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -181,10 +181,6 @@
private boolean wasLoadedIntoMemory(InvocationContext ctx, Fqn fqn)
{
Set<Fqn> fqnsLoaded = ctx.getFqnsLoaded();
- // make sure we wipe this in the context otherwise this will leak.
- // TODO: This should ideally be done in the InvocationContextInterceptor by calling InvocationContext.reset() on exit
- // for now, just remove this here
- ctx.setFqnsLoaded(null);
return fqnsLoaded != null && fqnsLoaded.contains(fqn);
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -174,7 +174,6 @@
// JBCACHE-1448 db name parsing fix courtesy of Ciro Cavani
/* Parse config string. */
int offset = configStr.indexOf('#');
- String cacheDbName;
if (offset >= 0 && offset < configStr.length() - 1)
{
cacheDbName = configStr.substring(offset + 1);
@@ -183,6 +182,7 @@
else
{
cacheDbName = cache.getClusterName();
+ if (cacheDbName == null) cacheDbName = "CacheInstance-" + System.identityHashCode(cache);
}
// test location
Modified: core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -135,6 +135,7 @@
else
{
cacheDbName = cache.getClusterName();
+ if (cacheDbName == null) cacheDbName = "CacheInstance-" + System.identityHashCode(cache);
}
// test location
Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/CacheLoaderTest.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -3,7 +3,10 @@
import org.jboss.cache.interceptors.CacheLoaderInterceptor;
import org.jboss.cache.interceptors.CacheStoreInterceptor;
import org.jboss.cache.util.TestingUtil;
-import static org.testng.AssertJUnit.*;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
import org.testng.annotations.Test;
import java.util.HashMap;
@@ -41,6 +44,8 @@
assertNotNull("Retrieval error: expected to retrieve " + CAPITAL + " for " + AUSTRIA, cache.get(AUSTRIA, CAPITAL));
assertNull("Retrieval error: did not expect to retrieve " + AREA + " for " + AUSTRIA, cache.get(AUSTRIA, AREA));
+ load++;
+
// verify statistics after retrieving entries - misses should still be same since nodes were already loaded
assertEquals("CacheLoaderLoads count error: ", load, loader.getCacheLoaderLoads());
assertEquals("CacheLoaderMisses count error: ", miss, loader.getCacheLoaderMisses());
@@ -99,6 +104,7 @@
// add two attributes - this should cause two stores
stores += 2;
+ load++;
cache.put(POLAND, CAPITAL, "Warsaw");
cache.put(POLAND, CURRENCY, "Zloty");
assertEquals("CacheLoaderLoads count error: ", load, loader.getCacheLoaderLoads());
Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/PassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/PassivationTest.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/PassivationTest.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -3,7 +3,10 @@
import org.jboss.cache.interceptors.ActivationInterceptor;
import org.jboss.cache.interceptors.PassivationInterceptor;
import org.jboss.cache.util.TestingUtil;
-import static org.testng.AssertJUnit.*;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
import org.testng.annotations.Test;
import java.util.HashMap;
@@ -50,6 +53,8 @@
assertNotNull("Retrieval error: expected to retrieve " + CAPITAL + " for " + AUSTRIA, cache.get(AUSTRIA, CAPITAL));
assertNull("Retrieval error: did not expect to retrieve " + AREA + " for " + AUSTRIA, cache.get(AUSTRIA, AREA));
+ miss++;
+
// verify statistics after retrieving entries - no change since nodes were already loaded
assertEquals("CacheLoaderLoads count error: ", 0, act.getCacheLoaderLoads());
assertEquals("CacheLoaderMisses count error: ", miss, act.getCacheLoaderMisses());
@@ -109,7 +114,7 @@
cache.put(POLAND, new HashMap<String, Object>());
cache.put(POLAND, CAPITAL, "Warsaw");
cache.put(POLAND, CURRENCY, "Zloty");
- miss++;
+ miss += 3;
assertEquals("CacheLoaderLoads count error: ", 1, act.getCacheLoaderLoads());
assertEquals("CacheLoaderMisses count error: ", miss, act.getCacheLoaderMisses());
assertEquals("Activations count error: ", activations, act.getActivations());
Modified: core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java 2008-11-27 14:49:26 UTC (rev 7217)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java 2008-11-27 17:45:46 UTC (rev 7218)
@@ -472,7 +472,7 @@
assertFalse(loader.exists(Fqn.fromString("/a/2")));
cache.get("/a/3", "test");// activate node
assertFalse(loader.exists(Fqn.fromString("/a/3")));
- assertTrue(loader.exists(Fqn.fromString("/a")));
+ assertFalse(loader.exists(Fqn.fromString("/a")));
}
public void testGetChildren8Passivation() throws Exception
16 years, 1 month
JBoss Cache SVN: r7217 - benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 09:49:26 -0500 (Thu, 27 Nov 2008)
New Revision: 7217
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RC.xml
benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RR.xml
Log:
cfgs
Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RC.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RC.xml 2008-11-27 14:38:14 UTC (rev 7216)
+++ benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RC.xml 2008-11-27 14:49:26 UTC (rev 7217)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"
concurrencyLevel="300"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RR.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RR.xml 2008-11-27 14:38:14 UTC (rev 7216)
+++ benchmarks/benchmark-fwk/trunk/cache-products/starobrno/conf/mvcc-local-RR.xml 2008-11-27 14:49:26 UTC (rev 7217)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"
concurrencyLevel="300"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
16 years, 1 month