/** {@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 { 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); } }