/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
NameSizeModeActions
arrow.cpython-36.pyc73280644editdlrm
cached.cpython-36.pyc230300644editdlrm
dask.cpython-36.pyc46560644editdlrm
dbfs.cpython-36.pyc133510644editdlrm
dvc.cpython-36.pyc26220644editdlrm
ftp.cpython-36.pyc104440644editdlrm
git.cpython-36.pyc37500644editdlrm
github.cpython-36.pyc74040644editdlrm
hdfs.cpython-36.pyc70930644editdlrm
http.cpython-36.pyc207520644editdlrm
jupyter.cpython-36.pyc41310644editdlrm
libarchive.cpython-36.pyc60050644editdlrm
local.cpython-36.pyc119120644editdlrm
memory.cpython-36.pyc66970644editdlrm
reference.cpython-36.pyc161420644editdlrm
sftp.cpython-36.pyc61040644editdlrm
smb.cpython-36.pyc105910644editdlrm
tar.cpython-36.pyc45020644editdlrm
webhdfs.cpython-36.pyc147120644editdlrm
zip.cpython-36.pyc32760644editdlrm
__init__.cpython-36.pyc1560644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/hdfs.cpython-36.pyc (7093B)
3 8%Eg@sddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z m Z e ddd d d d d dddddddddddddd dd d d ddddgGddde ZGdd d eZdS)!N)suppress)HadoopFileSystem)wrap_exceptions)AbstractFileSystem)infer_storage_options mirror_fromclientchmodchownuserdf disk_usagedownloaddriverexists extra_confZ get_capacityZget_space_usedhostZis_open kerb_ticketZstrip_protocolmkdirportZ read_parquetrmstatuploadcseZdZdZd#Zd$fdd Zed d Zed d Z ddZ ddZ e d%ddZ e ddZddZe ddZe ddZe d&ddZe d'd!d"ZZS)( PyArrowHDFSzAdapted version of Arrow's HadoopFileSystem This is a very simple wrapper over the pyarrow.hdfs.HadoopFileSystem, which passes on all calls to the underlying class.hdfsfiledefaultrNlibhdfsc sNtjf|t||||||d_tjfdd||||||f_dS)a7 Parameters ---------- host: str Hostname, IP or "default" to try to read from Hadoop config port: int Port to connect on, or default from Hadoop config if 0 user: str or None If given, connect as this username kerb_ticket: str or None If given, use this ticket for authentication driver: 'libhdfs' or 'libhdfs3' Binary driver; libhdfs if the JNI library and default extra_conf: None or dict Passed on to HadoopFileSystem )rrr rrrcs jjS)N)rclose)selfrE/usr/local/lib/python3.6/site-packages/fsspec/implementations/hdfs.py[sz&PyArrowHDFS.__init__..N)super__init__rrweakreffinalizepars)r rrr rrrkwargs) __class__)r r!r$6s zPyArrowHDFS.__init__cCsXt|}i}|jddr$|d|d<|jddr<|d|d<|jddrT|d|d<|S)Nrusernamer r)rget)pathopsoutrrr!_get_kwargs_from_urls_s      z!PyArrowHDFS._get_kwargs_from_urlscCs*t|}|d}|jdr&|dd}|S)Nr,zfile:)r startswith)clsr,r-rrr!_strip_protocolks   zPyArrowHDFS._strip_protocolcCs t|jfS)N)rr')r protocolrrr! __reduce_ex__uszPyArrowHDFS.__reduce_ex__cCs|jjdS)N)rr)r rrr!rxszPyArrowHDFS.closeTcs8fddjj|ddD}|r&|Sdd|DSdS)Ncsg|]}j|qSr) _adjust_entry).0entry)r rr! ~sz"PyArrowHDFS.ls..T)detailcSsg|] }|dqS)namer)r7r8rrr!r9s)rls)r r,r:listingr)r r!r<{szPyArrowHDFS.lscCs|j|jj|S)N)r6rinfo)r r,rrr!r>szPyArrowHDFS.infocCs^|j}d|kr$d|kr$|d|d<d|kr@d|kr@|d|d<d|krZ|j|d|d<|S)Ntypekindr;r,)copyr3)r Zoriginal_entryr8rrr!r6s  zPyArrowHDFS._adjust_entrycKs|j|r|j|dS|j|}dj|j|dtjdg}y6|j|d}tj||WdQRX|j j ||Wn6t k rt t |j j|WdQRXYnXWdQRXdS)N/z.tmp.wb)isdirmakedirsopenjoin_parentsecretsZ token_hexshutil copyfileobjrmv BaseExceptionrFileNotFoundErrorr)r ZlpathZrpathr(ZlstreamZ tmp_fnameZrstreamrrr!cp_files     zPyArrowHDFS.cp_filecCs |jj|S)N)rr)r r,rrr!rm_fileszPyArrowHDFS.rm_fileFcCs(| r|j|rt||jj|ddS)NT)Zcreate_parents)rFileExistsErrorrr)r r,exist_okrrr!rFszPyArrowHDFS.makedirsrbcKst|||f|||d|S)a Parameters ---------- path: str Location of file; should start with '/' mode: str block_size: int Hadoop block size, e.g., 2**26 autocommit: True Transactions are not yet implemented for HDFS; errors if not True kwargs: dict or None Hadoop config parameters Returns ------- HDFSFile file-like instance ) block_size autocommit cache_options)HDFSFile)r r,moderUrVrWr(rrr!_openszPyArrowHDFS._open)rr)rrNNrN)T)F)rTNTN)__name__ __module__ __qualname____doc__r4r$ staticmethodr/ classmethodr3r5rrr<r>r6rPrQrFrZ __classcell__rr)r)r!r s2%"     rc@sDeZdZdZdddZddd Zd d Zd d ZddZddZ dS)rXz`Wrapper around arrow's HdfsFile Allows seek beyond EOF and (eventually) commit/discard T readaheadNc KsX|s td||_||_||_||_|_|jj|||f||_|jj rT|j |_ dS)Nz2HDFSFile cannot be opened with 'autocommit=False'.) NotImplementedErrorfsr,rY blocksizerUrrGfhreadablesize seek_size) r rdr,rYrUrVZ cache_typerWr(rrr!r$s   zHDFSFile.__init__rcCs*|dkr|jrt||j}|jj||S)Nr)rgminrirfseek)r locwhencerrr!rks z HDFSFile.seekcCs t|j|S)N)getattrrf)r itemrrr! __getattr__szHDFSFile.__getattr__cCst|j|j|j|jffS)N)rXrdr,rYrU)r r4rrr!r5szHDFSFile.__reduce_ex__cCs|S)Nr)r rrr! __enter__szHDFSFile.__enter__cCs |jdS)N)r)r exc_typeexc_valexc_tbrrr!__exit__ szHDFSFile.__exit__)TrbN)r) r[r\r]r^r$rkrpr5rqrurrrr!rXs  rX)rJrKr% contextlibrZ pyarrow.hdfsrZfsspec.implementations.arrowrZ fsspec.specrZ fsspec.utilsrrrobjectrXrrrr!sP    0