diff --git hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java index 1ef5f27..9d2a32c 100644 --- hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java +++ hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java @@ -20,6 +20,8 @@ import java.io.File; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.security.PrivilegedExceptionAction; import java.util.List; import java.util.Map; @@ -104,6 +106,16 @@ public Path open(String user, Configuration conf) public void close() { if (tokenPath != null) { new File(tokenPath.toUri()).delete(); + String checksumStr = tokenPath.getParent() + File.separator + "." + tokenPath.getName() + ".crc"; + File checksumFile = null; + try { + checksumFile = new File(new URI(checksumStr)); + if (checksumFile.exists()) { + checksumFile.delete(); + } + } catch (URISyntaxException e) { + LOG.error("Failed to delete token crc file.", e); + } tokenPath = null; } }