use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class NodeIOServiceTest method setUp.
@Before
public void setUp() {
Node mockNode = mock(Node.class);
NodeEngineImpl mockNodeEngine = mock(NodeEngineImpl.class);
ioService = new NodeIOService(mockNode, mockNodeEngine);
Config config = new Config();
networkConfig = config.getNetworkConfig();
when(mockNode.getConfig()).thenReturn(config);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class PartitionedCluster method splitCluster.
private void splitCluster() {
Node n1 = getNode(h1);
Node n2 = getNode(h2);
Node n3 = getNode(h3);
Node n4 = getNode(h4);
Node n5 = getNode(h5);
FirewallingMockConnectionManager cm1 = getConnectionManager(n1);
FirewallingMockConnectionManager cm2 = getConnectionManager(n2);
FirewallingMockConnectionManager cm3 = getConnectionManager(n3);
FirewallingMockConnectionManager cm4 = getConnectionManager(n4);
FirewallingMockConnectionManager cm5 = getConnectionManager(n5);
cm1.block(n4.address);
cm2.block(n4.address);
cm3.block(n4.address);
cm1.block(n5.address);
cm2.block(n5.address);
cm3.block(n5.address);
cm4.block(n1.address);
cm4.block(n2.address);
cm4.block(n3.address);
cm5.block(n1.address);
cm5.block(n2.address);
cm5.block(n3.address);
n4.clusterService.removeAddress(n1.address, null);
n4.clusterService.removeAddress(n2.address, null);
n4.clusterService.removeAddress(n3.address, null);
n5.clusterService.removeAddress(n1.address, null);
n5.clusterService.removeAddress(n2.address, null);
n5.clusterService.removeAddress(n3.address, null);
n1.clusterService.removeAddress(n4.address, null);
n2.clusterService.removeAddress(n4.address, null);
n3.clusterService.removeAddress(n4.address, null);
n1.clusterService.removeAddress(n5.address, null);
n2.clusterService.removeAddress(n5.address, null);
n3.clusterService.removeAddress(n5.address, null);
}
use of com.hazelcast.instance.Node in project hazelcast by hazelcast.
the class PhoneHomeTest method testPhoneHomeParameters.
@Test
public void testPhoneHomeParameters() throws Exception {
Node node1 = TestUtil.getNode(hz1);
PhoneHome phoneHome = new PhoneHome();
sleepAtLeastMillis(1);
Map<String, String> parameters = phoneHome.phoneHome(node1, "test_version", false);
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
OperatingSystemMXBean osMxBean = ManagementFactory.getOperatingSystemMXBean();
assertEquals(parameters.get("version"), "test_version");
assertEquals(parameters.get("m"), node1.getLocalMember().getUuid());
assertEquals(parameters.get("e"), "false");
assertEquals(parameters.get("l"), "NULL");
assertEquals(parameters.get("p"), "source");
assertEquals(parameters.get("crsz"), "A");
assertEquals(parameters.get("cssz"), "A");
assertEquals(parameters.get("hdgb"), "0");
assertEquals(parameters.get("ccpp"), "0");
assertEquals(parameters.get("cdn"), "0");
assertEquals(parameters.get("cjv"), "0");
assertEquals(parameters.get("cnjs"), "0");
assertEquals(parameters.get("cpy"), "0");
assertEquals(parameters.get("jetv"), "");
assertFalse(Integer.parseInt(parameters.get("cuptm")) < 0);
assertNotEquals(parameters.get("nuptm"), "0");
assertNotEquals(parameters.get("nuptm"), parameters.get("cuptm"));
assertEquals(parameters.get("osn"), osMxBean.getName());
assertEquals(parameters.get("osa"), osMxBean.getArch());
assertEquals(parameters.get("osv"), osMxBean.getVersion());
assertEquals(parameters.get("jvmn"), runtimeMxBean.getVmName());
assertEquals(parameters.get("jvmv"), System.getProperty("java.version"));
}
use of com.hazelcast.instance.Node in project orientdb by orientechnologies.
the class ServerRun method terminateServer.
public void terminateServer() {
if (server != null) {
try {
HazelcastInstance hz = ((OHazelcastPlugin) server.getDistributedManager()).getHazelcastInstance();
final Node node = getHazelcastNode(hz);
node.getConnectionManager().shutdown();
node.shutdown(true);
hz.getLifecycleService().terminate();
} catch (Exception e) {
// IGNORE IT
}
try {
server.shutdown();
} catch (Exception e) {
// IGNORE IT
}
}
closeStorages();
}
use of com.hazelcast.instance.Node in project orientdb by orientechnologies.
the class ServerRun method rejoin.
public void rejoin(final ServerRun... serverIds) {
final Node currentNode = getHazelcastNode(((OHazelcastPlugin) server.getDistributedManager()).getHazelcastInstance());
for (ServerRun s : serverIds) {
final Node otherNode = getHazelcastNode(((OHazelcastPlugin) s.server.getDistributedManager()).getHazelcastInstance());
final ClusterServiceImpl clusterService = currentNode.getClusterService();
clusterService.merge(otherNode.address);
}
}
Aggregations