From 6d2d83cac78ded7fabae0b50733cd64bf795fd6c Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Tue, 28 Feb 2023 04:58:22 +0700 Subject: [PATCH] Remove NameAndUuid from Akka.Actor (#6460) --- .../Actor/NameAndUidBenchmarks.cs | 34 ------------ .../CoreAPISpec.ApproveCore.Core.verified.txt | 10 ---- ...oreAPISpec.ApproveCore.DotNet.verified.txt | 10 ---- .../CoreAPISpec.ApproveCore.Net.verified.txt | 10 ---- src/core/Akka/Actor/ActorCell.cs | 13 ----- src/core/Akka/Actor/NameAndUid.cs | 52 ------------------- 6 files changed, 129 deletions(-) delete mode 100644 src/benchmark/Akka.Benchmarks/Actor/NameAndUidBenchmarks.cs delete mode 100644 src/core/Akka/Actor/NameAndUid.cs diff --git a/src/benchmark/Akka.Benchmarks/Actor/NameAndUidBenchmarks.cs b/src/benchmark/Akka.Benchmarks/Actor/NameAndUidBenchmarks.cs deleted file mode 100644 index e13315a768d..00000000000 --- a/src/benchmark/Akka.Benchmarks/Actor/NameAndUidBenchmarks.cs +++ /dev/null @@ -1,34 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (C) 2009-2022 Lightbend Inc. -// Copyright (C) 2013-2022 .NET Foundation -// -//----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Text; -using Akka.Actor; -using Akka.Benchmarks.Configurations; -using BenchmarkDotNet.Attributes; - -namespace Akka.Benchmarks.Actor -{ - [Config(typeof(MicroBenchmarkConfig))] - public class NameAndUidBenchmarks - { - public const string ActorPath = "foo#11241311"; - - [Benchmark] - public NameAndUid ActorCell_SplitNameAndUid() - { - return ActorCell.SplitNameAndUid(ActorPath); - } - - [Benchmark] - public (string name, int uid) ActorCell_GetNameAndUid() - { - return ActorCell.GetNameAndUid(ActorPath); - } - } -} diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt index 0e51d0c9b34..c4eec9caa8b 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt @@ -113,8 +113,6 @@ namespace Akka.Actor protected bool SetChildrenTerminationReason(Akka.Actor.Internal.SuspendReason reason) { } public void SetReceiveTimeout(System.Nullable timeout = null) { } protected void SetTerminated() { } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public static Akka.Actor.NameAndUid SplitNameAndUid(string name) { } public virtual void Start() { } protected void Stash(Akka.Dispatch.SysMsg.SystemMessage msg) { } public void Stop(Akka.Actor.IActorRef child) { } @@ -1355,14 +1353,6 @@ namespace Akka.Actor public override void Suspend() { } protected override void TellInternal(object message, Akka.Actor.IActorRef sender) { } } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public class NameAndUid - { - public NameAndUid(string name, int uid) { } - public string Name { get; } - public int Uid { get; } - public override string ToString() { } - } public sealed class Nobody : Akka.Actor.MinimalActorRef { public static Akka.Actor.Nobody Instance; diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt index faa1118a99a..4b57d12c033 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt @@ -113,8 +113,6 @@ namespace Akka.Actor protected bool SetChildrenTerminationReason(Akka.Actor.Internal.SuspendReason reason) { } public void SetReceiveTimeout(System.Nullable timeout = null) { } protected void SetTerminated() { } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public static Akka.Actor.NameAndUid SplitNameAndUid(string name) { } public virtual void Start() { } protected void Stash(Akka.Dispatch.SysMsg.SystemMessage msg) { } public void Stop(Akka.Actor.IActorRef child) { } @@ -1357,14 +1355,6 @@ namespace Akka.Actor public override void Suspend() { } protected override void TellInternal(object message, Akka.Actor.IActorRef sender) { } } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public class NameAndUid - { - public NameAndUid(string name, int uid) { } - public string Name { get; } - public int Uid { get; } - public override string ToString() { } - } public sealed class Nobody : Akka.Actor.MinimalActorRef { public static Akka.Actor.Nobody Instance; diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt index 0e51d0c9b34..c4eec9caa8b 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt @@ -113,8 +113,6 @@ namespace Akka.Actor protected bool SetChildrenTerminationReason(Akka.Actor.Internal.SuspendReason reason) { } public void SetReceiveTimeout(System.Nullable timeout = null) { } protected void SetTerminated() { } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public static Akka.Actor.NameAndUid SplitNameAndUid(string name) { } public virtual void Start() { } protected void Stash(Akka.Dispatch.SysMsg.SystemMessage msg) { } public void Stop(Akka.Actor.IActorRef child) { } @@ -1355,14 +1353,6 @@ namespace Akka.Actor public override void Suspend() { } protected override void TellInternal(object message, Akka.Actor.IActorRef sender) { } } - [System.ObsoleteAttribute("Not used. Will be removed in Akka.NET v1.5.")] - public class NameAndUid - { - public NameAndUid(string name, int uid) { } - public string Name { get; } - public int Uid { get; } - public override string ToString() { } - } public sealed class Nobody : Akka.Actor.MinimalActorRef { public static Akka.Actor.Nobody Instance; diff --git a/src/core/Akka/Actor/ActorCell.cs b/src/core/Akka/Actor/ActorCell.cs index 473b718a6c7..9a090bafc3c 100644 --- a/src/core/Akka/Actor/ActorCell.cs +++ b/src/core/Akka/Actor/ActorCell.cs @@ -481,19 +481,6 @@ protected void SetActorFields(ActorBase actor) { actor?.Unclear(); } - /// - /// INTERNAL API - /// - /// TBD - /// TBD - [Obsolete("Not used. Will be removed in Akka.NET v1.5.")] - public static NameAndUid SplitNameAndUid(string name) - { - var i = name.IndexOf('#'); - return i < 0 - ? new NameAndUid(name, UndefinedUid) - : new NameAndUid(name.Substring(0, i), Int32.Parse(name.Substring(i + 1))); - } /// /// INTERNAL API diff --git a/src/core/Akka/Actor/NameAndUid.cs b/src/core/Akka/Actor/NameAndUid.cs deleted file mode 100644 index c3556b8d7b8..00000000000 --- a/src/core/Akka/Actor/NameAndUid.cs +++ /dev/null @@ -1,52 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (C) 2009-2022 Lightbend Inc. -// Copyright (C) 2013-2022 .NET Foundation -// -//----------------------------------------------------------------------- - -using System; - -namespace Akka.Actor -{ - /// - /// INTERNAL API - /// - [Obsolete("Not used. Will be removed in Akka.NET v1.5.")] - public class NameAndUid - { - private readonly string _name; - private readonly int _uid; - - /// - /// TBD - /// - /// TBD - /// TBD - public NameAndUid(string name, int uid) - { - _name = name; - _uid = uid; - } - - /// - /// TBD - /// - public string Name { get { return _name; } } - - /// - /// TBD - /// - public int Uid { get { return _uid; } } - - /// - /// TBD - /// - /// TBD - public override string ToString() - { - return _name + "#" + _uid; - } - } -} -