Changeset 16553
- Timestamp:
- 01/24/19 19:22:44 (6 years ago)
- Location:
- branches/2520_PersistenceReintegration
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2520_PersistenceReintegration/HeuristicLab.Clients.Hive/3.3/Util/PersistenceUtil.cs
r16480 r16553 24 24 using System.IO; 25 25 using HEAL.Fossil; 26 using HeuristicLab.Persistence.Default.Xml; 26 27 27 28 namespace HeuristicLab.Clients.Hive { 28 29 public static class PersistenceUtil { 29 30 public static byte[] Serialize(object obj, out IEnumerable<Type> types) { 30 using (MemoryStream memStream = new MemoryStream()) { 31 throw new NotImplementedException("Not supported by HEAL.Fossil yet."); // TODO 32 // XmlGenerator.Serialize(obj, memStream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, out types); 33 // byte[] jobByteArray = memStream.ToArray(); 34 // return jobByteArray; 35 } 31 var ser = new ProtoBufSerializer(); 32 return ser.Serialize(obj, out types); 36 33 } 37 34 … … 43 40 public static T Deserialize<T>(byte[] sjob) { 44 41 var ser = new ProtoBufSerializer(); 45 return (T)ser.Deserialize(sjob); 42 try { 43 return (T)ser.Deserialize(sjob); 44 } catch (Exception) { 45 // retry with old persistence 46 using (MemoryStream memStream = new MemoryStream(sjob)) { 47 return XmlParser.Deserialize<T>(memStream); 48 } 49 } 46 50 } 47 51 } -
branches/2520_PersistenceReintegration/HeuristicLab.Hive/3.3/HeuristicLab.Hive-3.3.csproj
r16452 r16553 89 89 </PropertyGroup> 90 90 <ItemGroup> 91 <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> 92 <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath> 93 </Reference> 94 <Reference Include="HEAL.Fossil, Version=1.0.2.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 95 <HintPath>..\..\packages\HEAL.Fossil.1.0.2-pre-02\lib\netstandard2.0\HEAL.Fossil.dll</HintPath> 96 </Reference> 91 97 <Reference Include="System" /> 92 98 <Reference Include="System.Core" /> 93 99 <Reference Include="System.Drawing" /> 100 <Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> 101 <HintPath>..\..\packages\System.Drawing.Common.4.5.1\lib\net461\System.Drawing.Common.dll</HintPath> 102 </Reference> 94 103 <Reference Include="System.Xml.Linq" /> 95 104 <Reference Include="System.Data.DataSetExtensions" /> … … 98 107 </ItemGroup> 99 108 <ItemGroup> 109 <None Include="packages.config" /> 100 110 <None Include="Properties\AssemblyInfo.cs.frame" /> 101 111 <None Include="Plugin.cs.frame" /> -
branches/2520_PersistenceReintegration/HeuristicLab.Hive/3.3/ITask.cs
r16453 r16553 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HEAL.Fossil; 25 26 26 27 namespace HeuristicLab.Hive { 28 [StorableType("197BB925-85AD-4DAE-A5F8-9EC33C07A0AF")] 27 29 public interface ITask : IDeepCloneable, ICloneable { 28 30 TimeSpan ExecutionTime { get; }
Note: See TracChangeset
for help on using the changeset viewer.