Search in sources :

Example 1 with HadoopProcessDescriptor

use of org.apache.ignite.internal.processors.hadoop.taskexecutor.external.HadoopProcessDescriptor in project ignite by apache.

the class HadoopExternalProcessStarter method run.

/**
     * Run the process.
     *
     * @throws Exception If failed.
     */
public void run() throws Exception {
    File outputDir = outputDirectory();
    initializeStreams(outputDir);
    ExecutorService msgExecSvc = Executors.newFixedThreadPool(Integer.getInteger("MSG_THREAD_POOL_SIZE", Runtime.getRuntime().availableProcessors() * 2));
    IgniteLogger log = logger(outputDir);
    HadoopExternalCommunication comm = new HadoopExternalCommunication(args.nodeId, args.childProcId, new JdkMarshaller(), log, msgExecSvc, "external", args.workDir);
    comm.start();
    HadoopProcessDescriptor nodeDesc = new HadoopProcessDescriptor(args.nodeId, args.parentProcId);
    nodeDesc.address(args.addr);
    nodeDesc.tcpPort(args.tcpPort);
    nodeDesc.sharedMemoryPort(args.shmemPort);
    HadoopChildProcessRunner runner = new HadoopChildProcessRunner();
    runner.start(comm, nodeDesc, msgExecSvc, log);
    System.err.println("Started");
    System.err.flush();
    System.setOut(new PrintStream(out));
    System.setErr(new PrintStream(err));
}
Also used : PrintStream(java.io.PrintStream) ExecutorService(java.util.concurrent.ExecutorService) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller) HadoopExternalCommunication(org.apache.ignite.internal.processors.hadoop.taskexecutor.external.communication.HadoopExternalCommunication) HadoopProcessDescriptor(org.apache.ignite.internal.processors.hadoop.taskexecutor.external.HadoopProcessDescriptor) IgniteLogger(org.apache.ignite.IgniteLogger) File(java.io.File)

Aggregations

File (java.io.File)1 PrintStream (java.io.PrintStream)1 ExecutorService (java.util.concurrent.ExecutorService)1 IgniteLogger (org.apache.ignite.IgniteLogger)1 HadoopProcessDescriptor (org.apache.ignite.internal.processors.hadoop.taskexecutor.external.HadoopProcessDescriptor)1 HadoopExternalCommunication (org.apache.ignite.internal.processors.hadoop.taskexecutor.external.communication.HadoopExternalCommunication)1 JdkMarshaller (org.apache.ignite.marshaller.jdk.JdkMarshaller)1