use of org.neo4j.causalclustering.discovery.ClientConnectorAddresses in project neo4j by neo4j.
the class ConnectToRandomCoreServerStrategyTest method fakeCoreTopology.
static CoreTopology fakeCoreTopology(MemberId... memberIds) {
assert memberIds.length > 0;
ClusterId clusterId = new ClusterId(UUID.randomUUID());
Map<MemberId, CoreServerInfo> coreMembers = new HashMap<>();
int offset = 0;
for (MemberId memberId : memberIds) {
coreMembers.put(memberId, new CoreServerInfo(new AdvertisedSocketAddress("localhost", 5000 + offset), new AdvertisedSocketAddress("localhost", 6000 + offset), new ClientConnectorAddresses(singletonList(new ClientConnectorAddresses.ConnectorUri(ClientConnectorAddresses.Scheme.bolt, new AdvertisedSocketAddress("localhost", 7000 + offset)))), asSet("core")));
offset++;
}
return new CoreTopology(clusterId, false, coreMembers);
}
use of org.neo4j.causalclustering.discovery.ClientConnectorAddresses in project neo4j by neo4j.
the class UserDefinedConfigurationStrategyTest method fakeReadReplicaTopology.
private ReadReplicaTopology fakeReadReplicaTopology(MemberId[] readReplicaIds, NoEastGroupGenerator groupGenerator) {
assert readReplicaIds.length > 0;
Map<MemberId, ReadReplicaInfo> readReplicas = new HashMap<>();
int offset = 0;
for (MemberId memberId : readReplicaIds) {
readReplicas.put(memberId, new ReadReplicaInfo(new ClientConnectorAddresses(singletonList(new ClientConnectorAddresses.ConnectorUri(ClientConnectorAddresses.Scheme.bolt, new AdvertisedSocketAddress("localhost", 11000 + offset)))), new AdvertisedSocketAddress("localhost", 10000 + offset), groupGenerator.get(memberId)));
offset++;
}
return new ReadReplicaTopology(readReplicas);
}
use of org.neo4j.causalclustering.discovery.ClientConnectorAddresses in project neo4j by neo4j.
the class UserDefinedConfigurationStrategyTest method fakeReadReplicaTopology.
static ReadReplicaTopology fakeReadReplicaTopology(MemberId... readReplicaIds) {
assert readReplicaIds.length > 0;
Map<MemberId, ReadReplicaInfo> readReplicas = new HashMap<>();
int offset = 0;
for (MemberId memberId : readReplicaIds) {
readReplicas.put(memberId, new ReadReplicaInfo(new ClientConnectorAddresses(singletonList(new ClientConnectorAddresses.ConnectorUri(ClientConnectorAddresses.Scheme.bolt, new AdvertisedSocketAddress("localhost", 11000 + offset)))), new AdvertisedSocketAddress("localhost", 10000 + offset)));
offset++;
}
return new ReadReplicaTopology(readReplicas);
}
Aggregations