(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)
| 395 | } |
| 396 | |
| 397 | func PrintSinglePausing(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool) { |
| 398 | stateMap := resp.GetBulkLoadStates()[partitionIndex] |
| 399 | if !detailed { |
| 400 | PrintSingleSummary(client, resp.GetAppName(), int32(partitionIndex), resp.GetPartitionsStatus()[partitionIndex]) |
| 401 | return |
| 402 | } |
| 403 | var sList []interface{} |
| 404 | type singleStruct struct { |
| 405 | Node string `json:"NodeAddress"` |
| 406 | PStatus string `json:"PartitionStatus"` |
| 407 | Paused bool `json:"IsPaused"` |
| 408 | } |
| 409 | for node, state := range stateMap { |
| 410 | sList = append(sList, singleStruct{ |
| 411 | Node: node.String(), |
| 412 | PStatus: resp.GetPartitionsStatus()[partitionIndex].String(), |
| 413 | Paused: state.GetIsPaused(), |
| 414 | }) |
| 415 | } |
| 416 | util.SortStructsByField(sList, "Node") |
| 417 | tabular.New(client, sList, func(tbWriter *tablewriter.Table) { |
| 418 | tbWriter.SetFooter([]string{ |
| 419 | fmt.Sprintf("Table(%s) Partition[%d]", resp.GetAppName(), partitionIndex), |
| 420 | fmt.Sprintf("Table(%s)", resp.GetAppStatus().String()), |
| 421 | "", |
| 422 | }) |
| 423 | }).Render() |
| 424 | } |
| 425 | |
| 426 | func PrintSingleSummary(client *Client, tableName string, pidx int32, partitionStatus admin.BulkLoadStatus) { |
| 427 | var tList []interface{} |
no test coverage detected