/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public void start(final HadoopContext ctx) throws IgniteCheckedException { super.start(ctx); busyLock = new GridSpinReadWriteLock(); evtProcSvc = Executors.newFixedThreadPool(1); assert jobCls == null; HadoopClassLoader ldr = ctx.kernalContext().hadoopHelper().commonClassLoader(); try { jobCls = (Class<HadoopJobEx>)ldr.loadClass(HadoopCommonUtils.JOB_CLS_NAME); } catch (Exception ioe) { throw new IgniteCheckedException("Failed to load job class [class=" + HadoopCommonUtils.JOB_CLS_NAME + ']', ioe); } }
/** {@inheritDoc} */ @Override public void start(HadoopContext ctx) throws IgniteCheckedException { super.start(ctx); ctx.kernalContext().io().addMessageListener(GridTopic.TOPIC_HADOOP_MSG, new GridMessageListener() { @Override public void onMessage(UUID nodeId, Object msg, byte plc) { onMessageReceived(nodeId, (HadoopMessage)msg); } }); ctx.kernalContext().io().addUserMessageListener(GridTopic.TOPIC_HADOOP, new IgniteBiPredicate<UUID, Object>() { @Override public boolean apply(UUID nodeId, Object msg) { return onMessageReceived(nodeId, (HadoopMessage)msg); } }); }
/** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { if (ctx.isDaemon()) return; HadoopConfiguration cfg = ctx.config().getHadoopConfiguration(); if (cfg == null) cfg = new HadoopConfiguration(); else cfg = new HadoopConfiguration(cfg); initializeDefaults(cfg); hctx = new HadoopContext( ctx, cfg, new HadoopJobTracker(), new HadoopEmbeddedTaskExecutor(), // TODO: IGNITE-404: Uncomment when fixed. //cfg.isExternalExecution() ? new HadoopExternalTaskExecutor() : new HadoopEmbeddedTaskExecutor(), new HadoopShuffle()); for (HadoopComponent c : hctx.components()) c.start(hctx); hadoop = new HadoopImpl(this); ctx.addNodeAttribute(HadoopAttributes.NAME, new HadoopAttributes(cfg)); }