You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
721 B
26 lines
721 B
package weed_server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
|
|
)
|
|
|
|
// GetState returns a volume server's state flags.
|
|
func (vs *VolumeServer) GetState(ctx context.Context, req *volume_server_pb.GetStateRequest) (*volume_server_pb.GetStateResponse, error) {
|
|
resp := &volume_server_pb.GetStateResponse{
|
|
State: vs.store.State.Pb,
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// SetState updates state flags for volume servers.
|
|
func (vs *VolumeServer) SetState(ctx context.Context, req *volume_server_pb.SetStateRequest) (*volume_server_pb.SetStateResponse, error) {
|
|
err := vs.store.State.Update(req.State)
|
|
resp := &volume_server_pb.SetStateResponse{
|
|
State: vs.store.State.Pb,
|
|
}
|
|
|
|
return resp, err
|
|
}
|