MCPcopy Create free account
hub / github.com/brimdata/super / OpenPool

Function OpenPool

db/pool.go:78–98  ·  view source on GitHub ↗
(ctx context.Context, engine storage.Engine, logger *zap.Logger, root *storage.URI, config *pools.Config)

Source from the content-addressed store, hash-verified

76}
77
78func OpenPool(ctx context.Context, engine storage.Engine, logger *zap.Logger, root *storage.URI, config *pools.Config) (*Pool, error) {
79 path := config.Path(root)
80 branchesPath := path.JoinPath(BranchesTag)
81 branches, err := branches.OpenStore(ctx, engine, logger, branchesPath)
82 if err != nil {
83 return nil, err
84 }
85 commitsPath := path.JoinPath(CommitsTag)
86 commits, err := commits.OpenStore(engine, logger, commitsPath)
87 if err != nil {
88 return nil, err
89 }
90 return &Pool{
91 Config: *config,
92 engine: engine,
93 Path: path,
94 DataPath: DataPath(path),
95 branches: branches,
96 commits: commits,
97 }, nil
98}
99
100func RemovePool(ctx context.Context, engine storage.Engine, root *storage.URI, config *pools.Config) error {
101 return engine.DeleteByPrefix(ctx, config.Path(root))

Callers 1

openPoolMethod · 0.85

Calls 5

OpenStoreFunction · 0.92
OpenStoreFunction · 0.92
DataPathFunction · 0.85
JoinPathMethod · 0.80
PathMethod · 0.45

Tested by

no test coverage detected