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);
}
}
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);
}
}
Aggregations