MCPcopy
hub / github.com/pingcap/tidb / NewDebugCommand

Function NewDebugCommand

br/cmd/br/debug.go:37–63  ·  view source on GitHub ↗

NewDebugCommand return a debug subcommand.

()

Source from the content-addressed store, hash-verified

35
36// NewDebugCommand return a debug subcommand.
37func NewDebugCommand() *cobra.Command {
38 meta := &cobra.Command{
39 Use: "debug <subcommand>",
40 Short: "commands to check/debug backup data",
41 SilenceUsage: false,
42 PersistentPreRunE: func(c *cobra.Command, args []string) error {
43 if err := Init(c); err != nil {
44 return errors.Trace(err)
45 }
46 build.LogInfo(build.BR)
47 tidblogutil.LogEnvVariables()
48 task.LogArguments(c)
49 return nil
50 },
51 // To be compatible with older BR.
52 Aliases: []string{"validate"},
53 }
54 meta.AddCommand(newCheckSumCommand())
55 meta.AddCommand(newBackupMetaCommand())
56 meta.AddCommand(decodeBackupMetaCommand())
57 meta.AddCommand(encodeBackupMetaCommand())
58 meta.AddCommand(setPDConfigCommand())
59 meta.AddCommand(searchStreamBackupCommand())
60 meta.Hidden = true
61
62 return meta
63}
64
65func newCheckSumCommand() *cobra.Command {
66 command := &cobra.Command{

Callers 1

mainFunction · 0.85

Calls 8

LogArgumentsFunction · 0.92
newCheckSumCommandFunction · 0.85
newBackupMetaCommandFunction · 0.85
decodeBackupMetaCommandFunction · 0.85
encodeBackupMetaCommandFunction · 0.85
setPDConfigCommandFunction · 0.85
InitFunction · 0.70

Tested by

no test coverage detected