Skip to content

Commit 7b8017c

Browse files
authored
!all node renames: node -> endpoint; unique node -> node (#1077)
1 parent 970bfdd commit 7b8017c

File tree

136 files changed

+3823
-2888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3823
-2888
lines changed

IntegrationTests/tests_01_cluster/it_Clustered_swim_suspension_reachability/main.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if args.count >= 3 {
5353
print("parsing port")
5454
let port = Int(args[2])!
5555
print("Joining")
56-
system.cluster.join(node: Node(systemName: "System", host: host, port: port))
56+
system.cluster.join(endpoint: Cluster.Endpoint(systemName: "System", host: host, port: port))
5757
}
5858

5959
_Thread.sleep(.seconds(120))

MultiNodeTests/DistributedActorsMultiNodeTests/MultiNode+ClusterSingletonTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public final class MultiNodeClusterSingletonTests: MultiNodeTestSuite {
7979
}
8080

8181
distributed func greet(name: String) -> String {
82-
"\(self.greeting) \(name)! (from node: \(self.id.uniqueNode), id: \(self.id.detailedDescription))"
82+
"\(self.greeting) \(name)! (from node: \(self.id.node), id: \(self.id.detailedDescription))"
8383
}
8484
}
8585
}

MultiNodeTests/DistributedActorsMultiNodeTests/MultiNode+ReceptionistTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public final class MultiNodeReceptionistTests: MultiNodeTestSuite {
5151
let expectedCount = Nodes.allCases.count
5252
var discovered: Set<DistributedEcho> = []
5353
for try await actor in await multiNode.system.receptionist.listing(of: .init(DistributedEcho.self)) {
54-
multiNode.log.notice("Discovered \(actor.id) from \(actor.id.uniqueNode)")
54+
multiNode.log.notice("Discovered \(actor.id) from \(actor.id.node)")
5555
discovered.insert(actor)
5656

5757
if discovered.count == expectedCount {
@@ -79,7 +79,7 @@ public final class MultiNodeReceptionistTests: MultiNodeTestSuite {
7979
}
8080

8181
distributed func echo(name: String) -> String {
82-
"echo: \(self.greeting)\(name)! (from node: \(self.id.uniqueNode), id: \(self.id.detailedDescription))"
82+
"echo: \(self.greeting)\(name)! (from node: \(self.id.node), id: \(self.id.detailedDescription))"
8383
}
8484
}
8585
}

Protos/ActorID.proto

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ option optimize_for = SPEED;
1818
option swift_prefix = "_Proto";
1919

2020
message ActorID {
21-
UniqueNode node = 1;
21+
ClusterNode node = 1;
2222
ActorPath path = 2;
2323
uint32 incarnation = 3;
2424
map<string, bytes> metadata = 4;
@@ -28,12 +28,12 @@ message ActorPath {
2828
repeated string segments = 1;
2929
}
3030

31-
message UniqueNode {
32-
Node node = 1;
33-
uint64 nid = 2;
31+
message ClusterNode {
32+
ClusterEndpoint endpoint = 1;
33+
uint64 nid = 2;
3434
}
3535

36-
message Node {
36+
message ClusterEndpoint {
3737
string protocol = 1;
3838
string system = 2;
3939
string hostname = 3;

Protos/Clocks/VersionVector.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ message ActorIdentity {
3030

3131
message VersionReplicaID {
3232
oneof value {
33-
ActorID actorID = 1;
34-
UniqueNode uniqueNode = 2;
35-
uint64 uniqueNodeID = 3;
33+
ActorID actorID = 1;
34+
ClusterNode node = 2;
35+
uint64 nodeID = 3;
3636
}
3737
}
3838

Protos/Cluster/Cluster.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ message ClusterInbound {
3737
}
3838

3939
message ClusterRestInPeace {
40-
UniqueNode targetNode = 1;
41-
UniqueNode fromNode = 2;
40+
ClusterNode targetNode = 1;
41+
ClusterNode fromNode = 2;
4242
}

Protos/Cluster/ClusterEvents.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ message ClusterEvent {
3232
}
3333

3434
message ClusterMembershipChange {
35-
UniqueNode node = 1;
35+
ClusterNode node = 1;
3636

3737
ClusterMemberStatus fromStatus = 2;
38-
ClusterMemberStatus toStatus = 3;
38+
ClusterMemberStatus toStatus = 3;
3939
}
4040

4141
message ClusterLeadershipChange {

Protos/Cluster/Membership.proto

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ import "Clocks/VersionVector.proto";
2323

2424
message ClusterMembership {
2525
repeated ClusterMember members = 1;
26-
UniqueNode leaderNode = 2;
26+
ClusterNode leaderNode = 2;
2727
}
2828

2929
message ClusterMember {
30-
UniqueNode node = 1;
31-
ClusterMemberStatus status = 2;
30+
ClusterNode node = 1;
31+
ClusterMemberStatus status = 2;
3232
ClusterMemberReachability reachability = 3;
33-
uint32 upNumber = 4;
33+
uint32 upNumber = 4;
3434
}
3535

3636
enum ClusterMemberReachability {
3737
CLUSTER_MEMBER_REACHABILITY_UNSPECIFIED = 0;
38-
CLUSTER_MEMBER_REACHABILITY_REACHABLE = 1;
38+
CLUSTER_MEMBER_REACHABILITY_REACHABLE = 1;
3939
CLUSTER_MEMBER_REACHABILITY_UNREACHABLE = 2;
4040
}
4141

@@ -51,13 +51,13 @@ enum ClusterMemberStatus {
5151
// ==== Membership Gossip ----------------------------------------------------------------------------------------------
5252

5353
message ClusterMembershipGossip {
54-
// Membership contains full UniqueNode renderings, and the owner and seen table refer to them by UniqueNode.ID
54+
// Membership contains full ClusterNode renderings, and the owner and seen table refer to them by ClusterNode.ID
5555
// this saves us space (by avoiding to render the unique node explicitly many times for each member/seen-entry).
5656
ClusterMembership membership = 1;
5757

58-
// The following fields will use compressed UniqueNode encoding and ONLY serialize them as their uniqueNodeID.
59-
// During deserialization the fields can be resolved against the membership to obtain full UniqueNode values if necessary.
60-
uint64 ownerUniqueNodeID = 2;
58+
// The following fields will use compressed ClusterNode encoding and ONLY serialize them as their nodeID.
59+
// During deserialization the fields can be resolved against the membership to obtain full ClusterNode values if necessary.
60+
uint64 ownerClusterNodeID = 2;
6161
ClusterMembershipSeenTable seenTable = 3;
6262
}
6363

@@ -66,6 +66,6 @@ message ClusterMembershipSeenTable {
6666
}
6767

6868
message ClusterMembershipSeenTableRow {
69-
uint64 uniqueNodeID = 1;
69+
uint64 nodeID = 1;
7070
VersionVector version = 2;
7171
}

Protos/Cluster/SWIM/SWIM.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ message SWIMStatus {
4848

4949
Type type = 1;
5050
uint64 incarnation = 2;
51-
repeated UniqueNode suspectedBy = 3;
51+
repeated ClusterNode suspectedBy = 3;
5252
}
5353

5454
message SWIMMember {

Protos/WireProtocol.proto

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import "Serialization/Serialization.proto";
2424
// ==== Handshake ------------------------------------------------------------------------------------------------------
2525

2626
message HandshakeOffer {
27-
ProtocolVersion version = 1;
28-
UniqueNode originNode = 2;
29-
Node targetNode = 3;
27+
ProtocolVersion version = 1;
28+
ClusterNode originNode = 2;
29+
ClusterEndpoint targetEndpoint = 3;
3030
// In the future we may want to add additional information
3131
// about certain capabilities here. E.g. when a node supports
3232
// faster transport like InfiniBand and the likes, so we can
@@ -43,14 +43,14 @@ message HandshakeResponse {
4343

4444
message HandshakeAccept {
4545
ProtocolVersion version = 1;
46-
UniqueNode originNode = 2;
47-
UniqueNode targetNode = 3;
46+
ClusterNode originNode = 2;
47+
ClusterNode targetNode = 3;
4848
}
4949

5050
message HandshakeReject {
5151
ProtocolVersion version = 1;
52-
UniqueNode originNode = 2;
53-
UniqueNode targetNode = 3;
52+
ClusterNode originNode = 2;
53+
ClusterNode targetNode = 3;
5454
string reason = 4;
5555
}
5656

@@ -66,16 +66,16 @@ message Envelope {
6666
// System messages have to be reliable, therefore they need to be acknowledged
6767
// by the receiving node.
6868
message SystemEnvelope {
69-
uint64 sequenceNr = 1;
70-
UniqueNode from = 2;
69+
uint64 sequenceNr = 1;
70+
ClusterNode from = 2;
7171

72-
Manifest manifest = 3;
73-
bytes payload = 4;
72+
Manifest manifest = 3;
73+
bytes payload = 4;
7474
}
7575

7676
message SystemAck {
7777
uint64 sequenceNr = 1;
78-
UniqueNode from = 2;
78+
ClusterNode from = 2;
7979
}
8080

8181
// The version is represented as 4 bytes:

Samples/Sources/SampleDiningPhilosophers/DistributedDiningPhilosophers.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ final class DistributedDiningPhilosophers {
3535
print("~~~~~~~ started \(systems.count) actor systems ~~~~~~~")
3636

3737
// TODO: Joining to be simplified by having "seed nodes" (that a node should join)
38-
systemA.cluster.join(node: systemB.settings.node)
39-
systemA.cluster.join(node: systemC.settings.node)
40-
systemC.cluster.join(node: systemB.settings.node)
38+
systemA.cluster.join(endpoint: systemB.settings.endpoint)
39+
systemA.cluster.join(endpoint: systemC.settings.endpoint)
40+
systemC.cluster.join(endpoint: systemB.settings.endpoint)
4141

4242
print("waiting for cluster to form...")
4343
try await self.ensureCluster(systems, within: .seconds(10))
@@ -71,7 +71,7 @@ final class DistributedDiningPhilosophers {
7171
}
7272

7373
private func ensureCluster(_ systems: [ClusterSystem], within: Duration) async throws {
74-
let nodes = Set(systems.map(\.settings.uniqueBindNode))
74+
let nodes = Set(systems.map(\.settings.bindNode))
7575

7676
try await withThrowingTaskGroup(of: Void.self) { group in
7777
for system in systems {

0 commit comments

Comments
 (0)