def hdfs_uri_to_real_path(hdfs_uri, environ):
 components = urlparse(hdfs_uri)
 scheme = components.scheme
 path = components.path
 if ((not scheme) and (not path.startswith('/'))):
  path = ('/user/%s/%s' % (environ['USER'], path))
 return os.path.join(get_mock_hdfs_root(environ=environ), path.lstrip('/'))

def hdfs_uri_to_real_path ( hdfs_uri , environ ) : components = urlparse ( hdfs_uri ) scheme = components . scheme path = components . path if ( ( not scheme ) and ( not path . startswith ( '/' ) ) ) : path = ( '/user/%s/%s' % ( environ [ 'USER' ] , path ) ) return os . path . join ( get_mock_hdfs_root ( environ = environ ) , path . lstrip ( '/' ) )
map an hdfs uri to a path on the filesystem .