diff options
author | Justin Clark-Casey (justincc) | 2015-01-08 20:21:40 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-01-08 20:21:40 +0000 |
commit | 08606ae409b400b6f9b83006ed04826eede8a9c7 (patch) | |
tree | b11e1ebfa99dfda28aa3df22041c6e3d167491ce /OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |
parent | Commented out clear_registry_ because (1) it isn't clearing up anything anymo... (diff) | |
download | opensim-SC_OLD-08606ae409b400b6f9b83006ed04826eede8a9c7.zip opensim-SC_OLD-08606ae409b400b6f9b83006ed04826eede8a9c7.tar.gz opensim-SC_OLD-08606ae409b400b6f9b83006ed04826eede8a9c7.tar.bz2 opensim-SC_OLD-08606ae409b400b6f9b83006ed04826eede8a9c7.tar.xz |
Make the IteratingUuidGatherer the only UuidGatherer.
This UUID gatherer provides a superset of the previous gatherer's functionality
as it also allows the caller to control gathering iterations for load purposes.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 2ac1517..6343a81 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -412,12 +412,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
412 | 412 | ||
413 | // The act of gathering UUIDs downloads some assets from the remote server | 413 | // The act of gathering UUIDs downloads some assets from the remote server |
414 | // but not all... | 414 | // but not all... |
415 | Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); | ||
416 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); | 415 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); |
417 | uuidGatherer.GatherAssetUuids(assetID, meta.Type, ids); | 416 | uuidGatherer.AddForInspection(assetID); |
418 | m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", ids.Count); | 417 | uuidGatherer.GatherAll(); |
418 | |||
419 | m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", uuidGatherer.GatheredUuids.Count); | ||
419 | bool success = true; | 420 | bool success = true; |
420 | foreach (UUID uuid in ids.Keys) | 421 | foreach (UUID uuid in uuidGatherer.GatheredUuids.Keys) |
421 | if (FetchAsset(userAssetURL, uuid) == null) | 422 | if (FetchAsset(userAssetURL, uuid) == null) |
422 | success = false; | 423 | success = false; |
423 | 424 | ||
@@ -428,7 +429,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
428 | m_log.DebugFormat("[HG ASSET MAPPER]: Successfully got item {0} from asset server {1}", assetID, userAssetURL); | 429 | m_log.DebugFormat("[HG ASSET MAPPER]: Successfully got item {0} from asset server {1}", assetID, userAssetURL); |
429 | } | 430 | } |
430 | 431 | ||
431 | |||
432 | public void Post(UUID assetID, UUID ownerID, string userAssetURL) | 432 | public void Post(UUID assetID, UUID ownerID, string userAssetURL) |
433 | { | 433 | { |
434 | m_log.DebugFormat("[HG ASSET MAPPER]: Starting to send asset {0} with children to asset server {1}", assetID, userAssetURL); | 434 | m_log.DebugFormat("[HG ASSET MAPPER]: Starting to send asset {0} with children to asset server {1}", assetID, userAssetURL); |
@@ -442,9 +442,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
442 | return; | 442 | return; |
443 | } | 443 | } |
444 | 444 | ||
445 | Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); | ||
446 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); | 445 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); |
447 | uuidGatherer.GatherAssetUuids(asset.FullID, asset.Type, ids); | 446 | uuidGatherer.AddForInspection(asset.FullID); |
448 | 447 | ||
449 | // Check which assets already exist in the destination server | 448 | // Check which assets already exist in the destination server |
450 | 449 | ||
@@ -452,16 +451,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
452 | if (!url.EndsWith("/") && !url.EndsWith("=")) | 451 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
453 | url = url + "/"; | 452 | url = url + "/"; |
454 | 453 | ||
455 | string[] remoteAssetIDs = new string[ids.Count]; | 454 | string[] remoteAssetIDs = new string[uuidGatherer.GatheredUuids.Count]; |
456 | int i = 0; | 455 | int i = 0; |
457 | foreach (UUID id in ids.Keys) | 456 | foreach (UUID id in uuidGatherer.GatheredUuids.Keys) |
458 | remoteAssetIDs[i++] = url + id.ToString(); | 457 | remoteAssetIDs[i++] = url + id.ToString(); |
459 | 458 | ||
460 | bool[] exist = m_scene.AssetService.AssetsExist(remoteAssetIDs); | 459 | bool[] exist = m_scene.AssetService.AssetsExist(remoteAssetIDs); |
461 | 460 | ||
462 | var existSet = new HashSet<string>(); | 461 | var existSet = new HashSet<string>(); |
463 | i = 0; | 462 | i = 0; |
464 | foreach (UUID id in ids.Keys) | 463 | foreach (UUID id in uuidGatherer.GatheredUuids.Keys) |
465 | { | 464 | { |
466 | if (exist[i]) | 465 | if (exist[i]) |
467 | existSet.Add(id.ToString()); | 466 | existSet.Add(id.ToString()); |
@@ -472,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
472 | 471 | ||
473 | bool success = true; | 472 | bool success = true; |
474 | 473 | ||
475 | foreach (UUID uuid in ids.Keys) | 474 | foreach (UUID uuid in uuidGatherer.GatheredUuids.Keys) |
476 | { | 475 | { |
477 | if (!existSet.Contains(uuid.ToString())) | 476 | if (!existSet.Contains(uuid.ToString())) |
478 | { | 477 | { |