Giter VIP home page Giter VIP logo

py-hdfs-mount's Introduction

Requirements

Python 3

Install

sudo apt-get install fuse libfuse2
pip3 install -r requirements.txt

If you will be using kerberos, install libkrb5-dev:

sudo apt-get install libkrb5-dev

Configuration

cp example.config.yaml config.yaml
$EDITOR config.yaml

Running

If you are using kerberos, run a kinit:

kinit -kt $USER $USER@REALM

In all cases you then will have to create a new empty directory that with be the mount point:

mkdir /mnt/dest_mount

And finaly you can run py-hdfs-fuse:

python3 hdfs_mount.py [--loglevel LEVEL] config.yaml

Have fun!

Note: if anything goes wrong and you have to kill py-hdfs-mount, you will probably have to run this command on the mounted folder to unlock it:

fusermount -u /mnt/dest_mount
umount -l /mnt/dest_mount

Tested with

  • Vim (open file, edit randomly, save and close)
  • cp/mv

Functionnalities

  • Cached writes (HDFS is an immutable FS (so writes=delete+insert))
  • Random writes (slow - because of the immutability of HDFS - but working!)
  • Very fast ls (cached directory metadata)
  • directory stored as a zip file in HDFS (to solve small files problem)
  • directory stored as a avro file in HDFS (to solve small files problem)
  • CRC32 checksum
  • Load options from configuration file

Implemented FUSE methods

Basic

  • access
  • chmod
  • chown
  • getattr
  • readdir
  • readlink
  • mknod
  • rmdir
  • mkdir
  • statfs
  • unlink
  • symlink
  • rename
  • link
  • utimens

File methods

  • open
  • create
  • read
  • write (caching is done in memory)
  • truncate
  • flush (writes the in memory written chunks to a temporary file in the local FS in the right order and calls fsync)
  • fsync (send the temporary file to HDFS)
  • release

py-hdfs-mount's People

Contributors

dependabot[bot] avatar dubrzr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.