/** * Load a class replacing it with our own implementation. * * @param originalName Name. * @param replaceName Replacement. * @return Class. */ private Class<?> loadReplace(final String originalName, final String replaceName) { synchronized (getClassLoadingLock(originalName)) { // First, check if the class has already been loaded Class c = findLoadedClass(originalName); if (c != null) return c; byte[] bytes = bytesCache.get(originalName); if (bytes == null) { InputStream in = helper.loadClassBytes(this, replaceName); if (in == null) throw new IgniteException("Failed to replace class [originalName=" + originalName + ", replaceName=" + replaceName + ']'); bytes = helper.loadReplace(in, originalName, replaceName); bytesCache.put(originalName, bytes); } return defineClass(originalName, bytes, 0, bytes.length); } }
/** {@inheritDoc} */ @Override public String igniteWorkDirectory() { return helper.workDirectory(); }
/** {@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); } }
HadoopProcessorAdapter cmp = null; if (!ctx.hadoopHelper().isNoOp() && cfg.isPeerClassLoadingEnabled()) { U.warn(log, "Hadoop module is found in classpath, but will not be started because peer class " + "loading is enabled (set IgniteConfiguration.peerClassLoadingEnabled to \"false\" if you want " +
ctx.hadoopHelper().close();
/** {@inheritDoc} */ @Override public void start() throws IgniteException { HadoopClassLoader ldr = ctx.hadoopHelper().commonClassLoader(); ClassLoader oldLdr = HadoopCommonUtils.setContextClassLoader(ldr); try { target = HadoopDelegateUtils.secondaryFileSystemDelegate(ldr, this); target.start(); } finally { HadoopCommonUtils.restoreContextClassLoader(oldLdr); } }
HadoopProcessorAdapter cmp = null; if (!ctx.hadoopHelper().isNoOp() && cfg.isPeerClassLoadingEnabled()) { U.warn(log, "Hadoop module is found in classpath, but will not be started because peer class " + "loading is enabled (set IgniteConfiguration.peerClassLoadingEnabled to \"false\" if you want " +
ctx.hadoopHelper().close();
/** * Load a class replacing it with our own implementation. * * @param originalName Name. * @param replaceName Replacement. * @return Class. */ private Class<?> loadReplace(final String originalName, final String replaceName) { synchronized (getClassLoadingLock(originalName)) { // First, check if the class has already been loaded Class c = findLoadedClass(originalName); if (c != null) return c; byte[] bytes = bytesCache.get(originalName); if (bytes == null) { InputStream in = helper.loadClassBytes(this, replaceName); if (in == null) throw new IgniteException("Failed to replace class [originalName=" + originalName + ", replaceName=" + replaceName + ']'); bytes = helper.loadReplace(in, originalName, replaceName); bytesCache.put(originalName, bytes); } return defineClass(originalName, bytes, 0, bytes.length); } }