repo
stringlengths
5
67
path
stringlengths
4
218
func_name
stringlengths
0
151
original_string
stringlengths
52
373k
language
stringclasses
6 values
code
stringlengths
52
373k
code_tokens
listlengths
10
512
docstring
stringlengths
3
47.2k
docstring_tokens
listlengths
3
234
sha
stringlengths
40
40
url
stringlengths
85
339
partition
stringclasses
3 values
pachyderm/pachyderm
src/client/pfs.go
BuildCommit
func (c APIClient) BuildCommit(repoName string, branch string, parent string, treeObject string) (*pfs.Commit, error) { commit, err := c.PfsAPIClient.BuildCommit( c.Ctx(), &pfs.BuildCommitRequest{ Parent: NewCommit(repoName, parent), Branch: branch, Tree: &pfs.Object{Hash: treeObject}, }, ) if err !...
go
func (c APIClient) BuildCommit(repoName string, branch string, parent string, treeObject string) (*pfs.Commit, error) { commit, err := c.PfsAPIClient.BuildCommit( c.Ctx(), &pfs.BuildCommitRequest{ Parent: NewCommit(repoName, parent), Branch: branch, Tree: &pfs.Object{Hash: treeObject}, }, ) if err !...
[ "func", "(", "c", "APIClient", ")", "BuildCommit", "(", "repoName", "string", ",", "branch", "string", ",", "parent", "string", ",", "treeObject", "string", ")", "(", "*", "pfs", ".", "Commit", ",", "error", ")", "{", "commit", ",", "err", ":=", "c", ...
// BuildCommit builds a commit in a single call from an existing HashTree that // has already been written to the object store. Note this is a more advanced // pattern for creating commits that's mostly used internally.
[ "BuildCommit", "builds", "a", "commit", "in", "a", "single", "call", "from", "an", "existing", "HashTree", "that", "has", "already", "been", "written", "to", "the", "object", "store", ".", "Note", "this", "is", "a", "more", "advanced", "pattern", "for", "c...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L166-L179
test
pachyderm/pachyderm
src/client/pfs.go
StartCommitParent
func (c APIClient) StartCommitParent(repoName string, branch string, parentCommit string) (*pfs.Commit, error) { commit, err := c.PfsAPIClient.StartCommit( c.Ctx(), &pfs.StartCommitRequest{ Parent: &pfs.Commit{ Repo: &pfs.Repo{ Name: repoName, }, ID: parentCommit, }, Branch: branch, }, ...
go
func (c APIClient) StartCommitParent(repoName string, branch string, parentCommit string) (*pfs.Commit, error) { commit, err := c.PfsAPIClient.StartCommit( c.Ctx(), &pfs.StartCommitRequest{ Parent: &pfs.Commit{ Repo: &pfs.Repo{ Name: repoName, }, ID: parentCommit, }, Branch: branch, }, ...
[ "func", "(", "c", "APIClient", ")", "StartCommitParent", "(", "repoName", "string", ",", "branch", "string", ",", "parentCommit", "string", ")", "(", "*", "pfs", ".", "Commit", ",", "error", ")", "{", "commit", ",", "err", ":=", "c", ".", "PfsAPIClient",...
// StartCommitParent begins the process of committing data to a Repo. Once started // you can write to the Commit with PutFile and when all the data has been // written you must finish the Commit with FinishCommit. NOTE, data is not // persisted until FinishCommit is called. // branch is a more convenient way to build ...
[ "StartCommitParent", "begins", "the", "process", "of", "committing", "data", "to", "a", "Repo", ".", "Once", "started", "you", "can", "write", "to", "the", "Commit", "with", "PutFile", "and", "when", "all", "the", "data", "has", "been", "written", "you", "...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L195-L212
test
pachyderm/pachyderm
src/client/pfs.go
FinishCommit
func (c APIClient) FinishCommit(repoName string, commitID string) error { _, err := c.PfsAPIClient.FinishCommit( c.Ctx(), &pfs.FinishCommitRequest{ Commit: NewCommit(repoName, commitID), }, ) return grpcutil.ScrubGRPC(err) }
go
func (c APIClient) FinishCommit(repoName string, commitID string) error { _, err := c.PfsAPIClient.FinishCommit( c.Ctx(), &pfs.FinishCommitRequest{ Commit: NewCommit(repoName, commitID), }, ) return grpcutil.ScrubGRPC(err) }
[ "func", "(", "c", "APIClient", ")", "FinishCommit", "(", "repoName", "string", ",", "commitID", "string", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "FinishCommit", "(", "c", ".", "Ctx", "(", ")", ",", "&", "pfs", ".", ...
// FinishCommit ends the process of committing data to a Repo and persists the // Commit. Once a Commit is finished the data becomes immutable and future // attempts to write to it with PutFile will error.
[ "FinishCommit", "ends", "the", "process", "of", "committing", "data", "to", "a", "Repo", "and", "persists", "the", "Commit", ".", "Once", "a", "Commit", "is", "finished", "the", "data", "becomes", "immutable", "and", "future", "attempts", "to", "write", "to"...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L217-L225
test
pachyderm/pachyderm
src/client/pfs.go
InspectCommit
func (c APIClient) InspectCommit(repoName string, commitID string) (*pfs.CommitInfo, error) { return c.inspectCommit(repoName, commitID, pfs.CommitState_STARTED) }
go
func (c APIClient) InspectCommit(repoName string, commitID string) (*pfs.CommitInfo, error) { return c.inspectCommit(repoName, commitID, pfs.CommitState_STARTED) }
[ "func", "(", "c", "APIClient", ")", "InspectCommit", "(", "repoName", "string", ",", "commitID", "string", ")", "(", "*", "pfs", ".", "CommitInfo", ",", "error", ")", "{", "return", "c", ".", "inspectCommit", "(", "repoName", ",", "commitID", ",", "pfs",...
// InspectCommit returns info about a specific Commit.
[ "InspectCommit", "returns", "info", "about", "a", "specific", "Commit", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L228-L230
test
pachyderm/pachyderm
src/client/pfs.go
BlockCommit
func (c APIClient) BlockCommit(repoName string, commitID string) (*pfs.CommitInfo, error) { return c.inspectCommit(repoName, commitID, pfs.CommitState_FINISHED) }
go
func (c APIClient) BlockCommit(repoName string, commitID string) (*pfs.CommitInfo, error) { return c.inspectCommit(repoName, commitID, pfs.CommitState_FINISHED) }
[ "func", "(", "c", "APIClient", ")", "BlockCommit", "(", "repoName", "string", ",", "commitID", "string", ")", "(", "*", "pfs", ".", "CommitInfo", ",", "error", ")", "{", "return", "c", ".", "inspectCommit", "(", "repoName", ",", "commitID", ",", "pfs", ...
// BlockCommit returns info about a specific Commit, but blocks until that // commit has been finished.
[ "BlockCommit", "returns", "info", "about", "a", "specific", "Commit", "but", "blocks", "until", "that", "commit", "has", "been", "finished", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L234-L236
test
pachyderm/pachyderm
src/client/pfs.go
ListCommit
func (c APIClient) ListCommit(repoName string, to string, from string, number uint64) ([]*pfs.CommitInfo, error) { var result []*pfs.CommitInfo if err := c.ListCommitF(repoName, to, from, number, func(ci *pfs.CommitInfo) error { result = append(result, ci) return nil }); err != nil { return nil, err } return...
go
func (c APIClient) ListCommit(repoName string, to string, from string, number uint64) ([]*pfs.CommitInfo, error) { var result []*pfs.CommitInfo if err := c.ListCommitF(repoName, to, from, number, func(ci *pfs.CommitInfo) error { result = append(result, ci) return nil }); err != nil { return nil, err } return...
[ "func", "(", "c", "APIClient", ")", "ListCommit", "(", "repoName", "string", ",", "to", "string", ",", "from", "string", ",", "number", "uint64", ")", "(", "[", "]", "*", "pfs", ".", "CommitInfo", ",", "error", ")", "{", "var", "result", "[", "]", ...
// ListCommit lists commits. // If only `repo` is given, all commits in the repo are returned. // If `to` is given, only the ancestors of `to`, including `to` itself, // are considered. // If `from` is given, only the descendents of `from`, including `from` // itself, are considered. // `number` determines how many com...
[ "ListCommit", "lists", "commits", ".", "If", "only", "repo", "is", "given", "all", "commits", "in", "the", "repo", "are", "returned", ".", "If", "to", "is", "given", "only", "the", "ancestors", "of", "to", "including", "to", "itself", "are", "considered", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L260-L269
test
pachyderm/pachyderm
src/client/pfs.go
ListCommitF
func (c APIClient) ListCommitF(repoName string, to string, from string, number uint64, f func(*pfs.CommitInfo) error) error { req := &pfs.ListCommitRequest{ Repo: NewRepo(repoName), Number: number, } if from != "" { req.From = NewCommit(repoName, from) } if to != "" { req.To = NewCommit(repoName, to) } ...
go
func (c APIClient) ListCommitF(repoName string, to string, from string, number uint64, f func(*pfs.CommitInfo) error) error { req := &pfs.ListCommitRequest{ Repo: NewRepo(repoName), Number: number, } if from != "" { req.From = NewCommit(repoName, from) } if to != "" { req.To = NewCommit(repoName, to) } ...
[ "func", "(", "c", "APIClient", ")", "ListCommitF", "(", "repoName", "string", ",", "to", "string", ",", "from", "string", ",", "number", "uint64", ",", "f", "func", "(", "*", "pfs", ".", "CommitInfo", ")", "error", ")", "error", "{", "req", ":=", "&"...
// ListCommitF lists commits, calling f with each commit. // If only `repo` is given, all commits in the repo are returned. // If `to` is given, only the ancestors of `to`, including `to` itself, // are considered. // If `from` is given, only the descendents of `from`, including `from` // itself, are considered. // `nu...
[ "ListCommitF", "lists", "commits", "calling", "f", "with", "each", "commit", ".", "If", "only", "repo", "is", "given", "all", "commits", "in", "the", "repo", "are", "returned", ".", "If", "to", "is", "given", "only", "the", "ancestors", "of", "to", "incl...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L279-L309
test
pachyderm/pachyderm
src/client/pfs.go
ListCommitByRepo
func (c APIClient) ListCommitByRepo(repoName string) ([]*pfs.CommitInfo, error) { return c.ListCommit(repoName, "", "", 0) }
go
func (c APIClient) ListCommitByRepo(repoName string) ([]*pfs.CommitInfo, error) { return c.ListCommit(repoName, "", "", 0) }
[ "func", "(", "c", "APIClient", ")", "ListCommitByRepo", "(", "repoName", "string", ")", "(", "[", "]", "*", "pfs", ".", "CommitInfo", ",", "error", ")", "{", "return", "c", ".", "ListCommit", "(", "repoName", ",", "\"\"", ",", "\"\"", ",", "0", ")", ...
// ListCommitByRepo lists all commits in a repo.
[ "ListCommitByRepo", "lists", "all", "commits", "in", "a", "repo", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L312-L314
test
pachyderm/pachyderm
src/client/pfs.go
CreateBranch
func (c APIClient) CreateBranch(repoName string, branch string, commit string, provenance []*pfs.Branch) error { var head *pfs.Commit if commit != "" { head = NewCommit(repoName, commit) } _, err := c.PfsAPIClient.CreateBranch( c.Ctx(), &pfs.CreateBranchRequest{ Branch: NewBranch(repoName, branch), ...
go
func (c APIClient) CreateBranch(repoName string, branch string, commit string, provenance []*pfs.Branch) error { var head *pfs.Commit if commit != "" { head = NewCommit(repoName, commit) } _, err := c.PfsAPIClient.CreateBranch( c.Ctx(), &pfs.CreateBranchRequest{ Branch: NewBranch(repoName, branch), ...
[ "func", "(", "c", "APIClient", ")", "CreateBranch", "(", "repoName", "string", ",", "branch", "string", ",", "commit", "string", ",", "provenance", "[", "]", "*", "pfs", ".", "Branch", ")", "error", "{", "var", "head", "*", "pfs", ".", "Commit", "\n", ...
// CreateBranch creates a new branch
[ "CreateBranch", "creates", "a", "new", "branch" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L317-L331
test
pachyderm/pachyderm
src/client/pfs.go
InspectBranch
func (c APIClient) InspectBranch(repoName string, branch string) (*pfs.BranchInfo, error) { branchInfo, err := c.PfsAPIClient.InspectBranch( c.Ctx(), &pfs.InspectBranchRequest{ Branch: NewBranch(repoName, branch), }, ) return branchInfo, grpcutil.ScrubGRPC(err) }
go
func (c APIClient) InspectBranch(repoName string, branch string) (*pfs.BranchInfo, error) { branchInfo, err := c.PfsAPIClient.InspectBranch( c.Ctx(), &pfs.InspectBranchRequest{ Branch: NewBranch(repoName, branch), }, ) return branchInfo, grpcutil.ScrubGRPC(err) }
[ "func", "(", "c", "APIClient", ")", "InspectBranch", "(", "repoName", "string", ",", "branch", "string", ")", "(", "*", "pfs", ".", "BranchInfo", ",", "error", ")", "{", "branchInfo", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "InspectBranch", "(",...
// InspectBranch returns information on a specific PFS branch
[ "InspectBranch", "returns", "information", "on", "a", "specific", "PFS", "branch" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L334-L342
test
pachyderm/pachyderm
src/client/pfs.go
ListBranch
func (c APIClient) ListBranch(repoName string) ([]*pfs.BranchInfo, error) { branchInfos, err := c.PfsAPIClient.ListBranch( c.Ctx(), &pfs.ListBranchRequest{ Repo: NewRepo(repoName), }, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return branchInfos.BranchInfo, nil }
go
func (c APIClient) ListBranch(repoName string) ([]*pfs.BranchInfo, error) { branchInfos, err := c.PfsAPIClient.ListBranch( c.Ctx(), &pfs.ListBranchRequest{ Repo: NewRepo(repoName), }, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return branchInfos.BranchInfo, nil }
[ "func", "(", "c", "APIClient", ")", "ListBranch", "(", "repoName", "string", ")", "(", "[", "]", "*", "pfs", ".", "BranchInfo", ",", "error", ")", "{", "branchInfos", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "ListBranch", "(", "c", ".", "Ctx"...
// ListBranch lists the active branches on a Repo.
[ "ListBranch", "lists", "the", "active", "branches", "on", "a", "Repo", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L345-L356
test
pachyderm/pachyderm
src/client/pfs.go
SetBranch
func (c APIClient) SetBranch(repoName string, commit string, branch string) error { return c.CreateBranch(repoName, branch, commit, nil) }
go
func (c APIClient) SetBranch(repoName string, commit string, branch string) error { return c.CreateBranch(repoName, branch, commit, nil) }
[ "func", "(", "c", "APIClient", ")", "SetBranch", "(", "repoName", "string", ",", "commit", "string", ",", "branch", "string", ")", "error", "{", "return", "c", ".", "CreateBranch", "(", "repoName", ",", "branch", ",", "commit", ",", "nil", ")", "\n", "...
// SetBranch sets a commit and its ancestors as a branch. // SetBranch is deprecated in favor of CommitBranch.
[ "SetBranch", "sets", "a", "commit", "and", "its", "ancestors", "as", "a", "branch", ".", "SetBranch", "is", "deprecated", "in", "favor", "of", "CommitBranch", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L360-L362
test
pachyderm/pachyderm
src/client/pfs.go
DeleteBranch
func (c APIClient) DeleteBranch(repoName string, branch string, force bool) error { _, err := c.PfsAPIClient.DeleteBranch( c.Ctx(), &pfs.DeleteBranchRequest{ Branch: NewBranch(repoName, branch), Force: force, }, ) return grpcutil.ScrubGRPC(err) }
go
func (c APIClient) DeleteBranch(repoName string, branch string, force bool) error { _, err := c.PfsAPIClient.DeleteBranch( c.Ctx(), &pfs.DeleteBranchRequest{ Branch: NewBranch(repoName, branch), Force: force, }, ) return grpcutil.ScrubGRPC(err) }
[ "func", "(", "c", "APIClient", ")", "DeleteBranch", "(", "repoName", "string", ",", "branch", "string", ",", "force", "bool", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "DeleteBranch", "(", "c", ".", "Ctx", "(", ")", ","...
// DeleteBranch deletes a branch, but leaves the commits themselves intact. // In other words, those commits can still be accessed via commit IDs and // other branches they happen to be on.
[ "DeleteBranch", "deletes", "a", "branch", "but", "leaves", "the", "commits", "themselves", "intact", ".", "In", "other", "words", "those", "commits", "can", "still", "be", "accessed", "via", "commit", "IDs", "and", "other", "branches", "they", "happen", "to", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L367-L376
test
pachyderm/pachyderm
src/client/pfs.go
DeleteCommit
func (c APIClient) DeleteCommit(repoName string, commitID string) error { _, err := c.PfsAPIClient.DeleteCommit( c.Ctx(), &pfs.DeleteCommitRequest{ Commit: NewCommit(repoName, commitID), }, ) return grpcutil.ScrubGRPC(err) }
go
func (c APIClient) DeleteCommit(repoName string, commitID string) error { _, err := c.PfsAPIClient.DeleteCommit( c.Ctx(), &pfs.DeleteCommitRequest{ Commit: NewCommit(repoName, commitID), }, ) return grpcutil.ScrubGRPC(err) }
[ "func", "(", "c", "APIClient", ")", "DeleteCommit", "(", "repoName", "string", ",", "commitID", "string", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "DeleteCommit", "(", "c", ".", "Ctx", "(", ")", ",", "&", "pfs", ".", ...
// DeleteCommit deletes a commit.
[ "DeleteCommit", "deletes", "a", "commit", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L379-L387
test
pachyderm/pachyderm
src/client/pfs.go
FlushCommit
func (c APIClient) FlushCommit(commits []*pfs.Commit, toRepos []*pfs.Repo) (CommitInfoIterator, error) { ctx, cancel := context.WithCancel(c.Ctx()) stream, err := c.PfsAPIClient.FlushCommit( ctx, &pfs.FlushCommitRequest{ Commits: commits, ToRepos: toRepos, }, ) if err != nil { cancel() return nil, g...
go
func (c APIClient) FlushCommit(commits []*pfs.Commit, toRepos []*pfs.Repo) (CommitInfoIterator, error) { ctx, cancel := context.WithCancel(c.Ctx()) stream, err := c.PfsAPIClient.FlushCommit( ctx, &pfs.FlushCommitRequest{ Commits: commits, ToRepos: toRepos, }, ) if err != nil { cancel() return nil, g...
[ "func", "(", "c", "APIClient", ")", "FlushCommit", "(", "commits", "[", "]", "*", "pfs", ".", "Commit", ",", "toRepos", "[", "]", "*", "pfs", ".", "Repo", ")", "(", "CommitInfoIterator", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ...
// FlushCommit returns an iterator that returns commits that have the // specified `commits` as provenance. Note that the iterator can block if // jobs have not successfully completed. This in effect waits for all of the // jobs that are triggered by a set of commits to complete. // // If toRepos is not nil then only ...
[ "FlushCommit", "returns", "an", "iterator", "that", "returns", "commits", "that", "have", "the", "specified", "commits", "as", "provenance", ".", "Note", "that", "the", "iterator", "can", "block", "if", "jobs", "have", "not", "successfully", "completed", ".", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L400-L414
test
pachyderm/pachyderm
src/client/pfs.go
FlushCommitF
func (c APIClient) FlushCommitF(commits []*pfs.Commit, toRepos []*pfs.Repo, f func(*pfs.CommitInfo) error) error { stream, err := c.PfsAPIClient.FlushCommit( c.Ctx(), &pfs.FlushCommitRequest{ Commits: commits, ToRepos: toRepos, }, ) if err != nil { return grpcutil.ScrubGRPC(err) } for { ci, err := ...
go
func (c APIClient) FlushCommitF(commits []*pfs.Commit, toRepos []*pfs.Repo, f func(*pfs.CommitInfo) error) error { stream, err := c.PfsAPIClient.FlushCommit( c.Ctx(), &pfs.FlushCommitRequest{ Commits: commits, ToRepos: toRepos, }, ) if err != nil { return grpcutil.ScrubGRPC(err) } for { ci, err := ...
[ "func", "(", "c", "APIClient", ")", "FlushCommitF", "(", "commits", "[", "]", "*", "pfs", ".", "Commit", ",", "toRepos", "[", "]", "*", "pfs", ".", "Repo", ",", "f", "func", "(", "*", "pfs", ".", "CommitInfo", ")", "error", ")", "error", "{", "st...
// FlushCommitF calls f with commits that have the specified `commits` as // provenance. Note that it can block if jobs have not successfully // completed. This in effect waits for all of the jobs that are triggered by a // set of commits to complete. // // If toRepos is not nil then only the commits up to and includin...
[ "FlushCommitF", "calls", "f", "with", "commits", "that", "have", "the", "specified", "commits", "as", "provenance", ".", "Note", "that", "it", "can", "block", "if", "jobs", "have", "not", "successfully", "completed", ".", "This", "in", "effect", "waits", "fo...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L427-L450
test
pachyderm/pachyderm
src/client/pfs.go
FlushCommitAll
func (c APIClient) FlushCommitAll(commits []*pfs.Commit, toRepos []*pfs.Repo) ([]*pfs.CommitInfo, error) { var result []*pfs.CommitInfo if err := c.FlushCommitF(commits, toRepos, func(ci *pfs.CommitInfo) error { result = append(result, ci) return nil }); err != nil { return nil, err } return result, nil }
go
func (c APIClient) FlushCommitAll(commits []*pfs.Commit, toRepos []*pfs.Repo) ([]*pfs.CommitInfo, error) { var result []*pfs.CommitInfo if err := c.FlushCommitF(commits, toRepos, func(ci *pfs.CommitInfo) error { result = append(result, ci) return nil }); err != nil { return nil, err } return result, nil }
[ "func", "(", "c", "APIClient", ")", "FlushCommitAll", "(", "commits", "[", "]", "*", "pfs", ".", "Commit", ",", "toRepos", "[", "]", "*", "pfs", ".", "Repo", ")", "(", "[", "]", "*", "pfs", ".", "CommitInfo", ",", "error", ")", "{", "var", "resul...
// FlushCommitAll returns commits that have the specified `commits` as // provenance. Note that it can block if jobs have not successfully // completed. This in effect waits for all of the jobs that are triggered by a // set of commits to complete. // // If toRepos is not nil then only the commits up to and including t...
[ "FlushCommitAll", "returns", "commits", "that", "have", "the", "specified", "commits", "as", "provenance", ".", "Note", "that", "it", "can", "block", "if", "jobs", "have", "not", "successfully", "completed", ".", "This", "in", "effect", "waits", "for", "all", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L463-L472
test
pachyderm/pachyderm
src/client/pfs.go
SubscribeCommit
func (c APIClient) SubscribeCommit(repo string, branch string, from string, state pfs.CommitState) (CommitInfoIterator, error) { ctx, cancel := context.WithCancel(c.Ctx()) req := &pfs.SubscribeCommitRequest{ Repo: NewRepo(repo), Branch: branch, State: state, } if from != "" { req.From = NewCommit(repo, f...
go
func (c APIClient) SubscribeCommit(repo string, branch string, from string, state pfs.CommitState) (CommitInfoIterator, error) { ctx, cancel := context.WithCancel(c.Ctx()) req := &pfs.SubscribeCommitRequest{ Repo: NewRepo(repo), Branch: branch, State: state, } if from != "" { req.From = NewCommit(repo, f...
[ "func", "(", "c", "APIClient", ")", "SubscribeCommit", "(", "repo", "string", ",", "branch", "string", ",", "from", "string", ",", "state", "pfs", ".", "CommitState", ")", "(", "CommitInfoIterator", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "co...
// SubscribeCommit is like ListCommit but it keeps listening for commits as // they come in.
[ "SubscribeCommit", "is", "like", "ListCommit", "but", "it", "keeps", "listening", "for", "commits", "as", "they", "come", "in", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L503-L519
test
pachyderm/pachyderm
src/client/pfs.go
SubscribeCommitF
func (c APIClient) SubscribeCommitF(repo, branch, from string, state pfs.CommitState, f func(*pfs.CommitInfo) error) error { req := &pfs.SubscribeCommitRequest{ Repo: NewRepo(repo), Branch: branch, State: state, } if from != "" { req.From = NewCommit(repo, from) } stream, err := c.PfsAPIClient.Subscribe...
go
func (c APIClient) SubscribeCommitF(repo, branch, from string, state pfs.CommitState, f func(*pfs.CommitInfo) error) error { req := &pfs.SubscribeCommitRequest{ Repo: NewRepo(repo), Branch: branch, State: state, } if from != "" { req.From = NewCommit(repo, from) } stream, err := c.PfsAPIClient.Subscribe...
[ "func", "(", "c", "APIClient", ")", "SubscribeCommitF", "(", "repo", ",", "branch", ",", "from", "string", ",", "state", "pfs", ".", "CommitState", ",", "f", "func", "(", "*", "pfs", ".", "CommitInfo", ")", "error", ")", "error", "{", "req", ":=", "&...
// SubscribeCommitF is like ListCommit but it calls a callback function with // the results rather than returning an iterator.
[ "SubscribeCommitF", "is", "like", "ListCommit", "but", "it", "calls", "a", "callback", "function", "with", "the", "results", "rather", "than", "returning", "an", "iterator", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L523-L545
test
pachyderm/pachyderm
src/client/pfs.go
PutObjectAsync
func (c APIClient) PutObjectAsync(tags []*pfs.Tag) (*PutObjectWriteCloserAsync, error) { w, err := c.newPutObjectWriteCloserAsync(tags) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return w, nil }
go
func (c APIClient) PutObjectAsync(tags []*pfs.Tag) (*PutObjectWriteCloserAsync, error) { w, err := c.newPutObjectWriteCloserAsync(tags) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return w, nil }
[ "func", "(", "c", "APIClient", ")", "PutObjectAsync", "(", "tags", "[", "]", "*", "pfs", ".", "Tag", ")", "(", "*", "PutObjectWriteCloserAsync", ",", "error", ")", "{", "w", ",", "err", ":=", "c", ".", "newPutObjectWriteCloserAsync", "(", "tags", ")", ...
// PutObjectAsync puts a value into the object store asynchronously.
[ "PutObjectAsync", "puts", "a", "value", "into", "the", "object", "store", "asynchronously", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L548-L554
test
pachyderm/pachyderm
src/client/pfs.go
PutObject
func (c APIClient) PutObject(_r io.Reader, tags ...string) (object *pfs.Object, _ int64, retErr error) { r := grpcutil.ReaderWrapper{_r} w, err := c.newPutObjectWriteCloser(tags...) if err != nil { return nil, 0, grpcutil.ScrubGRPC(err) } defer func() { if err := w.Close(); err != nil && retErr == nil { ret...
go
func (c APIClient) PutObject(_r io.Reader, tags ...string) (object *pfs.Object, _ int64, retErr error) { r := grpcutil.ReaderWrapper{_r} w, err := c.newPutObjectWriteCloser(tags...) if err != nil { return nil, 0, grpcutil.ScrubGRPC(err) } defer func() { if err := w.Close(); err != nil && retErr == nil { ret...
[ "func", "(", "c", "APIClient", ")", "PutObject", "(", "_r", "io", ".", "Reader", ",", "tags", "...", "string", ")", "(", "object", "*", "pfs", ".", "Object", ",", "_", "int64", ",", "retErr", "error", ")", "{", "r", ":=", "grpcutil", ".", "ReaderWr...
// PutObject puts a value into the object store and tags it with 0 or more tags.
[ "PutObject", "puts", "a", "value", "into", "the", "object", "store", "and", "tags", "it", "with", "0", "or", "more", "tags", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L557-L579
test
pachyderm/pachyderm
src/client/pfs.go
PutObjectSplit
func (c APIClient) PutObjectSplit(_r io.Reader) (objects []*pfs.Object, _ int64, retErr error) { r := grpcutil.ReaderWrapper{_r} w, err := c.newPutObjectSplitWriteCloser() if err != nil { return nil, 0, grpcutil.ScrubGRPC(err) } defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = grpc...
go
func (c APIClient) PutObjectSplit(_r io.Reader) (objects []*pfs.Object, _ int64, retErr error) { r := grpcutil.ReaderWrapper{_r} w, err := c.newPutObjectSplitWriteCloser() if err != nil { return nil, 0, grpcutil.ScrubGRPC(err) } defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = grpc...
[ "func", "(", "c", "APIClient", ")", "PutObjectSplit", "(", "_r", "io", ".", "Reader", ")", "(", "objects", "[", "]", "*", "pfs", ".", "Object", ",", "_", "int64", ",", "retErr", "error", ")", "{", "r", ":=", "grpcutil", ".", "ReaderWrapper", "{", "...
// PutObjectSplit is the same as PutObject except that the data is splitted // into several smaller objects. This is primarily useful if you'd like to // be able to resume upload.
[ "PutObjectSplit", "is", "the", "same", "as", "PutObject", "except", "that", "the", "data", "is", "splitted", "into", "several", "smaller", "objects", ".", "This", "is", "primarily", "useful", "if", "you", "d", "like", "to", "be", "able", "to", "resume", "u...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L584-L606
test
pachyderm/pachyderm
src/client/pfs.go
GetObject
func (c APIClient) GetObject(hash string, writer io.Writer) error { getObjectClient, err := c.ObjectAPIClient.GetObject( c.Ctx(), &pfs.Object{Hash: hash}, ) if err != nil { return grpcutil.ScrubGRPC(err) } if err := grpcutil.WriteFromStreamingBytesClient(getObjectClient, writer); err != nil { return grpcut...
go
func (c APIClient) GetObject(hash string, writer io.Writer) error { getObjectClient, err := c.ObjectAPIClient.GetObject( c.Ctx(), &pfs.Object{Hash: hash}, ) if err != nil { return grpcutil.ScrubGRPC(err) } if err := grpcutil.WriteFromStreamingBytesClient(getObjectClient, writer); err != nil { return grpcut...
[ "func", "(", "c", "APIClient", ")", "GetObject", "(", "hash", "string", ",", "writer", "io", ".", "Writer", ")", "error", "{", "getObjectClient", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "GetObject", "(", "c", ".", "Ctx", "(", ")", ",", "&...
// GetObject gets an object out of the object store by hash.
[ "GetObject", "gets", "an", "object", "out", "of", "the", "object", "store", "by", "hash", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L609-L621
test
pachyderm/pachyderm
src/client/pfs.go
GetObjectReader
func (c APIClient) GetObjectReader(hash string) (io.ReadCloser, error) { ctx, cancel := context.WithCancel(c.Ctx()) getObjectClient, err := c.ObjectAPIClient.GetObject( ctx, &pfs.Object{Hash: hash}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(getObjectClie...
go
func (c APIClient) GetObjectReader(hash string) (io.ReadCloser, error) { ctx, cancel := context.WithCancel(c.Ctx()) getObjectClient, err := c.ObjectAPIClient.GetObject( ctx, &pfs.Object{Hash: hash}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(getObjectClie...
[ "func", "(", "c", "APIClient", ")", "GetObjectReader", "(", "hash", "string", ")", "(", "io", ".", "ReadCloser", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ".", "WithCancel", "(", "c", ".", "Ctx", "(", ")", ")", "\n", "getObjectCl...
// GetObjectReader returns a reader for an object in object store by hash.
[ "GetObjectReader", "returns", "a", "reader", "for", "an", "object", "in", "object", "store", "by", "hash", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L624-L634
test
pachyderm/pachyderm
src/client/pfs.go
GetObjects
func (c APIClient) GetObjects(hashes []string, offset uint64, size uint64, totalSize uint64, writer io.Writer) error { var objects []*pfs.Object for _, hash := range hashes { objects = append(objects, &pfs.Object{Hash: hash}) } getObjectsClient, err := c.ObjectAPIClient.GetObjects( c.Ctx(), &pfs.GetObjectsReq...
go
func (c APIClient) GetObjects(hashes []string, offset uint64, size uint64, totalSize uint64, writer io.Writer) error { var objects []*pfs.Object for _, hash := range hashes { objects = append(objects, &pfs.Object{Hash: hash}) } getObjectsClient, err := c.ObjectAPIClient.GetObjects( c.Ctx(), &pfs.GetObjectsReq...
[ "func", "(", "c", "APIClient", ")", "GetObjects", "(", "hashes", "[", "]", "string", ",", "offset", "uint64", ",", "size", "uint64", ",", "totalSize", "uint64", ",", "writer", "io", ".", "Writer", ")", "error", "{", "var", "objects", "[", "]", "*", "...
// GetObjects gets several objects out of the object store by hash.
[ "GetObjects", "gets", "several", "objects", "out", "of", "the", "object", "store", "by", "hash", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L646-L667
test
pachyderm/pachyderm
src/client/pfs.go
TagObject
func (c APIClient) TagObject(hash string, tags ...string) error { var _tags []*pfs.Tag for _, tag := range tags { _tags = append(_tags, &pfs.Tag{Name: tag}) } if _, err := c.ObjectAPIClient.TagObject( c.Ctx(), &pfs.TagObjectRequest{ Object: &pfs.Object{Hash: hash}, Tags: _tags, }, ); err != nil { ...
go
func (c APIClient) TagObject(hash string, tags ...string) error { var _tags []*pfs.Tag for _, tag := range tags { _tags = append(_tags, &pfs.Tag{Name: tag}) } if _, err := c.ObjectAPIClient.TagObject( c.Ctx(), &pfs.TagObjectRequest{ Object: &pfs.Object{Hash: hash}, Tags: _tags, }, ); err != nil { ...
[ "func", "(", "c", "APIClient", ")", "TagObject", "(", "hash", "string", ",", "tags", "...", "string", ")", "error", "{", "var", "_tags", "[", "]", "*", "pfs", ".", "Tag", "\n", "for", "_", ",", "tag", ":=", "range", "tags", "{", "_tags", "=", "ap...
// TagObject applies a tag to an existing object.
[ "TagObject", "applies", "a", "tag", "to", "an", "existing", "object", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L679-L694
test
pachyderm/pachyderm
src/client/pfs.go
ListObject
func (c APIClient) ListObject(f func(*pfs.Object) error) error { listObjectClient, err := c.ObjectAPIClient.ListObjects(c.Ctx(), &pfs.ListObjectsRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } for { object, err := listObjectClient.Recv() if err != nil { if err == io.EOF { return nil } ...
go
func (c APIClient) ListObject(f func(*pfs.Object) error) error { listObjectClient, err := c.ObjectAPIClient.ListObjects(c.Ctx(), &pfs.ListObjectsRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } for { object, err := listObjectClient.Recv() if err != nil { if err == io.EOF { return nil } ...
[ "func", "(", "c", "APIClient", ")", "ListObject", "(", "f", "func", "(", "*", "pfs", ".", "Object", ")", "error", ")", "error", "{", "listObjectClient", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "ListObjects", "(", "c", ".", "Ctx", "(", ")"...
// ListObject lists objects stored in pfs.
[ "ListObject", "lists", "objects", "stored", "in", "pfs", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L697-L714
test
pachyderm/pachyderm
src/client/pfs.go
InspectObject
func (c APIClient) InspectObject(hash string) (*pfs.ObjectInfo, error) { value, err := c.ObjectAPIClient.InspectObject( c.Ctx(), &pfs.Object{Hash: hash}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return value, nil }
go
func (c APIClient) InspectObject(hash string) (*pfs.ObjectInfo, error) { value, err := c.ObjectAPIClient.InspectObject( c.Ctx(), &pfs.Object{Hash: hash}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return value, nil }
[ "func", "(", "c", "APIClient", ")", "InspectObject", "(", "hash", "string", ")", "(", "*", "pfs", ".", "ObjectInfo", ",", "error", ")", "{", "value", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "InspectObject", "(", "c", ".", "Ctx", "(", ")",...
// InspectObject returns info about an Object.
[ "InspectObject", "returns", "info", "about", "an", "Object", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L717-L726
test
pachyderm/pachyderm
src/client/pfs.go
GetTag
func (c APIClient) GetTag(tag string, writer io.Writer) error { getTagClient, err := c.ObjectAPIClient.GetTag( c.Ctx(), &pfs.Tag{Name: tag}, ) if err != nil { return grpcutil.ScrubGRPC(err) } if err := grpcutil.WriteFromStreamingBytesClient(getTagClient, writer); err != nil { return grpcutil.ScrubGRPC(err)...
go
func (c APIClient) GetTag(tag string, writer io.Writer) error { getTagClient, err := c.ObjectAPIClient.GetTag( c.Ctx(), &pfs.Tag{Name: tag}, ) if err != nil { return grpcutil.ScrubGRPC(err) } if err := grpcutil.WriteFromStreamingBytesClient(getTagClient, writer); err != nil { return grpcutil.ScrubGRPC(err)...
[ "func", "(", "c", "APIClient", ")", "GetTag", "(", "tag", "string", ",", "writer", "io", ".", "Writer", ")", "error", "{", "getTagClient", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "GetTag", "(", "c", ".", "Ctx", "(", ")", ",", "&", "pfs"...
// GetTag gets an object out of the object store by tag.
[ "GetTag", "gets", "an", "object", "out", "of", "the", "object", "store", "by", "tag", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L729-L741
test
pachyderm/pachyderm
src/client/pfs.go
GetTagReader
func (c APIClient) GetTagReader(tag string) (io.ReadCloser, error) { ctx, cancel := context.WithCancel(c.Ctx()) getTagClient, err := c.ObjectAPIClient.GetTag( ctx, &pfs.Tag{Name: tag}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(getTagClient, cancel), nil ...
go
func (c APIClient) GetTagReader(tag string) (io.ReadCloser, error) { ctx, cancel := context.WithCancel(c.Ctx()) getTagClient, err := c.ObjectAPIClient.GetTag( ctx, &pfs.Tag{Name: tag}, ) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(getTagClient, cancel), nil ...
[ "func", "(", "c", "APIClient", ")", "GetTagReader", "(", "tag", "string", ")", "(", "io", ".", "ReadCloser", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ".", "WithCancel", "(", "c", ".", "Ctx", "(", ")", ")", "\n", "getTagClient", ...
// GetTagReader returns a reader for an object in object store by tag.
[ "GetTagReader", "returns", "a", "reader", "for", "an", "object", "in", "object", "store", "by", "tag", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L744-L754
test
pachyderm/pachyderm
src/client/pfs.go
ListTag
func (c APIClient) ListTag(f func(*pfs.ListTagsResponse) error) error { listTagClient, err := c.ObjectAPIClient.ListTags(c.Ctx(), &pfs.ListTagsRequest{IncludeObject: true}) if err != nil { return grpcutil.ScrubGRPC(err) } for { listTagResponse, err := listTagClient.Recv() if err != nil { if err == io.EOF {...
go
func (c APIClient) ListTag(f func(*pfs.ListTagsResponse) error) error { listTagClient, err := c.ObjectAPIClient.ListTags(c.Ctx(), &pfs.ListTagsRequest{IncludeObject: true}) if err != nil { return grpcutil.ScrubGRPC(err) } for { listTagResponse, err := listTagClient.Recv() if err != nil { if err == io.EOF {...
[ "func", "(", "c", "APIClient", ")", "ListTag", "(", "f", "func", "(", "*", "pfs", ".", "ListTagsResponse", ")", "error", ")", "error", "{", "listTagClient", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "ListTags", "(", "c", ".", "Ctx", "(", ")...
// ListTag lists tags stored in pfs.
[ "ListTag", "lists", "tags", "stored", "in", "pfs", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L766-L783
test
pachyderm/pachyderm
src/client/pfs.go
Compact
func (c APIClient) Compact() error { _, err := c.ObjectAPIClient.Compact( c.Ctx(), &types.Empty{}, ) return err }
go
func (c APIClient) Compact() error { _, err := c.ObjectAPIClient.Compact( c.Ctx(), &types.Empty{}, ) return err }
[ "func", "(", "c", "APIClient", ")", "Compact", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "ObjectAPIClient", ".", "Compact", "(", "c", ".", "Ctx", "(", ")", ",", "&", "types", ".", "Empty", "{", "}", ",", ")", "\n", "return", "err...
// Compact forces compaction of objects.
[ "Compact", "forces", "compaction", "of", "objects", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L786-L792
test
pachyderm/pachyderm
src/client/pfs.go
NewPutFileClient
func (c APIClient) NewPutFileClient() (PutFileClient, error) { pfc, err := c.PfsAPIClient.PutFile(c.Ctx()) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return &putFileClient{c: pfc}, nil }
go
func (c APIClient) NewPutFileClient() (PutFileClient, error) { pfc, err := c.PfsAPIClient.PutFile(c.Ctx()) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return &putFileClient{c: pfc}, nil }
[ "func", "(", "c", "APIClient", ")", "NewPutFileClient", "(", ")", "(", "PutFileClient", ",", "error", ")", "{", "pfc", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "PutFile", "(", "c", ".", "Ctx", "(", ")", ")", "\n", "if", "err", "!=", "nil", ...
// NewPutFileClient returns a new client for putting files into pfs in a single request.
[ "NewPutFileClient", "returns", "a", "new", "client", "for", "putting", "files", "into", "pfs", "in", "a", "single", "request", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L839-L845
test
pachyderm/pachyderm
src/client/pfs.go
PutFileOverwrite
func (c *putFileClient) PutFileOverwrite(repoName string, commitID string, path string, reader io.Reader, overwriteIndex int64) (_ int, retErr error) { writer, err := c.newPutFileWriteCloser(repoName, commitID, path, pfs.Delimiter_NONE, 0, 0, 0, &pfs.OverwriteIndex{Index: overwriteIndex}) if err != nil { return 0, ...
go
func (c *putFileClient) PutFileOverwrite(repoName string, commitID string, path string, reader io.Reader, overwriteIndex int64) (_ int, retErr error) { writer, err := c.newPutFileWriteCloser(repoName, commitID, path, pfs.Delimiter_NONE, 0, 0, 0, &pfs.OverwriteIndex{Index: overwriteIndex}) if err != nil { return 0, ...
[ "func", "(", "c", "*", "putFileClient", ")", "PutFileOverwrite", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "reader", "io", ".", "Reader", ",", "overwriteIndex", "int64", ")", "(", "_", "int", ",", "retErr", "error", ...
// PutFileOverwrite is like PutFile but it overwrites the file rather than // appending to it. overwriteIndex allows you to specify the index of the // object starting from which you'd like to overwrite. If you want to // overwrite the entire file, specify an index of 0.
[ "PutFileOverwrite", "is", "like", "PutFile", "but", "it", "overwrites", "the", "file", "rather", "than", "appending", "to", "it", ".", "overwriteIndex", "allows", "you", "to", "specify", "the", "index", "of", "the", "object", "starting", "from", "which", "you"...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L885-L897
test
pachyderm/pachyderm
src/client/pfs.go
Close
func (c *putFileClient) Close() error { _, err := c.c.CloseAndRecv() return grpcutil.ScrubGRPC(err) }
go
func (c *putFileClient) Close() error { _, err := c.c.CloseAndRecv() return grpcutil.ScrubGRPC(err) }
[ "func", "(", "c", "*", "putFileClient", ")", "Close", "(", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "c", ".", "CloseAndRecv", "(", ")", "\n", "return", "grpcutil", ".", "ScrubGRPC", "(", "err", ")", "\n", "}" ]
// Close must be called after you're done using a putFileClient. // Further requests will throw errors.
[ "Close", "must", "be", "called", "after", "you", "re", "done", "using", "a", "putFileClient", ".", "Further", "requests", "will", "throw", "errors", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L947-L950
test
pachyderm/pachyderm
src/client/pfs.go
CopyFile
func (c APIClient) CopyFile(srcRepo, srcCommit, srcPath, dstRepo, dstCommit, dstPath string, overwrite bool) error { if _, err := c.PfsAPIClient.CopyFile(c.Ctx(), &pfs.CopyFileRequest{ Src: NewFile(srcRepo, srcCommit, srcPath), Dst: NewFile(dstRepo, dstCommit, dstPath), Overwrite: overwrite, }...
go
func (c APIClient) CopyFile(srcRepo, srcCommit, srcPath, dstRepo, dstCommit, dstPath string, overwrite bool) error { if _, err := c.PfsAPIClient.CopyFile(c.Ctx(), &pfs.CopyFileRequest{ Src: NewFile(srcRepo, srcCommit, srcPath), Dst: NewFile(dstRepo, dstCommit, dstPath), Overwrite: overwrite, }...
[ "func", "(", "c", "APIClient", ")", "CopyFile", "(", "srcRepo", ",", "srcCommit", ",", "srcPath", ",", "dstRepo", ",", "dstCommit", ",", "dstPath", "string", ",", "overwrite", "bool", ")", "error", "{", "if", "_", ",", "err", ":=", "c", ".", "PfsAPICli...
// CopyFile copys a file from one pfs location to another. It can be used on // directories or regular files.
[ "CopyFile", "copys", "a", "file", "from", "one", "pfs", "location", "to", "another", ".", "It", "can", "be", "used", "on", "directories", "or", "regular", "files", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1021-L1031
test
pachyderm/pachyderm
src/client/pfs.go
GetFile
func (c APIClient) GetFile(repoName string, commitID string, path string, offset int64, size int64, writer io.Writer) error { if c.limiter != nil { c.limiter.Acquire() defer c.limiter.Release() } apiGetFileClient, err := c.getFile(repoName, commitID, path, offset, size) if err != nil { return grpcutil.ScrubGR...
go
func (c APIClient) GetFile(repoName string, commitID string, path string, offset int64, size int64, writer io.Writer) error { if c.limiter != nil { c.limiter.Acquire() defer c.limiter.Release() } apiGetFileClient, err := c.getFile(repoName, commitID, path, offset, size) if err != nil { return grpcutil.ScrubGR...
[ "func", "(", "c", "APIClient", ")", "GetFile", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "offset", "int64", ",", "size", "int64", ",", "writer", "io", ".", "Writer", ")", "error", "{", "if", "c", ".", "limiter", ...
// GetFile returns the contents of a file at a specific Commit. // offset specifies a number of bytes that should be skipped in the beginning of the file. // size limits the total amount of data returned, note you will get fewer bytes // than size if you pass a value larger than the size of the file. // If size is set ...
[ "GetFile", "returns", "the", "contents", "of", "a", "file", "at", "a", "specific", "Commit", ".", "offset", "specifies", "a", "number", "of", "bytes", "that", "should", "be", "skipped", "in", "the", "beginning", "of", "the", "file", ".", "size", "limits", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1038-L1051
test
pachyderm/pachyderm
src/client/pfs.go
GetFileReader
func (c APIClient) GetFileReader(repoName string, commitID string, path string, offset int64, size int64) (io.Reader, error) { apiGetFileClient, err := c.getFile(repoName, commitID, path, offset, size) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(apiGetFileClient, ...
go
func (c APIClient) GetFileReader(repoName string, commitID string, path string, offset int64, size int64) (io.Reader, error) { apiGetFileClient, err := c.getFile(repoName, commitID, path, offset, size) if err != nil { return nil, grpcutil.ScrubGRPC(err) } return grpcutil.NewStreamingBytesReader(apiGetFileClient, ...
[ "func", "(", "c", "APIClient", ")", "GetFileReader", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "offset", "int64", ",", "size", "int64", ")", "(", "io", ".", "Reader", ",", "error", ")", "{", "apiGetFileClient", ","...
// GetFileReader returns a reader for the contents of a file at a specific Commit. // offset specifies a number of bytes that should be skipped in the beginning of the file. // size limits the total amount of data returned, note you will get fewer bytes // than size if you pass a value larger than the size of the file....
[ "GetFileReader", "returns", "a", "reader", "for", "the", "contents", "of", "a", "file", "at", "a", "specific", "Commit", ".", "offset", "specifies", "a", "number", "of", "bytes", "that", "should", "be", "skipped", "in", "the", "beginning", "of", "the", "fi...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1058-L1064
test
pachyderm/pachyderm
src/client/pfs.go
GetFileReadSeeker
func (c APIClient) GetFileReadSeeker(repoName string, commitID string, path string) (io.ReadSeeker, error) { fileInfo, err := c.InspectFile(repoName, commitID, path) if err != nil { return nil, err } reader, err := c.GetFileReader(repoName, commitID, path, 0, 0) if err != nil { return nil, err } return &getF...
go
func (c APIClient) GetFileReadSeeker(repoName string, commitID string, path string) (io.ReadSeeker, error) { fileInfo, err := c.InspectFile(repoName, commitID, path) if err != nil { return nil, err } reader, err := c.GetFileReader(repoName, commitID, path, 0, 0) if err != nil { return nil, err } return &getF...
[ "func", "(", "c", "APIClient", ")", "GetFileReadSeeker", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ")", "(", "io", ".", "ReadSeeker", ",", "error", ")", "{", "fileInfo", ",", "err", ":=", "c", ".", "InspectFile", "(", ...
// GetFileReadSeeker returns a reader for the contents of a file at a specific // Commit that permits Seeking to different points in the file.
[ "GetFileReadSeeker", "returns", "a", "reader", "for", "the", "contents", "of", "a", "file", "at", "a", "specific", "Commit", "that", "permits", "Seeking", "to", "different", "points", "in", "the", "file", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1068-L1084
test
pachyderm/pachyderm
src/client/pfs.go
InspectFile
func (c APIClient) InspectFile(repoName string, commitID string, path string) (*pfs.FileInfo, error) { return c.inspectFile(repoName, commitID, path) }
go
func (c APIClient) InspectFile(repoName string, commitID string, path string) (*pfs.FileInfo, error) { return c.inspectFile(repoName, commitID, path) }
[ "func", "(", "c", "APIClient", ")", "InspectFile", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ")", "(", "*", "pfs", ".", "FileInfo", ",", "error", ")", "{", "return", "c", ".", "inspectFile", "(", "repoName", ",", "com...
// InspectFile returns info about a specific file.
[ "InspectFile", "returns", "info", "about", "a", "specific", "file", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1099-L1101
test
pachyderm/pachyderm
src/client/pfs.go
ListFile
func (c APIClient) ListFile(repoName string, commitID string, path string) ([]*pfs.FileInfo, error) { var result []*pfs.FileInfo if err := c.ListFileF(repoName, commitID, path, 0, func(fi *pfs.FileInfo) error { result = append(result, fi) return nil }); err != nil { return nil, err } return result, nil }
go
func (c APIClient) ListFile(repoName string, commitID string, path string) ([]*pfs.FileInfo, error) { var result []*pfs.FileInfo if err := c.ListFileF(repoName, commitID, path, 0, func(fi *pfs.FileInfo) error { result = append(result, fi) return nil }); err != nil { return nil, err } return result, nil }
[ "func", "(", "c", "APIClient", ")", "ListFile", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ")", "(", "[", "]", "*", "pfs", ".", "FileInfo", ",", "error", ")", "{", "var", "result", "[", "]", "*", "pfs", ".", "FileI...
// ListFile returns info about all files in a Commit under path.
[ "ListFile", "returns", "info", "about", "all", "files", "in", "a", "Commit", "under", "path", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1117-L1126
test
pachyderm/pachyderm
src/client/pfs.go
ListFileHistory
func (c APIClient) ListFileHistory(repoName string, commitID string, path string, history int64) ([]*pfs.FileInfo, error) { var result []*pfs.FileInfo if err := c.ListFileF(repoName, commitID, path, history, func(fi *pfs.FileInfo) error { result = append(result, fi) return nil }); err != nil { return nil, err ...
go
func (c APIClient) ListFileHistory(repoName string, commitID string, path string, history int64) ([]*pfs.FileInfo, error) { var result []*pfs.FileInfo if err := c.ListFileF(repoName, commitID, path, history, func(fi *pfs.FileInfo) error { result = append(result, fi) return nil }); err != nil { return nil, err ...
[ "func", "(", "c", "APIClient", ")", "ListFileHistory", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "history", "int64", ")", "(", "[", "]", "*", "pfs", ".", "FileInfo", ",", "error", ")", "{", "var", "result", "[", ...
// ListFileHistory returns info about all files and their history in a Commit under path.
[ "ListFileHistory", "returns", "info", "about", "all", "files", "and", "their", "history", "in", "a", "Commit", "under", "path", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1129-L1138
test
pachyderm/pachyderm
src/client/pfs.go
ListFileF
func (c APIClient) ListFileF(repoName string, commitID string, path string, history int64, f func(fi *pfs.FileInfo) error) error { fs, err := c.PfsAPIClient.ListFileStream( c.Ctx(), &pfs.ListFileRequest{ File: NewFile(repoName, commitID, path), History: history, }, ) if err != nil { return grpcutil....
go
func (c APIClient) ListFileF(repoName string, commitID string, path string, history int64, f func(fi *pfs.FileInfo) error) error { fs, err := c.PfsAPIClient.ListFileStream( c.Ctx(), &pfs.ListFileRequest{ File: NewFile(repoName, commitID, path), History: history, }, ) if err != nil { return grpcutil....
[ "func", "(", "c", "APIClient", ")", "ListFileF", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "history", "int64", ",", "f", "func", "(", "fi", "*", "pfs", ".", "FileInfo", ")", "error", ")", "error", "{", "fs", ",...
// ListFileF returns info about all files in a Commit under path, calling f with each FileInfo.
[ "ListFileF", "returns", "info", "about", "all", "files", "in", "a", "Commit", "under", "path", "calling", "f", "with", "each", "FileInfo", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1141-L1166
test
pachyderm/pachyderm
src/client/pfs.go
Walk
func (c APIClient) Walk(repoName string, commitID string, path string, f WalkFn) error { fs, err := c.PfsAPIClient.WalkFile( c.Ctx(), &pfs.WalkFileRequest{File: NewFile(repoName, commitID, path)}) if err != nil { return grpcutil.ScrubGRPC(err) } for { fi, err := fs.Recv() if err == io.EOF { return nil ...
go
func (c APIClient) Walk(repoName string, commitID string, path string, f WalkFn) error { fs, err := c.PfsAPIClient.WalkFile( c.Ctx(), &pfs.WalkFileRequest{File: NewFile(repoName, commitID, path)}) if err != nil { return grpcutil.ScrubGRPC(err) } for { fi, err := fs.Recv() if err == io.EOF { return nil ...
[ "func", "(", "c", "APIClient", ")", "Walk", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ",", "f", "WalkFn", ")", "error", "{", "fs", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "WalkFile", "(", "c", ".", "Ctx", ...
// Walk walks the pfs filesystem rooted at path. walkFn will be called for each // file found under path in lexicographical order. This includes both regular // files and directories.
[ "Walk", "walks", "the", "pfs", "filesystem", "rooted", "at", "path", ".", "walkFn", "will", "be", "called", "for", "each", "file", "found", "under", "path", "in", "lexicographical", "order", ".", "This", "includes", "both", "regular", "files", "and", "direct...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1258-L1279
test
pachyderm/pachyderm
src/client/pfs.go
DeleteFile
func (c APIClient) DeleteFile(repoName string, commitID string, path string) error { _, err := c.PfsAPIClient.DeleteFile( c.Ctx(), &pfs.DeleteFileRequest{ File: NewFile(repoName, commitID, path), }, ) return err }
go
func (c APIClient) DeleteFile(repoName string, commitID string, path string) error { _, err := c.PfsAPIClient.DeleteFile( c.Ctx(), &pfs.DeleteFileRequest{ File: NewFile(repoName, commitID, path), }, ) return err }
[ "func", "(", "c", "APIClient", ")", "DeleteFile", "(", "repoName", "string", ",", "commitID", "string", ",", "path", "string", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "PfsAPIClient", ".", "DeleteFile", "(", "c", ".", "Ctx", "(", ")", ",",...
// DeleteFile deletes a file from a Commit. // DeleteFile leaves a tombstone in the Commit, assuming the file isn't written // to later attempting to get the file from the finished commit will result in // not found error. // The file will of course remain intact in the Commit's parent.
[ "DeleteFile", "deletes", "a", "file", "from", "a", "Commit", ".", "DeleteFile", "leaves", "a", "tombstone", "in", "the", "Commit", "assuming", "the", "file", "isn", "t", "written", "to", "later", "attempting", "to", "get", "the", "file", "from", "the", "fi...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1286-L1294
test
pachyderm/pachyderm
src/client/pfs.go
Write
func (w *PutObjectWriteCloserAsync) Write(p []byte) (int, error) { select { case err := <-w.errChan: if err != nil { return 0, grpcutil.ScrubGRPC(err) } default: for len(w.buf)+len(p) > cap(w.buf) { // Write the bytes that fit into w.buf, then // remove those bytes from p. i := cap(w.buf) - len(w.b...
go
func (w *PutObjectWriteCloserAsync) Write(p []byte) (int, error) { select { case err := <-w.errChan: if err != nil { return 0, grpcutil.ScrubGRPC(err) } default: for len(w.buf)+len(p) > cap(w.buf) { // Write the bytes that fit into w.buf, then // remove those bytes from p. i := cap(w.buf) - len(w.b...
[ "func", "(", "w", "*", "PutObjectWriteCloserAsync", ")", "Write", "(", "p", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "select", "{", "case", "err", ":=", "<-", "w", ".", "errChan", ":", "if", "err", "!=", "nil", "{", "return", "0...
// Write performs a write.
[ "Write", "performs", "a", "write", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1443-L1462
test
pachyderm/pachyderm
src/client/pfs.go
Close
func (w *PutObjectWriteCloserAsync) Close() error { w.writeChan <- w.buf close(w.writeChan) err := <-w.errChan if err != nil { return grpcutil.ScrubGRPC(err) } w.object, err = w.client.CloseAndRecv() return grpcutil.ScrubGRPC(err) }
go
func (w *PutObjectWriteCloserAsync) Close() error { w.writeChan <- w.buf close(w.writeChan) err := <-w.errChan if err != nil { return grpcutil.ScrubGRPC(err) } w.object, err = w.client.CloseAndRecv() return grpcutil.ScrubGRPC(err) }
[ "func", "(", "w", "*", "PutObjectWriteCloserAsync", ")", "Close", "(", ")", "error", "{", "w", ".", "writeChan", "<-", "w", ".", "buf", "\n", "close", "(", "w", ".", "writeChan", ")", "\n", "err", ":=", "<-", "w", ".", "errChan", "\n", "if", "err",...
// Close closes the writer.
[ "Close", "closes", "the", "writer", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pfs.go#L1465-L1474
test
pachyderm/pachyderm
src/client/version/client.go
PrettyPrintVersionNoAdditional
func PrettyPrintVersionNoAdditional(version *pb.Version) string { return fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Micro) }
go
func PrettyPrintVersionNoAdditional(version *pb.Version) string { return fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Micro) }
[ "func", "PrettyPrintVersionNoAdditional", "(", "version", "*", "pb", ".", "Version", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"%d.%d.%d\"", ",", "version", ".", "Major", ",", "version", ".", "Minor", ",", "version", ".", "Micro", ")", "\...
// PrettyPrintVersionNoAdditional returns a version string without // version.Additional.
[ "PrettyPrintVersionNoAdditional", "returns", "a", "version", "string", "without", "version", ".", "Additional", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/version/client.go#L52-L54
test
pachyderm/pachyderm
src/server/cmd/pachctl-doc/main.go
recursiveBlockQuoteExamples
func recursiveBlockQuoteExamples(parent *cobra.Command) { if parent.Example != "" { parent.Example = fmt.Sprintf("```sh\n%s\n```", parent.Example) } for _, cmd := range parent.Commands() { recursiveBlockQuoteExamples(cmd) } }
go
func recursiveBlockQuoteExamples(parent *cobra.Command) { if parent.Example != "" { parent.Example = fmt.Sprintf("```sh\n%s\n```", parent.Example) } for _, cmd := range parent.Commands() { recursiveBlockQuoteExamples(cmd) } }
[ "func", "recursiveBlockQuoteExamples", "(", "parent", "*", "cobra", ".", "Command", ")", "{", "if", "parent", ".", "Example", "!=", "\"\"", "{", "parent", ".", "Example", "=", "fmt", ".", "Sprintf", "(", "\"```sh\\n%s\\n```\"", ",", "\\n", ")", "\n", "}", ...
// Walk the command tree, wrap any examples in a block-quote with shell highlighting
[ "Walk", "the", "command", "tree", "wrap", "any", "examples", "in", "a", "block", "-", "quote", "with", "shell", "highlighting" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/cmd/pachctl-doc/main.go#L21-L29
test
pachyderm/pachyderm
src/plugin/vault/pachyderm/helpers.go
errMissingField
func errMissingField(field string) *logical.Response { return logical.ErrorResponse(fmt.Sprintf("missing required field '%s'", field)) }
go
func errMissingField(field string) *logical.Response { return logical.ErrorResponse(fmt.Sprintf("missing required field '%s'", field)) }
[ "func", "errMissingField", "(", "field", "string", ")", "*", "logical", ".", "Response", "{", "return", "logical", ".", "ErrorResponse", "(", "fmt", ".", "Sprintf", "(", "\"missing required field '%s'\"", ",", "field", ")", ")", "\n", "}" ]
// errMissingField returns a logical response error that prints a consistent // error message for when a required field is missing.
[ "errMissingField", "returns", "a", "logical", "response", "error", "that", "prints", "a", "consistent", "error", "message", "for", "when", "a", "required", "field", "is", "missing", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/helpers.go#L14-L16
test
pachyderm/pachyderm
src/plugin/vault/pachyderm/helpers.go
validateFields
func validateFields(req *logical.Request, data *framework.FieldData) error { var unknownFields []string for k := range req.Data { if _, ok := data.Schema[k]; !ok { unknownFields = append(unknownFields, k) } } if len(unknownFields) > 0 { return fmt.Errorf("unknown fields: %q", unknownFields) } return ni...
go
func validateFields(req *logical.Request, data *framework.FieldData) error { var unknownFields []string for k := range req.Data { if _, ok := data.Schema[k]; !ok { unknownFields = append(unknownFields, k) } } if len(unknownFields) > 0 { return fmt.Errorf("unknown fields: %q", unknownFields) } return ni...
[ "func", "validateFields", "(", "req", "*", "logical", ".", "Request", ",", "data", "*", "framework", ".", "FieldData", ")", "error", "{", "var", "unknownFields", "[", "]", "string", "\n", "for", "k", ":=", "range", "req", ".", "Data", "{", "if", "_", ...
// validateFields verifies that no bad arguments were given to the request.
[ "validateFields", "verifies", "that", "no", "bad", "arguments", "were", "given", "to", "the", "request", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/helpers.go#L19-L32
test
pachyderm/pachyderm
src/plugin/vault/pachyderm/helpers.go
putConfig
func putConfig(ctx context.Context, s logical.Storage, cfg *config) error { entry, err := logical.StorageEntryJSON("config", cfg) if err != nil { return fmt.Errorf("%v: failed to generate storage entry", err) } if err := s.Put(ctx, entry); err != nil { return fmt.Errorf("%v: failed to write configuration to sto...
go
func putConfig(ctx context.Context, s logical.Storage, cfg *config) error { entry, err := logical.StorageEntryJSON("config", cfg) if err != nil { return fmt.Errorf("%v: failed to generate storage entry", err) } if err := s.Put(ctx, entry); err != nil { return fmt.Errorf("%v: failed to write configuration to sto...
[ "func", "putConfig", "(", "ctx", "context", ".", "Context", ",", "s", "logical", ".", "Storage", ",", "cfg", "*", "config", ")", "error", "{", "entry", ",", "err", ":=", "logical", ".", "StorageEntryJSON", "(", "\"config\"", ",", "cfg", ")", "\n", "if"...
// putConfig parses and returns the configuration data from the storage backend.
[ "putConfig", "parses", "and", "returns", "the", "configuration", "data", "from", "the", "storage", "backend", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/helpers.go#L35-L44
test
pachyderm/pachyderm
src/plugin/vault/pachyderm/helpers.go
getConfig
func getConfig(ctx context.Context, s logical.Storage) (*config, error) { entry, err := s.Get(ctx, "config") if err != nil { return nil, fmt.Errorf("%v: failed to get config from storage", err) } if entry == nil || len(entry.Value) == 0 { return nil, errors.New("no configuration in storage") } var result con...
go
func getConfig(ctx context.Context, s logical.Storage) (*config, error) { entry, err := s.Get(ctx, "config") if err != nil { return nil, fmt.Errorf("%v: failed to get config from storage", err) } if entry == nil || len(entry.Value) == 0 { return nil, errors.New("no configuration in storage") } var result con...
[ "func", "getConfig", "(", "ctx", "context", ".", "Context", ",", "s", "logical", ".", "Storage", ")", "(", "*", "config", ",", "error", ")", "{", "entry", ",", "err", ":=", "s", ".", "Get", "(", "ctx", ",", "\"config\"", ")", "\n", "if", "err", "...
// getConfig parses and returns the configuration data from the storage backend.
[ "getConfig", "parses", "and", "returns", "the", "configuration", "data", "from", "the", "storage", "backend", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/helpers.go#L47-L62
test
pachyderm/pachyderm
src/client/pkg/grpcutil/server.go
Serve
func Serve( servers ...ServerOptions, ) (retErr error) { for _, server := range servers { if server.RegisterFunc == nil { return ErrMustSpecifyRegisterFunc } if server.Port == 0 { return ErrMustSpecifyPort } opts := []grpc.ServerOption{ grpc.MaxConcurrentStreams(math.MaxUint32), grpc.MaxRecvMsgS...
go
func Serve( servers ...ServerOptions, ) (retErr error) { for _, server := range servers { if server.RegisterFunc == nil { return ErrMustSpecifyRegisterFunc } if server.Port == 0 { return ErrMustSpecifyPort } opts := []grpc.ServerOption{ grpc.MaxConcurrentStreams(math.MaxUint32), grpc.MaxRecvMsgS...
[ "func", "Serve", "(", "servers", "...", "ServerOptions", ",", ")", "(", "retErr", "error", ")", "{", "for", "_", ",", "server", ":=", "range", "servers", "{", "if", "server", ".", "RegisterFunc", "==", "nil", "{", "return", "ErrMustSpecifyRegisterFunc", "\...
// Serve serves stuff.
[ "Serve", "serves", "stuff", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/grpcutil/server.go#L63-L127
test
pachyderm/pachyderm
src/server/pkg/sync/sync.go
NewPuller
func NewPuller() *Puller { return &Puller{ errCh: make(chan error, 1), pipes: make(map[string]bool), } }
go
func NewPuller() *Puller { return &Puller{ errCh: make(chan error, 1), pipes: make(map[string]bool), } }
[ "func", "NewPuller", "(", ")", "*", "Puller", "{", "return", "&", "Puller", "{", "errCh", ":", "make", "(", "chan", "error", ",", "1", ")", ",", "pipes", ":", "make", "(", "map", "[", "string", "]", "bool", ")", ",", "}", "\n", "}" ]
// NewPuller creates a new Puller struct.
[ "NewPuller", "creates", "a", "new", "Puller", "struct", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/sync/sync.go#L40-L45
test
pachyderm/pachyderm
src/server/pkg/sync/sync.go
PullTree
func (p *Puller) PullTree(client *pachclient.APIClient, root string, tree hashtree.HashTree, pipes bool, concurrency int) error { limiter := limit.New(concurrency) var eg errgroup.Group if err := tree.Walk("/", func(path string, node *hashtree.NodeProto) error { if node.FileNode != nil { path := filepath.Join(r...
go
func (p *Puller) PullTree(client *pachclient.APIClient, root string, tree hashtree.HashTree, pipes bool, concurrency int) error { limiter := limit.New(concurrency) var eg errgroup.Group if err := tree.Walk("/", func(path string, node *hashtree.NodeProto) error { if node.FileNode != nil { path := filepath.Join(r...
[ "func", "(", "p", "*", "Puller", ")", "PullTree", "(", "client", "*", "pachclient", ".", "APIClient", ",", "root", "string", ",", "tree", "hashtree", ".", "HashTree", ",", "pipes", "bool", ",", "concurrency", "int", ")", "error", "{", "limiter", ":=", ...
// PullTree pulls from a raw HashTree rather than a repo.
[ "PullTree", "pulls", "from", "a", "raw", "HashTree", "rather", "than", "a", "repo", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/sync/sync.go#L284-L312
test
pachyderm/pachyderm
src/server/pkg/sync/sync.go
Push
func Push(client *pachclient.APIClient, root string, commit *pfs.Commit, overwrite bool) error { var g errgroup.Group if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { g.Go(func() (retErr error) { if path == root || info.IsDir() { return nil } f, err := os.Open(path)...
go
func Push(client *pachclient.APIClient, root string, commit *pfs.Commit, overwrite bool) error { var g errgroup.Group if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { g.Go(func() (retErr error) { if path == root || info.IsDir() { return nil } f, err := os.Open(path)...
[ "func", "Push", "(", "client", "*", "pachclient", ".", "APIClient", ",", "root", "string", ",", "commit", "*", "pfs", ".", "Commit", ",", "overwrite", "bool", ")", "error", "{", "var", "g", "errgroup", ".", "Group", "\n", "if", "err", ":=", "filepath",...
// Push puts files under root into an open commit.
[ "Push", "puts", "files", "under", "root", "into", "an", "open", "commit", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/sync/sync.go#L357-L395
test
pachyderm/pachyderm
src/server/pkg/sync/sync.go
PushObj
func PushObj(pachClient *pachclient.APIClient, commit *pfs.Commit, objClient obj.Client, root string) error { var eg errgroup.Group sem := make(chan struct{}, 200) if err := pachClient.Walk(commit.Repo.Name, commit.ID, "", func(fileInfo *pfs.FileInfo) error { if fileInfo.FileType != pfs.FileType_FILE { return n...
go
func PushObj(pachClient *pachclient.APIClient, commit *pfs.Commit, objClient obj.Client, root string) error { var eg errgroup.Group sem := make(chan struct{}, 200) if err := pachClient.Walk(commit.Repo.Name, commit.ID, "", func(fileInfo *pfs.FileInfo) error { if fileInfo.FileType != pfs.FileType_FILE { return n...
[ "func", "PushObj", "(", "pachClient", "*", "pachclient", ".", "APIClient", ",", "commit", "*", "pfs", ".", "Commit", ",", "objClient", "obj", ".", "Client", ",", "root", "string", ")", "error", "{", "var", "eg", "errgroup", ".", "Group", "\n", "sem", "...
// PushObj pushes data from commit to an object store.
[ "PushObj", "pushes", "data", "from", "commit", "to", "an", "object", "store", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/sync/sync.go#L398-L424
test
pachyderm/pachyderm
src/server/pkg/sync/sync.go
PushFile
func PushFile(c *pachclient.APIClient, pfc pachclient.PutFileClient, pfsFile *pfs.File, osFile io.ReadSeeker) error { fileInfo, err := c.InspectFile(pfsFile.Commit.Repo.Name, pfsFile.Commit.ID, pfsFile.Path) if err != nil && !isNotExist(err) { return err } var i int var object *pfs.Object if fileInfo != nil { ...
go
func PushFile(c *pachclient.APIClient, pfc pachclient.PutFileClient, pfsFile *pfs.File, osFile io.ReadSeeker) error { fileInfo, err := c.InspectFile(pfsFile.Commit.Repo.Name, pfsFile.Commit.ID, pfsFile.Path) if err != nil && !isNotExist(err) { return err } var i int var object *pfs.Object if fileInfo != nil { ...
[ "func", "PushFile", "(", "c", "*", "pachclient", ".", "APIClient", ",", "pfc", "pachclient", ".", "PutFileClient", ",", "pfsFile", "*", "pfs", ".", "File", ",", "osFile", "io", ".", "ReadSeeker", ")", "error", "{", "fileInfo", ",", "err", ":=", "c", "....
// PushFile makes sure that pfsFile has the same content as osFile.
[ "PushFile", "makes", "sure", "that", "pfsFile", "has", "the", "same", "content", "as", "osFile", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/sync/sync.go#L431-L461
test
pachyderm/pachyderm
src/client/debug.go
Dump
func (c APIClient) Dump(w io.Writer) error { goroClient, err := c.DebugClient.Dump(c.Ctx(), &debug.DumpRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } return grpcutil.ScrubGRPC(grpcutil.WriteFromStreamingBytesClient(goroClient, w)) }
go
func (c APIClient) Dump(w io.Writer) error { goroClient, err := c.DebugClient.Dump(c.Ctx(), &debug.DumpRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } return grpcutil.ScrubGRPC(grpcutil.WriteFromStreamingBytesClient(goroClient, w)) }
[ "func", "(", "c", "APIClient", ")", "Dump", "(", "w", "io", ".", "Writer", ")", "error", "{", "goroClient", ",", "err", ":=", "c", ".", "DebugClient", ".", "Dump", "(", "c", ".", "Ctx", "(", ")", ",", "&", "debug", ".", "DumpRequest", "{", "}", ...
// Dump writes debug information from the server to w.
[ "Dump", "writes", "debug", "information", "from", "the", "server", "to", "w", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/debug.go#L13-L19
test
pachyderm/pachyderm
src/client/debug.go
Profile
func (c APIClient) Profile(profile string, duration time.Duration, w io.Writer) error { var d *types.Duration if duration != 0 { d = types.DurationProto(duration) } profileClient, err := c.DebugClient.Profile(c.Ctx(), &debug.ProfileRequest{ Profile: profile, Duration: d, }) if err != nil { return grpcuti...
go
func (c APIClient) Profile(profile string, duration time.Duration, w io.Writer) error { var d *types.Duration if duration != 0 { d = types.DurationProto(duration) } profileClient, err := c.DebugClient.Profile(c.Ctx(), &debug.ProfileRequest{ Profile: profile, Duration: d, }) if err != nil { return grpcuti...
[ "func", "(", "c", "APIClient", ")", "Profile", "(", "profile", "string", ",", "duration", "time", ".", "Duration", ",", "w", "io", ".", "Writer", ")", "error", "{", "var", "d", "*", "types", ".", "Duration", "\n", "if", "duration", "!=", "0", "{", ...
// Profile writes a pprof profile for pachd to w.
[ "Profile", "writes", "a", "pprof", "profile", "for", "pachd", "to", "w", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/debug.go#L22-L35
test
pachyderm/pachyderm
src/client/debug.go
Binary
func (c APIClient) Binary(w io.Writer) error { binaryClient, err := c.DebugClient.Binary(c.Ctx(), &debug.BinaryRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } return grpcutil.ScrubGRPC(grpcutil.WriteFromStreamingBytesClient(binaryClient, w)) }
go
func (c APIClient) Binary(w io.Writer) error { binaryClient, err := c.DebugClient.Binary(c.Ctx(), &debug.BinaryRequest{}) if err != nil { return grpcutil.ScrubGRPC(err) } return grpcutil.ScrubGRPC(grpcutil.WriteFromStreamingBytesClient(binaryClient, w)) }
[ "func", "(", "c", "APIClient", ")", "Binary", "(", "w", "io", ".", "Writer", ")", "error", "{", "binaryClient", ",", "err", ":=", "c", ".", "DebugClient", ".", "Binary", "(", "c", ".", "Ctx", "(", ")", ",", "&", "debug", ".", "BinaryRequest", "{", ...
// Binary writes the running pachd binary to w.
[ "Binary", "writes", "the", "running", "pachd", "binary", "to", "w", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/debug.go#L38-L44
test
pachyderm/pachyderm
src/server/pfs/server/cache_stats.go
RegisterCacheStats
func RegisterCacheStats(cacheName string, groupCacheStats *groupcache.Stats) { c := &cacheStats{ cacheName: cacheName, descriptions: make(map[string]*prometheus.Desc), stats: groupCacheStats, } if err := prometheus.Register(c); err != nil { // metrics may be redundantly registered; ignore these err...
go
func RegisterCacheStats(cacheName string, groupCacheStats *groupcache.Stats) { c := &cacheStats{ cacheName: cacheName, descriptions: make(map[string]*prometheus.Desc), stats: groupCacheStats, } if err := prometheus.Register(c); err != nil { // metrics may be redundantly registered; ignore these err...
[ "func", "RegisterCacheStats", "(", "cacheName", "string", ",", "groupCacheStats", "*", "groupcache", ".", "Stats", ")", "{", "c", ":=", "&", "cacheStats", "{", "cacheName", ":", "cacheName", ",", "descriptions", ":", "make", "(", "map", "[", "string", "]", ...
// RegisterCacheStats creates a new wrapper for groupcache stats that implements // the prometheus.Collector interface, and registers it
[ "RegisterCacheStats", "creates", "a", "new", "wrapper", "for", "groupcache", "stats", "that", "implements", "the", "prometheus", ".", "Collector", "interface", "and", "registers", "it" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/server/cache_stats.go#L24-L36
test
pachyderm/pachyderm
src/server/pfs/fuse/file.go
wait
func (c *counter) wait(n int64) { c.mu.Lock() defer c.mu.Unlock() for c.n < n { c.cond.Wait() } }
go
func (c *counter) wait(n int64) { c.mu.Lock() defer c.mu.Unlock() for c.n < n { c.cond.Wait() } }
[ "func", "(", "c", "*", "counter", ")", "wait", "(", "n", "int64", ")", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "for", "c", ".", "n", "<", "n", "{", "c", ".", "cond", ".", ...
// wait until more than n bytes have been written
[ "wait", "until", "more", "than", "n", "bytes", "have", "been", "written" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/fuse/file.go#L164-L170
test
pachyderm/pachyderm
src/server/pkg/workload/workload.go
RunWorkload
func RunWorkload( client *client.APIClient, rand *rand.Rand, size int, ) error { worker := newWorker(rand) for i := 0; i < size; i++ { if err := worker.work(client); err != nil { return err } } for _, job := range worker.startedJobs { jobInfo, err := client.InspectJob(job.ID, true) if err != nil { ...
go
func RunWorkload( client *client.APIClient, rand *rand.Rand, size int, ) error { worker := newWorker(rand) for i := 0; i < size; i++ { if err := worker.work(client); err != nil { return err } } for _, job := range worker.startedJobs { jobInfo, err := client.InspectJob(job.ID, true) if err != nil { ...
[ "func", "RunWorkload", "(", "client", "*", "client", ".", "APIClient", ",", "rand", "*", "rand", ".", "Rand", ",", "size", "int", ",", ")", "error", "{", "worker", ":=", "newWorker", "(", "rand", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "...
// RunWorkload runs a test workload against a Pachyderm cluster.
[ "RunWorkload", "runs", "a", "test", "workload", "against", "a", "Pachyderm", "cluster", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/workload/workload.go#L14-L35
test
pachyderm/pachyderm
src/server/pkg/workload/workload.go
createRepo
func (w *worker) createRepo(c *client.APIClient) error { repoName := w.randString(10) if err := c.CreateRepo(repoName); err != nil { return err } w.repos = append(w.repos, &pfs.Repo{Name: repoName}) // Start the first commit in the repo (no parent). This is critical to // advanceCommit(), which will try to fin...
go
func (w *worker) createRepo(c *client.APIClient) error { repoName := w.randString(10) if err := c.CreateRepo(repoName); err != nil { return err } w.repos = append(w.repos, &pfs.Repo{Name: repoName}) // Start the first commit in the repo (no parent). This is critical to // advanceCommit(), which will try to fin...
[ "func", "(", "w", "*", "worker", ")", "createRepo", "(", "c", "*", "client", ".", "APIClient", ")", "error", "{", "repoName", ":=", "w", ".", "randString", "(", "10", ")", "\n", "if", "err", ":=", "c", ".", "CreateRepo", "(", "repoName", ")", ";", ...
// createRepo creates a new repo in the cluster
[ "createRepo", "creates", "a", "new", "repo", "in", "the", "cluster" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/workload/workload.go#L101-L117
test
pachyderm/pachyderm
src/server/pkg/workload/workload.go
advanceCommit
func (w *worker) advanceCommit(c *client.APIClient) error { if len(w.started) >= maxStartedCommits || len(w.finished) == 0 { // Randomly select a commit that has been started and finish it if len(w.started) == 0 { return nil } i := w.rand.Intn(len(w.started)) commit := w.started[i] // Before we finish ...
go
func (w *worker) advanceCommit(c *client.APIClient) error { if len(w.started) >= maxStartedCommits || len(w.finished) == 0 { // Randomly select a commit that has been started and finish it if len(w.started) == 0 { return nil } i := w.rand.Intn(len(w.started)) commit := w.started[i] // Before we finish ...
[ "func", "(", "w", "*", "worker", ")", "advanceCommit", "(", "c", "*", "client", ".", "APIClient", ")", "error", "{", "if", "len", "(", "w", ".", "started", ")", ">=", "maxStartedCommits", "||", "len", "(", "w", ".", "finished", ")", "==", "0", "{",...
// advanceCommit either starts or finishes a commit, depending on the state of // the cluster.
[ "advanceCommit", "either", "starts", "or", "finishes", "a", "commit", "depending", "on", "the", "state", "of", "the", "cluster", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/workload/workload.go#L121-L151
test
pachyderm/pachyderm
src/server/pkg/workload/workload.go
RandString
func RandString(r *rand.Rand, n int) string { b := make([]byte, n) for i := range b { b[i] = letters[r.Intn(len(letters))] } return string(b) }
go
func RandString(r *rand.Rand, n int) string { b := make([]byte, n) for i := range b { b[i] = letters[r.Intn(len(letters))] } return string(b) }
[ "func", "RandString", "(", "r", "*", "rand", ".", "Rand", ",", "n", "int", ")", "string", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "n", ")", "\n", "for", "i", ":=", "range", "b", "{", "b", "[", "i", "]", "=", "letters", "[", "r",...
// RandString returns a random alphabetical string of size n
[ "RandString", "returns", "a", "random", "alphabetical", "string", "of", "size", "n" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/workload/workload.go#L217-L223
test
pachyderm/pachyderm
src/server/pkg/workload/workload.go
NewReader
func NewReader(rand *rand.Rand, bytes int64) io.Reader { return &reader{ rand: rand, bytes: bytes, } }
go
func NewReader(rand *rand.Rand, bytes int64) io.Reader { return &reader{ rand: rand, bytes: bytes, } }
[ "func", "NewReader", "(", "rand", "*", "rand", ".", "Rand", ",", "bytes", "int64", ")", "io", ".", "Reader", "{", "return", "&", "reader", "{", "rand", ":", "rand", ",", "bytes", ":", "bytes", ",", "}", "\n", "}" ]
// NewReader returns a Reader which generates strings of characters.
[ "NewReader", "returns", "a", "Reader", "which", "generates", "strings", "of", "characters", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/workload/workload.go#L255-L260
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
iterDir
func iterDir(tx *bolt.Tx, path string, f func(k, v []byte, c *bolt.Cursor) error) error { node, err := get(tx, path) if err != nil { return err } if node.DirNode == nil { return errorf(PathConflict, "the file at \"%s\" is not a directory", path) } c := NewChildCursor(tx, path) for k, v := c.K(), c.V(); k ...
go
func iterDir(tx *bolt.Tx, path string, f func(k, v []byte, c *bolt.Cursor) error) error { node, err := get(tx, path) if err != nil { return err } if node.DirNode == nil { return errorf(PathConflict, "the file at \"%s\" is not a directory", path) } c := NewChildCursor(tx, path) for k, v := c.K(), c.V(); k ...
[ "func", "iterDir", "(", "tx", "*", "bolt", ".", "Tx", ",", "path", "string", ",", "f", "func", "(", "k", ",", "v", "[", "]", "byte", ",", "c", "*", "bolt", ".", "Cursor", ")", "error", ")", "error", "{", "node", ",", "err", ":=", "get", "(", ...
// iterDir iterates through the nodes under path, it errors with PathNotFound if path doesn't exist, it errors with PathConflict if path exists but isn't a directory.
[ "iterDir", "iterates", "through", "the", "nodes", "under", "path", "it", "errors", "with", "PathNotFound", "if", "path", "doesn", "t", "exist", "it", "errors", "with", "PathConflict", "if", "path", "exists", "but", "isn", "t", "a", "directory", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L199-L218
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
FSSize
func (h *dbHashTree) FSSize() int64 { rootNode, err := h.Get("/") if err != nil { return 0 } return rootNode.SubtreeSize }
go
func (h *dbHashTree) FSSize() int64 { rootNode, err := h.Get("/") if err != nil { return 0 } return rootNode.SubtreeSize }
[ "func", "(", "h", "*", "dbHashTree", ")", "FSSize", "(", ")", "int64", "{", "rootNode", ",", "err", ":=", "h", ".", "Get", "(", "\"/\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", "\n", "}", "\n", "return", "rootNode", ".", "Subtree...
// FSSize gets the size of the hashtree
[ "FSSize", "gets", "the", "size", "of", "the", "hashtree" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L323-L329
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Diff
func (h *dbHashTree) Diff(oldHashTree HashTree, newPath string, oldPath string, recursiveDepth int64, f func(path string, node *NodeProto, new bool) error) (retErr error) { // Setup a txn for each hashtree, this is a bit complicated because we don't want to make 2 read tx to the same tree, if we did then should someon...
go
func (h *dbHashTree) Diff(oldHashTree HashTree, newPath string, oldPath string, recursiveDepth int64, f func(path string, node *NodeProto, new bool) error) (retErr error) { // Setup a txn for each hashtree, this is a bit complicated because we don't want to make 2 read tx to the same tree, if we did then should someon...
[ "func", "(", "h", "*", "dbHashTree", ")", "Diff", "(", "oldHashTree", "HashTree", ",", "newPath", "string", ",", "oldPath", "string", ",", "recursiveDepth", "int64", ",", "f", "func", "(", "path", "string", ",", "node", "*", "NodeProto", ",", "new", "boo...
// Diff returns the diff of two hashtrees at particular paths.
[ "Diff", "returns", "the", "diff", "of", "two", "hashtrees", "at", "particular", "paths", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L464-L499
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Serialize
func (h *dbHashTree) Serialize(_w io.Writer) error { w := pbutil.NewWriter(_w) return h.View(func(tx *bolt.Tx) error { for _, bucket := range buckets { b := tx.Bucket(b(bucket)) if _, err := w.Write( &BucketHeader{ Bucket: bucket, }); err != nil { return err } if err := b.ForEach(func(k...
go
func (h *dbHashTree) Serialize(_w io.Writer) error { w := pbutil.NewWriter(_w) return h.View(func(tx *bolt.Tx) error { for _, bucket := range buckets { b := tx.Bucket(b(bucket)) if _, err := w.Write( &BucketHeader{ Bucket: bucket, }); err != nil { return err } if err := b.ForEach(func(k...
[ "func", "(", "h", "*", "dbHashTree", ")", "Serialize", "(", "_w", "io", ".", "Writer", ")", "error", "{", "w", ":=", "pbutil", ".", "NewWriter", "(", "_w", ")", "\n", "return", "h", ".", "View", "(", "func", "(", "tx", "*", "bolt", ".", "Tx", "...
// Serialize serializes a binary version of the hashtree.
[ "Serialize", "serializes", "a", "binary", "version", "of", "the", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L502-L528
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Deserialize
func (h *dbHashTree) Deserialize(_r io.Reader) error { r := pbutil.NewReader(_r) hdr := &BucketHeader{} batchSize := 10000 kvs := make(chan *keyValue, batchSize/10) // create cancellable ctx in case bolt writer encounters error eg, copyCtx := errgroup.WithContext(context.Background()) eg.Go(func() error { var...
go
func (h *dbHashTree) Deserialize(_r io.Reader) error { r := pbutil.NewReader(_r) hdr := &BucketHeader{} batchSize := 10000 kvs := make(chan *keyValue, batchSize/10) // create cancellable ctx in case bolt writer encounters error eg, copyCtx := errgroup.WithContext(context.Background()) eg.Go(func() error { var...
[ "func", "(", "h", "*", "dbHashTree", ")", "Deserialize", "(", "_r", "io", ".", "Reader", ")", "error", "{", "r", ":=", "pbutil", ".", "NewReader", "(", "_r", ")", "\n", "hdr", ":=", "&", "BucketHeader", "{", "}", "\n", "batchSize", ":=", "10000", "...
// Deserialize deserializes a hashtree.
[ "Deserialize", "deserializes", "a", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L535-L617
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Copy
func (h *dbHashTree) Copy() (HashTree, error) { if err := h.Hash(); err != nil { return nil, err } r, w := io.Pipe() var eg errgroup.Group eg.Go(func() (retErr error) { defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = err } }() return h.Serialize(w) }) var result HashT...
go
func (h *dbHashTree) Copy() (HashTree, error) { if err := h.Hash(); err != nil { return nil, err } r, w := io.Pipe() var eg errgroup.Group eg.Go(func() (retErr error) { defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = err } }() return h.Serialize(w) }) var result HashT...
[ "func", "(", "h", "*", "dbHashTree", ")", "Copy", "(", ")", "(", "HashTree", ",", "error", ")", "{", "if", "err", ":=", "h", ".", "Hash", "(", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "r", ",", "w", "...
// Copy returns a copy of the hashtree.
[ "Copy", "returns", "a", "copy", "of", "the", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L620-L644
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Destroy
func (h *dbHashTree) Destroy() error { path := h.Path() if err := h.Close(); err != nil { return err } return os.Remove(path) }
go
func (h *dbHashTree) Destroy() error { path := h.Path() if err := h.Close(); err != nil { return err } return os.Remove(path) }
[ "func", "(", "h", "*", "dbHashTree", ")", "Destroy", "(", ")", "error", "{", "path", ":=", "h", ".", "Path", "(", ")", "\n", "if", "err", ":=", "h", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "retu...
// Destroy cleans up the on disk structures for the hashtree.
[ "Destroy", "cleans", "up", "the", "on", "disk", "structures", "for", "the", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L647-L653
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
PutFileOverwrite
func (h *dbHashTree) PutFileOverwrite(path string, objects []*pfs.Object, overwriteIndex *pfs.OverwriteIndex, sizeDelta int64) error { return h.putFile(path, objects, overwriteIndex, sizeDelta, false) }
go
func (h *dbHashTree) PutFileOverwrite(path string, objects []*pfs.Object, overwriteIndex *pfs.OverwriteIndex, sizeDelta int64) error { return h.putFile(path, objects, overwriteIndex, sizeDelta, false) }
[ "func", "(", "h", "*", "dbHashTree", ")", "PutFileOverwrite", "(", "path", "string", ",", "objects", "[", "]", "*", "pfs", ".", "Object", ",", "overwriteIndex", "*", "pfs", ".", "OverwriteIndex", ",", "sizeDelta", "int64", ")", "error", "{", "return", "h...
// PutFileOverwrite is the same as PutFile, except that instead of // appending the objects to the end of the given file, the objects // are inserted to the given index, and the existing objects starting // from the given index are removed.
[ "PutFileOverwrite", "is", "the", "same", "as", "PutFile", "except", "that", "instead", "of", "appending", "the", "objects", "to", "the", "end", "of", "the", "given", "file", "the", "objects", "are", "inserted", "to", "the", "given", "index", "and", "the", ...
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L710-L712
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
PutDirHeaderFooter
func (h *dbHashTree) PutDirHeaderFooter(path string, header, footer *pfs.Object, headerSize, footerSize int64) error { path = clean(path) return h.Batch(func(tx *bolt.Tx) error { // validation: 'path' must point to directory (or nothing--may not be // created yet) node, err := get(tx, path) if err != nil && C...
go
func (h *dbHashTree) PutDirHeaderFooter(path string, header, footer *pfs.Object, headerSize, footerSize int64) error { path = clean(path) return h.Batch(func(tx *bolt.Tx) error { // validation: 'path' must point to directory (or nothing--may not be // created yet) node, err := get(tx, path) if err != nil && C...
[ "func", "(", "h", "*", "dbHashTree", ")", "PutDirHeaderFooter", "(", "path", "string", ",", "header", ",", "footer", "*", "pfs", ".", "Object", ",", "headerSize", ",", "footerSize", "int64", ")", "error", "{", "path", "=", "clean", "(", "path", ")", "\...
// PutDirHeaderFooter implements the hashtree.PutDirHeaderFooter interface // method
[ "PutDirHeaderFooter", "implements", "the", "hashtree", ".", "PutDirHeaderFooter", "interface", "method" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L716-L762
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
PutFileHeaderFooter
func (h *dbHashTree) PutFileHeaderFooter(path string, objects []*pfs.Object, size int64) error { return h.putFile(path, objects, nil, size, true) }
go
func (h *dbHashTree) PutFileHeaderFooter(path string, objects []*pfs.Object, size int64) error { return h.putFile(path, objects, nil, size, true) }
[ "func", "(", "h", "*", "dbHashTree", ")", "PutFileHeaderFooter", "(", "path", "string", ",", "objects", "[", "]", "*", "pfs", ".", "Object", ",", "size", "int64", ")", "error", "{", "return", "h", ".", "putFile", "(", "path", ",", "objects", ",", "ni...
// PutFileHeaderFooter implements the HashTree PutFileHeaderFooter method
[ "PutFileHeaderFooter", "implements", "the", "HashTree", "PutFileHeaderFooter", "method" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L765-L767
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
deleteDir
func deleteDir(tx *bolt.Tx, path string) error { c := fs(tx).Cursor() prefix := append(b(path), nullByte[0]) for k, _ := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, _ = c.Next() { if err := c.Delete(); err != nil { return err } } return fs(tx).Delete(b(path)) }
go
func deleteDir(tx *bolt.Tx, path string) error { c := fs(tx).Cursor() prefix := append(b(path), nullByte[0]) for k, _ := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, _ = c.Next() { if err := c.Delete(); err != nil { return err } } return fs(tx).Delete(b(path)) }
[ "func", "deleteDir", "(", "tx", "*", "bolt", ".", "Tx", ",", "path", "string", ")", "error", "{", "c", ":=", "fs", "(", "tx", ")", ".", "Cursor", "(", ")", "\n", "prefix", ":=", "append", "(", "b", "(", "path", ")", ",", "nullByte", "[", "0", ...
// deleteDir deletes a directory and all the children under it
[ "deleteDir", "deletes", "a", "directory", "and", "all", "the", "children", "under", "it" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L874-L883
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
NewReader
func NewReader(r io.Reader, filter Filter) *Reader { return &Reader{ pbr: pbutil.NewReader(r), filter: filter, } }
go
func NewReader(r io.Reader, filter Filter) *Reader { return &Reader{ pbr: pbutil.NewReader(r), filter: filter, } }
[ "func", "NewReader", "(", "r", "io", ".", "Reader", ",", "filter", "Filter", ")", "*", "Reader", "{", "return", "&", "Reader", "{", "pbr", ":", "pbutil", ".", "NewReader", "(", "r", ")", ",", "filter", ":", "filter", ",", "}", "\n", "}" ]
// NewReader creates a new hashtree reader.
[ "NewReader", "creates", "a", "new", "hashtree", "reader", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L956-L961
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Read
func (r *Reader) Read() (*MergeNode, error) { _k, err := r.pbr.ReadBytes() if err != nil { return nil, err } if r.filter != nil { for { if r.filter(_k) { break } _, err = r.pbr.ReadBytes() if err != nil { return nil, err } _k, err = r.pbr.ReadBytes() if err != nil { return nil, ...
go
func (r *Reader) Read() (*MergeNode, error) { _k, err := r.pbr.ReadBytes() if err != nil { return nil, err } if r.filter != nil { for { if r.filter(_k) { break } _, err = r.pbr.ReadBytes() if err != nil { return nil, err } _k, err = r.pbr.ReadBytes() if err != nil { return nil, ...
[ "func", "(", "r", "*", "Reader", ")", "Read", "(", ")", "(", "*", "MergeNode", ",", "error", ")", "{", "_k", ",", "err", ":=", "r", ".", "pbr", ".", "ReadBytes", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n"...
// Read reads the next merge node.
[ "Read", "reads", "the", "next", "merge", "node", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L964-L997
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
NewWriter
func NewWriter(w io.Writer) *Writer { return &Writer{ pbw: pbutil.NewWriter(w), } }
go
func NewWriter(w io.Writer) *Writer { return &Writer{ pbw: pbutil.NewWriter(w), } }
[ "func", "NewWriter", "(", "w", "io", ".", "Writer", ")", "*", "Writer", "{", "return", "&", "Writer", "{", "pbw", ":", "pbutil", ".", "NewWriter", "(", "w", ")", ",", "}", "\n", "}" ]
// NewWriter creates a new hashtree writer.
[ "NewWriter", "creates", "a", "new", "hashtree", "writer", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1008-L1012
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Write
func (w *Writer) Write(n *MergeNode) error { // Marshal node if it was merged if n.nodeProto != nil { var err error n.v, err = n.nodeProto.Marshal() if err != nil { return err } } // Get size info from root node if bytes.Equal(n.k, nullByte) { if n.nodeProto == nil { n.nodeProto = &NodeProto{} i...
go
func (w *Writer) Write(n *MergeNode) error { // Marshal node if it was merged if n.nodeProto != nil { var err error n.v, err = n.nodeProto.Marshal() if err != nil { return err } } // Get size info from root node if bytes.Equal(n.k, nullByte) { if n.nodeProto == nil { n.nodeProto = &NodeProto{} i...
[ "func", "(", "w", "*", "Writer", ")", "Write", "(", "n", "*", "MergeNode", ")", "error", "{", "if", "n", ".", "nodeProto", "!=", "nil", "{", "var", "err", "error", "\n", "n", ".", "v", ",", "err", "=", "n", ".", "nodeProto", ".", "Marshal", "("...
// Write writes the next merge node.
[ "Write", "writes", "the", "next", "merge", "node", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1015-L1052
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Copy
func (w *Writer) Copy(r *Reader) error { for { n, err := r.Read() if err != nil { if err == io.EOF { return nil } return err } if err := w.Write(n); err != nil { return err } } }
go
func (w *Writer) Copy(r *Reader) error { for { n, err := r.Read() if err != nil { if err == io.EOF { return nil } return err } if err := w.Write(n); err != nil { return err } } }
[ "func", "(", "w", "*", "Writer", ")", "Copy", "(", "r", "*", "Reader", ")", "error", "{", "for", "{", "n", ",", "err", ":=", "r", ".", "Read", "(", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "io", ".", "EOF", "{", "return"...
// Copy copies a hashtree reader in a writer.
[ "Copy", "copies", "a", "hashtree", "reader", "in", "a", "writer", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1055-L1068
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Index
func (w *Writer) Index() ([]byte, error) { buf := &bytes.Buffer{} pbw := pbutil.NewWriter(buf) for _, idx := range w.idxs { if _, err := pbw.Write(idx); err != nil { return nil, err } } return buf.Bytes(), nil }
go
func (w *Writer) Index() ([]byte, error) { buf := &bytes.Buffer{} pbw := pbutil.NewWriter(buf) for _, idx := range w.idxs { if _, err := pbw.Write(idx); err != nil { return nil, err } } return buf.Bytes(), nil }
[ "func", "(", "w", "*", "Writer", ")", "Index", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "buf", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "pbw", ":=", "pbutil", ".", "NewWriter", "(", "buf", ")", "\n", "for", "_", ",",...
// Index returns the index for a hashtree writer.
[ "Index", "returns", "the", "index", "for", "a", "hashtree", "writer", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1077-L1086
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
GetRangeFromIndex
func GetRangeFromIndex(r io.Reader, prefix string) (uint64, uint64, error) { prefix = clean(prefix) pbr := pbutil.NewReader(r) idx := &Index{} k := b(prefix) var lower, upper uint64 iter := func(f func(int) bool) error { for { if err := pbr.Read(idx); err != nil { if err == io.EOF { break } ...
go
func GetRangeFromIndex(r io.Reader, prefix string) (uint64, uint64, error) { prefix = clean(prefix) pbr := pbutil.NewReader(r) idx := &Index{} k := b(prefix) var lower, upper uint64 iter := func(f func(int) bool) error { for { if err := pbr.Read(idx); err != nil { if err == io.EOF { break } ...
[ "func", "GetRangeFromIndex", "(", "r", "io", ".", "Reader", ",", "prefix", "string", ")", "(", "uint64", ",", "uint64", ",", "error", ")", "{", "prefix", "=", "clean", "(", "prefix", ")", "\n", "pbr", ":=", "pbutil", ".", "NewReader", "(", "r", ")", ...
// GetRangeFromIndex returns a subtree byte range in a serialized hashtree based on a passed in prefix.
[ "GetRangeFromIndex", "returns", "a", "subtree", "byte", "range", "in", "a", "serialized", "hashtree", "based", "on", "a", "passed", "in", "prefix", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1089-L1144
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
NewFilter
func NewFilter(numTrees int64, tree int64) Filter { return func(k []byte) bool { if pathToTree(k, numTrees) == uint64(tree) { return true } return false } }
go
func NewFilter(numTrees int64, tree int64) Filter { return func(k []byte) bool { if pathToTree(k, numTrees) == uint64(tree) { return true } return false } }
[ "func", "NewFilter", "(", "numTrees", "int64", ",", "tree", "int64", ")", "Filter", "{", "return", "func", "(", "k", "[", "]", "byte", ")", "bool", "{", "if", "pathToTree", "(", "k", ",", "numTrees", ")", "==", "uint64", "(", "tree", ")", "{", "ret...
// NewFilter creates a filter for a hashtree shard.
[ "NewFilter", "creates", "a", "filter", "for", "a", "hashtree", "shard", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1147-L1154
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
PathToTree
func PathToTree(path string, numTrees int64) uint64 { path = clean(path) return pathToTree(b(path), numTrees) }
go
func PathToTree(path string, numTrees int64) uint64 { path = clean(path) return pathToTree(b(path), numTrees) }
[ "func", "PathToTree", "(", "path", "string", ",", "numTrees", "int64", ")", "uint64", "{", "path", "=", "clean", "(", "path", ")", "\n", "return", "pathToTree", "(", "b", "(", "path", ")", ",", "numTrees", ")", "\n", "}" ]
// PathToTree computes the hashtree shard for a path.
[ "PathToTree", "computes", "the", "hashtree", "shard", "for", "a", "path", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1157-L1160
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Merge
func Merge(w *Writer, rs []*Reader) error { if len(rs) == 0 { return nil } mq := &mergePQ{q: make([]*nodeStream, len(rs)+1)} // Setup first set of nodes for _, r := range rs { if err := mq.insert(&nodeStream{r: r}); err != nil { return err } } for mq.q[1] != nil { // Get next nodes to merge ns, err ...
go
func Merge(w *Writer, rs []*Reader) error { if len(rs) == 0 { return nil } mq := &mergePQ{q: make([]*nodeStream, len(rs)+1)} // Setup first set of nodes for _, r := range rs { if err := mq.insert(&nodeStream{r: r}); err != nil { return err } } for mq.q[1] != nil { // Get next nodes to merge ns, err ...
[ "func", "Merge", "(", "w", "*", "Writer", ",", "rs", "[", "]", "*", "Reader", ")", "error", "{", "if", "len", "(", "rs", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n", "mq", ":=", "&", "mergePQ", "{", "q", ":", "make", "(", "[", "]"...
// Merge merges a collection of hashtree readers into a hashtree writer.
[ "Merge", "merges", "a", "collection", "of", "hashtree", "readers", "into", "a", "hashtree", "writer", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1287-L1315
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Hash
func (h *dbHashTree) Hash() error { return h.Batch(func(tx *bolt.Tx) error { return canonicalize(tx, "") }) }
go
func (h *dbHashTree) Hash() error { return h.Batch(func(tx *bolt.Tx) error { return canonicalize(tx, "") }) }
[ "func", "(", "h", "*", "dbHashTree", ")", "Hash", "(", ")", "error", "{", "return", "h", ".", "Batch", "(", "func", "(", "tx", "*", "bolt", ".", "Tx", ")", "error", "{", "return", "canonicalize", "(", "tx", ",", "\"\"", ")", "\n", "}", ")", "\n...
// Hash updates all of the hashes and node size metadata, it also checks // for conflicts.
[ "Hash", "updates", "all", "of", "the", "hashes", "and", "node", "size", "metadata", "it", "also", "checks", "for", "conflicts", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1417-L1421
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
IsGlob
func IsGlob(pattern string) bool { pattern = clean(pattern) return globRegex.Match([]byte(pattern)) }
go
func IsGlob(pattern string) bool { pattern = clean(pattern) return globRegex.Match([]byte(pattern)) }
[ "func", "IsGlob", "(", "pattern", "string", ")", "bool", "{", "pattern", "=", "clean", "(", "pattern", ")", "\n", "return", "globRegex", ".", "Match", "(", "[", "]", "byte", "(", "pattern", ")", ")", "\n", "}" ]
// IsGlob checks if the pattern contains a glob character
[ "IsGlob", "checks", "if", "the", "pattern", "contains", "a", "glob", "character" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1474-L1477
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
GlobLiteralPrefix
func GlobLiteralPrefix(pattern string) string { pattern = clean(pattern) idx := globRegex.FindStringIndex(pattern) if idx == nil { return pattern } return pattern[:idx[0]] }
go
func GlobLiteralPrefix(pattern string) string { pattern = clean(pattern) idx := globRegex.FindStringIndex(pattern) if idx == nil { return pattern } return pattern[:idx[0]] }
[ "func", "GlobLiteralPrefix", "(", "pattern", "string", ")", "string", "{", "pattern", "=", "clean", "(", "pattern", ")", "\n", "idx", ":=", "globRegex", ".", "FindStringIndex", "(", "pattern", ")", "\n", "if", "idx", "==", "nil", "{", "return", "pattern", ...
// GlobLiteralPrefix returns the prefix before the first glob character
[ "GlobLiteralPrefix", "returns", "the", "prefix", "before", "the", "first", "glob", "character" ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1480-L1487
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
GetHashTreeObject
func GetHashTreeObject(pachClient *client.APIClient, storageRoot string, treeRef *pfs.Object) (HashTree, error) { return getHashTree(storageRoot, func(w io.Writer) error { return pachClient.GetObject(treeRef.Hash, w) }) }
go
func GetHashTreeObject(pachClient *client.APIClient, storageRoot string, treeRef *pfs.Object) (HashTree, error) { return getHashTree(storageRoot, func(w io.Writer) error { return pachClient.GetObject(treeRef.Hash, w) }) }
[ "func", "GetHashTreeObject", "(", "pachClient", "*", "client", ".", "APIClient", ",", "storageRoot", "string", ",", "treeRef", "*", "pfs", ".", "Object", ")", "(", "HashTree", ",", "error", ")", "{", "return", "getHashTree", "(", "storageRoot", ",", "func", ...
// GetHashTreeObject is a convenience function to deserialize a HashTree from an object in the object store.
[ "GetHashTreeObject", "is", "a", "convenience", "function", "to", "deserialize", "a", "HashTree", "from", "an", "object", "in", "the", "object", "store", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1490-L1494
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
GetHashTreeTag
func GetHashTreeTag(pachClient *client.APIClient, storageRoot string, treeRef *pfs.Tag) (HashTree, error) { return getHashTree(storageRoot, func(w io.Writer) error { return pachClient.GetTag(treeRef.Name, w) }) }
go
func GetHashTreeTag(pachClient *client.APIClient, storageRoot string, treeRef *pfs.Tag) (HashTree, error) { return getHashTree(storageRoot, func(w io.Writer) error { return pachClient.GetTag(treeRef.Name, w) }) }
[ "func", "GetHashTreeTag", "(", "pachClient", "*", "client", ".", "APIClient", ",", "storageRoot", "string", ",", "treeRef", "*", "pfs", ".", "Tag", ")", "(", "HashTree", ",", "error", ")", "{", "return", "getHashTree", "(", "storageRoot", ",", "func", "(",...
// GetHashTreeTag is a convenience function to deserialize a HashTree from an tagged object in the object store.
[ "GetHashTreeTag", "is", "a", "convenience", "function", "to", "deserialize", "a", "HashTree", "from", "an", "tagged", "object", "in", "the", "object", "store", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1497-L1501
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
PutHashTree
func PutHashTree(pachClient *client.APIClient, tree HashTree, tags ...string) (*pfs.Object, error) { r, w := io.Pipe() var eg errgroup.Group eg.Go(func() (retErr error) { defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = err } }() return tree.Serialize(w) }) var treeRef *pf...
go
func PutHashTree(pachClient *client.APIClient, tree HashTree, tags ...string) (*pfs.Object, error) { r, w := io.Pipe() var eg errgroup.Group eg.Go(func() (retErr error) { defer func() { if err := w.Close(); err != nil && retErr == nil { retErr = err } }() return tree.Serialize(w) }) var treeRef *pf...
[ "func", "PutHashTree", "(", "pachClient", "*", "client", ".", "APIClient", ",", "tree", "HashTree", ",", "tags", "...", "string", ")", "(", "*", "pfs", ".", "Object", ",", "error", ")", "{", "r", ",", "w", ":=", "io", ".", "Pipe", "(", ")", "\n", ...
// PutHashTree is a convenience function for putting a HashTree to an object store.
[ "PutHashTree", "is", "a", "convenience", "function", "for", "putting", "a", "HashTree", "to", "an", "object", "store", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1530-L1551
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
NewChildCursor
func NewChildCursor(tx *bolt.Tx, path string) *ChildCursor { path = clean(path) c := fs(tx).Cursor() dir := b(path) k, v := c.Seek(append(dir, nullByte[0])) if !bytes.Equal(dir, nullByte) { dir = append(dir, nullByte[0]) } if !bytes.HasPrefix(k, dir) { k, v = nil, nil } return &ChildCursor{ c: c, dir...
go
func NewChildCursor(tx *bolt.Tx, path string) *ChildCursor { path = clean(path) c := fs(tx).Cursor() dir := b(path) k, v := c.Seek(append(dir, nullByte[0])) if !bytes.Equal(dir, nullByte) { dir = append(dir, nullByte[0]) } if !bytes.HasPrefix(k, dir) { k, v = nil, nil } return &ChildCursor{ c: c, dir...
[ "func", "NewChildCursor", "(", "tx", "*", "bolt", ".", "Tx", ",", "path", "string", ")", "*", "ChildCursor", "{", "path", "=", "clean", "(", "path", ")", "\n", "c", ":=", "fs", "(", "tx", ")", ".", "Cursor", "(", ")", "\n", "dir", ":=", "b", "(...
// NewChildCursor creates a new child cursor.
[ "NewChildCursor", "creates", "a", "new", "child", "cursor", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1563-L1580
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
Next
func (d *ChildCursor) Next() ([]byte, []byte) { if d.k == nil { return nil, nil } k, v := d.c.Seek(append(d.k, 1)) if !bytes.HasPrefix(k, d.dir) { k, v = nil, nil } d.k, d.v = k, v return k, v }
go
func (d *ChildCursor) Next() ([]byte, []byte) { if d.k == nil { return nil, nil } k, v := d.c.Seek(append(d.k, 1)) if !bytes.HasPrefix(k, d.dir) { k, v = nil, nil } d.k, d.v = k, v return k, v }
[ "func", "(", "d", "*", "ChildCursor", ")", "Next", "(", ")", "(", "[", "]", "byte", ",", "[", "]", "byte", ")", "{", "if", "d", ".", "k", "==", "nil", "{", "return", "nil", ",", "nil", "\n", "}", "\n", "k", ",", "v", ":=", "d", ".", "c", ...
// Next gets the next key, value pair.
[ "Next", "gets", "the", "next", "key", "value", "pair", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1593-L1603
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
NewOrdered
func NewOrdered(root string) *Ordered { root = clean(root) o := &Ordered{} n := &node{ path: "", nodeProto: &NodeProto{ Name: "", DirNode: &DirectoryNodeProto{}, }, hash: sha256.New(), } o.fs = append(o.fs, n) o.dirStack = append(o.dirStack, n) o.MkdirAll(root) o.root = root return o }
go
func NewOrdered(root string) *Ordered { root = clean(root) o := &Ordered{} n := &node{ path: "", nodeProto: &NodeProto{ Name: "", DirNode: &DirectoryNodeProto{}, }, hash: sha256.New(), } o.fs = append(o.fs, n) o.dirStack = append(o.dirStack, n) o.MkdirAll(root) o.root = root return o }
[ "func", "NewOrdered", "(", "root", "string", ")", "*", "Ordered", "{", "root", "=", "clean", "(", "root", ")", "\n", "o", ":=", "&", "Ordered", "{", "}", "\n", "n", ":=", "&", "node", "{", "path", ":", "\"\"", ",", "nodeProto", ":", "&", "NodePro...
// NewOrdered creates a new ordered hashtree.
[ "NewOrdered", "creates", "a", "new", "ordered", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1632-L1648
test
pachyderm/pachyderm
src/server/pkg/hashtree/db.go
MkdirAll
func (o *Ordered) MkdirAll(path string) { var paths []string for path != "" { paths = append(paths, path) path, _ = split(path) } for i := len(paths) - 1; i >= 0; i-- { o.PutDir(paths[i]) } }
go
func (o *Ordered) MkdirAll(path string) { var paths []string for path != "" { paths = append(paths, path) path, _ = split(path) } for i := len(paths) - 1; i >= 0; i-- { o.PutDir(paths[i]) } }
[ "func", "(", "o", "*", "Ordered", ")", "MkdirAll", "(", "path", "string", ")", "{", "var", "paths", "[", "]", "string", "\n", "for", "path", "!=", "\"\"", "{", "paths", "=", "append", "(", "paths", ",", "path", ")", "\n", "path", ",", "_", "=", ...
// MkdirAll puts all of the parent directories of a given // path into the hashtree.
[ "MkdirAll", "puts", "all", "of", "the", "parent", "directories", "of", "a", "given", "path", "into", "the", "hashtree", "." ]
94fb2d536cb6852a77a49e8f777dc9c1bde2c723
https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1652-L1661
test