summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/persistency/ClusterStorageManager.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-02-28 16:06:40 +0100
committerAndrew Branson <andrew.branson@cern.ch>2013-02-28 16:06:40 +0100
commit288f3c6045d8f6b1e4d9b0b02a99d76f3d3683e1 (patch)
treeea29d4eb429eeca7611c1dd0e30e4ab9649bd81e /src/main/java/com/c2kernel/persistency/ClusterStorageManager.java
parentba1d538b588dc57066213a94803584ea9016e1e7 (diff)
RemoveNonStrongRefCache, as it didn't add anything to Map.
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/ClusterStorageManager.java')
-rw-r--r--src/main/java/com/c2kernel/persistency/ClusterStorageManager.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/com/c2kernel/persistency/ClusterStorageManager.java b/src/main/java/com/c2kernel/persistency/ClusterStorageManager.java
index bb5f90f..6c247b2 100644
--- a/src/main/java/com/c2kernel/persistency/ClusterStorageManager.java
+++ b/src/main/java/com/c2kernel/persistency/ClusterStorageManager.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
import java.util.StringTokenizer;
import com.c2kernel.common.ObjectNotFoundException;
@@ -16,7 +17,6 @@ import com.c2kernel.persistency.outcome.Outcome;
import com.c2kernel.persistency.outcome.Viewpoint;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
-import com.c2kernel.utils.NonStrongRefCache;
import com.c2kernel.utils.SoftCache;
import com.c2kernel.utils.WeakCache;
@@ -33,7 +33,7 @@ public class ClusterStorageManager {
HashMap<String, ArrayList<ClusterStorage>> clusterWriters = new HashMap<String, ArrayList<ClusterStorage>>();
HashMap<String, ArrayList<ClusterStorage>> clusterReaders = new HashMap<String, ArrayList<ClusterStorage>>();
// we don't need a soft cache for the top level cache - the proxies and entities clear that when reaped
- HashMap<Integer, NonStrongRefCache<String, C2KLocalObject>> memoryCache = new HashMap<Integer, NonStrongRefCache<String, C2KLocalObject>>();
+ HashMap<Integer, Map<String, C2KLocalObject>> memoryCache = new HashMap<Integer, Map<String, C2KLocalObject>>();
/**
* Initialises all ClusterStorage handlers listed by class name in the property "ClusterStorages"
@@ -130,7 +130,7 @@ public class ClusterStorageManager {
* Does not look in any currently open transactions.
*/
public String[] getClusterContents(Integer sysKey, String path) throws ClusterStorageException {
- //String[] retArr = new String[0];
+
ArrayList<String> contents = new ArrayList<String>();
// get all readers
Logger.msg(8, "ClusterStorageManager.getClusterContents() - Finding contents of "+path);
@@ -161,7 +161,7 @@ public class ClusterStorageManager {
public C2KLocalObject get(Integer sysKeyIntObj, String path) throws ClusterStorageException, ObjectNotFoundException {
C2KLocalObject result = null;
// check cache first
- NonStrongRefCache<String, C2KLocalObject> sysKeyMemCache = null;
+ Map<String, C2KLocalObject> sysKeyMemCache = null;
sysKeyMemCache = memoryCache.get(sysKeyIntObj);
if (sysKeyMemCache != null) {
synchronized(sysKeyMemCache) {
@@ -246,7 +246,7 @@ public class ClusterStorageManager {
}
}
// put in mem cache if that worked
- NonStrongRefCache<String, C2KLocalObject> sysKeyMemCache;
+ Map<String, C2KLocalObject> sysKeyMemCache;
if (memoryCache.containsKey(sysKeyIntObj))
sysKeyMemCache = memoryCache.get(sysKeyIntObj);
else {
@@ -283,7 +283,7 @@ public class ClusterStorageManager {
}
if (memoryCache.containsKey(sysKeyIntObj)) {
- NonStrongRefCache<?, ?> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
+ Map<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
synchronized (sysKeyMemCache) {
sysKeyMemCache.remove(path);
}
@@ -298,7 +298,7 @@ public class ClusterStorageManager {
Logger.msg(7, "CSM.clearCache() - removing "+sysKeyIntObj+"/"+path);
if (memoryCache.containsKey(sysKeyIntObj)) {
- NonStrongRefCache<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
+ Map<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
synchronized(sysKeyMemCache) {
for (Iterator<String> iter = sysKeyMemCache.keySet().iterator(); iter.hasNext();) {
String thisPath = iter.next();
@@ -318,7 +318,7 @@ public class ClusterStorageManager {
if (memoryCache.containsKey(sysKeyIntObj)) {
synchronized (memoryCache) {
if (Logger.doLog(6)) {
- NonStrongRefCache<?, ?> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
+ Map<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
int size = sysKeyMemCache.size();
Logger.msg(6, "CSM.clearCache() - "+size+" objects to remove.");
}
@@ -341,7 +341,7 @@ public class ClusterStorageManager {
synchronized(memoryCache) {
for (Integer sysKey : memoryCache.keySet()) {
Logger.msg(logLevel, "Cached Objects of Entity "+sysKey);
- NonStrongRefCache<?, ?> sysKeyMemCache = memoryCache.get(sysKey);
+ Map<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKey);
try {
synchronized(sysKeyMemCache) {
for (Object name : sysKeyMemCache.keySet()) {