Giter Club home page Giter Club logo

google-file-system's Introduction

Google-File-System

A python implementation of Google File System

Compile

  • Run bash recompile.sh

Dependency

  • gRPC

Run

  • In one terminal, run python chunk_server.py to start chunk servers.
  • In other terminal, run python master_server.py to start master server.
  • From the third terminal, run python client.py <command> <file_path> <args> to interact with file system.

Commands

  • python client.py create <file_path>
    • Creates a new file with given absolute file path <file_path>
  • python client.py list <prefix>
    • Lists all files whose absolute path have prefix <prefix>
  • python client.py append <file_path> <string>
    • Appends <string> to file <file_path>
  • python client.py read <file_path> <offset> <len>
    • Reads <len> characters of file <file_path> starting from <offset>
  • python client.py delete <file_path>
    • Deletes file <file_path>
  • python client.py undelete <file_path>
    • Restores the deleted file <file_path>

Miscellaneous Details

  • common.py contains common metadata including port numbers of master server and chunk servers, chunk size, etc. It also contains some common code.
  • Proper logging is provided in each of chunk server, master server and client.
  • Most of the errors are handled in the code.
  • As per original GFS, files are identified by absolute paths. There is no concept of directories. GFS has a module which keeps checks on file path and directory structure consistencies. It is not implemented here.
  • The code is gradually extendable by adding features one by one.

Demo

After starting chunk servers and master server, run the following series of commands to have a glimpse of GFS.

python client.py create /file1
python client.py create /dir1/file2
python client.py list /dir1
python client.py append /file1 abcdefghijklm
python client.py read /file1 2 6
python client.py delete /file1
python client.py list /
python client.py undelete /file1
python client.py list /

google-file-system's People

Contributors

chaitanya100100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ravi-ror

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.