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

Method openPool

db/root.go:295–310  ·  view source on GitHub ↗
(ctx context.Context, config *pools.Config)

Source from the content-addressed store, hash-verified

293}
294
295func (r *Root) openPool(ctx context.Context, config *pools.Config) (*Pool, error) {
296 if p, ok := r.poolCache.Get(config.ID); ok {
297 // The cached pool's config may be outdated, so rather than
298 // return the pool directly, we return a copy whose config we
299 // can safely update without locking.
300 p := *p
301 p.Config = *config
302 return &p, nil
303 }
304 p, err := OpenPool(ctx, r.engine, r.logger, r.path, config)
305 if err != nil {
306 return nil, err
307 }
308 r.poolCache.Add(config.ID, p)
309 return p, nil
310}
311
312func (r *Root) RenamePool(ctx context.Context, id ksuid.KSUID, newName string) error {
313 return r.pools.Rename(ctx, id, newName)

Callers 3

BatchifyBranchesMethod · 0.95
OpenPoolMethod · 0.95
CreatePoolMethod · 0.95

Calls 3

OpenPoolFunction · 0.85
GetMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected