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

Function PrintSingleIngesting

admin-cli/executor/bulk_load.go:337–364  ·  view source on GitHub ↗
(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool)

Source from the content-addressed store, hash-verified

335}
336
337func PrintSingleIngesting(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool) {
338 stateMap := resp.GetBulkLoadStates()[partitionIndex]
339 if !detailed {
340 PrintSingleSummary(client, resp.GetAppName(), int32(partitionIndex), resp.GetPartitionsStatus()[partitionIndex])
341 return
342 }
343 var sList []interface{}
344 type singleStruct struct {
345 Node string `json:"NodeAddress"`
346 PStatus string `json:"PartitionStatus"`
347 IStatus string `json:"IngestionStatus"`
348 }
349 for node, state := range stateMap {
350 sList = append(sList, singleStruct{
351 Node: node.String(),
352 PStatus: resp.GetPartitionsStatus()[partitionIndex].String(),
353 IStatus: state.GetIngestStatus().String(),
354 })
355 }
356 util.SortStructsByField(sList, "Node")
357 tabular.New(client, sList, func(tbWriter *tablewriter.Table) {
358 tbWriter.SetFooter([]string{
359 fmt.Sprintf("Table(%s) Partition[%d]", resp.GetAppName(), partitionIndex),
360 fmt.Sprintf("Table(%s)", resp.GetAppStatus().String()),
361 "",
362 })
363 }).Render()
364}
365
366func PrintSingleCleanupFlag(client *Client, resp *admin.QueryBulkLoadResponse, partitionIndex int, detailed bool) {
367 stateMap := resp.GetBulkLoadStates()[partitionIndex]

Callers 1

QueryBulkLoadFunction · 0.85

Calls 3

PrintSingleSummaryFunction · 0.85
RenderMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected