Skip to content

Commit

Permalink
Remove Microsoft.ServiceFabric.Internal references (#377)
Browse files Browse the repository at this point in the history
The `Microsoft.ServiceFabric.Internal.dll` was introduced years ago as an assembly meant to be used by the Service Fabric SDK packages instead of the `System.Fabric.dll`. The `Microsoft.ServiceFabric.Internal` assembly includes a subset of the types from `System.Fabric` with the exception of a few internal types.

However, both of these DLLs are now included in the `Microsoft.ServiceFabric` NuGet package and most Service Fabric .NET services, reference both of them. With the original intent abandoned, there is no clear value in keeping the `Microsoft.ServiceFabric.Internal.dll`. Removing it from the Service Fabric Runtime and SDK eliminates the cost of maintaining it and reduces unnecessary complexity and cognitive load on the engineers.

See [Windows Fabric PR](https://dev.azure.com/msazure/One/_git/WindowsFabric/pullrequest/10327808) for more.

* Remove Microsoft.ServiceFabric.Internal references
* Reference runtime packages with build number 1928
* Increment internal package version to 8.0.7
  • Loading branch information
olegsych authored Aug 21, 2024
1 parent 6f7dc80 commit 7529176
Show file tree
Hide file tree
Showing 48 changed files with 46 additions and 220 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@
<File Include="$(DropFolderNetStandard_Win)Microsoft.ServiceFabric.ReliableCollection.Interop.dll">
<TargetPath>build\netcoreapp2.0</TargetPath>
</File>
<File Include="$(DropFolderNetStandard_Win)Microsoft.ServiceFabric.Internal.dll">
<TargetPath>build\netcoreapp2.0</TargetPath>
</File>
<File Include="$(DropFolderNetStandard_Win)Microsoft.ServiceFabric.Internal.Strings.dll">
<TargetPath>build\netcoreapp2.0</TargetPath>
</File>
<File Include="$(DropFolderNetStandard_Win)System.Fabric.dll">
<TargetPath>build\netcoreapp2.0</TargetPath>
</File>
Expand Down
10 changes: 5 additions & 5 deletions properties/service_fabric_common.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

<!-- Set Versions. These are used for generating Assemblies and Nuget packages. -->
<!-- Versions used for Microsoft.ServiceFabric.* nuget packages from other repos.-->
<NugetPkg_Version_Microsoft_ServiceFabric>11.0.1004</NugetPkg_Version_Microsoft_ServiceFabric>
<NugetPkg_Version_Microsoft_ServiceFabric_Diagnostics_Internal>8.0.1004</NugetPkg_Version_Microsoft_ServiceFabric_Diagnostics_Internal>
<NugetPkg_Version_Microsoft_ServiceFabric_Data>8.0.1004</NugetPkg_Version_Microsoft_ServiceFabric_Data>
<NugetPkg_Version_Microsoft_ServiceFabric_FabricTransport_Internal>8.0.1004</NugetPkg_Version_Microsoft_ServiceFabric_FabricTransport_Internal>
<NugetPkg_Version_Microsoft_ServiceFabric>11.0.1928</NugetPkg_Version_Microsoft_ServiceFabric>
<NugetPkg_Version_Microsoft_ServiceFabric_Diagnostics_Internal>8.0.1928</NugetPkg_Version_Microsoft_ServiceFabric_Diagnostics_Internal>
<NugetPkg_Version_Microsoft_ServiceFabric_Data>8.0.1928</NugetPkg_Version_Microsoft_ServiceFabric_Data>
<NugetPkg_Version_Microsoft_ServiceFabric_FabricTransport_Internal>8.0.1928</NugetPkg_Version_Microsoft_ServiceFabric_FabricTransport_Internal>

<!-- Version for binaries, nuget packages generated from this repo. -->
<!-- TODO: Versions numbers are changed here manually for now, Integrate this with GitVersion. -->
<MajorVersion>8</MajorVersion>
<MinorVersion>0</MinorVersion>
<BuildVersion>5</BuildVersion>
<BuildVersion>7</BuildVersion>
<Revision>0</Revision>

</PropertyGroup>
Expand Down
5 changes: 1 addition & 4 deletions src/Microsoft.ServiceFabric.Actors/ActorId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

namespace Microsoft.ServiceFabric.Actors
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Fabric.Common;
using System.Globalization;
using System.Runtime.Serialization;
using System.Text;
using Microsoft.ServiceFabric.Services;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// The ActorId represents the identity of an actor within an actor service. This is used to identify the partition of the actor service inside which the actor will run, see <see cref="GetPartitionKey"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using FabricBaselessPerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricBaselessPerformanceCounterWriter;
using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;
using System.Fabric.Common;

// This class modifies the value of the performance counter that represents the
// number of pending actor calls that are waiting for the actor lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using FabricBaselessPerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricBaselessPerformanceCounterWriter;
using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;
using System.Fabric.Common;

// This class modifies the value of the performance counter that represents the
// frequency at which a particular actor method throws exceptions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;
using FabricPerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterWriter;
using System.Fabric.Common;

// This class modifies the value of the performance counter that represents the
// time taken to execute a particular actor method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using FabricBaselessPerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricBaselessPerformanceCounterWriter;
using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;
using System.Fabric.Common;

// This class modifies the value of the performance counter that represents the
// frequency at which a particular actor method is invoked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Collections.Generic;
using FabricPerformanceCounterCategoryType = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterCategoryType;
using FabricPerformanceCounterDefinition = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterDefinition;
using FabricPerformanceCounterSetDefinition = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetDefinition;
using FabricPerformanceCounterType = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterType;
using IFabricPerformanceCountersDefinition = Microsoft_ServiceFabric_Internal::System.Fabric.Common.IFabricPerformanceCountersDefinition;
using System.Fabric.Common;

internal class ActorPerformanceCounters : IFabricPerformanceCountersDefinition
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;
using FabricPerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterWriter;
using System.Fabric.Common;

// This class modifies the value of the performance counter that represents the
// time taken to save actor state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@

namespace Microsoft.ServiceFabric.Actors.Diagnostics
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Collections.Generic;
using System.Fabric.Common;
using System.Reflection;
using System.Text;
using Microsoft.ServiceFabric.Actors.Runtime;
using Microsoft.ServiceFabric.Services.Remoting;
using Microsoft.ServiceFabric.Services.Remoting.Description;
using Microsoft.ServiceFabric.Services.Remoting.Diagnostic;
using FabricAverageCount64PerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricAverageCount64PerformanceCounterWriter;
using FabricNumberOfItems64PerformanceCounterWriter = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricNumberOfItems64PerformanceCounterWriter;
using FabricPerformanceCounterDefinition = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterDefinition;
using FabricPerformanceCounterSet = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSet;
using FabricPerformanceCounterSetDefinition = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetDefinition;
using FabricPerformanceCounterSetInstance = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricPerformanceCounterSetInstance;

internal class PerformanceCounterProvider : IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,4 @@
<LastGenOutput>SR.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Target Name="AddCustomAliases" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'Microsoft.ServiceFabric.Internal' AND '%(ReferencePath.NuGetPackageId)' == 'Microsoft.ServiceFabric'">
<Aliases>Microsoft_ServiceFabric_Internal</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

namespace Microsoft.ServiceFabric.Actors.Remoting.V1.FabricTransport.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System.Fabric;
using System.Fabric.Common;
using Microsoft.ServiceFabric.Actors.Generator;
using Microsoft.ServiceFabric.Actors.Remoting.FabricTransport;
using Microsoft.ServiceFabric.Actors.Remoting.V1.Runtime;
Expand All @@ -16,7 +15,6 @@ namespace Microsoft.ServiceFabric.Actors.Remoting.V1.FabricTransport.Runtime
using Microsoft.ServiceFabric.Services.Remoting.Runtime;
using Microsoft.ServiceFabric.Services.Remoting.V1.FabricTransport.Runtime;
using Microsoft.ServiceFabric.Services.Remoting.V1.Runtime;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// An <see cref="IServiceRemotingListener"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

namespace Microsoft.ServiceFabric.Actors.Remoting.V1.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Fabric;
using System.Fabric.Common;
using System.Globalization;
using System.Runtime.Serialization;
using System.Threading;
Expand All @@ -19,8 +18,6 @@ namespace Microsoft.ServiceFabric.Actors.Remoting.V1.Runtime
using Microsoft.ServiceFabric.Services.Remoting.Runtime;
using Microsoft.ServiceFabric.Services.Remoting.V1;
using Microsoft.ServiceFabric.Services.Remoting.V1.Runtime;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// Provides an implementation of <see cref="IServiceRemotingMessageHandler"/> that can dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

namespace Microsoft.ServiceFabric.Actors.Remoting.V2.FabricTransport.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Collections.Generic;
using System.Fabric;
using System.Fabric.Common;
using Microsoft.ServiceFabric.Actors.Generator;
using Microsoft.ServiceFabric.Actors.Migration;
using Microsoft.ServiceFabric.Actors.Remoting.FabricTransport;
Expand All @@ -20,7 +19,6 @@ namespace Microsoft.ServiceFabric.Actors.Remoting.V2.FabricTransport.Runtime
using Microsoft.ServiceFabric.Services.Remoting.V2;
using Microsoft.ServiceFabric.Services.Remoting.V2.FabricTransport.Runtime;
using Microsoft.ServiceFabric.Services.Remoting.V2.Runtime;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// An <see cref="IServiceRemotingListener"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@

namespace Microsoft.ServiceFabric.Actors.Remoting.V2.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Fabric;
using System.Fabric.Common;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -19,7 +18,6 @@ namespace Microsoft.ServiceFabric.Actors.Remoting.V2.Runtime
using Microsoft.ServiceFabric.Services.Remoting.V2;
using Microsoft.ServiceFabric.Services.Remoting.V2.Builder;
using Microsoft.ServiceFabric.Services.Remoting.V2.Runtime;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// Provides an implementation of <see cref="IServiceRemotingMessageHandler"/> that can dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System.Fabric.Common;
using System.IO;
using System.Text;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;

internal sealed class ActorReminderDataSerializer
{
Expand Down
4 changes: 1 addition & 3 deletions src/Microsoft.ServiceFabric.Actors/Runtime/ActorRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Fabric;
using System.Fabric.Common;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ServiceFabric.Actors.Diagnostics;
using Microsoft.ServiceFabric.Actors.Generator;
using Microsoft.ServiceFabric.Services.Runtime;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;

/// <summary>
/// Contains methods to register actor and actor service types with Service Fabric runtime. Registering the types allows the runtime to create instances of the actor and the actor service. See https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-lifecycle for more information on the lifecycle of an actor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;
using System.Fabric.Common;

/// <summary>
/// Represents a change to an actor state with a given state name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Collections.Generic;
using System.Fabric;
using System.Fabric.Common;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ServiceFabric.Data;
using Microsoft.ServiceFabric.Services.Common;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;
using SR = Microsoft.ServiceFabric.Actors.SR;

internal sealed class ActorStateManager : IActorStateManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Fabric.Common;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;

internal static class BinaryReaderWriterExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Fabric;
using System.Fabric.Common;
using System.Fabric.Health;
using System.Globalization;
using System.IO;
Expand All @@ -26,10 +25,7 @@ namespace Microsoft.ServiceFabric.Actors.Runtime

using CopyCompletionCallback = System.Action<System.Fabric.KeyValueStoreEnumerator>;
using DataLossCallback = System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<bool>>;
using FabricDirectory = Microsoft_ServiceFabric_Internal::System.Fabric.Common.FabricDirectory;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;
using ReplicationCallback = System.Action<System.Collections.Generic.IEnumerator<System.Fabric.KeyValueStoreNotification>>;
using Requires = Microsoft_ServiceFabric_Internal::System.Fabric.Common.Requires;
using RestoreCompletedCallback = System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task>;
using SR = Microsoft.ServiceFabric.Actors.SR;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System.Collections.Generic;
using System.Fabric;
using System.Fabric.Common;
using System.Threading;
using System.Threading.Tasks;
using CopyCompletionCallback = System.Action<System.Fabric.KeyValueStoreEnumerator>;
using DataLossCallback = System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<bool>>;
using KeyValueStoreReplica_V2 = Microsoft_ServiceFabric_Internal::System.Fabric.KeyValueStoreReplica_V2;
using KeyValueStoreReplicaSettings_V2 = Microsoft_ServiceFabric_Internal::System.Fabric.KeyValueStoreReplicaSettings_V2;
using ReplicationCallback = System.Action<System.Collections.Generic.IEnumerator<System.Fabric.KeyValueStoreNotification>>;
using RestoreCompletedCallback = System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

namespace Microsoft.ServiceFabric.Actors.Runtime
{
extern alias Microsoft_ServiceFabric_Internal;

using System.Fabric.Common;
using System.IO;
using System.Text;
using ReleaseAssert = Microsoft_ServiceFabric_Internal::System.Fabric.Common.ReleaseAssert;

internal sealed class LogicalTimestampSerializer
{
Expand Down
Loading

0 comments on commit 7529176

Please sign in to comment.