Rename ISerializer and make ApplicationEnvironment's serizlier non-customizable (#159)
This commit is contained in:
Родитель
3baa593ad2
Коммит
39bd60dd11
|
@ -31,6 +31,7 @@ The following references must be changed:
|
||||||
- `ViewportRelativePercent` -> `VisibleDomainRelativePercent`
|
- `ViewportRelativePercent` -> `VisibleDomainRelativePercent`
|
||||||
- `Projection.ClipTimeToViewport` -> `Projection.ClipTimeToVisibleDomain`
|
- `Projection.ClipTimeToViewport` -> `Projection.ClipTimeToVisibleDomain`
|
||||||
- `Projection.AggregateInViewport` -> `Projection.AggregateInVisibleDomain`
|
- `Projection.AggregateInViewport` -> `Projection.AggregateInVisibleDomain`
|
||||||
|
- `ISerializer` -> `ITableConfigurationsSerializer`
|
||||||
|
|
||||||
## Obsolete Members
|
## Obsolete Members
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
using System;
|
||||||
using Microsoft.Performance.SDK.Extensibility.DataCooking;
|
using Microsoft.Performance.SDK.Extensibility.DataCooking;
|
||||||
using Microsoft.Performance.SDK.Extensibility.SourceParsing;
|
using Microsoft.Performance.SDK.Extensibility.SourceParsing;
|
||||||
using Microsoft.Performance.SDK.Processing;
|
using Microsoft.Performance.SDK.Processing;
|
||||||
|
using Microsoft.Performance.SDK.Runtime.DTO;
|
||||||
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.DataCookers;
|
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.DataCookers;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.Performance.SDK.Runtime
|
namespace Microsoft.Performance.SDK.Runtime
|
||||||
{
|
{
|
||||||
|
@ -27,9 +28,6 @@ namespace Microsoft.Performance.SDK.Runtime
|
||||||
/// <param name="tableDataSynchronizer">
|
/// <param name="tableDataSynchronizer">
|
||||||
/// Used to synchronize table data changes with the user interface.
|
/// Used to synchronize table data changes with the user interface.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="serializer">
|
|
||||||
/// Used to serialize/deserialize data (e.g. table configurations).
|
|
||||||
/// </param>
|
|
||||||
/// <param name="dataCookers">
|
/// <param name="dataCookers">
|
||||||
/// A repository of source data cookers.
|
/// A repository of source data cookers.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
@ -43,7 +41,6 @@ namespace Microsoft.Performance.SDK.Runtime
|
||||||
string applicationName,
|
string applicationName,
|
||||||
string runtimeName,
|
string runtimeName,
|
||||||
ITableDataSynchronization tableDataSynchronizer,
|
ITableDataSynchronization tableDataSynchronizer,
|
||||||
ISerializer serializer,
|
|
||||||
ISourceDataCookerRepository dataCookers,
|
ISourceDataCookerRepository dataCookers,
|
||||||
ISourceSessionFactory sourceSessionFactory,
|
ISourceSessionFactory sourceSessionFactory,
|
||||||
IMessageBox messageBox)
|
IMessageBox messageBox)
|
||||||
|
@ -51,7 +48,6 @@ namespace Microsoft.Performance.SDK.Runtime
|
||||||
// application and runtime names may be null
|
// application and runtime names may be null
|
||||||
|
|
||||||
Guard.NotNull(tableDataSynchronizer, nameof(tableDataSynchronizer));
|
Guard.NotNull(tableDataSynchronizer, nameof(tableDataSynchronizer));
|
||||||
Guard.NotNull(serializer, nameof(serializer));
|
|
||||||
Guard.NotNull(dataCookers, nameof(dataCookers));
|
Guard.NotNull(dataCookers, nameof(dataCookers));
|
||||||
Guard.NotNull(sourceSessionFactory, nameof(sourceSessionFactory));
|
Guard.NotNull(sourceSessionFactory, nameof(sourceSessionFactory));
|
||||||
Guard.NotNull(messageBox, nameof(messageBox));
|
Guard.NotNull(messageBox, nameof(messageBox));
|
||||||
|
@ -64,7 +60,7 @@ namespace Microsoft.Performance.SDK.Runtime
|
||||||
// _CDS_
|
// _CDS_
|
||||||
// todo:when tests are ready, consider checking that columnController is not null
|
// todo:when tests are ready, consider checking that columnController is not null
|
||||||
|
|
||||||
this.Serializer = serializer;
|
this.Serializer = new TableConfigurationsSerializer();
|
||||||
this.TableDataSynchronizer = tableDataSynchronizer;
|
this.TableDataSynchronizer = tableDataSynchronizer;
|
||||||
this.SourceDataCookerFactoryRetrieval = dataCookers;
|
this.SourceDataCookerFactoryRetrieval = dataCookers;
|
||||||
this.SourceSessionFactory = sourceSessionFactory;
|
this.SourceSessionFactory = sourceSessionFactory;
|
||||||
|
@ -80,7 +76,7 @@ namespace Microsoft.Performance.SDK.Runtime
|
||||||
public bool IsInteractive { get; set; }
|
public bool IsInteractive { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ISerializer Serializer { get; }
|
public ITableConfigurationsSerializer Serializer { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ITableDataSynchronization TableDataSynchronizer { get; }
|
public ITableDataSynchronization TableDataSynchronizer { get; }
|
||||||
|
|
|
@ -13,14 +13,14 @@ using Microsoft.Performance.SDK.Processing;
|
||||||
namespace Microsoft.Performance.SDK.Runtime.DTO
|
namespace Microsoft.Performance.SDK.Runtime.DTO
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to de/serialize table configurations from/to a stream.
|
/// Used to de/serialize <see cref="TableConfigurations"/> instances from/to a stream.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TableConfigurationsSerializer
|
public class TableConfigurationsSerializer
|
||||||
: ISerializer
|
: ITableConfigurationsSerializer
|
||||||
{
|
{
|
||||||
private const string indentChars = " ";
|
private const string indentChars = " ";
|
||||||
|
|
||||||
private static Lazy<(double Version, Type PrebuiltConfigType)[]> versionToTypeLazy
|
private static Lazy<(double Version, Type PrebuiltConfigType)[]> versionToTypeLazy
|
||||||
= new Lazy<(double Version, Type PrebuiltConfigType)[]>(() =>
|
= new Lazy<(double Version, Type PrebuiltConfigType)[]>(() =>
|
||||||
{
|
{
|
||||||
var assembly = typeof(PrebuiltConfigurationsBase).Assembly;
|
var assembly = typeof(PrebuiltConfigurationsBase).Assembly;
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.Tables
|
||||||
ITableExtensionReference,
|
ITableExtensionReference,
|
||||||
IEquatable<TableExtensionReference>
|
IEquatable<TableExtensionReference>
|
||||||
{
|
{
|
||||||
private static ISerializer tableConfigSerializer = new TableConfigurationsSerializer();
|
private static ITableConfigurationsSerializer tableConfigSerializer = new TableConfigurationsSerializer();
|
||||||
|
|
||||||
private TableDescriptor tableDescriptor;
|
private TableDescriptor tableDescriptor;
|
||||||
private Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction;
|
private Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction;
|
||||||
|
@ -169,7 +169,7 @@ namespace Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.Tables
|
||||||
/// <list type="bullet">
|
/// <list type="bullet">
|
||||||
/// <item>
|
/// <item>
|
||||||
/// must expose a valid <see cref="TableDescriptor"/>.
|
/// must expose a valid <see cref="TableDescriptor"/>.
|
||||||
/// See <see cref="TableDescriptorFactory.TryCreate(Type, ISerializer, out TableDescriptor)"/>
|
/// See <see cref="TableDescriptorFactory.TryCreate(Type, ITableConfigurationsSerializer, out TableDescriptor)"/>
|
||||||
/// for details on how a table is to expose a descriptor.
|
/// for details on how a table is to expose a descriptor.
|
||||||
/// </item>
|
/// </item>
|
||||||
/// </list>
|
/// </list>
|
||||||
|
@ -236,7 +236,7 @@ namespace Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.Tables
|
||||||
/// <list type="bullet">
|
/// <list type="bullet">
|
||||||
/// <item>
|
/// <item>
|
||||||
/// must expose a valid <see cref="TableDescriptor"/>.
|
/// must expose a valid <see cref="TableDescriptor"/>.
|
||||||
/// See <see cref="TableDescriptorFactory.TryCreate(Type, ISerializer, out TableDescriptor)"/>
|
/// See <see cref="TableDescriptorFactory.TryCreate(Type, ITableConfigurationsSerializer, out TableDescriptor)"/>
|
||||||
/// for details on how a table is to expose a descriptor.
|
/// for details on how a table is to expose a descriptor.
|
||||||
/// </item>
|
/// </item>
|
||||||
/// </list>
|
/// </list>
|
||||||
|
|
|
@ -12,15 +12,15 @@ namespace Microsoft.Performance.SDK.Tests
|
||||||
{
|
{
|
||||||
public FakeTableProvider()
|
public FakeTableProvider()
|
||||||
{
|
{
|
||||||
this.DiscoverCalls = new List<ISerializer>();
|
this.DiscoverCalls = new List<ITableConfigurationsSerializer>();
|
||||||
this.DiscoverReturnValue = Array.Empty<DiscoveredTable>();
|
this.DiscoverReturnValue = Array.Empty<DiscoveredTable>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ISerializer> DiscoverCalls { get; }
|
public List<ITableConfigurationsSerializer> DiscoverCalls { get; }
|
||||||
|
|
||||||
public IEnumerable<DiscoveredTable> DiscoverReturnValue { get; set; }
|
public IEnumerable<DiscoveredTable> DiscoverReturnValue { get; set; }
|
||||||
|
|
||||||
public IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer)
|
public IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
this.DiscoverCalls.Add(tableConfigSerializer);
|
this.DiscoverCalls.Add(tableConfigSerializer);
|
||||||
return this.DiscoverReturnValue;
|
return this.DiscoverReturnValue;
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Microsoft.Performance.SDK.Tests
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class ProcessingSourceTests
|
public class ProcessingSourceTests
|
||||||
{
|
{
|
||||||
private ISerializer serializer = new FakeSerializer();
|
private ITableConfigurationsSerializer serializer = new FakeSerializer();
|
||||||
private IApplicationEnvironment applicationEnvironment = new StubApplicationEnvironment() { Serializer = new FakeSerializer() };
|
private IApplicationEnvironment applicationEnvironment = new StubApplicationEnvironment() { Serializer = new FakeSerializer() };
|
||||||
|
|
||||||
[TestCleanup]
|
[TestCleanup]
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.Performance.SDK.Tests
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class TableDescriptorFactoryTests
|
public class TableDescriptorFactoryTests
|
||||||
{
|
{
|
||||||
private static ISerializer serializer = new FakeSerializer();
|
private static ITableConfigurationsSerializer serializer = new FakeSerializer();
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
[UnitTest]
|
[UnitTest]
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.Performance.SDK.Tests
|
||||||
internal static class TableDescriptorUtils
|
internal static class TableDescriptorUtils
|
||||||
{
|
{
|
||||||
internal static List<TableDescriptor> CreateTableDescriptors(
|
internal static List<TableDescriptor> CreateTableDescriptors(
|
||||||
ISerializer serializer,
|
ITableConfigurationsSerializer serializer,
|
||||||
params Type[] types)
|
params Type[] types)
|
||||||
{
|
{
|
||||||
CreateTableDescriptors(serializer, out var descriptors, out _, out _, types);
|
CreateTableDescriptors(serializer, out var descriptors, out _, out _, types);
|
||||||
|
@ -21,7 +21,7 @@ namespace Microsoft.Performance.SDK.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void CreateTableDescriptors(
|
internal static void CreateTableDescriptors(
|
||||||
ISerializer serializer,
|
ITableConfigurationsSerializer serializer,
|
||||||
out List<TableDescriptor> descriptors,
|
out List<TableDescriptor> descriptors,
|
||||||
out List<Action<ITableBuilder, IDataExtensionRetrieval>> buildActions,
|
out List<Action<ITableBuilder, IDataExtensionRetrieval>> buildActions,
|
||||||
out List<bool> isInternal,
|
out List<bool> isInternal,
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Microsoft.Performance.SDK.Tests.TestClasses
|
||||||
|
|
||||||
public bool IsInteractive { get; set; }
|
public bool IsInteractive { get; set; }
|
||||||
|
|
||||||
public ISerializer Serializer { get; set; }
|
public ITableConfigurationsSerializer Serializer { get; set; }
|
||||||
|
|
||||||
public ITableDataSynchronization TableDataSynchronizer { get; set; }
|
public ITableDataSynchronization TableDataSynchronizer { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
using System;
|
||||||
using Microsoft.Performance.SDK.Extensibility.DataCooking;
|
using Microsoft.Performance.SDK.Extensibility.DataCooking;
|
||||||
using Microsoft.Performance.SDK.Extensibility.SourceParsing;
|
using Microsoft.Performance.SDK.Extensibility.SourceParsing;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.Performance.SDK.Processing
|
namespace Microsoft.Performance.SDK.Processing
|
||||||
{
|
{
|
||||||
|
@ -34,9 +34,9 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
bool IsInteractive { get; }
|
bool IsInteractive { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the serializer to use for deserializing table configurations.
|
/// Gets the serializer to use for deserializing <see cref="TableConfiguration"/> instances.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ISerializer Serializer { get; }
|
ITableConfigurationsSerializer Serializer { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides the interface to be used to notify that data in
|
/// Provides the interface to be used to notify that data in
|
||||||
|
|
|
@ -7,10 +7,10 @@ using System.IO;
|
||||||
namespace Microsoft.Performance.SDK.Processing
|
namespace Microsoft.Performance.SDK.Processing
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to perform serialization operations against <see cref="TableConfiguration"/>
|
/// Used to perform serialization operations against <see cref="TableConfigurations"/>
|
||||||
/// instances.
|
/// instances.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISerializer
|
public interface ITableConfigurationsSerializer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deserializes the content of a <see cref="Stream"/> into a collection
|
/// Deserializes the content of a <see cref="Stream"/> into a collection
|
|
@ -21,6 +21,6 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
/// A collection of tables. Each <see cref="DiscoveredTable"/> in the collection must have
|
/// A collection of tables. Each <see cref="DiscoveredTable"/> in the collection must have
|
||||||
/// a unique <see cref="TableDescriptor"/>.
|
/// a unique <see cref="TableDescriptor"/>.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer);
|
IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,7 +296,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeAllTables(ISerializer tableConfigSerializer)
|
private void InitializeAllTables(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
Debug.Assert(tableConfigSerializer != null);
|
Debug.Assert(tableConfigSerializer != null);
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
public static TableConfigurations GetPrebuiltTableConfigurations(
|
public static TableConfigurations GetPrebuiltTableConfigurations(
|
||||||
Type tableType,
|
Type tableType,
|
||||||
Guid tableId,
|
Guid tableId,
|
||||||
ISerializer serializer)
|
ITableConfigurationsSerializer serializer)
|
||||||
{
|
{
|
||||||
return GetPrebuiltTableConfigurations(tableType, tableId, serializer, null);
|
return GetPrebuiltTableConfigurations(tableType, tableId, serializer, null);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
public static TableConfigurations GetPrebuiltTableConfigurations(
|
public static TableConfigurations GetPrebuiltTableConfigurations(
|
||||||
Type tableType,
|
Type tableType,
|
||||||
Guid tableId,
|
Guid tableId,
|
||||||
ISerializer serializer,
|
ITableConfigurationsSerializer serializer,
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
Guard.NotNull(serializer, nameof(serializer));
|
Guard.NotNull(serializer, nameof(serializer));
|
||||||
|
@ -136,7 +136,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
private static TableConfigurations GetPrebuiltConfigurationFromExternalFile(
|
private static TableConfigurations GetPrebuiltConfigurationFromExternalFile(
|
||||||
Type tableType,
|
Type tableType,
|
||||||
Guid tableId,
|
Guid tableId,
|
||||||
ISerializer serializer,
|
ITableConfigurationsSerializer serializer,
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
var tableAttribute = tableType.GetCustomAttribute<PrebuiltConfigurationsFilePathAttribute>();
|
var tableAttribute = tableType.GetCustomAttribute<PrebuiltConfigurationsFilePathAttribute>();
|
||||||
|
@ -203,7 +203,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
private static TableConfigurations GetPrebuiltConfigurationFromEmbeddedResource(
|
private static TableConfigurations GetPrebuiltConfigurationFromEmbeddedResource(
|
||||||
Type tableType,
|
Type tableType,
|
||||||
Guid tableId,
|
Guid tableId,
|
||||||
ISerializer serializer,
|
ITableConfigurationsSerializer serializer,
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
var tableAttribute = tableType.GetCustomAttribute<PrebuiltConfigurationsEmbeddedResourceAttribute>();
|
var tableAttribute = tableType.GetCustomAttribute<PrebuiltConfigurationsEmbeddedResourceAttribute>();
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static bool TryCreate(
|
public static bool TryCreate(
|
||||||
Type type,
|
Type type,
|
||||||
ISerializer tableConfigSerializer,
|
ITableConfigurationsSerializer tableConfigSerializer,
|
||||||
out TableDescriptor tableDescriptor)
|
out TableDescriptor tableDescriptor)
|
||||||
{
|
{
|
||||||
return TryCreate(type, tableConfigSerializer, out tableDescriptor, out var buildTableAction);
|
return TryCreate(type, tableConfigSerializer, out tableDescriptor, out var buildTableAction);
|
||||||
|
@ -98,7 +98,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static bool TryCreate(
|
public static bool TryCreate(
|
||||||
Type type,
|
Type type,
|
||||||
ISerializer tableConfigSerializer,
|
ITableConfigurationsSerializer tableConfigSerializer,
|
||||||
out TableDescriptor tableDescriptor,
|
out TableDescriptor tableDescriptor,
|
||||||
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction)
|
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static bool TryCreate(
|
public static bool TryCreate(
|
||||||
Type type,
|
Type type,
|
||||||
ISerializer tableConfigSerializer,
|
ITableConfigurationsSerializer tableConfigSerializer,
|
||||||
out TableDescriptor tableDescriptor,
|
out TableDescriptor tableDescriptor,
|
||||||
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction,
|
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction,
|
||||||
out Func<IDataExtensionRetrieval, bool> isDataAvailableFunc)
|
out Func<IDataExtensionRetrieval, bool> isDataAvailableFunc)
|
||||||
|
@ -208,7 +208,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static bool TryCreate(
|
public static bool TryCreate(
|
||||||
Type type,
|
Type type,
|
||||||
ISerializer tableConfigSerializer,
|
ITableConfigurationsSerializer tableConfigSerializer,
|
||||||
ILogger logger,
|
ILogger logger,
|
||||||
out TableDescriptor tableDescriptor,
|
out TableDescriptor tableDescriptor,
|
||||||
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction,
|
out Action<ITableBuilder, IDataExtensionRetrieval> buildTableAction,
|
||||||
|
@ -276,7 +276,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
private static TableDescriptor GetTableDescriptor(
|
private static TableDescriptor GetTableDescriptor(
|
||||||
Type type,
|
Type type,
|
||||||
string propertyName,
|
string propertyName,
|
||||||
ISerializer tableConfigSerializer,
|
ITableConfigurationsSerializer tableConfigSerializer,
|
||||||
ILogger logger)
|
ILogger logger)
|
||||||
{
|
{
|
||||||
Debug.Assert(type != null, $"Parameter {nameof(type)} cannot be null.");
|
Debug.Assert(type != null, $"Parameter {nameof(type)} cannot be null.");
|
||||||
|
|
|
@ -152,7 +152,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
private static IEnumerable<DiscoveredTable> DoAssemblyDiscovery(
|
private static IEnumerable<DiscoveredTable> DoAssemblyDiscovery(
|
||||||
IEnumerable<Assembly> assemblies,
|
IEnumerable<Assembly> assemblies,
|
||||||
Func<Type, bool> typeFilter,
|
Func<Type, bool> typeFilter,
|
||||||
ISerializer tableConfigSerializer)
|
ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
Debug.Assert(assemblies != null);
|
Debug.Assert(assemblies != null);
|
||||||
Debug.Assert(typeFilter != null);
|
Debug.Assert(typeFilter != null);
|
||||||
|
@ -186,7 +186,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
this.assembly = assembly;
|
this.assembly = assembly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer)
|
public IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
return DoAssemblyDiscovery(new[] { assembly, }, _ => true, tableConfigSerializer);
|
return DoAssemblyDiscovery(new[] { assembly, }, _ => true, tableConfigSerializer);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ namespace Microsoft.Performance.SDK.Processing
|
||||||
this.assemblies = assemblies;
|
this.assemblies = assemblies;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer)
|
public IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
return DoAssemblyDiscovery(
|
return DoAssemblyDiscovery(
|
||||||
this.assemblies,
|
this.assemblies,
|
||||||
|
|
|
@ -9,7 +9,7 @@ using Microsoft.Performance.SDK.Processing;
|
||||||
namespace Microsoft.Performance.Testing.SDK
|
namespace Microsoft.Performance.Testing.SDK
|
||||||
{
|
{
|
||||||
public sealed class FakeSerializer
|
public sealed class FakeSerializer
|
||||||
: ISerializer
|
: ITableConfigurationsSerializer
|
||||||
{
|
{
|
||||||
public IEnumerable<TableConfigurations> DeserializeTableConfigurations(Stream stream)
|
public IEnumerable<TableConfigurations> DeserializeTableConfigurations(Stream stream)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Microsoft.Performance.Testing.SDK
|
||||||
|
|
||||||
public bool IsInteractive { get; set; }
|
public bool IsInteractive { get; set; }
|
||||||
|
|
||||||
public ISerializer Serializer { get; set; }
|
public ITableConfigurationsSerializer Serializer { get; set; }
|
||||||
|
|
||||||
public ITableDataSynchronization TableDataSynchronizer { get; set; }
|
public ITableDataSynchronization TableDataSynchronizer { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace Microsoft.Performance.Toolkit.Engine.Tests.TestCookers.Source123
|
||||||
private sealed class Discovery
|
private sealed class Discovery
|
||||||
: ITableProvider
|
: ITableProvider
|
||||||
{
|
{
|
||||||
public IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer)
|
public IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
return new HashSet<DiscoveredTable>
|
return new HashSet<DiscoveredTable>
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace Microsoft.Performance.Toolkit.Engine.Tests.TestCookers.Source5
|
||||||
private static readonly ITableProvider DefaultProvider
|
private static readonly ITableProvider DefaultProvider
|
||||||
= TableDiscovery.CreateForAssembly(typeof(Source5DataSource).Assembly);
|
= TableDiscovery.CreateForAssembly(typeof(Source5DataSource).Assembly);
|
||||||
|
|
||||||
public IEnumerable<DiscoveredTable> Discover(ISerializer tableConfigSerializer)
|
public IEnumerable<DiscoveredTable> Discover(ITableConfigurationsSerializer tableConfigSerializer)
|
||||||
{
|
{
|
||||||
var tables = new HashSet<DiscoveredTable>(DefaultProvider.Discover(tableConfigSerializer));
|
var tables = new HashSet<DiscoveredTable>(DefaultProvider.Discover(tableConfigSerializer));
|
||||||
tables.Add(
|
tables.Add(
|
||||||
|
|
|
@ -12,7 +12,6 @@ using Microsoft.Performance.SDK;
|
||||||
using Microsoft.Performance.SDK.Extensibility;
|
using Microsoft.Performance.SDK.Extensibility;
|
||||||
using Microsoft.Performance.SDK.Processing;
|
using Microsoft.Performance.SDK.Processing;
|
||||||
using Microsoft.Performance.SDK.Runtime;
|
using Microsoft.Performance.SDK.Runtime;
|
||||||
using Microsoft.Performance.SDK.Runtime.DTO;
|
|
||||||
using Microsoft.Performance.SDK.Runtime.Extensibility;
|
using Microsoft.Performance.SDK.Runtime.Extensibility;
|
||||||
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions;
|
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions;
|
||||||
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.Repository;
|
using Microsoft.Performance.SDK.Runtime.Extensibility.DataExtensions.Repository;
|
||||||
|
@ -758,7 +757,6 @@ namespace Microsoft.Performance.Toolkit.Engine
|
||||||
applicationName: applicationName,
|
applicationName: applicationName,
|
||||||
runtimeName: runtimeName,
|
runtimeName: runtimeName,
|
||||||
new RuntimeTableSynchronizer(),
|
new RuntimeTableSynchronizer(),
|
||||||
new TableConfigurationsSerializer(),
|
|
||||||
instance.Extensions,
|
instance.Extensions,
|
||||||
instance.Factory.CreateSourceSessionFactory(),
|
instance.Factory.CreateSourceSessionFactory(),
|
||||||
createInfo.IsInteractive
|
createInfo.IsInteractive
|
||||||
|
|
Загрузка…
Ссылка в новой задаче