/usr/local/lib64/python3.6/site-packages/pyarrow
NameSizeModeActions
include/-0755rm
includes/-0755rm
tensorflow/-0755rm
tests/-0755rm
vendored/-0755rm
__pycache__/-0755rm
array.pxi796090644editdlrm
benchmark.pxi8690644editdlrm
benchmark.py8560644editdlrm
builder.pxi26880644editdlrm
cffi.py21780644editdlrm
compat.pxi18100644editdlrm
compat.py10760644editdlrm
compute.py228370644editdlrm
config.pxi26130644editdlrm
csv.py9620644editdlrm
cuda.py10870644editdlrm
dataset.py333330644editdlrm
error.pxi78070644editdlrm
feather.py92580644editdlrm
filesystem.py144680644editdlrm
flight.py17940644editdlrm
fs.py134440644editdlrm
gandiva.pyx184470644editdlrm
hdfs.py75270644editdlrm
io.pxi644950644editdlrm
ipc.pxi288210644editdlrm
ipc.py80290644editdlrm
json.py8580644editdlrm
jvm.py95930644editdlrm
lib.cpython-36m-x86_64-linux-gnu.so37605280755editdlrm
lib.pxd144420644editdlrm
lib.pyx43730644editdlrm
libarrow.so.600481626000755editdlrm
libarrow_dataset.so.60025411200755editdlrm
libarrow_flight.so.600129997840755editdlrm
libarrow_python.so.60018489200755editdlrm
libarrow_python_flight.so.6001127280755editdlrm
libparquet.so.60044585520755editdlrm
libplasma.so.6002512960755editdlrm
lib_api.h191530644editdlrm
memory.pxi74510644editdlrm
orc.py52690644editdlrm
pandas-shim.pxi79870644editdlrm
pandas_compat.py422430644editdlrm
parquet.py868440644editdlrm
plasma-store-server4827760755editdlrm
plasma.py60750644editdlrm
public-api.pxi128140644editdlrm
scalar.pxi291820644editdlrm
serialization.pxi190860644editdlrm
serialization.py182020644editdlrm
table.pxi722770644editdlrm
tensor.pxi343110644editdlrm
types.pxi794320644editdlrm
types.py103810644editdlrm
util.py50010644editdlrm
_compute.cpython-36m-x86_64-linux-gnu.so7173120755editdlrm
_compute.pxd11490644editdlrm
_compute.pyx417590644editdlrm
_csv.cpython-36m-x86_64-linux-gnu.so3121680755editdlrm
_csv.pxd16020644editdlrm
_csv.pyx392970644editdlrm
_cuda.pxd19220644editdlrm
_cuda.pyx347310644editdlrm
_dataset.cpython-36m-x86_64-linux-gnu.so10801680755editdlrm
_dataset.pxd16440644editdlrm
_dataset.pyx1200540644editdlrm
_dataset_orc.cpython-36m-x86_64-linux-gnu.so525360755editdlrm
_dataset_orc.pyx13450644editdlrm
_feather.cpython-36m-x86_64-linux-gnu.so942800755editdlrm
_feather.pyx36230644editdlrm
_flight.cpython-36m-x86_64-linux-gnu.so11246640755editdlrm
_flight.pyx935320644editdlrm
_fs.cpython-36m-x86_64-linux-gnu.so4699920755editdlrm
_fs.pxd24840644editdlrm
_fs.pyx400170644editdlrm
_generated_version.py1420644editdlrm
_hdfs.cpython-36m-x86_64-linux-gnu.so1273520755editdlrm
_hdfs.pyx54710644editdlrm
_hdfsio.cpython-36m-x86_64-linux-gnu.so2080960755editdlrm
_hdfsio.pyx136810644editdlrm
_json.cpython-36m-x86_64-linux-gnu.so906160755editdlrm
_json.pyx84060644editdlrm
_orc.cpython-36m-x86_64-linux-gnu.so1097760755editdlrm
_orc.pxd23500644editdlrm
_orc.pyx51510644editdlrm
_parquet.cpython-36m-x86_64-linux-gnu.so5077920755editdlrm
_parquet.pxd220840644editdlrm
_parquet.pyx479970644editdlrm
_plasma.cpython-36m-x86_64-linux-gnu.so2591680755editdlrm
_plasma.pyx294950644editdlrm
_s3fs.cpython-36m-x86_64-linux-gnu.so1994960755editdlrm
_s3fs.pyx116620644editdlrm
__init__.pxd21950644editdlrm
__init__.py212630644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/hdfs.py (7527B)
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import os import posixpath import sys import warnings from pyarrow.util import implements, _DEPR_MSG from pyarrow.filesystem import FileSystem import pyarrow._hdfsio as _hdfsio class HadoopFileSystem(_hdfsio.HadoopFileSystem, FileSystem): """ DEPRECATED: FileSystem interface for HDFS cluster. See pyarrow.hdfs.connect for full connection details .. deprecated:: 2.0 ``pyarrow.hdfs.HadoopFileSystem`` is deprecated, please use ``pyarrow.fs.HadoopFileSystem`` instead. """ def __init__(self, host="default", port=0, user=None, kerb_ticket=None, driver='libhdfs', extra_conf=None): warnings.warn( _DEPR_MSG.format( "hdfs.HadoopFileSystem", "2.0.0", "fs.HadoopFileSystem"), FutureWarning, stacklevel=2) if driver == 'libhdfs': _maybe_set_hadoop_classpath() self._connect(host, port, user, kerb_ticket, extra_conf) def __reduce__(self): return (HadoopFileSystem, (self.host, self.port, self.user, self.kerb_ticket, self.extra_conf)) def _isfilestore(self): """ Return True if this is a Unix-style file store with directories. """ return True @implements(FileSystem.isdir) def isdir(self, path): return super().isdir(path) @implements(FileSystem.isfile) def isfile(self, path): return super().isfile(path) @implements(FileSystem.delete) def delete(self, path, recursive=False): return super().delete(path, recursive) def mkdir(self, path, **kwargs): """ Create directory in HDFS. Parameters ---------- path : str Directory path to create, including any parent directories. Notes ----- libhdfs does not support create_parents=False, so we ignore this here """ return super().mkdir(path) @implements(FileSystem.rename) def rename(self, path, new_path): return super().rename(path, new_path) @implements(FileSystem.exists) def exists(self, path): return super().exists(path) def ls(self, path, detail=False): """ Retrieve directory contents and metadata, if requested. Parameters ---------- path : str HDFS path to retrieve contents of. detail : bool, default False If False, only return list of paths. Returns ------- result : list of dicts (detail=True) or strings (detail=False) """ return super().ls(path, detail) def walk(self, top_path): """ Directory tree generator for HDFS, like os.walk. Parameters ---------- top_path : str Root directory for tree traversal. Returns ------- Generator yielding 3-tuple (dirpath, dirnames, filename) """ contents = self.ls(top_path, detail=True) directories, files = _libhdfs_walk_files_dirs(top_path, contents) yield top_path, directories, files for dirname in directories: yield from self.walk(self._path_join(top_path, dirname)) def _maybe_set_hadoop_classpath(): import re if re.search(r'hadoop-common[^/]+.jar', os.environ.get('CLASSPATH', '')): return if 'HADOOP_HOME' in os.environ: if sys.platform != 'win32': classpath = _derive_hadoop_classpath() else: hadoop_bin = '{}/bin/hadoop'.format(os.environ['HADOOP_HOME']) classpath = _hadoop_classpath_glob(hadoop_bin) else: classpath = _hadoop_classpath_glob('hadoop') os.environ['CLASSPATH'] = classpath.decode('utf-8') def _derive_hadoop_classpath(): import subprocess find_args = ('find', '-L', os.environ['HADOOP_HOME'], '-name', '*.jar') find = subprocess.Popen(find_args, stdout=subprocess.PIPE) xargs_echo = subprocess.Popen(('xargs', 'echo'), stdin=find.stdout, stdout=subprocess.PIPE) jars = subprocess.check_output(('tr', "' '", "':'"), stdin=xargs_echo.stdout) hadoop_conf = os.environ["HADOOP_CONF_DIR"] \ if "HADOOP_CONF_DIR" in os.environ \ else os.environ["HADOOP_HOME"] + "/etc/hadoop" return (hadoop_conf + ":").encode("utf-8") + jars def _hadoop_classpath_glob(hadoop_bin): import subprocess hadoop_classpath_args = (hadoop_bin, 'classpath', '--glob') return subprocess.check_output(hadoop_classpath_args) def _libhdfs_walk_files_dirs(top_path, contents): files = [] directories = [] for c in contents: scrubbed_name = posixpath.split(c['name'])[1] if c['kind'] == 'file': files.append(scrubbed_name) else: directories.append(scrubbed_name) return directories, files def connect(host="default", port=0, user=None, kerb_ticket=None, extra_conf=None): """ DEPRECATED: Connect to an HDFS cluster. All parameters are optional and should only be set if the defaults need to be overridden. Authentication should be automatic if the HDFS cluster uses Kerberos. However, if a username is specified, then the ticket cache will likely be required. .. deprecated:: 2.0 ``pyarrow.hdfs.connect`` is deprecated, please use ``pyarrow.fs.HadoopFileSystem`` instead. Parameters ---------- host : NameNode. Set to "default" for fs.defaultFS from core-site.xml. port : NameNode's port. Set to 0 for default or logical (HA) nodes. user : Username when connecting to HDFS; None implies login user. kerb_ticket : Path to Kerberos ticket cache. extra_conf : dict, default None extra Key/Value pairs for config; Will override any hdfs-site.xml properties Notes ----- The first time you call this method, it will take longer than usual due to JNI spin-up time. Returns ------- filesystem : HadoopFileSystem """ warnings.warn( _DEPR_MSG.format("hdfs.connect", "2.0.0", "fs.HadoopFileSystem"), FutureWarning, stacklevel=2 ) return _connect( host=host, port=port, user=user, kerb_ticket=kerb_ticket, extra_conf=extra_conf ) def _connect(host="default", port=0, user=None, kerb_ticket=None, extra_conf=None): with warnings.catch_warnings(): warnings.simplefilter("ignore") fs = HadoopFileSystem(host=host, port=port, user=user, kerb_ticket=kerb_ticket, extra_conf=extra_conf) return fs