use of org.apache.ignite.internal.processors.port.GridPortRecord in project ignite by apache.
the class IgniteKernal method ackStart.
/**
* Prints start info.
*
* @param rtBean Java runtime bean.
*/
private void ackStart(RuntimeMXBean rtBean) {
ClusterNode locNode = localNode();
if (log.isQuiet()) {
U.quiet(false, "");
U.quiet(false, "Ignite node started OK (id=" + U.id8(locNode.id()) + (F.isEmpty(igniteInstanceName) ? "" : ", instance name=" + igniteInstanceName) + ')');
}
if (log.isInfoEnabled()) {
log.info("");
String ack = "Ignite ver. " + VER_STR + '#' + BUILD_TSTAMP_STR + "-sha1:" + REV_HASH_STR;
String dash = U.dash(ack.length());
SB sb = new SB();
for (GridPortRecord rec : ctx.ports().records()) sb.a(rec.protocol()).a(":").a(rec.port()).a(" ");
String str = NL + NL + ">>> " + dash + NL + ">>> " + ack + NL + ">>> " + dash + NL + ">>> OS name: " + U.osString() + NL + ">>> CPU(s): " + locNode.metrics().getTotalCpus() + NL + ">>> Heap: " + U.heapSize(locNode, 2) + "GB" + NL + ">>> VM name: " + rtBean.getName() + NL + (igniteInstanceName == null ? "" : ">>> Ignite instance name: " + igniteInstanceName + NL) + ">>> Local node [" + "ID=" + locNode.id().toString().toUpperCase() + ", order=" + locNode.order() + ", clientMode=" + ctx.clientNode() + "]" + NL + ">>> Local node addresses: " + U.addressesAsString(locNode) + NL + ">>> Local ports: " + sb + NL;
log.info(str);
}
}
use of org.apache.ignite.internal.processors.port.GridPortRecord in project ignite by apache.
the class TcpDiscoverySelfTest method testMulticastIpFinder.
/**
* @throws Exception If any error occurs.
*/
public void testMulticastIpFinder() throws Exception {
try {
for (int i = 0; i < 5; i++) {
Ignite g = startGrid("MulticastIpFinder-" + i);
assertEquals(i + 1, g.cluster().nodes().size());
TcpDiscoverySpi spi = (TcpDiscoverySpi) g.configuration().getDiscoverySpi();
TcpDiscoveryMulticastIpFinder ipFinder = (TcpDiscoveryMulticastIpFinder) spi.getIpFinder();
boolean found = false;
for (GridPortRecord rec : ((IgniteKernal) g).context().ports().records()) {
if ((rec.protocol() == UDP) && rec.port() == ipFinder.getMulticastPort()) {
found = true;
break;
}
}
assertTrue("TcpDiscoveryMulticastIpFinder should register port.", found);
}
} finally {
stopAllGrids();
}
}
use of org.apache.ignite.internal.processors.port.GridPortRecord in project ignite by apache.
the class IgfsServerManagerIpcEndpointRegistrationAbstractSelfTest method checkRegisteredIpcEndpoints.
/**
* Counts all registered IPC endpoints.
*
* @return Tuple2 where (tcp endpoints count, shmem endpoints count).
* @throws Exception If failed.
*/
protected T2<Integer, Integer> checkRegisteredIpcEndpoints() throws Exception {
GridKernalContext ctx = ((IgniteKernal) grid()).context();
int tcp = 0;
int shmem = 0;
for (GridPortRecord record : ctx.ports().records()) {
if (record.clazz() == IpcSharedMemoryServerEndpoint.class)
shmem++;
else if (record.clazz() == IpcServerTcpEndpoint.class)
tcp++;
}
return new T2<>(tcp, shmem);
}
Aggregations