Search in sources :

Example 1 with ClientConnectorAddresses

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);
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) ClusterId(org.neo4j.causalclustering.identity.ClusterId) HashMap(java.util.HashMap) CoreServerInfo(org.neo4j.causalclustering.discovery.CoreServerInfo) AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) ClientConnectorAddresses(org.neo4j.causalclustering.discovery.ClientConnectorAddresses) CoreTopology(org.neo4j.causalclustering.discovery.CoreTopology)

Example 2 with ClientConnectorAddresses

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);
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) ReadReplicaInfo(org.neo4j.causalclustering.discovery.ReadReplicaInfo) HashMap(java.util.HashMap) AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) ClientConnectorAddresses(org.neo4j.causalclustering.discovery.ClientConnectorAddresses) ReadReplicaTopology(org.neo4j.causalclustering.discovery.ReadReplicaTopology)

Example 3 with ClientConnectorAddresses

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);
}
Also used : MemberId(org.neo4j.causalclustering.identity.MemberId) ReadReplicaInfo(org.neo4j.causalclustering.discovery.ReadReplicaInfo) HashMap(java.util.HashMap) AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) ClientConnectorAddresses(org.neo4j.causalclustering.discovery.ClientConnectorAddresses) ReadReplicaTopology(org.neo4j.causalclustering.discovery.ReadReplicaTopology)

Aggregations

HashMap (java.util.HashMap)3 ClientConnectorAddresses (org.neo4j.causalclustering.discovery.ClientConnectorAddresses)3 MemberId (org.neo4j.causalclustering.identity.MemberId)3 AdvertisedSocketAddress (org.neo4j.helpers.AdvertisedSocketAddress)3 ReadReplicaInfo (org.neo4j.causalclustering.discovery.ReadReplicaInfo)2 ReadReplicaTopology (org.neo4j.causalclustering.discovery.ReadReplicaTopology)2 CoreServerInfo (org.neo4j.causalclustering.discovery.CoreServerInfo)1 CoreTopology (org.neo4j.causalclustering.discovery.CoreTopology)1 ClusterId (org.neo4j.causalclustering.identity.ClusterId)1