[
https://issues.apache.org/jira/browse/HADOOP-13018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15259649#comment-15259649
]
Ravi Prakash commented on HADOOP-13018:
---------------------------------------
Do you mean this instead?
{code} if (tokenFileLocation != null) {
for (String tokenFileName:
StringUtils.getTrimmedStrings(tokenFileLocation)) {
if (tokenFileName.length() > 0) {
File tokenFile = new File(tokenFileName);
if (verifyFileIsValid(tokenFile, CAT_TOKEN, "token")) {
if(verify(tokenFile, conf, CAT_TOKEN, "token")) {
println("Successfully read credentials from " + tokenFile);
} else {
println("Failed to read credentials from " + tokenFile);
}
} else {
println("tokenFile("+tokenFileName+") does not exist");
}
}
}
}
}
private boolean verify(File tokenFile, Configuration conf, String category,
String message) throws KerberosDiagsFailure {
try {
Credentials.readTokenStorageFile(tokenFile, conf);
} catch(Exception e) {
if (!nofail) {
fail(category, message);
} else {
error(category, message);
}
return false;
}
return true;
}
{code}
I was trying to avoid {{verify}} be specific to the method call it is trying to
verify
> Make Kdiag check whether hadoop.token.files points to existent and valid files
> ------------------------------------------------------------------------------
>
> Key: HADOOP-13018
> URL: https://issues.apache.org/jira/browse/HADOOP-13018
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 3.0.0
> Reporter: Ravi Prakash
> Assignee: Ravi Prakash
> Attachments: HADOOP-13018.01.patch, HADOOP-13018.02.patch
>
>
> Steve proposed that KDiag should fail fast to help debug the case that
> hadoop.token.files points to a file not found. This JIRA is to affect that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)