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

Method Run

cmd/super/db/create/command.go:52–86  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

50}
51
52func (c *Command) Run(args []string) error {
53 ctx, cleanup, err := c.Init()
54 if err != nil {
55 return err
56 }
57 defer cleanup()
58 if len(args) != 1 {
59 return errors.New("create requires one argument")
60 }
61 db, err := c.DBFlags.Open(ctx)
62 if err != nil {
63 return err
64 }
65 sortKey, err := order.ParseSortKeys(c.sortKey)
66 if err != nil {
67 return err
68 }
69 poolName := args[0]
70 id, err := db.CreatePool(ctx, poolName, sortKey, int(c.seekStride), int64(c.thresh))
71 if err != nil {
72 return err
73 }
74 if !c.DBFlags.Quiet {
75 fmt.Printf("pool created: %s %s\n", poolName, id)
76 }
77 if c.use {
78 if err := poolflags.WriteHead(poolName, "main"); err != nil {
79 return err
80 }
81 if !c.DBFlags.Quiet {
82 fmt.Printf("Switched to branch \"main\" on pool %q\n", poolName)
83 }
84 }
85 return nil
86}

Callers

nothing calls this directly

Implementers 15

Displaypkg/display/display.go
Serverpkg/httpd/server.go
Commandcmd/gentoken/main.go
Commandcmd/super/dev/command.go
Commandcmd/super/dev/vector/command.go
Commandcmd/super/dev/vector/copy/command.go
Commandcmd/super/dev/vector/project/command.g
Commandcmd/super/dev/vector/search/command.go
Commandcmd/super/dev/dig/command.go
Commandcmd/super/dev/dig/frames/command.go
Commandcmd/super/dev/dig/slice/command.go
Commandcmd/super/dev/csup/command.go

Calls 6

ParseSortKeysFunction · 0.92
WriteHeadFunction · 0.92
NewMethod · 0.80
InitMethod · 0.65
CreatePoolMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected