diff options
author | Justin Clarke Casey | 2009-03-06 20:12:08 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-03-06 20:12:08 +0000 |
commit | 85774de2310141f4311bc3df1946d44df9ddde59 (patch) | |
tree | e86febe5873121d9a529f6d77a2a7ee929030425 /OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |
parent | * Protects RestClient from crashing with dictionary exception, which leads to... (diff) | |
download | opensim-SC_OLD-85774de2310141f4311bc3df1946d44df9ddde59.zip opensim-SC_OLD-85774de2310141f4311bc3df1946d44df9ddde59.tar.gz opensim-SC_OLD-85774de2310141f4311bc3df1946d44df9ddde59.tar.bz2 opensim-SC_OLD-85774de2310141f4311bc3df1946d44df9ddde59.tar.xz |
* Improve memory usage when writing OARs
* This should make saving large OARs a somewhat better experience
* However, the problem where saving an archive pulls large numbers of assets into the asset cache isn't yet resolved
* This patch also removes lots of archive writing spam that crept in
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index b5aa0f3..cc4eadb 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -85,17 +85,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
85 | 85 | ||
86 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); | 86 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); |
87 | 87 | ||
88 | TarArchiveWriter archive = new TarArchiveWriter(); | 88 | TarArchiveWriter archive = new TarArchiveWriter(m_saveStream); |
89 | 89 | ||
90 | // Write out control file | 90 | // Write out control file |
91 | archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); | 91 | archive.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); |
92 | 92 | ||
93 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | 93 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); |
94 | 94 | ||
95 | // Write out region settings | 95 | // Write out region settings |
96 | string settingsPath | 96 | string settingsPath |
97 | = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); | 97 | = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); |
98 | archive.AddFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); | 98 | archive.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); |
99 | 99 | ||
100 | m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); | 100 | m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); |
101 | 101 | ||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
105 | 105 | ||
106 | MemoryStream ms = new MemoryStream(); | 106 | MemoryStream ms = new MemoryStream(); |
107 | m_terrainModule.SaveToStream(terrainPath, ms); | 107 | m_terrainModule.SaveToStream(terrainPath, ms); |
108 | archive.AddFile(terrainPath, ms.ToArray()); | 108 | archive.WriteFile(terrainPath, ms.ToArray()); |
109 | ms.Close(); | 109 | ms.Close(); |
110 | 110 | ||
111 | m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); | 111 | m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); |
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
125 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), | 125 | Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), |
126 | sceneObject.UUID); | 126 | sceneObject.UUID); |
127 | 127 | ||
128 | archive.AddFile(filename, serializedObject); | 128 | archive.WriteFile(filename, serializedObject); |
129 | } | 129 | } |
130 | 130 | ||
131 | m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); | 131 | m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); |
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
134 | AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); | 134 | AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); |
135 | assetsArchiver.Archive(archive); | 135 | assetsArchiver.Archive(archive); |
136 | 136 | ||
137 | archive.WriteTar(m_saveStream); | 137 | archive.Close(); |
138 | 138 | ||
139 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive for {0}", m_scene.RegionInfo.RegionName); | 139 | m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive for {0}", m_scene.RegionInfo.RegionName); |
140 | 140 | ||