public void refreshClassloader() throws IOException {
    if (recentlyLocalizedJars.isEmpty()) return;
    String[] jars = recentlyLocalizedJars.toArray(new String[0]);
    recentlyLocalizedJars.clear();
    ClassLoader updatedCl = null;
    try {
      AddToClassPathAction addAction = new AddToClassPathAction(executorClassloader, Arrays.asList(jars));
      updatedCl = AccessController.doPrivileged(addAction);
      if (LOG.isInfoEnabled()) {
        LOG.info("Added " + jars.length + " jars to classpath");
      }
    } catch (Throwable t) {
      // TODO: we could fall back to trying one by one and only ignore the failed ones.
      logRefreshError("Unable to localize jars: ", jars, t);
      return; // logRefreshError always throws.
    }
    if (updatedCl != executorClassloader) {
      throw new AssertionError("Classloader was replaced despite using UDFClassLoader: new "
          + updatedCl + ", old " + executorClassloader);
    }
    String[] classNames = recentlyLocalizedClasses.toArray(jars);
    recentlyLocalizedClasses.clear();
    try {
      for (String className : classNames) {
        allowedUdfClasses.put(Class.forName(className, false, executorClassloader), Boolean.TRUE);
      }
    } catch (Throwable t) {
      // TODO: we could fall back to trying one by one and only ignore the failed ones.
      logRefreshError("Unable to instantiate localized classes: ", classNames, t);
      return;  // logRefreshError always throws.
    }
  }
This class localizes and manages jars for the functions allowed inside LLAP.
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/FunctionLocalizer.java