[jbosscache-commits] JBoss Cache SVN: r4940 - in core/trunk/src/main/java/org/jboss/cache: invocation and 1 other directories.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Wed Jan 2 06:56:57 EST 2008
Author: manik.surtani at jboss.com
Date: 2008-01-02 06:56:56 -0500 (Wed, 02 Jan 2008)
New Revision: 4940
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java
Log:
Fixed data gravitation issues
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-02 11:30:24 UTC (rev 4939)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-02 11:56:56 UTC (rev 4940)
@@ -2827,7 +2827,7 @@
// use a get() call into the cache to make sure cache loading takes place.
ctx.getOptionOverrides().setSkipDataGravitation(true);
- actualNode = get(backupNodeFqn);
+ actualNode = spi.getNode(backupNodeFqn);
ctx.getOptionOverrides().setSkipDataGravitation(false);
if (log.isTraceEnabled())
log.trace("Looking for " + backupNodeFqn + ". Search result: " + actualNode);
@@ -2908,8 +2908,10 @@
if (log.isTraceEnabled())
log.trace("DataGravitationCleanup: Removing primary (" + primary + ") and backup (" + backup + ")");
//primaryDataCleanup = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, primary, false);
+ spi.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
spi.removeNode(primary);
//backupDataCleanup = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, backup, false);
+ spi.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
spi.removeNode(backup);
}
else
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-01-02 11:30:24 UTC (rev 4939)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-01-02 11:56:56 UTC (rev 4940)
@@ -10,7 +10,6 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.marshall.MethodCall;
-import org.jboss.cache.marshall.MethodDeclarations;
/**
* The JBoss Cache hand-wired interceptor stack. A "minimal" AOP framework which uses delegation through an
@@ -76,7 +75,7 @@
InvocationContext ctx = invocationContextContainer.get();
// BR methods should NOT block on the cache being started, since the cache depends on these completing to start.
- if (!MethodDeclarations.isBuddyGroupOrganisationMethod(call.getMethodId()) &&
+ if (//!MethodDeclarations.isBuddyGroupOrganisationMethod(call.getMethodId()) &&
!cache.getCacheStatus().allowInvocations() && !skipCacheStatusCheck)
{
// only throw an exception if this is a locally originating call - JBCACHE-1179
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-02 11:30:24 UTC (rev 4939)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-02 11:56:56 UTC (rev 4940)
@@ -30,8 +30,13 @@
{
if (methodCall.getMethodId() == MethodDeclarations.clusteredGetMethod_id)
return invokeClusteredGet(methodCall);
- else if (MethodDeclarations.isDataGravitationMethod(methodCall.getMethodId()))
- return invokeDataGravitationCall(methodCall);
+ else if (methodCall.getMethodId() == MethodDeclarations.dataGravitationCleanupMethod_id)
+ {
+ Object[] args = methodCall.getArgs();
+ cache._dataGravitationCleanup((GlobalTransaction) args[0], (Fqn) args[1], (Fqn) args[2]);
+ return null;
+ }
+
else
{
try
@@ -75,25 +80,6 @@
return clusteredGet((MethodCall) args[0], (Boolean) args[1]);
}
- public Object invokeDataGravitationCall(MethodCall call) throws Exception
- {
- Object[] args = call.getArgs();
- if (call.getMethodId() == MethodDeclarations.dataGravitationMethod_id)
- {
- return cache.gravitateData((Fqn) args[0], (Boolean) args[1]);
- }
- else if (call.getMethodId() == MethodDeclarations.dataGravitationCleanupMethod_id)
- {
- cache._dataGravitationCleanup((GlobalTransaction) args[0], (Fqn) args[1], (Fqn) args[2]);
- return null;
- }
- else
- {
- throw new UnsupportedOperationException(call + " is not a data gravitation call!");
- }
- }
-
-
public void block()
{
MethodCall m = MethodCallFactory.create(MethodDeclarations.blockChannelLocal);
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java 2008-01-02 11:30:24 UTC (rev 4939)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java 2008-01-02 11:56:56 UTC (rev 4940)
@@ -10,6 +10,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.buddyreplication.BuddyGroup;
@@ -276,7 +277,7 @@
remoteAssignToBuddyGroupMethod = CacheImpl.class.getDeclaredMethod("_remoteAssignToBuddyGroup", BuddyGroup.class, Map.class);
dataGravitationCleanupMethod = CacheImpl.class.getDeclaredMethod("_dataGravitationCleanup", GlobalTransaction.class, Fqn.class, Fqn.class);
- dataGravitationMethod = CacheImpl.class.getDeclaredMethod("gravitateData", Fqn.class, boolean.class);
+ dataGravitationMethod = CacheSPI.class.getDeclaredMethod("gravitateData", Fqn.class, boolean.class);
// ------------ move() api
moveMethodLocal = CacheImpl.class.getDeclaredMethod("_move", Fqn.class, Fqn.class);
More information about the jbosscache-commits
mailing list