Search in sources :

Example 6 with ClusterMemberInfo

use of org.neo4j.management.ClusterMemberInfo in project neo4j by neo4j.

the class HaBeanIT method shouldAccessHaBeans.

@Test
public void shouldAccessHaBeans() throws Throwable {
    ManagedCluster cluster = clusterRule.startCluster();
    // High Availability bean
    HighAvailability ha = ha(cluster.getMaster());
    assertNotNull("could not get ha bean", ha);
    assertMasterInformation(ha);
    assertMasterAndSlaveInformation(ha.getInstancesInCluster());
    for (ClusterMemberInfo info : ha.getInstancesInCluster()) {
        assertTrue(info.isAlive());
        assertTrue(info.isAvailable());
    }
    // Branched data bean
    BranchedStore bs = beans(cluster.getMaster()).getBranchedStoreBean();
    assertNotNull("could not get branched store bean", bs);
}
Also used : ClusterMemberInfo(org.neo4j.management.ClusterMemberInfo) ManagedCluster(org.neo4j.kernel.impl.ha.ClusterManager.ManagedCluster) HighAvailability(org.neo4j.management.HighAvailability) BranchedStore(org.neo4j.management.BranchedStore) Test(org.junit.Test)

Example 7 with ClusterMemberInfo

use of org.neo4j.management.ClusterMemberInfo in project neo4j by neo4j.

the class HaBeanIT method assertMasterAndSlaveInformation.

private void assertMasterAndSlaveInformation(ClusterMemberInfo[] instancesInCluster) throws Exception {
    ClusterMemberInfo master = member(instancesInCluster, 1);
    assertEquals(1137, getUriForScheme("ha", Iterables.map(URI::create, Arrays.asList(master.getUris()))).getPort());
    assertEquals(HighAvailabilityModeSwitcher.MASTER, master.getHaRole());
    ClusterMemberInfo slave = member(instancesInCluster, 2);
    assertEquals(1138, getUriForScheme("ha", Iterables.map(URI::create, Arrays.asList(slave.getUris()))).getPort());
    assertEquals(HighAvailabilityModeSwitcher.SLAVE, slave.getHaRole());
    assertTrue("Slave not available", slave.isAvailable());
}
Also used : ClusterMemberInfo(org.neo4j.management.ClusterMemberInfo)

Aggregations

ClusterMemberInfo (org.neo4j.management.ClusterMemberInfo)7 Function (java.util.function.Function)2 Test (org.junit.Test)2 ClusterMember (org.neo4j.kernel.ha.cluster.member.ClusterMember)2 ClusterMembers (org.neo4j.kernel.ha.cluster.member.ClusterMembers)2 ClusterDatabaseInfo (org.neo4j.management.ClusterDatabaseInfo)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Iterables (org.neo4j.helpers.collection.Iterables)1 Iterables.asArray (org.neo4j.helpers.collection.Iterables.asArray)1 Iterables.map (org.neo4j.helpers.collection.Iterables.map)1 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)1 PageCache (org.neo4j.io.pagecache.PageCache)1 Config (org.neo4j.kernel.configuration.Config)1 LastUpdateTime (org.neo4j.kernel.ha.LastUpdateTime)1 LastTxIdGetter (org.neo4j.kernel.impl.core.LastTxIdGetter)1 ManagedCluster (org.neo4j.kernel.impl.ha.ClusterManager.ManagedCluster)1 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)1 KernelData (org.neo4j.kernel.internal.KernelData)1