Ejemplo n.º 1
0
def get_plain_path(abs_path):
    """
    Convert absolute HDFS path to plain path (dropping hdfs:// and ip)

    Example use-case:

    >>> hdfs.get_plain_path("hdfs://10.0.2.15:8020/Projects/demo_deep_learning_admin000/Models/")
    >>> # returns: "/Projects/demo_deep_learning_admin000/Models/"

     Args:
         :abs_path: the absolute HDFS path containing hdfs:// and/or ip

    Returns:
          the plain path without hdfs:// and ip
    """
    return path.split(path.abspath(abs_path))[2]
Ejemplo n.º 2
0
 def _hdfs_ls(self, hdfs_path):
     return [
         split(d['name'])[2] for d in self.hdfs.list_directory(hdfs_path)
     ]
Ejemplo n.º 3
0
def split_hdfs_path(hdfs_path, user=None):  # backwards compatibility
    from pydoop.hdfs.path import split
    return split(hdfs_path, user)
Ejemplo n.º 4
0
def split_hdfs_path(hdfs_path, user=None):  # backwards compatibility
    from pydoop.hdfs.path import split
    return split(hdfs_path, user)