storage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidObject = errors.New("pfs: invalid object")
	ErrIsDirectory   = errors.New("pfs: is directory")
	ErrOverallocated = errors.New("pfs: overallocated")
	ErrNoShards      = errors.New("pfs: no shards")
)

Functions

func NewShardHTTPHandler

func NewShardHTTPHandler(shard Shard) http.Handler

func RunWorkload

func RunWorkload(t require.TestingT, url string, w traffic.Workload)

Types

type Branch

type Branch struct {
	Name    string
	ModTime time.Time
}

type Commit

type Commit struct {
	Name    string
	ModTime time.Time
}

type File

type File struct {
	Name    string
	ModTime time.Time
	File    *os.File
}

type Filesystem

type Filesystem interface {
	FileGet(name string, commit string) (File, error)
	FileGetAll(name string, commit string) ([]File, error)
	FileCreate(name string, content io.Reader, branch string) error

	CommitGet(name string) (Commit, error)
	CommitList() ([]Commit, error)
	CommitCreate(name string, branch string) (Commit, error)

	BranchGet(name string) (Branch, error)
	BranchList() ([]Branch, error)
	BranchCreate(name string, commit string) (Branch, error)

	PipelineCreate(name string, content io.Reader, branch string) error
	PipelineWait(name string, commit string) error
	PipelineFileGet(pipelineName string, fileName string, commit string) (File, error)
	PipelineFileGetAll(pipelineName string, fileName string, commit string, shard string) ([]File, error)
}

type Replica

type Replica interface {
	From() (string, error)
	Push(diff io.Reader) error
	Pull(from string, p btrfs.Pusher) error
}

type Shard

type Shard interface {
	Filesystem
	Replica
	FillRole()
	FindRole()
	EnsureRepos() error
}

func NewShard

func NewShard(
	url string,
	dataRepo string,
	pipelinePrefix string,
	shardNum uint64,
	modulos uint64,
	cache etcache.Cache,
) Shard

Jump to

Keyboard shortcuts

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