/** {@inheritDoc} */ @Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { try { // Always load Hadoop classes explicitly, since Hadoop can be available in App classpath. if (name.equals(CLS_SHUTDOWN_HOOK_MANAGER)) // Dirty hack to get rid of Hadoop shutdown hooks. return loadReplace(name, CLS_SHUTDOWN_HOOK_MANAGER_REPLACE); else if (name.equals(CLS_DAEMON)) // We replace this in order to be able to forcibly stop some daemon threads // that otherwise never stop (e.g. PeerCache runnables): return loadReplace(name, CLS_DAEMON_REPLACE); // For Ignite Hadoop and IGFS classes we have to check if they depend on Hadoop. if (loadByCurrentClassloader(name)) return loadClassExplicitly(name, resolve); return super.loadClass(name, resolve); } catch (NoClassDefFoundError | ClassNotFoundException e) { throw new ClassNotFoundException("Failed to load class: " + name, e); } }
/** {@inheritDoc} */ @Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { if (HadoopClassLoader.loadByCurrentClassloader(name)) { try { synchronized (getClassLoadingLock(name)) { // First, check if the class has already been loaded Class c = findLoadedClass(name); if (c == null) c = findClass(name); if (resolve) resolveClass(c); return c; } } catch (NoClassDefFoundError | ClassNotFoundException e) { throw new IgniteException("Failed to load class by test class loader: " + name, e); } } return super.loadClass(name, resolve); } }
/** {@inheritDoc} */ @Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { try { // Always load Hadoop classes explicitly, since Hadoop can be available in App classpath. if (name.equals(CLS_SHUTDOWN_HOOK_MANAGER)) // Dirty hack to get rid of Hadoop shutdown hooks. return loadReplace(name, CLS_SHUTDOWN_HOOK_MANAGER_REPLACE); else if (name.equals(CLS_DAEMON)) // We replace this in order to be able to forcibly stop some daemon threads // that otherwise never stop (e.g. PeerCache runnables): return loadReplace(name, CLS_DAEMON_REPLACE); // For Ignite Hadoop and IGFS classes we have to check if they depend on Hadoop. if (loadByCurrentClassloader(name)) return loadClassExplicitly(name, resolve); return super.loadClass(name, resolve); } catch (NoClassDefFoundError | ClassNotFoundException e) { throw new ClassNotFoundException("Failed to load class: " + name, e); } }