Search in sources :

Example 1 with IpcServerEndpoint

use of org.apache.ignite.internal.util.ipc.IpcServerEndpoint in project ignite by apache.

the class IgfsSharedMemoryTestServer method main.

@SuppressWarnings({ "BusyWait", "InfiniteLoopStatement" })
public static void main(String[] args) throws IgniteCheckedException {
    System.out.println("Starting server ...");
    // Tell our process PID to the wrapper.
    X.println(GridJavaProcess.PID_MSG_PREFIX + U.jvmPid());
    InputStream is = null;
    try {
        IpcServerEndpoint srv = new IpcSharedMemoryServerEndpoint(U.defaultWorkDirectory());
        new IgniteTestResources().inject(srv);
        srv.start();
        System.out.println("IPC shared memory server endpoint started");
        IpcEndpoint clientEndpoint = srv.accept();
        is = clientEndpoint.inputStream();
        for (; ; ) {
            X.println("Before read.");
            is.read();
            Thread.sleep(IpcSharedMemoryCrashDetectionSelfTest.RW_SLEEP_TIMEOUT);
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        U.closeQuiet(is);
    }
}
Also used : IpcEndpoint(org.apache.ignite.internal.util.ipc.IpcEndpoint) IpcServerEndpoint(org.apache.ignite.internal.util.ipc.IpcServerEndpoint) IgniteTestResources(org.apache.ignite.testframework.junits.IgniteTestResources) InputStream(java.io.InputStream) IgniteCheckedException(org.apache.ignite.IgniteCheckedException)

Example 2 with IpcServerEndpoint

use of org.apache.ignite.internal.util.ipc.IpcServerEndpoint in project ignite by apache.

the class VisorNodeDataCollectorJob method igfs.

/**
     * Collect IGFSs.
     *
     * @param res Job result.
     */
protected void igfs(VisorNodeDataCollectorJobResult res) {
    try {
        IgfsProcessorAdapter igfsProc = ignite.context().igfs();
        for (IgniteFileSystem igfs : igfsProc.igfss()) {
            long start0 = U.currentTimeMillis();
            FileSystemConfiguration igfsCfg = igfs.configuration();
            if (proxyCache(igfsCfg.getDataCacheConfiguration().getName()) || proxyCache(igfsCfg.getMetaCacheConfiguration().getName()))
                continue;
            try {
                Collection<IpcServerEndpoint> endPoints = igfsProc.endpoints(igfs.name());
                if (endPoints != null) {
                    for (IpcServerEndpoint ep : endPoints) if (ep.isManagement())
                        res.getIgfsEndpoints().add(new VisorIgfsEndpoint(igfs.name(), ignite.name(), ep.getHost(), ep.getPort()));
                }
                res.getIgfss().add(new VisorIgfs(igfs));
            } finally {
                if (debug)
                    log(ignite.log(), "Collected IGFS: " + igfs.name(), getClass(), start0);
            }
        }
    } catch (Exception igfssEx) {
        res.setIgfssEx(igfssEx);
    }
}
Also used : IgfsProcessorAdapter(org.apache.ignite.internal.processors.igfs.IgfsProcessorAdapter) IpcServerEndpoint(org.apache.ignite.internal.util.ipc.IpcServerEndpoint) VisorIgfsEndpoint(org.apache.ignite.internal.visor.igfs.VisorIgfsEndpoint) VisorIgfs(org.apache.ignite.internal.visor.igfs.VisorIgfs) IgniteFileSystem(org.apache.ignite.IgniteFileSystem) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Aggregations

IpcServerEndpoint (org.apache.ignite.internal.util.ipc.IpcServerEndpoint)2 InputStream (java.io.InputStream)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteFileSystem (org.apache.ignite.IgniteFileSystem)1 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)1 IgfsProcessorAdapter (org.apache.ignite.internal.processors.igfs.IgfsProcessorAdapter)1 IpcEndpoint (org.apache.ignite.internal.util.ipc.IpcEndpoint)1 VisorIgfs (org.apache.ignite.internal.visor.igfs.VisorIgfs)1 VisorIgfsEndpoint (org.apache.ignite.internal.visor.igfs.VisorIgfsEndpoint)1 IgniteTestResources (org.apache.ignite.testframework.junits.IgniteTestResources)1