Search in sources :

Example 1 with IgfsDataOutputStream

use of org.apache.ignite.internal.igfs.common.IgfsDataOutputStream in project ignite by apache.

the class HadoopIgfsIpcIo method start.

/**
 * Starts the IO.
 *
 * @throws IgniteCheckedException If failed to connect the endpoint.
 */
private void start() throws IgniteCheckedException {
    boolean success = false;
    try {
        endpoint = IpcEndpointFactory.connectEndpoint(endpointAddr, new GridLoggerProxy(new HadoopIgfsJclLogger(log), null, null, ""));
        out = new IgfsDataOutputStream(new BufferedOutputStream(endpoint.outputStream()));
        reader = new ReaderThread();
        // Required for Hadoop 2.x
        reader.setDaemon(true);
        reader.start();
        success = true;
    } catch (IgniteCheckedException e) {
        IpcOutOfSystemResourcesException resEx = e.getCause(IpcOutOfSystemResourcesException.class);
        if (resEx != null)
            throw new IgniteCheckedException(IpcSharedMemoryServerEndpoint.OUT_OF_RESOURCES_MSG, resEx);
        throw e;
    } finally {
        if (!success)
            stop();
    }
}
Also used : GridLoggerProxy(org.apache.ignite.internal.GridLoggerProxy) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IpcOutOfSystemResourcesException(org.apache.ignite.internal.util.ipc.shmem.IpcOutOfSystemResourcesException) IgfsDataOutputStream(org.apache.ignite.internal.igfs.common.IgfsDataOutputStream) BufferedOutputStream(java.io.BufferedOutputStream)

Aggregations

BufferedOutputStream (java.io.BufferedOutputStream)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridLoggerProxy (org.apache.ignite.internal.GridLoggerProxy)1 IgfsDataOutputStream (org.apache.ignite.internal.igfs.common.IgfsDataOutputStream)1 IpcOutOfSystemResourcesException (org.apache.ignite.internal.util.ipc.shmem.IpcOutOfSystemResourcesException)1