grpc connection to filer add sw-client-id header
This commit is contained in:
@@ -161,7 +161,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i
|
||||
for _, filer := range filers {
|
||||
for _, master := range masters {
|
||||
fmt.Fprintf(writer, "checking filer %s to master %s ... ", string(filer), string(master))
|
||||
err := pb.WithFilerClient(false, filer, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
err := pb.WithFilerClient(false, 0, filer, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
pong, err := client.Ping(context.Background(), &filer_pb.PingRequest{
|
||||
Target: string(master),
|
||||
TargetType: cluster.MasterType,
|
||||
@@ -181,7 +181,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i
|
||||
for _, filer := range filers {
|
||||
for _, volumeServer := range volumeServers {
|
||||
fmt.Fprintf(writer, "checking filer %s to volume server %s ... ", string(filer), string(volumeServer))
|
||||
err := pb.WithFilerClient(false, filer, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
err := pb.WithFilerClient(false, 0, filer, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
pong, err := client.Ping(context.Background(), &filer_pb.PingRequest{
|
||||
Target: string(volumeServer),
|
||||
TargetType: cluster.VolumeServerType,
|
||||
@@ -224,7 +224,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i
|
||||
for _, sourceFiler := range filers {
|
||||
for _, targetFiler := range filers {
|
||||
fmt.Fprintf(writer, "checking filer %s to %s ... ", string(sourceFiler), string(targetFiler))
|
||||
err := pb.WithFilerClient(false, sourceFiler, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
err := pb.WithFilerClient(false, 0, sourceFiler, commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
pong, err := client.Ping(context.Background(), &filer_pb.PingRequest{
|
||||
Target: string(targetFiler),
|
||||
TargetType: cluster.FilerType,
|
||||
|
||||
@@ -105,7 +105,7 @@ func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.W
|
||||
if node.Rack != "" {
|
||||
fmt.Fprintf(writer, " Rack: %v\n", node.Rack)
|
||||
}
|
||||
pb.WithFilerClient(false, pb.ServerAddress(node.Address), commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
pb.WithFilerClient(false, 0, pb.ServerAddress(node.Address), commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||
if err == nil {
|
||||
if resp.FilerGroup != "" {
|
||||
@@ -120,7 +120,7 @@ func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.W
|
||||
})
|
||||
}
|
||||
for _, node := range filerNodes {
|
||||
pb.WithFilerClient(false, pb.ServerAddress(node.Address), commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
pb.WithFilerClient(false, 0, pb.ServerAddress(node.Address), commandEnv.option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
fmt.Fprintf(writer, "* filer %s metadata sync time\n", node.Address)
|
||||
selfSignature := filerSignatures[node]
|
||||
for peer, peerSignature := range filerSignatures {
|
||||
|
||||
@@ -111,7 +111,7 @@ var _ = filer_pb.FilerClient(&CommandEnv{})
|
||||
|
||||
func (ce *CommandEnv) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
|
||||
|
||||
return pb.WithGrpcFilerClient(streamingMode, ce.option.FilerAddress, ce.option.GrpcDialOption, fn)
|
||||
return pb.WithGrpcFilerClient(streamingMode, 0, ce.option.FilerAddress, ce.option.GrpcDialOption, fn)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user