sync

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sync provides utility functions similar to `git pull/push` for PFS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Push

func Push(client *pachclient.APIClient, root string, commit *pfs.Commit, overwrite bool) error

Push puts files under root into an open commit.

func PushObj added in v1.3.2

func PushObj(pachClient pachclient.APIClient, commit *pfs.Commit, objClient obj.Client, root string) error

PushObj pushes data from commit to an object store.

Types

type Puller added in v1.3.17

type Puller struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Puller as a struct for managing a Pull operation.

func NewPuller added in v1.3.17

func NewPuller() *Puller

NewPuller creates a new Puller struct.

func (*Puller) CleanUp added in v1.3.17

func (p *Puller) CleanUp() (int64, error)

CleanUp cleans up blocked syscalls for pipes that were never opened. And returns the total number of bytes that have been pulled/pushed. It also returns any errors that might have been encountered while trying to read data for the pipes. CleanUp should be called after all code that might access pipes has completed running, it should not be called concurrently.

func (*Puller) Pull added in v1.3.17

func (p *Puller) Pull(client *pachclient.APIClient, root string, repo, commit, file string,
	pipes bool, concurrency int, tree hashtree.OpenHashTree, treeRoot string) error

Pull clones an entire repo at a certain commit. root is the local path you want to clone to. fileInfo is the file/dir we are puuling. pipes causes the function to create named pipes in place of files, thus lazily downloading the data as it's needed. tree is a hashtree to mirror the pulled content into (it may be left nil) treeRoot is the root the data is mirrored to within tree

func (*Puller) PullDiff added in v1.4.8

func (p *Puller) PullDiff(client *pachclient.APIClient, root string, newRepo, newCommit, newPath, oldRepo, oldCommit, oldPath string,
	newOnly bool, pipes bool, concurrency int, tree hashtree.OpenHashTree, treeRoot string) error

PullDiff is like Pull except that it materializes a Diff of the content rather than a the actual content. If newOnly is true then only new files will be downloaded and they will be downloaded under root. Otherwise new and old files will be downloaded under root/new and root/old respectively.

func (*Puller) PullTree added in v1.4.8

func (p *Puller) PullTree(client *pachclient.APIClient, root string, tree hashtree.HashTree, pipes bool, concurrency int) error

PullTree pulls from a raw HashTree rather than a repo.

Jump to

Keyboard shortcuts

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