flatfs

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2016 License: MIT Imports: 12 Imported by: 0

README

flatfs

flatfs is a simple datastore implementation inspired by gits on-disk object storage.

Documentation

Overview

Package flatfs is a Datastore implementation that stores all objects in a two-level directory structure in the local file system, regardless of the hierarchy of the keys.

Index

Constants

View Source
const SyncThreadsMax = 16

don't block more than 16 threads on sync opearation 16 should be able to sataurate most RAIDs in case of two used disks per write (RAID 1, 5) and queue depth of 2, 16 concurrent Sync calls should be able to saturate 16 HDDs RAID TODO: benchmark it out, maybe provide tweak parmeter

Variables

View Source
var (
	ErrBadPrefixLen = errors.New("bad prefix length")
)

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	// contains filtered or unexported fields
}

func New

func New(path string, prefixLen int, sync bool) (*Datastore, error)

func (*Datastore) Batch

func (fs *Datastore) Batch() (datastore.Batch, error)

func (*Datastore) Close

func (fs *Datastore) Close() error

func (*Datastore) Delete

func (fs *Datastore) Delete(key datastore.Key) error

func (*Datastore) Get

func (fs *Datastore) Get(key datastore.Key) (value interface{}, err error)

func (*Datastore) Has

func (fs *Datastore) Has(key datastore.Key) (exists bool, err error)

func (*Datastore) IsThreadSafe

func (*Datastore) IsThreadSafe()

func (*Datastore) Put

func (fs *Datastore) Put(key datastore.Key, value interface{}) error

func (*Datastore) Query

func (fs *Datastore) Query(q query.Query) (query.Results, error)

Jump to

Keyboard shortcuts

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