Changeset 186
- Timestamp:
- 07/07/11 22:57:24 (13 years ago)
- Location:
- trunk/src/com/bowman/cardserv
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/bowman/cardserv/DefaultCache.java
r133 r186 23 23 private int maxWaitPercent; 24 24 25 private int timeouts, instantHits, waitHits, remoteHits ;25 private int timeouts, instantHits, waitHits, remoteHits, pendingPeak; 26 26 27 27 public DefaultCache() { … … 46 46 if(ecmMap == null) ecmMap = new MessageCacheMap(maxAge); 47 47 else ecmMap.setMaxAge(maxAge); 48 pendingPeak = 0; 48 49 } 49 50 … … 65 66 synchronized(this) { 66 67 67 boolean waited = false ;68 boolean waited = false, alerted = false; 68 69 long delay; 69 70 … … 78 79 // allow a set cache listener to introduce a lock for any other arbitrary reason 79 80 if(!pendingEcms.containsKey(request) && listener.lockRequest(successFactor, request)) 80 addRequest(successFactor, request, alwaysWait);81 addRequest(successFactor, request, true); // alwayswait = true <-- prevent clusteredcache from sending the lock 81 82 } 82 83 … … 98 99 logger.finest("Waited for " + request.hashCodeStr() + " in cache: " + delay + " ms"); 99 100 waited = true; 100 if(delay >= maxWait) { 101 break; 101 if(!alerted && delay >= (maxWait / 2)) { 102 alerted = true; 103 delayAlert(successFactor, request, alwaysWait, maxWait); 102 104 } 105 if(delay >= maxWait) break; 103 106 } 104 107 } … … 132 135 } 133 136 137 } 138 139 protected void delayAlert(int successFactor, CamdNetMessage request, boolean alwaysWait, long maxWait) { 140 // nothing to do in this impl 134 141 } 135 142 … … 160 167 public Properties getUsageStats() { 161 168 Properties p = new Properties(); 162 p.setProperty("pending-ecms", String.valueOf(pendingEcms.size()) );169 p.setProperty("pending-ecms", String.valueOf(pendingEcms.size()) + " (peak: " + pendingPeak + ")"); 163 170 p.setProperty("cached-ecms", String.valueOf(ecmMap.size())); 164 171 p.setProperty("timeouts", String.valueOf(timeouts)); … … 179 186 protected synchronized void addRequest(int successFactor, CamdNetMessage request, boolean alwaysWait) { 180 187 CamdNetMessage oldRequest = (CamdNetMessage)pendingEcms.put(request, request); 188 if(pendingEcms.size() > pendingPeak) pendingPeak = pendingEcms.size(); 181 189 if(oldRequest == null) { 182 190 if(forwarder != null) forwarder.onRequest(successFactor, request); -
trunk/src/com/bowman/cardserv/ProxyConfig.java
r165 r186 486 486 cacheHandler.setListener(sidLinker); 487 487 } else cacheHandler.setListener(null); 488 ProxyPlugin plugin; 489 for(Iterator iter = proxyPlugins.values().iterator(); iter.hasNext(); ) { // hack to start cache plugins on first load 490 plugin = (ProxyPlugin)iter.next(); 491 if(plugin instanceof CacheListener) plugin.start((CardServProxy)rootConfigurable); 492 } 488 493 } 489 494 -
trunk/src/com/bowman/cardserv/SidCacheLinker.java
r141 r186 432 432 if(undecodable && testService == null) reportAddedService(linkedReq, origReq); 433 433 linkedReq.setLinkedService(linkStr); 434 reply.setConnectorName("SidCacheLinker"); 434 435 cache.processReply(linkedReq, reply); 435 436 } -
trunk/src/com/bowman/cardserv/session/AbstractSession.java
r165 r186 26 26 boolean userDebug; 27 27 28 Set allowedConnectors, mappedProfiles, allowedProfiles = new HashSet();28 Set allowedConnectors, mappedProfiles, allowedProfiles; 29 29 Map allowedServices, blockedServices; 30 30 int allowedRate; -
trunk/src/com/bowman/cardserv/tv/TvService.java
r125 r186 38 38 39 39 public TvService(TvService ts, long customData) { 40 this(ts, customData, null); 41 } 42 43 public TvService(TvService ts, long customData, String profile) { 40 44 this.id = ts.id; 41 45 this.namespace = ts.namespace; … … 45 49 this.number = ts.number; 46 50 this.unknown = ts.unknown; 47 this.profileName = ts.profileName;51 this.profileName = profile==null?ts.profileName:profile; 48 52 this.provider = ts.provider; 49 53 this.name = ts.name;
Note:
See TracChangeset
for help on using the changeset viewer.