public static DtClassLoader retrieveClassLoad(List<URL> jarUrls) {
        jarUrls.sort(Comparator.comparing(URL::toString));

        List<String> jarMd5s = new ArrayList<>(jarUrls.size());
        for (URL jarUrl : jarUrls) {
            try (FileInputStream inputStream = new FileInputStream(jarUrl.getPath())){
                String jarMd5 = DigestUtils.md5Hex(inputStream);
                jarMd5s.add(jarMd5);
            } catch (Exception e) {
                throw new RuntimeException("Exceptions appears when read file:" + e);
            }
        }
        String jarUrlkey = StringUtils.join(jarMd5s, "_");
        return pluginClassLoader.computeIfAbsent(jarUrlkey, k -> {
            try {
                URL[] urls = jarUrls.toArray(new URL[jarUrls.size()]);
                ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
                DtClassLoader classLoader = new DtClassLoader(urls, parentClassLoader);
                LOG.info("jarUrl:{} create ClassLoad successful...", jarUrlkey);
                return classLoader;
            } catch (Throwable e) {
                LOG.error("retrieve ClassLoad happens error:{}", e);
                throw new RuntimeException("retrieve ClassLoad happens error");
            }
        });
    }
company: www.dtstack.com
author: toutian
create: 2019/10/14
core/src/main/java/com/dtstack/flink/sql/classloader/ClassLoaderManager.java