Anandsagar created OOZIE-2238:
---------------------------------
Summary: Resolving full path in FsActionExecutor on URIs with no
namenode e.g. hdfs:///path/to/file
Key: OOZIE-2238
URL: https://issues.apache.org/jira/browse/OOZIE-2238
Project: Oozie
Issue Type: Improvement
Reporter: Anandsagar
When performing hadoop actions, FsActionExecutor resolves the path in
resolveToFullPath method. {code} if (nameNode == null) {
validatePath(path, withScheme);
fullPath = path;
} else {
// If the path doesn't have a scheme or authority, use the nameNode
which should have already been verified earlier
String pathScheme = path.toUri().getScheme();
String pathAuthority = path.toUri().getAuthority();
if (pathScheme == null || pathAuthority == null) {
if (path.isAbsolute()) {
String nameNodeSchemeAuthority =
nameNode.toUri().getScheme() + "://" + nameNode.toUri().getAuthority();
fullPath = new Path(nameNodeSchemeAuthority +
path.toString());
} else {
throw new
ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS011",
"Path [{0}] cannot be relative", path);
}
} else {
// If the path has a scheme and authority, but its not the
nameNode then validate the path as-is and return it as-is
// If it is the nameNode, then it should have already been
verified earlier so return it as-is
if (!nameNode.toUri().getScheme().equals(pathScheme) ||
!nameNode.toUri().getAuthority().equals(pathAuthority)) {
validatePath(path, withScheme);
}
fullPath = path;
}{code}
It'll work for following path patterns
# hdfs://<myNameNode>/path/to/file
# /path/to/file
But sending following URI in the workflow "hdfs:///path/to/file" will fail with
message "namenode : myNameNodehdfs://" does not exist. The reason for this is
the condition {code} if (pathScheme == null || pathAuthority == null) {code}
and path construction under it. This needs to be further updated to check
if(pathScheme != null && pathAuthority == null) then perform different append
strategy
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)