Search in sources :

Example 1 with GridPortRecord

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);
    }
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) GridPortRecord(org.apache.ignite.internal.processors.port.GridPortRecord) SB(org.apache.ignite.internal.util.typedef.internal.SB)

Example 2 with GridPortRecord

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();
    }
}
Also used : IgniteKernal(org.apache.ignite.internal.IgniteKernal) TcpDiscoveryMulticastIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder) Ignite(org.apache.ignite.Ignite) GridPortRecord(org.apache.ignite.internal.processors.port.GridPortRecord)

Example 3 with GridPortRecord

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);
}
Also used : IgniteKernal(org.apache.ignite.internal.IgniteKernal) GridKernalContext(org.apache.ignite.internal.GridKernalContext) GridPortRecord(org.apache.ignite.internal.processors.port.GridPortRecord) IpcServerTcpEndpoint(org.apache.ignite.internal.util.ipc.loopback.IpcServerTcpEndpoint) IpcServerTcpEndpoint(org.apache.ignite.internal.util.ipc.loopback.IpcServerTcpEndpoint) IpcSharedMemoryServerEndpoint(org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint) T2(org.apache.ignite.internal.util.typedef.T2)

Aggregations

GridPortRecord (org.apache.ignite.internal.processors.port.GridPortRecord)3 IgniteKernal (org.apache.ignite.internal.IgniteKernal)2 Ignite (org.apache.ignite.Ignite)1 ClusterNode (org.apache.ignite.cluster.ClusterNode)1 GridKernalContext (org.apache.ignite.internal.GridKernalContext)1 IpcServerTcpEndpoint (org.apache.ignite.internal.util.ipc.loopback.IpcServerTcpEndpoint)1 IpcSharedMemoryServerEndpoint (org.apache.ignite.internal.util.ipc.shmem.IpcSharedMemoryServerEndpoint)1 T2 (org.apache.ignite.internal.util.typedef.T2)1 SB (org.apache.ignite.internal.util.typedef.internal.SB)1 TcpDiscoveryMulticastIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder)1