public GridRegion Get(UUID scopeID, string name, out bool inCache) { inCache = false; ScopedRegionName sname = new ScopedRegionName(scopeID, name); ScopedRegionUUID id; if (m_NameCache.TryGetValue(sname, out id)) { GridRegion rinfo = null; if (m_UUIDCache.TryGetValue(id, out rinfo)) { inCache = true; return(rinfo); } } return(null); }
public void Cache(UUID scopeID, UUID regionID, GridRegion rinfo) { // for now, do not cache negative results; this is because // we need to figure out how to handle regions coming online // in a timely way if (rinfo == null) { return; } ScopedRegionUUID id = new ScopedRegionUUID(scopeID, regionID); // Cache even null accounts m_UUIDCache.AddOrUpdate(id, rinfo, CACHE_EXPIRATION_SECONDS); if (rinfo != null) { ScopedRegionName name = new ScopedRegionName(scopeID, rinfo.RegionName); m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS); } }
public void Cache(UUID scopeID, UUID regionID, GridRegion rinfo) { // for now, do not cache negative results; this is because // we need to figure out how to handle regions coming online // in a timely way if (rinfo == null) return; ScopedRegionUUID id = new ScopedRegionUUID(scopeID,regionID); // Cache even null accounts m_UUIDCache.AddOrUpdate(id, rinfo, CACHE_EXPIRATION_SECONDS); if (rinfo != null) { ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName); m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS); ScopedRegionHandle hnd = new ScopedRegionHandle(scopeID, rinfo.RegionHandle); m_HandleCache.AddOrUpdate(hnd,id,CACHE_EXPIRATION_SECONDS); } }
public GridRegion Get(UUID scopeID, string name, out bool inCache) { inCache = false; ScopedRegionName sname = new ScopedRegionName(scopeID,name); ScopedRegionUUID id; if (m_NameCache.TryGetValue(sname, out id)) { GridRegion rinfo = null; if (m_UUIDCache.TryGetValue(id, out rinfo)) { inCache = true; return rinfo; } } return null; }