fs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseTempDirLimitNumFiles

func ChooseTempDirLimitNumFiles() (limit int)

Choose a reasonable value for ServerConfig.TempDirLimitNumFiles based on process limits.

func NewServer

func NewServer(cfg *ServerConfig) (server fuse.Server, err error)

Create a fuse file system server according to the supplied configuration.

Types

type GenerationBackedInode

type GenerationBackedInode interface {
	inode.Inode
	SourceGeneration() int64
}

A common interface for inodes backed by particular object generations. Implemented by FileInode and SymlinkInode.

type ServerConfig

type ServerConfig struct {
	// A clock used for modification times and cache expiration.
	Clock timeutil.Clock

	// The bucket that the file system is to export.
	Bucket gcs.Bucket

	// The temporary directory to use for local caching, or the empty string to
	// use the system default.
	TempDir string

	// A desired limit on the number of open files used for storing temporary
	// object contents. May not be obeyed if there is a large number of dirtied
	// files that have not been flushed or closed.
	//
	// Most users will want to use ChooseTempDirLimitNumFiles to choose this.
	TempDirLimitNumFiles int

	// A desired limit on temporary space usage, in bytes. May not be obeyed if
	// there is a large volume of dirtied files that have not been flushed or
	// closed.
	TempDirLimitBytes int64

	// If set to a non-zero value N, the file system will read objects from GCS a
	// chunk at a time with a maximum read size of N, caching each chunk
	// independently. The part about separate caching does not apply to dirty
	// files, for which the entire contents will be in the temporary directory
	// regardless of this setting.
	GCSChunkSize uint64

	// By default, if a bucket contains the object "foo/bar" but no object named
	// "foo/", it's as if the directory doesn't exist. This allows us to have
	// non-flaky name resolution code.
	//
	// Setting this bool to true enables a mode where object listings are
	// consulted to allow for the directory in the situation above to exist. Note
	// that this has drawbacks in the form of name resolution flakiness and
	// surprising behavior.
	//
	// See docs/semantics.md for more info.
	ImplicitDirectories bool

	// If non-zero, each directory will maintain a cache from child name to
	// information about whether that name exists as a file and/or directory.
	// This may speed up calls to look up and stat inodes, especially when
	// combined with a stat-caching GCS bucket, but comes at the cost of
	// consistency: if the child is removed and recreated with a different type
	// before the expiration, we may fail to find it.
	DirTypeCacheTTL time.Duration

	// The UID and GID that owns all inodes in the file system.
	Uid uint32
	Gid uint32

	// Permissions bits to use for files and directories. No bits outside of
	// os.ModePerm may be set.
	FilePerms os.FileMode
	DirPerms  os.FileMode

	// Files backed by on object of length at least AppendThreshold that have
	// only been appended to (i.e. none of the object's contents have been
	// dirtied) will be written out by "appending" to the object in GCS with this
	// process:
	//
	// 1. Write out a temporary object containing the appended contents whose
	//    name begins with TmpObjectPrefix.
	//
	// 2. Compose the original object and the temporary object on top of the
	//    original object.
	//
	// 3. Delete the temporary object.
	//
	// Note that if the process fails or is interrupted the temporary object will
	// not be cleaned up, so the user must ensure that TmpObjectPrefix is
	// periodically garbage collected.
	AppendThreshold int64
	TmpObjectPrefix string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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