diff options
author | Diva Canto | 2015-05-07 19:24:08 -0700 |
---|---|---|
committer | Diva Canto | 2015-05-07 19:24:08 -0700 |
commit | c74cef0f4261191962959e42c7e349adafd42a04 (patch) | |
tree | 95ad098d2606b7d37a6b287816d9f6a02311860d /OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.zip opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.gz opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.bz2 opensim-SC_OLD-c74cef0f4261191962959e42c7e349adafd42a04.tar.xz |
Major change in the way inventory is downloaded: added a method throughout IIventoryService that fetches sets of folders at once. Also added folder id in the InventoryCollection data structure, so that we don't need to go to inventory server again just for that. This reduces the chatter between sims and inventory server by... a lot. On my tests, this reduces initial inventory download down to 30% of what it currently is.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory')
4 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index e13ee42..232cfdf 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -389,6 +389,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
389 | return connector.GetFolderContent(userID, folderID); | 389 | return connector.GetFolderContent(userID, folderID); |
390 | } | 390 | } |
391 | 391 | ||
392 | public InventoryCollection[] GetMultipleFoldersContent(UUID userID, UUID[] folderIDs) | ||
393 | { | ||
394 | string invURL = GetInventoryServiceURL(userID); | ||
395 | |||
396 | if (invURL == null) // not there, forward to local inventory connector to resolve | ||
397 | lock (m_Lock) | ||
398 | return m_LocalGridInventoryService.GetMultipleFoldersContent(userID, folderIDs); | ||
399 | |||
400 | else | ||
401 | { | ||
402 | InventoryCollection[] coll = new InventoryCollection[folderIDs.Length]; | ||
403 | int i = 0; | ||
404 | foreach (UUID fid in folderIDs) | ||
405 | coll[i++] = GetFolderContent(userID, fid); | ||
406 | |||
407 | return coll; | ||
408 | } | ||
409 | } | ||
410 | |||
392 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 411 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
393 | { | 412 | { |
394 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); | 413 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 499ca5e..71dc337 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
106 | if (m_Inventories.TryGetValue(userID, out inv)) | 106 | if (m_Inventories.TryGetValue(userID, out inv)) |
107 | { | 107 | { |
108 | c = new InventoryCollection(); | 108 | c = new InventoryCollection(); |
109 | c.UserID = userID; | 109 | c.OwnerID = userID; |
110 | 110 | ||
111 | c.Folders = inv.Folders.FindAll(delegate(InventoryFolderBase f) | 111 | c.Folders = inv.Folders.FindAll(delegate(InventoryFolderBase f) |
112 | { | 112 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index cbe0e37..75dd200 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -195,6 +195,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
195 | return invCol; | 195 | return invCol; |
196 | } | 196 | } |
197 | 197 | ||
198 | public virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs) | ||
199 | { | ||
200 | InventoryCollection[] invColl = new InventoryCollection[folderIDs.Length]; | ||
201 | int i = 0; | ||
202 | foreach (UUID fid in folderIDs) | ||
203 | { | ||
204 | invColl[i++] = GetFolderContent(principalID, fid); | ||
205 | } | ||
206 | |||
207 | return invColl; | ||
208 | |||
209 | } | ||
210 | |||
198 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 211 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
199 | { | 212 | { |
200 | return m_InventoryService.GetFolderItems(userID, folderID); | 213 | return m_InventoryService.GetFolderItems(userID, folderID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 166e4a1..9beb382 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -204,6 +204,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
204 | return invCol; | 204 | return invCol; |
205 | } | 205 | } |
206 | 206 | ||
207 | public virtual InventoryCollection[] GetMultipleFoldersContent(UUID principalID, UUID[] folderIDs) | ||
208 | { | ||
209 | return m_RemoteConnector.GetMultipleFoldersContent(principalID, folderIDs); | ||
210 | } | ||
211 | |||
207 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 212 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
208 | { | 213 | { |
209 | return m_RemoteConnector.GetFolderItems(userID, folderID); | 214 | return m_RemoteConnector.GetFolderItems(userID, folderID); |