diff options
author | Melanie Thielker | 2009-05-10 14:03:06 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-10 14:03:06 +0000 |
commit | 1a910b6e1dbace70b27581c51148a8732b46de79 (patch) | |
tree | c13e58aa932b0db95ca895cd0ff1275c0014ca9f /OpenSim/Region/CoreModules/Asset | |
parent | Add some asset cache plumbing. Change the generic cache from UUID to string (diff) | |
download | opensim-SC_OLD-1a910b6e1dbace70b27581c51148a8732b46de79.zip opensim-SC_OLD-1a910b6e1dbace70b27581c51148a8732b46de79.tar.gz opensim-SC_OLD-1a910b6e1dbace70b27581c51148a8732b46de79.tar.bz2 opensim-SC_OLD-1a910b6e1dbace70b27581c51148a8732b46de79.tar.xz |
Connect up the new asset cache and introduce an asynchronous call path
for asset retrieval (full asset only) to ease migration to the new system
Diffstat (limited to 'OpenSim/Region/CoreModules/Asset')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs index c4cc007..41d4bc6 100644 --- a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | |||
@@ -45,6 +45,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
45 | MethodBase.GetCurrentMethod().DeclaringType); | 45 | MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private bool m_Enabled = false; | 47 | private bool m_Enabled = false; |
48 | private Cache m_Cache = new Cache(CacheMedium.Memory, | ||
49 | CacheStrategy.Aggressive, | ||
50 | CacheFlags.AllowUpdate); | ||
48 | 51 | ||
49 | public string Name | 52 | public string Name |
50 | { | 53 | { |
@@ -69,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Asset | |||
69 | m_Enabled = true; | 72 | m_Enabled = true; |
70 | 73 | ||
71 | m_log.Info("[ASSET CACHE]: Core asset cache enabled"); | 74 | m_log.Info("[ASSET CACHE]: Core asset cache enabled"); |
75 | |||
76 | m_Cache.Size = 32768; | ||
72 | } | 77 | } |
73 | } | 78 | } |
74 | } | 79 | } |
@@ -99,19 +104,22 @@ namespace OpenSim.Region.CoreModules.Asset | |||
99 | 104 | ||
100 | public void Cache(AssetBase asset) | 105 | public void Cache(AssetBase asset) |
101 | { | 106 | { |
107 | m_Cache.Store(asset.ID, asset); | ||
102 | } | 108 | } |
103 | 109 | ||
104 | public AssetBase Get(string id) | 110 | public AssetBase Get(string id) |
105 | { | 111 | { |
106 | return null; | 112 | return (AssetBase)m_Cache.Get(id); |
107 | } | 113 | } |
108 | 114 | ||
109 | public void Expire(string id) | 115 | public void Expire(string id) |
110 | { | 116 | { |
117 | m_Cache.Invalidate(id); | ||
111 | } | 118 | } |
112 | 119 | ||
113 | public void Clear() | 120 | public void Clear() |
114 | { | 121 | { |
122 | m_Cache.Clear(); | ||
115 | } | 123 | } |
116 | } | 124 | } |
117 | } | 125 | } |