use of org.neo4j.management.HighAvailability in project graphdb by neo4j-attic.
the class TestHaBean method canGetHaBean.
@Test
public void canGetHaBean() throws Exception {
Neo4jManager neo4j = new Neo4jManager(db.getManagementBean(Kernel.class));
HighAvailability ha = neo4j.getHighAvailabilityBean();
assertNotNull("could not get ha bean", ha);
assertTrue("single instance should be master", ha.isMaster());
}
use of org.neo4j.management.HighAvailability 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);
}
use of org.neo4j.management.HighAvailability in project graphdb by neo4j-attic.
the class TestHaBean method canConnectToInstance.
@Test
public void canConnectToInstance() throws Exception {
Neo4jManager neo4j = new Neo4jManager(db.getManagementBean(Kernel.class));
HighAvailability ha = neo4j.getHighAvailabilityBean();
InstanceInfo[] instances = ha.getInstancesInCluster();
assertNotNull(instances);
assertEquals(1, instances.length);
InstanceInfo instance = instances[0];
assertNotNull(instance);
Pair<Neo4jManager, HighAvailability> proc = instance.connect();
assertNotNull("could not connect", proc);
neo4j = proc.first();
ha = proc.other();
assertNotNull(neo4j);
assertNotNull(ha);
instances = ha.getInstancesInCluster();
assertNotNull(instances);
assertEquals(1, instances.length);
assertEquals(instance.getAddress(), instances[0].getAddress());
assertEquals(instance.getInstanceId(), instances[0].getInstanceId());
}
use of org.neo4j.management.HighAvailability in project graphdb by neo4j-attic.
the class Neo4jPlugin method addTabs.
private void addTabs(ManagementAccess manager, String suffix, Map<String, JPanel> result) {
result.put("Neo4j" + suffix, add(new KernelWidget(manager)));
try {
HighAvailability ha = manager.getBean(HighAvailability.class);
if (ha != null) {
result.put("Neo4j HA" + suffix, add(new HaWidget(manager, ha)));
}
} catch (Exception haNotAvailable) {
// ok, just don't include HA info
}
try {
RemoteConnection remote = manager.getBean(RemoteConnection.class);
if (remote != null) {
DataBrowser browser = new DataBrowser(remote);
result.put("Neo4j Graph" + suffix, browser.view());
}
} catch (LinkageError dataBrowserNotAvailable) {
// ok, just don't data browser
} catch (Exception dataBrowserNotAvailable) {
// ok, just don't data browser
}
}
Aggregations