private String getSha(final Path localFile) throws IOException, IllegalArgumentException {
    FileSystem localFs = FileSystem.getLocal(conf);
    FileStatus fileStatus = localFs.getFileStatus(localFile);
    String key = getKey(fileStatus);
    String sha256 = shaCache.getIfPresent(key);
    if (sha256 == null) {
      FSDataInputStream is = null;
      try {
        is = localFs.open(localFile);
        long start = System.currentTimeMillis();
        sha256 = DigestUtils.sha256Hex(is);
        long end = System.currentTimeMillis();
        LOG.info("Computed sha: {} for file: {} of length: {} in {} ms", sha256, localFile,
          LlapUtil.humanReadableByteCount(fileStatus.getLen()), end - start);
        shaCache.put(key, sha256);
      } finally {
        if (is != null) {
          is.close();
        }
      }
    }
    return sha256;
  }
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