Giter VIP home page Giter VIP logo

lemondbfs's Introduction

LemonDBFS

A fuse file system cooperated with LemonDB to handle queries and tables. (extension of VE482 Lab8)

Usage

Compile:

  • cd src
  • make
  • cd ..

Run & Test:

  • ./src/lemondbfs -f dbdir/ mountdir/
  • ls -laR mountdir/
  • cd mountdir/mTable0/
  • echo "SWAP ( c16 c9 ) FROM mTable0 WHERE ( c0 <= -20302 ) ;" > .query
  • ls -a
  • head res.tbl
  • cd ../..
  • fusermount -u mountdir

Design Strategy

Currently no real file system operation is operated on mountdir/. Instead, they are all handled/translated/mirrored to real local file system operations or LemonDB instructions acted on dbdir/ and tables/files inside.

Overview

Goals:

  • access lemonDB files and run queries without accessing the software
  • extend UNIX "everything is a file" philosophy: a query is a file

Characteristics of lemonDBfs:

  • usage: lemondbfs db_dir mount_dir

  • strategy:

    1. for each .tbl file show a dir in mount_dir eg. for file mTable10.tbl show dir mTable10

    2. inside each dir show the corresponding table in file orig.tbl eg. for file mTable10.tbl show mtable10/orig.tbl

    3. inside each dir show an empty file called .query eg. for mTable10.tbl show the empty file mTable10/.query

    4. when a query is written to a .query file, apply it the orig.tbl and create the file res.tbl containing the result of the query eg. upon a write on mTable10/.query run the query (error on wrong query) and create mTable10/res.tbl with the result of the query

Development

Getting started:

  • prepare a skeleton of the code (eg. based on hello.c example?)
  • add a simple printf to understand how/when the functions are called eg. printf("getattr(\"%s\"\n", path);
  • keep the code short and simple, no long functions

Useful resources:

TODO

  • lemonDBfs must be more stable (cf. BUGS)

  • Allow more than one query in the .query file

  • When many queries are input allow temporary result tables to be created. Use a mount flag? Take advantage of the DUMP query or use another approach?

  • Allow the creation .tbl files: a dir in mount_dir + orig.tbl + .query file should create a corresponding .tbl file in db_dir

  • Allow the deletion of .tbl files: when a dir is deleted in mount_dir the corresponding .tbl file should disappear

  • Update this TODO. Creation + deletion are on the way, but not stable at all yet

BUGS

!!DO NOT RUN AS ROOT!!

Could potentially corrupt the DB, or even crash lemonDB. New creation and deletion are very unstable and can have terrible consequences...

Already handled by uid check to forbid root user.

lemondbfs's People

Contributors

reapor-yurnero avatar

Watchers

 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.