metaclusterfs

module
v0.0.0-...-d842b63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2016 License: Apache-2.0

README

metaclusterfs

Meta Filesystem for Disk Clusters

package main

import (
	"flag"
	"fmt"
	"os"

	"github.com/hanwen/go-fuse/fuse"
	"github.com/hanwen/go-fuse/fuse/nodefs"
	"github.com/maxymania/metaclusterfs/filerepo"
	"github.com/maxymania/metaclusterfs/fusebits2"

	"github.com/maxymania/metaclusterfs/joinf"
	"github.com/maxymania/metaclusterfs/uidf"
	"github.com/maxymania/metaclusterfs/resource"
	"github.com/satori/go.uuid"

	"github.com/maxymania/metaclusterfs/replica"
)

const FOLDER = "/path/to/partition"

func main() {
	//store := &uidf.FS{FOLDER}
	//store := &uidf.FS{FOLDER}
	store := replica.NewMultiRepo([]uidf.IRepo{
			&uidf.FS{FOLDER+"1"},
			&uidf.FS{FOLDER+"2"},
			&uidf.FS{FOLDER+"3"},
		},1<<12,2)
	{
		res := resource.NewResource(store,uuid.Nil.String())
    	joinf.CreateDir(res)
	    res.Dispose()
	}
	repo := new(filerepo.Repository)
	repo.Repo = store
	repo.Init()
	
	// Scans the arg list and sets up flags
	debug := flag.Bool("debug", false, "print debugging messages.")
	flag.Parse()
	if flag.NArg() < 1 {
		// TODO - where to get program name?
		fmt.Println("usage: main MOUNTPOINT BACKING-PREFIX")
		os.Exit(2)
	}

	mountPoint := flag.Arg(0)
	fmt.Println(mountPoint)
	root := new(fusebits2.DirNode)
	root.Init()
	root.Dir = repo.GetDir(uuid.Nil.String())

	conn := nodefs.NewFileSystemConnector(root, nil)
	fmt.Println("OK! Get Ready Now!")
	server, err := fuse.NewServer(conn.RawFS(), mountPoint, nil)
	if err != nil {
		fmt.Printf("Mount fail: %v\n", err)
		os.Exit(1)
	}
	server.SetDebug(*debug)
	fmt.Println("Mounted!")
	server.Serve()
}

Directories

Path Synopsis
This Package is deprecated!
This Package is deprecated!
This package implements file and directory semantics ontop of uidf.
This package implements file and directory semantics ontop of uidf.
Replica implements a replication mechanism for the uidf storage abstraction layer.
Replica implements a replication mechanism for the uidf storage abstraction layer.
The basic storage abstraction layer interface.
The basic storage abstraction layer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL