New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ClusterConfiguration to legacy #3901
Changes from 2 commits
4861e76
de51419
235079d
71c633c
57e7de2
d25c244
26a353a
fca4397
db4cfc0
7cf0d1c
600236f
8f6a020
37a5d8e
f0d7eb8
3d6a759
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
using System; | ||
using System; | ||
|
||
namespace Orleans.Runtime | ||
{ | ||
[Serializable] | ||
internal class HashBasedPlacement : PlacementStrategy | ||
{ | ||
|
||
internal static HashBasedPlacement Singleton { get; } = new HashBasedPlacement(); | ||
|
||
|
||
public HashBasedPlacement() | ||
{ | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is HashBasedPlacement; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,5 @@ namespace Orleans.Runtime | |
internal class PreferLocalPlacement : PlacementStrategy | ||
{ | ||
internal static PreferLocalPlacement Singleton { get; } = new PreferLocalPlacement(); | ||
|
||
private PreferLocalPlacement() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why these changes? |
||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is PreferLocalPlacement; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,32 +5,20 @@ namespace Orleans.Runtime | |
[Serializable] | ||
internal class StatelessWorkerPlacement : PlacementStrategy | ||
{ | ||
private static readonly int defaultMaxStatelessWorkers = Environment.ProcessorCount; | ||
private static readonly int DefaultMaxStatelessWorkers = Environment.ProcessorCount; | ||
|
||
public int MaxLocal { get; private set; } | ||
|
||
internal StatelessWorkerPlacement(int maxLocal = -1) | ||
{ | ||
// If maxLocal was not specified on the StatelessWorkerAttribute, | ||
// we will use the defaultMaxStatelessWorkers, which is System.Environment.ProcessorCount. | ||
MaxLocal = maxLocal > 0 ? maxLocal : defaultMaxStatelessWorkers; | ||
this.MaxLocal = maxLocal > 0 ? maxLocal : DefaultMaxStatelessWorkers; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return String.Format("StatelessWorkerPlacement(max={0})", MaxLocal); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more noise |
||
{ | ||
var other = obj as StatelessWorkerPlacement; | ||
return other != null && MaxLocal == other.MaxLocal; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode() ^ MaxLocal.GetHashCode(); | ||
return string.Format("StatelessWorkerPlacement(max={0})", this.MaxLocal); | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
using System; | ||
using System; | ||
|
||
namespace Orleans.Versions.Compatibility | ||
{ | ||
[Serializable] | ||
public class AllVersionsCompatible : CompatibilityStrategy | ||
{ | ||
public static AllVersionsCompatible Singleton { get; } = new AllVersionsCompatible(); | ||
|
||
private AllVersionsCompatible() | ||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is AllVersionsCompatible; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
using System; | ||
using System; | ||
|
||
namespace Orleans.Versions.Compatibility | ||
{ | ||
[Serializable] | ||
public class StrictVersionCompatible : CompatibilityStrategy | ||
{ | ||
public static StrictVersionCompatible Singleton { get; } = new StrictVersionCompatible(); | ||
|
||
private StrictVersionCompatible() | ||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is StrictVersionCompatible; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,5 @@ namespace Orleans.Versions.Selector | |
public class AllCompatibleVersions : VersionSelectorStrategy | ||
{ | ||
public static AllCompatibleVersions Singleton { get; } = new AllCompatibleVersions(); | ||
|
||
private AllCompatibleVersions() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't matter. These classes are just marker. |
||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is AllCompatibleVersions; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using Orleans.Versions.Compatibility; | ||
|
||
|
@@ -9,22 +9,8 @@ public interface IVersionSelector | |
IReadOnlyList<ushort> GetSuitableVersion(ushort requestedVersion, IReadOnlyList<ushort> availableVersions, ICompatibilityDirector compatibilityDirector); | ||
} | ||
|
||
public interface IVersionSelector<TPolicy> : IVersionSelector where TPolicy : VersionSelectorStrategy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you remove this interface ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These interfaces existed only to provide mappings from strategy types to other implementations, which requires reflection and is somewhat clumsy. Replaced this with typed services using type as key. |
||
{ | ||
} | ||
|
||
[Serializable] | ||
public abstract class VersionSelectorStrategy | ||
{ | ||
public static VersionSelectorStrategy Parse(string str) | ||
{ | ||
if (str.Equals(typeof(AllCompatibleVersions).Name)) | ||
return AllCompatibleVersions.Singleton; | ||
if (str.Equals(typeof(LatestVersion).Name)) | ||
return LatestVersion.Singleton; | ||
if (str.Equals(typeof(MinimumVersion).Name)) | ||
return MinimumVersion.Singleton; | ||
return null; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
using System; | ||
using System; | ||
|
||
namespace Orleans.Versions.Selector | ||
{ | ||
[Serializable] | ||
public class LatestVersion : VersionSelectorStrategy | ||
{ | ||
public static LatestVersion Singleton { get; } = new LatestVersion(); | ||
|
||
private LatestVersion() | ||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is LatestVersion; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
using System; | ||
using System; | ||
|
||
namespace Orleans.Versions.Selector | ||
{ | ||
[Serializable] | ||
public class MinimumVersion : VersionSelectorStrategy | ||
{ | ||
public static MinimumVersion Singleton { get; } = new MinimumVersion(); | ||
|
||
private MinimumVersion() | ||
{ } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
return obj is MinimumVersion; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return GetType().GetHashCode(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason of removing these methods? no usage of them? meaningless overrides, because it is using the base implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was just useless noise. Ran across it when trying to understand how strategies where used. Killed it because it just created confusion and was pointless.