[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Wed Jan 17 11:24:07 EST 2007
User: msurtani
Date: 07/01/17 11:24:07
Modified: src/org/jboss/cache CacheImpl.java VersionedNode.java
UnversionedNode.java CacheSPI.java
Log:
JBCACHE-565
Revision Changes Path
1.32 +7 -26 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- CacheImpl.java 17 Jan 2007 14:13:06 -0000 1.31
+++ CacheImpl.java 17 Jan 2007 16:24:07 -0000 1.32
@@ -94,7 +94,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: CacheImpl.java,v 1.31 2007/01/17 14:13:06 msurtani Exp $
+ * @version $Id: CacheImpl.java,v 1.32 2007/01/17 16:24:07 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -1355,25 +1355,6 @@
}
/**
- * Like <code>get()</code> method but without triggering a node visit event. This is used
- * to prevent refresh of the cache data in the eviction policy.
- *
- * @param fqn
- * @param key
- * @deprecated This will go away.
- */
- public Object peek(Fqn fqn, Object key) throws CacheException
- {
- return get(fqn, key, false);
- }
-
-
- public NodeSPI peek(Fqn fqn)
- {
- return findInternal(fqn, true);
- }
-
- /**
* Checks whether a given node exists in current in-memory state of the cache.
* Does not acquire any locks in doing so (result may be dirty read). Does
* not attempt to load nodes from a cache loader (may return false if a
@@ -1399,7 +1380,7 @@
*/
public boolean exists(Fqn fqn)
{
- Node n = findInternal(fqn, false);
+ Node n = peek(fqn, false);
return n != null;
}
@@ -1408,7 +1389,7 @@
*
* @param fqn
*/
- private NodeSPI findInternal(Fqn fqn, boolean includeNodesMarkedAsRemoved)
+ public NodeSPI peek(Fqn fqn, boolean includeDeletedNodes)
{
if (fqn == null || fqn.size() == 0) return root;
NodeSPI n = root;
@@ -1421,7 +1402,7 @@
{
return null;
}
- else if (!includeNodesMarkedAsRemoved && n.isDeleted())
+ else if (!includeDeletedNodes && n.isDeleted())
{
return null;
}
@@ -1450,7 +1431,7 @@
*/
public boolean exists(Fqn fqn, Object key)
{
- NodeSPI n = findInternal(fqn, false);
+ NodeSPI n = peek(fqn, false);
return n != null && n.getKeysDirect().contains(key);
}
@@ -3751,7 +3732,7 @@
*/
public void realRemove(Fqn f, boolean skipMarkerCheck)
{
- NodeSPI n = findInternal(f, true);
+ NodeSPI n = peek(f, true);
if (n == null)
{
return;
@@ -3785,7 +3766,7 @@
{
if (fqn == null) return null;
- NodeSPI toReturn = findInternal(fqn, false);
+ NodeSPI toReturn = peek(fqn, false);
if (version != null && configuration.isNodeLockingOptimistic())
{
1.8 +0 -0 JBossCache/src/org/jboss/cache/VersionedNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
1.20 +2 -2 JBossCache/src/org/jboss/cache/UnversionedNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UnversionedNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/UnversionedNode.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- UnversionedNode.java 11 Jan 2007 12:07:29 -0000 1.19
+++ UnversionedNode.java 17 Jan 2007 16:24:07 -0000 1.20
@@ -117,7 +117,7 @@
{
return null;
}
- return cache.peek(fqn.getParent());
+ return cache.peek(fqn.getParent(), true);
}
private synchronized void initLock()
@@ -428,7 +428,7 @@
public boolean hasChild(Fqn f)
{
- return cache.exists(new Fqn(getFqn(), f));
+ return getChild(f) != null;
}
public void putIfAbsent(Object k, Object v)
1.30 +3 -2 JBossCache/src/org/jboss/cache/CacheSPI.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheSPI.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheSPI.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- CacheSPI.java 15 Jan 2007 18:10:55 -0000 1.29
+++ CacheSPI.java 17 Jan 2007 16:24:07 -0000 1.30
@@ -147,9 +147,10 @@
* Returns a node without accessing the interceptor chain.
*
* @param fqn the Fqn to look up.
+ * @param includeDeletedNodes if you intend to see nodes marked as deleted within the current tx, set this to true
* @return a node if one exists or null
*/
- NodeSPI peek(Fqn fqn);
+ NodeSPI peek(Fqn fqn, boolean includeDeletedNodes);
/**
* Used with buddy replication's data gravitation interceptor. If marshalling is necessary, ensure that the cache is
More information about the jboss-cvs-commits
mailing list