コード例 #1
0
  def __init__(self, file_status, parent_path):
    self.path = Hdfs.join(parent_path, decode_fs_path(file_status['pathSuffix']))
    self.isDir = file_status['type'] == 'DIRECTORY'
    self.atime = file_status['accessTime'] / 1000
    self.mtime = file_status['modificationTime'] / 1000
    self.user = file_status['owner']
    self.group = file_status['group']
    self.size = file_status['length']
    self.blockSize = file_status['blockSize']
    self.replication = file_status['replication']

    self.mode = int(file_status['permission'], 8)
    if self.isDir:
      self.mode |= stat.S_IFDIR
    else:
      self.mode |= stat.S_IFREG
コード例 #2
0
ファイル: webhdfs_types.py プロジェクト: yhanwen/hue
    def __init__(self, file_status, parent_path):
        self.name = decode_fs_path(file_status['pathSuffix'])
        self.path = Hdfs.join(parent_path, self.name)
        self.isDir = file_status['type'] == 'DIRECTORY'
        self.type = file_status['type']
        self.atime = file_status['accessTime'] / 1000
        self.mtime = file_status['modificationTime'] / 1000
        self.user = file_status['owner']
        self.group = file_status['group']
        self.size = file_status['length']
        self.blockSize = file_status['blockSize']
        self.replication = file_status['replication']

        self.mode = int(file_status['permission'], 8)
        if self.isDir:
            self.mode |= stat.S_IFDIR
        else:
            self.mode |= stat.S_IFREG