pfs

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockInShard

func BlockInShard(shard *pfs.Shard, file *pfs.File, block *pfs.Block) bool

BlockInShard returns true if the block is in the given shard.

func ByteRangeSize

func ByteRangeSize(byteRange *pfs.ByteRange) uint64

ByteRangeSize returns byteRange.Upper - byteRange.Lower.

func FileInShard

func FileInShard(shard *pfs.Shard, file *pfs.File) bool

FileInShard checks if a given file belongs in a given shard, using only the file's top-level path. That is, for a path like foo/bar/buzz, FileInShard only considers foo

func ReduceCommitInfos

func ReduceCommitInfos(commitInfos []*pfs.CommitInfo) []*pfs.CommitInfo

ReduceCommitInfos combines commit info for each commit id, resolving writes and adding byte-sizes together as appropriate.

func ReduceFileInfos

func ReduceFileInfos(fileInfos []*pfs.FileInfo) []*pfs.FileInfo

ReduceFileInfos combines file info for each file path, taking the latest modification time for each path and combining their children.

func ReduceRepoInfos

func ReduceRepoInfos(repoInfos []*pfs.RepoInfo) []*pfs.RepoInfo

ReduceRepoInfos combines repo info for each named repo, adding byte-sizes together as appropriate.

Types

type ErrCommitExists added in v1.2.0

type ErrCommitExists struct {
	Commit *pfs.Commit
}

ErrCommitExists represents an error where the commit already exists.

func (ErrCommitExists) Error added in v1.3.19

func (e ErrCommitExists) Error() string

type ErrCommitFinished added in v1.2.0

type ErrCommitFinished struct {
	Commit *pfs.Commit
}

ErrCommitFinished represents an error where the commit has been finished.

func (ErrCommitFinished) Error added in v1.3.19

func (e ErrCommitFinished) Error() string

type ErrCommitNotFound

type ErrCommitNotFound struct {
	Commit *pfs.Commit
}

ErrCommitNotFound represents a commit-not-found error.

func (ErrCommitNotFound) Error added in v1.3.19

func (e ErrCommitNotFound) Error() string

type ErrFileNotFound

type ErrFileNotFound struct {
	File *pfs.File
}

ErrFileNotFound represents a file-not-found error.

func (ErrFileNotFound) Error added in v1.3.19

func (e ErrFileNotFound) Error() string

type ErrParentCommitNotFound

type ErrParentCommitNotFound struct {
	Commit *pfs.Commit
}

ErrParentCommitNotFound represents a parent-commit-not-found error.

func (ErrParentCommitNotFound) Error added in v1.3.19

func (e ErrParentCommitNotFound) Error() string

type ErrRepoExists added in v1.3.19

type ErrRepoExists struct {
	Repo *pfs.Repo
}

ErrRepoExists represents a repo-exists error.

func (ErrRepoExists) Error added in v1.3.19

func (e ErrRepoExists) Error() string

type ErrRepoNotFound

type ErrRepoNotFound struct {
	Repo *pfs.Repo
}

ErrRepoNotFound represents a repo-not-found error.

func (ErrRepoNotFound) Error added in v1.3.19

func (e ErrRepoNotFound) Error() string

type Hasher

type Hasher struct {
	FileModulus  uint64
	BlockModulus uint64
}

A Hasher represents a file/block hasher.

func NewHasher

func NewHasher(fileModulus uint64, blockModulus uint64) *Hasher

NewHasher creates a Hasher.

func (*Hasher) HashBlock

func (s *Hasher) HashBlock(file *pfs.File, block *pfs.Block) uint64

HashBlock computes and returns a hash of a block.

func (*Hasher) HashFile

func (s *Hasher) HashFile(file *pfs.File) uint64

HashFile computes and returns a hash of a file.

Directories

Path Synopsis
Package fuse is a generated protocol buffer package.
Package fuse is a generated protocol buffer package.
Package server is a generated protocol buffer package.
Package server is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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