Skip to content

Commit

Permalink
follow acelyc111 advice
Browse files Browse the repository at this point in the history
  • Loading branch information
lupengfan1 committed Dec 10, 2024
1 parent 764cafb commit b8a06c3
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions admin-cli/executor/disk_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ package executor
import (
"context"
"fmt"
"strings"
"time"

"github.com/apache/incubator-pegasus/admin-cli/tabular"
"github.com/apache/incubator-pegasus/admin-cli/util"
"github.com/apache/incubator-pegasus/go-client/idl/admin"
"github.com/apache/incubator-pegasus/go-client/idl/base"
"github.com/apache/incubator-pegasus/go-client/idl/radmin"
"github.com/apache/incubator-pegasus/go-client/session"
Expand Down Expand Up @@ -99,31 +97,6 @@ func QueryAllNodesDiskInfo(client *Client, tableName string) (map[string]*radmin
return respMap, nil
}

func QueryAliveNodesDiskInfo(client *Client, tableName string) (map[string]*radmin.QueryDiskInfoResponse, error) {
respMap := make(map[string]*radmin.QueryDiskInfoResponse)
nodeInfos, err := client.Meta.ListNodes()
if err != nil {
return respMap, err
}
for _, nodeInfo := range nodeInfos {
if nodeInfo.Status != admin.NodeStatus_NS_ALIVE {
continue
}
address := nodeInfo.GetAddress().GetAddress()
resp, err := SendQueryDiskInfoRequest(client, address, tableName)
if err != nil {
// this replica server haven't the table partition.
if strings.Contains(err.Error(), "ERR_OBJECT_NOT_FOUND") {
continue
} else {
return respMap, err
}
}
respMap[address] = resp
}
return respMap, nil
}

type DiskCapacityStruct struct {
Disk string `json:"disk"`
Capacity int64 `json:"capacity"`
Expand Down

0 comments on commit b8a06c3

Please sign in to comment.