-
Notifications
You must be signed in to change notification settings - Fork 568
/
drive.go
39 lines (34 loc) · 1.77 KB
/
drive.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Package drive provides the definitions for the low-level pfs storage drivers.
*/
package drive
import (
"io"
"go.pedge.io/pb/go/google/protobuf"
"github.com/pachyderm/pachyderm/src/client/pfs"
)
// Driver represents a low-level pfs storage driver.
type Driver interface {
CreateRepo(repo *pfs.Repo, created *google_protobuf.Timestamp, shards map[uint64]bool) error
InspectRepo(repo *pfs.Repo, shards map[uint64]bool) (*pfs.RepoInfo, error)
ListRepo(shards map[uint64]bool) ([]*pfs.RepoInfo, error)
DeleteRepo(repo *pfs.Repo, shards map[uint64]bool) error
StartCommit(repo *pfs.Repo, commitID string, parentID string, branch string, started *google_protobuf.Timestamp, shards map[uint64]bool) error
FinishCommit(commit *pfs.Commit, finished *google_protobuf.Timestamp, shards map[uint64]bool) error
InspectCommit(commit *pfs.Commit, shards map[uint64]bool) (*pfs.CommitInfo, error)
ListCommit(repo []*pfs.Repo, fromCommit []*pfs.Commit, shards map[uint64]bool) ([]*pfs.CommitInfo, error)
ListBranch(repo *pfs.Repo, shards map[uint64]bool) ([]*pfs.CommitInfo, error)
DeleteCommit(commit *pfs.Commit, shards map[uint64]bool) error
PutFile(file *pfs.File, shard uint64, reader io.Reader) error
MakeDirectory(file *pfs.File, shard uint64) error
GetFile(file *pfs.File, filterShard *pfs.Shard, offset int64, size int64, from *pfs.Commit, shard uint64) (io.ReadCloser, error)
InspectFile(file *pfs.File, filterShard *pfs.Shard, from *pfs.Commit, shard uint64) (*pfs.FileInfo, error)
ListFile(file *pfs.File, filterShard *pfs.Shard, from *pfs.Commit, shard uint64) ([]*pfs.FileInfo, error)
DeleteFile(file *pfs.File, shard uint64) error
AddShard(shard uint64) error
DeleteShard(shard uint64) error
Dump()
}
func NewDriver(blockAddress string) (Driver, error) {
return newDriver(blockAddress)
}