From 1bf05a543c1328c31b7b107a3335f34e8d174ed8 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 9 Mar 2009 18:35:26 +0000
Subject: * Move method documentation from AssetCache up to IAssetCache * No
functional changes
---
.../Framework/Communications/Cache/AssetCache.cs | 90 +++-------------------
1 file changed, 10 insertions(+), 80 deletions(-)
(limited to 'OpenSim/Framework/Communications')
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 30f7ddf..dfbdb09 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -37,8 +37,6 @@ using OpenSim.Framework.Statistics;
namespace OpenSim.Framework.Communications.Cache
{
- // public delegate void AssetRequestCallback(UUID assetID, AssetBase asset);
-
///
/// Manages local cache of assets and their sending to viewers.
///
@@ -49,7 +47,6 @@ namespace OpenSim.Framework.Communications.Cache
/// AssetNotFound(), which means they do share the same asset and texture caches.
public class AssetCache : IAssetCache
{
-
#region IPlugin
///
@@ -88,7 +85,6 @@ namespace OpenSim.Framework.Communications.Cache
assetCacheThread.IsBackground = true;
assetCacheThread.Start();
ThreadTracker.Add(assetCacheThread);
-
}
public virtual void Initialise(ConfigSettings settings, IAssetServer assetServer)
@@ -113,44 +109,27 @@ namespace OpenSim.Framework.Communications.Cache
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- ///
- /// The cache of assets. This does not include textures.
- ///
- //private Dictionary Assets;
-
- ///
- /// The cache of textures.
- ///
- //private Dictionary Textures;
-
- ///
+ ///
/// Assets requests which are waiting for asset server data. This includes texture requests
- ///
+ ///
private Dictionary RequestedAssets;
- ///
+ ///
/// Asset requests with data which are ready to be sent back to requesters. This includes textures.
- ///
+ ///
private List AssetRequests;
- ///
+ ///
/// Until the asset request is fulfilled, each asset request is associated with a list of requesters
- ///
- private Dictionary RequestLists;
-
- ///
- /// The 'server' from which assets can be requested and to which assets are persisted.
- ///
- private IAssetServer m_assetServer;
+ ///
+ private Dictionary RequestLists;
public IAssetServer AssetServer
{
get { return m_assetServer; }
}
+ private IAssetServer m_assetServer;
- ///
- /// Report statistical data.
- ///
public void ShowState()
{
m_log.InfoFormat("Memcache:{0} RequestLists:{1}",
@@ -160,9 +139,6 @@ namespace OpenSim.Framework.Communications.Cache
RequestLists.Count);
}
- ///
- /// Clear the asset cache.
- ///
public void Clear()
{
m_log.Info("[ASSET CACHE]: Clearing Asset cache");
@@ -214,12 +190,6 @@ namespace OpenSim.Framework.Communications.Cache
}
}
- ///
- /// Only get an asset if we already have it in the cache.
- ///
- ///
- ///
- /// true if the asset was in the cache, false if it was not
public bool TryGetCachedAsset(UUID assetId, out AssetBase asset)
{
Object tmp;
@@ -234,15 +204,6 @@ namespace OpenSim.Framework.Communications.Cache
return false;
}
- ///
- /// Asynchronously retrieve an asset.
- ///
- ///
- ///
- ///
- /// A callback invoked when the asset has either been found or not found.
- /// If the asset was found this is called with the asset UUID and the asset data
- /// If the asset was not found this is still called with the asset UUID but with a null asset data reference
public void GetAsset(UUID assetId, AssetRequestCallback callback, bool isTexture)
{
//m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId);
@@ -288,19 +249,6 @@ namespace OpenSim.Framework.Communications.Cache
}
}
- ///
- /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to
- /// load it into the cache.
- ///
- ///
- /// XXX We'll keep polling the cache until we get the asset or we exceed
- /// the allowed number of polls. This isn't a very good way of doing things since a single thread
- /// is processing inbound packets, so if the asset server is slow, we could block this for up to
- /// the timeout period. Whereever possible we want to use the asynchronous callback GetAsset()
- ///
- ///
- ///
- /// null if the asset could not be retrieved
public AssetBase GetAsset(UUID assetID, bool isTexture)
{
// I'm not going over 3 seconds since this will be blocking processing of all the other inbound
@@ -334,10 +282,6 @@ namespace OpenSim.Framework.Communications.Cache
return null;
}
- ///
- /// Add an asset to both the persistent store and the cache.
- ///
- ///
public void AddAsset(AssetBase asset)
{
if (!m_memcache.Contains(asset.FullID))
@@ -371,13 +315,6 @@ namespace OpenSim.Framework.Communications.Cache
}
}
- ///
- /// Allows you to clear a specific asset by uuid out
- /// of the asset cache. This is needed because the osdynamic
- /// texture code grows the asset cache without bounds. The
- /// real solution here is a much better cache archicture, but
- /// this is a stop gap measure until we have such a thing.
- ///
public void ExpireAsset(UUID uuid)
{
// uuid is unique, so no need to worry about it showing up
@@ -393,7 +330,6 @@ namespace OpenSim.Framework.Communications.Cache
// See IAssetReceiver
public virtual void AssetReceived(AssetBase asset, bool IsTexture)
{
-
AssetInfo assetInf = new AssetInfo(asset);
if (!m_memcache.Contains(assetInf.FullID))
{
@@ -488,11 +424,6 @@ namespace OpenSim.Framework.Communications.Cache
return numPackets;
}
- ///
- /// Handle an asset request from the client. The result will be sent back asynchronously.
- ///
- ///
- ///
public void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest)
{
UUID requestID = UUID.Zero;
@@ -581,8 +512,8 @@ namespace OpenSim.Framework.Communications.Cache
{
req2 = new AssetRequestToClient();
}
- // Trying to limit memory usage by only creating AssetRequestToClient if needed
- //req2 = new AssetRequestToClient();
+
+ // Trying to limit memory usage by only creating AssetRequestToClient if needed
req2.AssetInf = req.AssetInf;
req2.AssetRequestSource = req.AssetRequestSource;
req2.DataPointer = req.DataPointer;
@@ -595,7 +526,6 @@ namespace OpenSim.Framework.Communications.Cache
req2.RequestAssetID = req.RequestAssetID;
req2.TransferRequestID = req.TransferRequestID;
req.RequestUser.SendAsset(req2);
-
}
//remove requests that have been completed
--
cgit v1.1