Vixen
02b45cc4
csharp
public readonly record struct RealmInstanceId

Which process, as the placement backend names it.

Read the guide page for this →

Remarks

A string rather than a GUID, because it is the backend's own handle and every backend already has one that is more useful than anything this layer could mint: a Kubernetes pod name, a Docker container id, a process id. Printing it into a log is what lets an operator reach the thing with kubectl or docker or kill, which is the whole point of the value.

⚠ Not a ShardId, and losing the distinction loses the recovery story. One shard may be carried by several instances over its life — a crash and a replacement, a version rollout — and one instance never carries two shards.

⚠ default carries a null Value. A struct's property initialisers do not run for default(T), so the normalisation below covers every instance somebody constructed and none that arrived out of a zeroed field or an uninitialised array. Every member here is written to survive that — ask IsValid rather than Value.Length, which is the same discipline ImmutableArray<T>.IsDefault exists for.

Fields and properties (3)

  • public static RealmInstanceId None

    No instance.

  • public string Value

    The backend's handle. Null only on default; see the type's remarks.

  • public bool IsValid

    Whether this names an instance at all.

Methods (4)

  • public RealmInstanceId(string Value)

    Which process, as the placement backend names it.

  • public bool Equals(RealmInstanceId other)

    Whether two handles name the same instance.

  • public override int GetHashCode()

    Returns the hash code for this instance.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (20)

  • ClusterSerializationTestsVixen.Live.Cluster.Tests
  • DockerPlacementVixen.Live.Placement.Docker
  • DockerPlacementOptionsVixen.Live.Placement.Docker
  • DockerPlacementTestsVixen.Live.Placement.Docker.Tests
  • FakeShardVixen.Live.Realm.Cluster.Tests
  • IRealmPlacementVixen.Live.Abstractions
  • IShardGrainVixen.Live.Cluster
  • KubernetesPlacementVixen.Live.Placement.Kubernetes
  • KubernetesPlacementOptionsVixen.Live.Placement.Kubernetes
  • KubernetesPlacementTestsVixen.Live.Placement.Kubernetes.Tests
  • LiveVocabularyTestsVixen.Live.Abstractions.Tests
  • PlacementEventVixen.Live.Abstractions
  • ProcessPlacementVixen.Live.Placement.Process
  • ProcessPlacementOptionsVixen.Live.Placement.Process
  • RealmInstanceVixen.Live.Abstractions
  • RealmInstanceIdConverterVixen.Live.Cluster
  • ShardGrainVixen.Live.Orchestrator
  • ShardLifecycleVixen.Live.Orchestrator
  • ShardLifecycleTestsVixen.Live.Orchestrator.Tests
  • ShardReportVixen.Live.Cluster