Search in sources :

Example 11 with ClusterMembers

use of org.neo4j.kernel.ha.cluster.member.ClusterMembers in project neo4j by neo4j.

the class ClusterMetricsTest method getClusterMembers.

private static Supplier<ClusterMembers> getClusterMembers(String memberRole, HighAvailabilityMemberState memberState) {
    HighAvailabilityMemberStateMachine stateMachine = mock(HighAvailabilityMemberStateMachine.class);
    when(stateMachine.getCurrentState()).thenReturn(memberState);
    ClusterMember clusterMember = spy(new ClusterMember(new InstanceId(1)));
    when(clusterMember.getHARole()).thenReturn(memberRole);
    ObservedClusterMembers observedClusterMembers = mock(ObservedClusterMembers.class);
    when(observedClusterMembers.getCurrentMember()).thenReturn(clusterMember);
    return () -> new ClusterMembers(observedClusterMembers, stateMachine);
}
Also used : ObservedClusterMembers(org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers) HighAvailabilityMemberStateMachine(org.neo4j.kernel.ha.cluster.HighAvailabilityMemberStateMachine) ClusterMember(org.neo4j.kernel.ha.cluster.member.ClusterMember) InstanceId(org.neo4j.cluster.InstanceId) ClusterMembers(org.neo4j.kernel.ha.cluster.member.ClusterMembers) ObservedClusterMembers(org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers)

Aggregations

ClusterMembers (org.neo4j.kernel.ha.cluster.member.ClusterMembers)11 ObservedClusterMembers (org.neo4j.kernel.ha.cluster.member.ObservedClusterMembers)7 ClusterMember (org.neo4j.kernel.ha.cluster.member.ClusterMember)6 Test (org.junit.Test)5 InstanceId (org.neo4j.cluster.InstanceId)5 File (java.io.File)3 IOException (java.io.IOException)3 InetSocketAddress (java.net.InetSocketAddress)3 Predicate (java.util.function.Predicate)3 ClusterMemberAvailability (org.neo4j.cluster.member.ClusterMemberAvailability)3 StoreId (org.neo4j.kernel.impl.store.StoreId)3 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 TimeUnit (java.util.concurrent.TimeUnit)2 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)2 PageCache (org.neo4j.io.pagecache.PageCache)2 PagedFile (org.neo4j.io.pagecache.PagedFile)2 NeoStoreDataSource (org.neo4j.kernel.NeoStoreDataSource)2 Config (org.neo4j.kernel.configuration.Config)2 BranchedDataException (org.neo4j.kernel.ha.BranchedDataException)2