Build failed in Hudson: jboss-cache-core-2.2.X-jbossas » JBoss Cache - Core Edition #1
by jboss-qa-internal@redhat.com
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-2.2.X-jbossas/org....
------------------------------------------
started
Building remotely on conf1-linux
$ /qa/tools/opt/jdk1.5.0_15/bin/java -Xmx512m -cp /home/hudson/hudson_workspace/maven-agent.jar:/qa/tools/opt/maven-2.0.9/boot/classworlds-1.1.jar hudson.maven.agent.Main /qa/tools/opt/maven-2.0.9 /qa/services/hudson/hudson_release/WEB-INF/slave.jar /home/hudson/hudson_workspace/maven-interceptor.jar
channel started
[INFO] Scanning for projects...
WAGON_VERSION: 1.0-beta-2
[INFO] ------------------------------------------------------------------------
[INFO] Building JBoss Cache - Core Edition
[INFO] task-segment: [clean, site]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from central
[INFO] [clean:clean]
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-jxr-plugin: checking for updates from central
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-pmd-plugin: checking for updates from central
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from Main Maven Repo
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from snapshots.repository.codehaus.org
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from repository.jboss.org
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from snapshots.jboss.org
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from repository.jboss.org
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from snapshots.jboss.org
[INFO] snapshot org.codehaus.mojo:findbugs-maven-plugin:1.2-SNAPSHOT: checking for updates from e-xml.sourceforge.net
[WARNING] Attempting to build MavenProject instance for Artifact (org.codehaus.mojo:findbugs-maven-plugin:1.2-20080322.132217-15) of type: maven-plugin; constructing POM artifact instead.
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.codehaus.mojo:javancss-maven-plugin: checking for updates from central
[INFO] snapshot org.codehaus.mojo:javancss-maven-plugin:2.0-beta-3-SNAPSHOT: checking for updates from Main Maven Repo
[INFO] snapshot org.codehaus.mojo:javancss-maven-plugin:2.0-beta-3-SNAPSHOT: checking for updates from snapshots.repository.codehaus.org
[INFO] snapshot org.codehaus.mojo:javancss-maven-plugin:2.0-beta-3-SNAPSHOT: checking for updates from repository.jboss.org
[INFO] snapshot org.codehaus.mojo:javancss-maven-plugin:2.0-beta-3-SNAPSHOT: checking for updates from snapshots.jboss.org
[WARNING] Attempting to build MavenProject instance for Artifact (org.codehaus.mojo:javancss-maven-plugin:2.0-beta-3-20080522.073952-1) of type: maven-plugin; constructing POM artifact instead.
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.codehaus.mojo:taglist-maven-plugin: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from Main Maven Repo
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from snapshots.repository.codehaus.org
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from repository.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from snapshots.jboss.org
[INFO] artifact org.apache.maven.plugins:maven-project-info-reports-plugin: checking for updates from central
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] Preparing surefire-report:report
Downloading: http://repository.jboss.org/maven2/commons-logging/commons-logging/1.1.0....
208b downloaded
Downloading: http://repository.jboss.org/maven2/org/jboss/transaction/jboss-jta/4.3.0....
Downloading: http://snapshots.jboss.org/maven2/org/jboss/transaction/jboss-jta/4.3.0.G...
Downloading: http://e-xml.sourceforge.net/maven2/repository/org/jboss/transaction/jbos...
Downloading: http://repo1.maven.org/maven2/org/jboss/transaction/jboss-jta/4.3.0.GA/jb...
Downloading: http://repository.jboss.org/maven2/commons-logging/commons-logging/1.1.0....
54K downloaded
Downloading: http://repository.jboss.org/maven2/org/jboss/transaction/jboss-jta/4.3.0....
Downloading: http://snapshots.jboss.org/maven2/org/jboss/transaction/jboss-jta/4.3.0.G...
Downloading: http://e-xml.sourceforge.net/maven2/repository/org/jboss/transaction/jbos...
Downloading: http://repo1.maven.org/maven2/org/jboss/transaction/jboss-jta/4.3.0.GA/jb...
[HUDSON] Archiving /home/hudson/hudson_workspace/workspace/jboss-cache-core-2.2.X-jbossas/./pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.jboss.transaction:jboss-jta:jar:4.3.0.GA
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.jboss.transaction -DartifactId=jboss-jta -Dversion=4.3.0.GA -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.jboss.transaction -DartifactId=jboss-jta -Dversion=4.3.0.GA -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.jboss.cache:jbosscache-core:jar:2.2.0-SNAPSHOT-JBossAS
2) org.jboss.transaction:jboss-jta:jar:4.3.0.GA
----------
1 required artifact is missing.
for artifact:
org.jboss.cache:jbosscache-core:jar:2.2.0-SNAPSHOT-JBossAS
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
repository.jboss.org (http://repository.jboss.org/maven2),
e-xml.sourceforge.net (http://e-xml.sourceforge.net/maven2/repository),
snapshots.jboss.org (http://snapshots.jboss.org/maven2)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 25 seconds
[INFO] Finished at: Tue Jul 08 00:02:34 EDT 2008
[INFO] Final Memory: 29M/78M
[INFO] ------------------------------------------------------------------------
Waiting for Hudson to finish collecting data
16 years, 5 months
JBoss Cache SVN: r6476 - core/trunk/src/main/java/org/jboss/cache/commands/write.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-31 14:08:14 -0400 (Thu, 31 Jul 2008)
New Revision: 6476
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
Log:
Removed CreateNodeCommand frm MVCC codepaths
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-07-31 18:07:54 UTC (rev 6475)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-07-31 18:08:14 UTC (rev 6476)
@@ -1,85 +0,0 @@
-package org.jboss.cache.commands.write;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.commands.WriteCommand;
-import org.jboss.cache.commands.read.AbstractDataCommand;
-import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.transaction.GlobalTransaction;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Command that creates a node. Primarily to be used as an undo command for removing nodes.
- *
- * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
- * @since 2.2.0
- */
-public class CreateNodeCommand extends AbstractDataCommand implements WriteCommand
-{
- public static final int METHOD_ID = 48;
- protected final List<Fqn> newlyCreated = new LinkedList<Fqn>();
-
- public CreateNodeCommand(Fqn fqn)
- {
- this.fqn = fqn;
- newlyCreated.add(fqn);
- }
-
- public CreateNodeCommand()
- {
- }
-
- public int getCommandId()
- {
- return METHOD_ID;
- }
-
- public void setGlobalTransaction(GlobalTransaction gtx)
- {
- // no op
- }
-
- public GlobalTransaction getGlobalTransaction()
- {
- return null;
- }
-
- /**
- * Creates a node in the cache, specified by the given Fqn.
- */
- public Object perform(InvocationContext ctx)
- {
- Object[] results = dataContainer.createNodes(fqn);
- List<NodeSPI> created = (List<NodeSPI>) results[0];
-
- boolean foundFqn = false;
- if (!created.isEmpty())
- {
- for (NodeSPI n : created)
- {
- if (fqn.equals(n.getFqn())) foundFqn = true;
- newlyCreated.add(n.getFqn());
- }
- }
- if (newlyCreated != null && !foundFqn) newlyCreated.remove(fqn);
-
- return results[1];
- }
-
- public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
- {
- return visitor.visitCreateNodeCommand(ctx, this);
- }
-
- @Override
- public String toString()
- {
- return "CreateNodeCommand{" +
- "fqn=" + fqn +
- ", newlyCreated=" + newlyCreated +
- '}';
- }
-}
16 years, 5 months
JBoss Cache SVN: r6475 - in core/trunk/src: main/java/org/jboss/cache/buddyreplication and 7 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-31 14:07:54 -0400 (Thu, 31 Jul 2008)
New Revision: 6475
Added:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/CreateNodeCommand.java
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java
Modified:
core/trunk/src/main/java/org/jboss/cache/AbstractNode.java
core/trunk/src/main/java/org/jboss/cache/AbstractNodeFactory.java
core/trunk/src/main/java/org/jboss/cache/InternalNode.java
core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java
core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java
core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java
core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/base/PrePostProcessingCommandInterceptor.java
core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java
core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeHelper.java
core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java
core/trunk/src/test/java/org/jboss/cache/lock/AbstractLockManagerRecordingTest.java
Log:
Removed CreateNodeCommand frm MVCC codepaths
Modified: core/trunk/src/main/java/org/jboss/cache/AbstractNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/AbstractNode.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/AbstractNode.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -5,7 +5,6 @@
import static org.jboss.cache.AbstractNode.NodeFlags.REMOVED;
import static org.jboss.cache.AbstractNode.NodeFlags.RESIDENT;
-import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.lock.IdentityLock;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -228,31 +227,11 @@
throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
}
- public InternalNode<K, V> addChild(Fqn f)
- {
- throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
- }
-
- public InternalNode<K, V> addChild(Fqn f, boolean notify)
- {
- throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
- }
-
- public InternalNode<K, V> addChild(Object o, boolean notify)
- {
- throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
- }
-
public void setChildrenMap(ConcurrentMap<Object, InternalNode<K, V>> children)
{
throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
}
- public InternalNode<K, V> getOrCreateChild(Object childName, InvocationContext ctx)
- {
- throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
- }
-
public NodeSPI<K, V> getChildDirect(Fqn fqn)
{
throw new UnsupportedOperationException("Not supported in " + getClass().getSimpleName());
Modified: core/trunk/src/main/java/org/jboss/cache/AbstractNodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/AbstractNodeFactory.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/AbstractNodeFactory.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -126,7 +126,7 @@
return nid;
}
- public InternalNode<K, V> createAndRegister(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent)
+ public InternalNode<K, V> createChildNode(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent)
{
throw new UnsupportedOperationException("Unsupported in this implementation (" + getClass().getSimpleName() + ")!");
}
Modified: core/trunk/src/main/java/org/jboss/cache/InternalNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InternalNode.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/InternalNode.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,6 +1,5 @@
package org.jboss.cache;
-import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -118,14 +117,6 @@
void addChild(InternalNode<K, V> child);
- InternalNode<K, V> addChild(Fqn f);
-
- InternalNode<K, V> addChild(Fqn f, boolean notify);
-
- InternalNode<K, V> addChild(Object o, boolean notify);
-
- InternalNode<K, V> getOrCreateChild(Object childName, InvocationContext ctx);
-
// *****************End new methods *****************
Modified: core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -65,7 +65,7 @@
NodeSPI<K, V> createNode(Object childName, NodeSPI<K, V> parent);
/**
- * Creates a new node, registers an undo operation in the context, and optionally attaches the node to its parent.
+ * Creates a new node, and optionally attaches the node to its parent.
* <p/>
* The assumption here is that any locks are acquired to prevent concurrent creation of the same node. Implementations
* of the NodeFactory should not attempt to synchronize or guard against concurrent creation.
@@ -77,7 +77,7 @@
* @param attachToParent if true, the node is registered in the parent's child map. If false, it is not.
* @return a new node, or the existing node if one existed.
*/
- InternalNode<K, V> createAndRegister(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent);
+ InternalNode<K, V> createChildNode(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent);
NodeSPI<K, V> createRootNode();
Modified: core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/PessimisticUnversionedNode.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,7 +1,8 @@
package org.jboss.cache;
import static org.jboss.cache.AbstractNode.NodeFlags.VALID;
-import org.jboss.cache.commands.write.CreateNodeCommand;
+import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.lock.IdentityLock;
import org.jboss.cache.lock.LockStrategyFactory;
@@ -33,6 +34,9 @@
*/
protected transient IdentityLock lock = null;
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)
{
@@ -67,6 +71,14 @@
this.lockStrategyFactory = lockStrategyFactory;
}
+ public void injectDependencies(CacheSPI<K, V> spi, CommandsFactory commandsFactory, NodeFactory<K, V> nodeFactory)
+ {
+ this.cache = spi;
+ this.commandsFactory = commandsFactory;
+ this.nodeFactory = nodeFactory;
+ }
+
+
protected synchronized void initLock()
{
if (lock == null)
@@ -108,6 +120,8 @@
copyInternals(n);
n.children = children;
n.lockStrategyFactory = lockStrategyFactory;
+ n.commandsFactory = commandsFactory;
+ n.nodeFactory = nodeFactory;
return n;
}
Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -9,9 +9,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.jboss.cache.AbstractNode.NodeFlags.*;
-import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.marshall.MarshalledValue;
import org.jboss.cache.util.FastCopyHashMap;
import org.jboss.cache.util.ImmutableSetCopy;
@@ -45,8 +42,6 @@
*/
protected FastCopyHashMap<K, V> data;
protected NodeSPI<K, V> delegate;
- CommandsFactory commandsFactory;
- protected NodeFactory<K, V> nodeFactory;
protected CacheSPI<K, V> cache;
/**
@@ -114,13 +109,6 @@
this.delegate = delegate;
}
- public void injectDependencies(CacheSPI<K, V> spi, CommandsFactory commandsFactory, NodeFactory<K, V> nodeFactory)
- {
- this.cache = spi;
- this.commandsFactory = commandsFactory;
- this.nodeFactory = nodeFactory;
- }
-
/**
* Returns a parent by checking the TreeMap by name.
*/
@@ -172,12 +160,6 @@
}
@Override
- public InternalNode<K, V> getOrCreateChild(Object childName, InvocationContext ctx)
- {
- return getOrCreateChild(childName, ctx, true, true);
- }
-
- @Override
public InternalNode<K, V> getChild(Fqn f)
{
if (fqn.size() == 1)
@@ -274,68 +256,6 @@
}
}
- public InternalNode<K, V> addChild(Fqn f)
- {
- return addChild(f, true);
- }
-
- @Override
- public InternalNode<K, V> addChild(Fqn f, boolean notify)
- {
- if (f.size() == 1)
- {
- return getOrCreateChild(f.getLastElement(), cache.getInvocationContext(), true, notify);
- }
- else
- {
- throw new UnsupportedOperationException("Cannot directly create children which aren't directly under the current node.");
- }
- }
-
- @Override
- public InternalNode<K, V> addChild(Object o, boolean notify)
- {
- return getOrCreateChild(o, cache.getInvocationContext(), true, notify);
- }
-
- private InternalNode<K, V> getOrCreateChild(Object childName, InvocationContext ctx, boolean createIfNotExists, boolean notify)
- {
- InternalNode<K, V> child;
- if (childName == null) throw new IllegalArgumentException("null child name");
-
- child = children().get(childName);
-
- if (createIfNotExists && child == null)
- {
- Fqn childFqn = Fqn.fromRelativeElements(fqn, childName);
- InternalNode<K, V> newChild = nodeFactory.createInternalNode(childFqn);
-
- child = children().putIfAbsent(childName, newChild);
-
- if (child == null)
- {
- // addChild actually succeeded!
- child = newChild;
-
- if (trace) log.trace("created child: fqn=" + childFqn);
-
- if (ctx.getTransactionContext() != null)
- {
- CreateNodeCommand createNodeCommand = commandsFactory.buildCreateNodeCommand(childFqn);
- ctx.getTransactionContext().addLocalModification(createNodeCommand);
- }
-
- // notify if we actually created a new child
- if (notify)
- {
- cache.getNotifier().notifyNodeCreated(childFqn, true, ctx);
- cache.getNotifier().notifyNodeCreated(childFqn, false, ctx);
- }
- }
- }
- return child;
- }
-
public V remove(K key)
{
if (data == null) return null;
@@ -623,9 +543,7 @@
{
// direct reference to child map
n.children = children;
- n.commandsFactory = commandsFactory;
n.delegate = delegate;
- n.nodeFactory = nodeFactory;
n.flags = flags;
}
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -4,6 +4,7 @@
import org.jboss.cache.commands.AbstractVisitor;
import org.jboss.cache.commands.CommandsFactory;
import org.jboss.cache.commands.WriteCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -16,7 +17,6 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,5 +1,6 @@
package org.jboss.cache.commands;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -11,7 +12,15 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.ClearDataCommand;
+import org.jboss.cache.commands.write.EvictCommand;
+import org.jboss.cache.commands.write.InvalidateCommand;
+import org.jboss.cache.commands.write.MoveCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.invocation.InvocationContext;
import java.util.Collection;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -2,6 +2,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.buddyreplication.BuddyGroup;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -20,7 +21,6 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -8,6 +8,7 @@
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -26,7 +27,6 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
@@ -269,9 +269,7 @@
public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
{
- CreateNodeCommand command = new CreateNodeCommand(fqn);
- command.initialize(dataContainer);
- return command;
+ throw new UnsupportedOperationException("Not supported in MVCC!");
}
public ReplicableCommand fromStream(int id, Object[] parameters)
@@ -381,10 +379,7 @@
}
case CreateNodeCommand.METHOD_ID:
{
- CreateNodeCommand returnValue = new CreateNodeCommand(null);
- returnValue.initialize(dataContainer);
- command = returnValue;
- break;
+ throw new UnsupportedOperationException("CreateNodeCommand is not supported in MVCC!");
}
// --- transactional method calls
Modified: core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -2,8 +2,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.legacy.read.PessGetChildrenNamesCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.legacy.write.PessClearDataCommand;
-import org.jboss.cache.commands.legacy.write.PessCreateNodeCommand;
import org.jboss.cache.commands.legacy.write.PessMoveCommand;
import org.jboss.cache.commands.legacy.write.PessPutDataMapCommand;
import org.jboss.cache.commands.legacy.write.PessPutForExternalReadCommand;
@@ -12,7 +12,6 @@
import org.jboss.cache.commands.legacy.write.PessRemoveNodeCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -101,7 +100,7 @@
@Override
public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
{
- CreateNodeCommand command = new PessCreateNodeCommand(fqn);
+ CreateNodeCommand command = new CreateNodeCommand(fqn);
command.initialize(dataContainer);
return command;
}
@@ -188,7 +187,7 @@
}
case CreateNodeCommand.METHOD_ID:
{
- CreateNodeCommand returnValue = new PessCreateNodeCommand(null);
+ CreateNodeCommand returnValue = new CreateNodeCommand(null);
returnValue.initialize(dataContainer);
command = returnValue;
break;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,5 +1,6 @@
package org.jboss.cache.commands;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -11,7 +12,15 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.ClearDataCommand;
+import org.jboss.cache.commands.write.EvictCommand;
+import org.jboss.cache.commands.write.InvalidateCommand;
+import org.jboss.cache.commands.write.MoveCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.invocation.InvocationContext;
/**
Copied: core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/CreateNodeCommand.java (from rev 6455, core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/CreateNodeCommand.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/CreateNodeCommand.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -0,0 +1,101 @@
+package org.jboss.cache.commands.legacy.write;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.commands.Visitor;
+import org.jboss.cache.commands.WriteCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
+import org.jboss.cache.commands.read.AbstractDataCommand;
+import org.jboss.cache.invocation.InvocationContext;
+import org.jboss.cache.transaction.GlobalTransaction;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Command that creates a node. Primarily to be used as an undo command for removing nodes.
+ *
+ * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
+ * @since 2.2.0
+ * @deprecated will be removed when pessimistic locking is removed.
+ */
+@Deprecated
+public class CreateNodeCommand extends AbstractDataCommand implements WriteCommand, ReversibleCommand
+{
+ public static final int METHOD_ID = 48;
+ protected final List<Fqn> newlyCreated = new LinkedList<Fqn>();
+
+ public CreateNodeCommand(Fqn fqn)
+ {
+ this.fqn = fqn;
+ newlyCreated.add(fqn);
+ }
+
+ public CreateNodeCommand()
+ {
+ }
+
+ public int getCommandId()
+ {
+ return METHOD_ID;
+ }
+
+ public void setGlobalTransaction(GlobalTransaction gtx)
+ {
+ // no op
+ }
+
+ public GlobalTransaction getGlobalTransaction()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a node in the cache, specified by the given Fqn.
+ */
+ public Object perform(InvocationContext ctx)
+ {
+ Object[] results = dataContainer.createNodes(fqn);
+ List<NodeSPI> created = (List<NodeSPI>) results[0];
+
+ boolean foundFqn = false;
+ if (!created.isEmpty())
+ {
+ for (NodeSPI n : created)
+ {
+ if (fqn.equals(n.getFqn())) foundFqn = true;
+ newlyCreated.add(n.getFqn());
+ }
+ }
+ if (newlyCreated != null && !foundFqn) newlyCreated.remove(fqn);
+
+ return results[1];
+ }
+
+ public void rollback()
+ {
+ if (newlyCreated != null)
+ {
+ for (Fqn f : newlyCreated) dataContainer.removeFromDataStructure(f, true);
+ }
+ }
+
+ List<Fqn> getNewlyCreated()
+ {
+ return newlyCreated;
+ }
+
+ public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+ {
+ return visitor.visitCreateNodeCommand(ctx, this);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "CreateNodeCommand{" +
+ "fqn=" + fqn +
+ ", newlyCreated=" + newlyCreated +
+ '}';
+ }
+}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,41 +0,0 @@
-package org.jboss.cache.commands.legacy.write;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.commands.legacy.ReversibleCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
-
-import java.util.List;
-
-/**
- * A version of {@link org.jboss.cache.commands.write.CreateNodeCommand} which can be rolled back, for use with
- * pessimistic locking where changes are made directly on the data structures and may need to be reversed.
- *
- * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
- * @since 3.0
- * @deprecated will be removed along with optimistic and pessimistic locking.
- */
-@Deprecated
-public class PessCreateNodeCommand extends CreateNodeCommand implements ReversibleCommand
-{
- public PessCreateNodeCommand(Fqn fqn)
- {
- super(fqn);
- }
-
- public PessCreateNodeCommand()
- {
- }
-
- public void rollback()
- {
- if (newlyCreated != null)
- {
- for (Fqn f : newlyCreated) dataContainer.removeFromDataStructure(f, true);
- }
- }
-
- List<Fqn> getNewlyCreated()
- {
- return newlyCreated;
- }
-}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -5,6 +5,7 @@
import org.jboss.cache.InternalNode;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -16,7 +17,6 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
@@ -267,8 +267,7 @@
@Override
public Object handleCreateNodeCommand(InvocationContext ctx, CreateNodeCommand command) throws Throwable
{
- helper.wrapNodeForWriting(ctx, command.getFqn(), true, true, false, false, false); // get the node and stick it in the context.
- return invokeNextInterceptor(ctx, command);
+ throw new UnsupportedOperationException("Unsupported in MVCC!");
}
@Override
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -14,12 +14,12 @@
import org.jboss.cache.commands.VersionedDataCommand;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.commands.WriteCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutForExternalReadCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/base/PrePostProcessingCommandInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/base/PrePostProcessingCommandInterceptor.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/PrePostProcessingCommandInterceptor.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -1,6 +1,7 @@
package org.jboss.cache.interceptors.base;
import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
@@ -13,7 +14,6 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeFactory.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -7,11 +7,9 @@
import org.jboss.cache.InternalNode;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.UnversionedNode;
-import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.TransactionContext;
import java.util.Map;
@@ -99,7 +97,7 @@
@Override
@SuppressWarnings("unchecked")
- public InternalNode<K, V> createAndRegister(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent)
+ public InternalNode<K, V> createChildNode(Fqn fqn, InternalNode<K, V> parent, InvocationContext ctx, boolean attachToParent)
{
InternalNode<K, V> child;
if (fqn == null) throw new IllegalArgumentException("null child fqn");
@@ -116,13 +114,6 @@
if (trace) log.trace("Created new child with fqn [" + fqn + "]");
- TransactionContext tctx;
- if ((tctx = ctx.getTransactionContext()) != null)
- {
- CreateNodeCommand createNodeCommand = commandsFactory.buildCreateNodeCommand(fqn);
- tctx.addLocalModification(createNodeCommand);
- }
-
// notify if we actually created a new child
cache.getNotifier().notifyNodeCreated(fqn, false, ctx);
}
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeHelper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeHelper.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/MVCCNodeHelper.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -223,7 +223,7 @@
// now to lock and create the node. Lock first to prevent concurrent creation!
acquireLock(context, fqn);
- in = nodeFactory.createAndRegister(fqn, null, context, false);
+ in = nodeFactory.createChildNode(fqn, null, context, false);
n = nodeFactory.createWrappedNode(in);
n.setCreated(true);
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -6,7 +6,6 @@
import org.jboss.cache.InternalNode;
import org.jboss.cache.Node;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -137,26 +136,6 @@
delegate.addChild(child);
}
- public final InternalNode<K, V> addChild(Fqn f)
- {
- return delegate.addChild(f);
- }
-
- public final InternalNode<K, V> addChild(Fqn f, boolean notify)
- {
- return delegate.addChild(f, notify);
- }
-
- public final InternalNode<K, V> addChild(Object o, boolean notify)
- {
- return delegate.addChild(o, notify);
- }
-
- public final InternalNode<K, V> getOrCreateChild(Object childName, InvocationContext ctx)
- {
- return delegate.getOrCreateChild(childName, ctx);
- }
-
public final V remove(K key)
{
return delegate.remove(key);
Modified: core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -8,7 +8,7 @@
import java.util.ArrayList;
/**
- * Tester class for {@link org.jboss.cache.commands.write.CreateNodeCommand}
+ * Tester class for {@link CreateNodeCommand}
*
* @author Mircea.Markus(a)jboss.com
* @since 2.2
@@ -16,13 +16,13 @@
@Test(groups = "unit")
public class CreateNodeCommandTest extends AbstractDataCommandTest
{
- PessCreateNodeCommand command;
+ CreateNodeCommand command;
private Object[] result;
private ArrayList createdNodes;
protected void moreSetup()
{
- command = new PessCreateNodeCommand(testFqn);
+ command = new CreateNodeCommand(testFqn);
command.initialize(container);
createdNodes = new ArrayList();
result = new Object[2];
Modified: core/trunk/src/test/java/org/jboss/cache/lock/AbstractLockManagerRecordingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/AbstractLockManagerRecordingTest.java 2008-07-31 16:50:36 UTC (rev 6474)
+++ core/trunk/src/test/java/org/jboss/cache/lock/AbstractLockManagerRecordingTest.java 2008-07-31 18:07:54 UTC (rev 6475)
@@ -67,7 +67,6 @@
protected NodeSPI createNode(Fqn fqn)
{
UnversionedNode un = new UnversionedNode(fqn);
- un.injectDependencies(null, null, null);
return new NodeInvocationDelegate(un);
}
}
16 years, 5 months
JBoss Cache SVN: r6474 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-31 12:50:36 -0400 (Thu, 31 Jul 2008)
New Revision: 6474
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
Log:
More efficient flat map
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-31 16:22:57 UTC (rev 6473)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-31 16:50:36 UTC (rev 6474)
@@ -8,6 +8,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Option;
import org.jboss.cache.util.Caches;
+import org.jboss.cache.util.Caches.HashKeySelector;
import java.util.List;
import java.util.Map;
@@ -37,7 +38,7 @@
if (FLAT)
{
log.info("Using FLAT MAP wrapper");
- flatCache = Caches.asMap(cache);
+ flatCache = Caches.asPartitionedMap(cache.getRoot(), new HashKeySelector(128));
}
}
16 years, 5 months
JBoss Cache SVN: r6473 - in benchmarks/benchmark-fwk/trunk: src/org/cachebench and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-31 12:22:57 -0400 (Thu, 31 Jul 2008)
New Revision: 6473
Modified:
benchmarks/benchmark-fwk/trunk/runAllLocal.sh
benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
Log:
Updated to latest snapshot of 3.0 - and allowed ability to use flat map
Modified: benchmarks/benchmark-fwk/trunk/runAllLocal.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-07-31 16:22:52 UTC (rev 6472)
+++ benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-07-31 16:22:57 UTC (rev 6473)
@@ -1,10 +1,18 @@
#!/bin/bash
+# for jdk in java5 java6 java7 ; do
+# source ${jdk}
+jdk=java5
rm -rf ./output/*
-export JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.fwkCfgFile=cachebench-local.xml -Xms2g -Xmx2g"
+export PLAIN_JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.fwkCfgFile=cachebench-local.xml -Xms2g -Xmx2g"
+unset JVM_OPTIONS && export JVM_OPTIONS=${PLAIN_JVM_OPTIONS}
./runLocalNode.sh jbosscache-2.2.0 pess-local.xml
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
+unset JVM_OPTIONS && export JVM_OPTIONS="${PLAIN_JVM_OPTIONS} -cacheBenchFwk.useFlatCache=true -cacheBenchFwk.productSuffix=FlatCache"
+./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
+./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
+unset JVM_OPTIONS && export JVM_OPTIONS=${PLAIN_JVM_OPTIONS}
./runLocalNode.sh jbosscache-2.2.0 pess-local-NONE.xml
./runLocalNode.sh ehcache-1.5.0 ehcache-local.xml
./runLocalNode.sh coherence-3.3.1 local-default.xml
@@ -12,5 +20,7 @@
mkdir output
mv data* ./output
-./generateChart.sh -reportDir output -o MVCC -chartType putget
+./generateChart.sh -reportDir output -o LocalMode-${jdk} -chartType putget
+# done
+
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-07-31 16:22:52 UTC (rev 6472)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-07-31 16:22:57 UTC (rev 6473)
@@ -70,9 +70,12 @@
*/
private void initJVMParams(String defaultCfgFile)
{
+ boolean useFlatCache = Boolean.getBoolean("cacheBenchFwk.useFlatCache");
String overallCfg = System.getProperty("cacheBenchFwk.fwkCfgFile", defaultCfgFile);
String configuraton = System.getProperty("cacheBenchFwk.cacheConfigFile");
String cacheProductName = System.getProperty("cacheBenchFwk.cacheProductName");
+ String suffix = System.getProperty("cacheBenchFwk.productSuffix");
+ if (suffix != null && !suffix.trim().equals("")) cacheProductName += suffix;
String clusterSize = System.getProperty("clusterSize");
localOnly = Boolean.getBoolean("localOnly");
@@ -81,6 +84,7 @@
if (cacheProductName != null) systemParams.put("cacheProductName", cacheProductName);
if (clusterSize != null) systemParams.put("clusterSize", clusterSize);
if (localOnly) systemParams.put("localOnly", "TRUE");
+ if (useFlatCache) systemParams.put("cacheBenchFwk.useFlatCache", "TRUE");
}
private CacheBenchmarkRunner()
16 years, 5 months
JBoss Cache SVN: r6472 - in benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0: src/org/cachebench/cachewrappers and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-31 12:22:52 -0400 (Thu, 31 Jul 2008)
New Revision: 6472
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
Log:
Updated to latest snapshot of 3.0 - and allowed ability to use flat map
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-31 15:55:10 UTC (rev 6471)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-31 16:22:52 UTC (rev 6472)
@@ -7,6 +7,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Option;
+import org.jboss.cache.util.Caches;
import java.util.List;
import java.util.Map;
@@ -17,8 +18,15 @@
public class JBossCache300Wrapper implements CacheWrapper
{
private Cache cache;
+ private Map flatCache;
private Log log = LogFactory.getLog(JBossCache300Wrapper.class);
+ private final boolean FLAT; // this is final so that the compiler inlines it and it doesn't become a reason for a perf bottleneck
+ public JBossCache300Wrapper()
+ {
+ FLAT = Boolean.getBoolean("cacheBenchFwk.useFlatCache");
+ }
+
public void init(Map parameters) throws Exception
{
log.info("Creating cache with the following configuration: " + parameters);
@@ -26,6 +34,11 @@
log.info("Running cache with following config: " + cache.getConfiguration());
log.info("Running following JBossCacheVersion: " + org.jboss.cache.Version.version);
log.info("Running following JBossCacheCodeName: " + org.jboss.cache.Version.codename);
+ if (FLAT)
+ {
+ log.info("Using FLAT MAP wrapper");
+ flatCache = Caches.asMap(cache);
+ }
}
public void setUp() throws Exception
@@ -39,18 +52,31 @@
public void put(List<String> path, Object key, Object value) throws Exception
{
- cache.put(Fqn.fromList((List) path, true), key, value);
+ if (FLAT)
+ flatCache.put(key, value);
+ else
+ cache.put(Fqn.fromList((List) path, true), key, value);
}
public Object get(List<String> path, Object key) throws Exception
{
- return cache.get(Fqn.fromList((List) path, true), key);
+ if (FLAT)
+ return flatCache.get(key);
+ else
+ return cache.get(Fqn.fromList((List) path, true), key);
}
public void empty() throws Exception
{
- //not removing root because there it fails with buddy replication: http://jira.jboss.com/jira/browse/JBCACHE-1241
- cache.removeNode(Fqn.fromElements("test"));
+ if (FLAT)
+ {
+ flatCache.clear();
+ }
+ else
+ {
+ //not removing root because there it fails with buddy replication: http://jira.jboss.com/jira/browse/JBCACHE-1241
+ cache.removeNode(Fqn.fromElements("test"));
+ }
}
public int getNumMembers()
@@ -72,6 +98,6 @@
}
Option option = cache.getInvocationContext().getOptionOverrides();
option.setForceDataGravitation(true);
- return cache.get(Fqn.fromList((List) path, true), key);
+ return get(path, key);
}
}
16 years, 5 months