private void addJarLRByClass(Class<?> clazz, final Map<String, LocalResource> lrMap) throws IOException,
      LoginException {
    String jarPath = Utilities.jarFinderGetJar(clazz);
    if (jarPath == null) {
      throw new IOException("Can't find jar for: " + clazz);
    }
    final File jar = new File(jarPath);
    final String localJarPath = jar.toURI().toURL().toExternalForm();
    final LocalResource jarLr = createJarLocalResource(localJarPath);
    lrMap.put(DagUtils.getBaseName(jarLr), jarLr);
  }
Returns a local resource representing a jar.
This resource will be used to execute the plan on the cluster.
@param localJarPath Local path to the jar to be localized.
@return LocalResource corresponding to the localized hive exec resource.
@throws IOException when any file system related call fails.
@throws LoginException when we are unable to determine the user.
@throws URISyntaxException when current jar location cannot be determined.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java