Skip to content

Commit

Permalink
ckp read
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenbin1002 committed Aug 2, 2024
1 parent 4200a31 commit 66c270f
Showing 1 changed file with 49 additions and 6 deletions.
55 changes: 49 additions & 6 deletions pkg/vm/engine/tae/rpc/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,9 @@ func (c *ckpListArg) getCkpList() (res string, err error) {
}
var global string
if entry.IsIncremental() {
global = "I"
global = "Incremental"
} else {
global = "G"
global = "Global"
}
ckpEntries = append(ckpEntries, CkpEntry{
Index: i,
Expand Down Expand Up @@ -1353,9 +1353,9 @@ type ckpDownloadArg struct {

func (c *ckpDownloadArg) PrepareCommand() *cobra.Command {
ckpStatCmd := &cobra.Command{
Use: "down",
Short: "checkpoint down",
Long: "Display all checkpoints",
Use: "download",
Short: "checkpoint download",
Long: "download checkpoints",
Run: RunFactory(c),
}

Expand Down Expand Up @@ -1389,7 +1389,7 @@ func (c *ckpDownloadArg) Run() (err error) {
return c.DownLoadEntries(ctx, entries)
}

func (c *ckpDownloadArg) DownLoadEntries(ctx context.Context, entries []*checkpoint.CheckpointEntry) (err error) {
func (c *ckpDownloadArg) DownLoadEntries(ctx context.Context, entries []*checkpoint.CheckpointEntry) error {
for i, entry := range entries {
data, err := getCkpData(context.Background(), entry, c.ctx.db.Runtime.Fs)
if err != nil {
Expand Down Expand Up @@ -1430,3 +1430,46 @@ func (c *ckpDownloadArg) DownLoadEntries(ctx context.Context, entries []*checkpo

return nil
}

type ckpReadArg struct {

Check failure on line 1434 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

type `ckpReadArg` is unused (unused)
ctx *inspectContext
name string
path string
res string
}

func (c *ckpReadArg) PrepareCommand() *cobra.Command {

Check failure on line 1441 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

func `(*ckpReadArg).PrepareCommand` is unused (unused)
ckpReadCmd := &cobra.Command{
Use: "read",
Short: "checkpoint down",
Long: "Display all checkpoints",
Run: RunFactory(c),
}

ckpReadCmd.SetUsageTemplate(c.Usage())

ckpReadCmd.Flags().StringP("name", "n", "", "checkpoint name")

return ckpReadCmd
}

func (c *ckpReadArg) FromCommand(cmd *cobra.Command) (err error) {

Check failure on line 1456 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

func `(*ckpReadArg).FromCommand` is unused (unused)
dir, _ := cmd.Flags().GetString("name")
c.path, c.name = filepath.Split(dir)
if cmd.Flag("ictx") != nil {
c.ctx = cmd.Flag("ictx").Value.(*inspectContext)
}
return nil
}

func (c *ckpReadArg) String() string {

Check failure on line 1465 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

func `(*ckpReadArg).String` is unused (unused)
return c.res
}

func (c *ckpReadArg) Usage() (res string) {

Check failure on line 1469 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

func `(*ckpReadArg).Usage` is unused (unused)
return
}

func (c *ckpReadArg) Run() (err error) {

Check failure on line 1473 in pkg/vm/engine/tae/rpc/tool.go

View workflow job for this annotation

GitHub Actions / Matrixone CI / SCA Test on Ubuntu/x86

func `(*ckpReadArg).Run` is unused (unused)
return nil
}

0 comments on commit 66c270f

Please sign in to comment.