MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / QuerySplitStatus

Function QuerySplitStatus

admin-cli/executor/partition_split.go:39–81  ·  view source on GitHub ↗
(client *Client, tableName string)

Source from the content-addressed store, hash-verified

37}
38
39func QuerySplitStatus(client *Client, tableName string) error {
40 resp, err := client.Meta.QuerySplitStatus(tableName)
41 if err != nil {
42 return err
43 }
44 // show all partitions split status
45 type splitStatusStruct struct {
46 PartitionIndex int32 `json:"Pidx"`
47 Status string `json:"SplitStatus"`
48 }
49 fmt.Println("[AllPartitionStatus]")
50 var pList []interface{}
51 var i int32 = 0
52 statusMap := resp.GetStatus()
53 for ; i < resp.GetNewPartitionCount_()/2; i++ {
54 var status string
55 value, ok := statusMap[i]
56 if ok {
57 status = value.String()
58 } else {
59 status = "COMPLETED"
60 }
61 pList = append(pList, splitStatusStruct{
62 PartitionIndex: i,
63 Status: status,
64 })
65 }
66 tabular.Print(client, pList)
67
68 // show summary count
69 fmt.Println("[Summary]")
70 var sList []interface{}
71 type summaryStruct struct {
72 SplittingCount int32 `json:"SplittingCount"`
73 CompletedCount int32 `json:"CompletedCount"`
74 }
75 sList = append(sList, summaryStruct{
76 SplittingCount: int32(len(statusMap)),
77 CompletedCount: resp.GetNewPartitionCount_()/2 - int32(len(statusMap)),
78 })
79 tabular.Print(client, sList)
80 return nil
81}
82
83func PausePartitionSplit(client *Client, tableName string, parentPidx int) error {
84 err := client.Meta.PausePartitionSplit(tableName, parentPidx)

Callers

nothing calls this directly

Calls 3

QuerySplitStatusMethod · 0.65
StringMethod · 0.65
PrintMethod · 0.65

Tested by

no test coverage detected