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

Method Remove

db/pools/store.go:102–120  ·  view source on GitHub ↗

Remove deletes a pool from the configuration journal.

(ctx context.Context, config Config)

Source from the content-addressed store, hash-verified

100
101// Remove deletes a pool from the configuration journal.
102func (s *Store) Remove(ctx context.Context, config Config) error {
103 err := s.store.Delete(ctx, config.Name, func(v journal.Entry) bool {
104 p, ok := v.(*Config)
105 if !ok {
106 return false
107 }
108 return p.ID == config.ID
109 })
110 if err != nil {
111 if err == journal.ErrNoSuchKey {
112 return fmt.Errorf("%s: %w", config.ID, ErrNotFound)
113 }
114 if err == journal.ErrConstraint {
115 return fmt.Errorf("%s: pool %q renamed during removal", config.Name, config.ID)
116 }
117 return err
118 }
119 return nil
120}

Callers 9

handleBranchLoadFunction · 0.45
DeleteMethod · 0.45
closeMethod · 0.45
forwardMethod · 0.45
CloseAndRemoveMethod · 0.45
commitMethod · 0.45
removeBranchMethod · 0.45
RemovePoolMethod · 0.45
AbortMethod · 0.45

Calls 1

DeleteMethod · 0.65

Tested by

no test coverage detected