add -disk to filer command (#4247)
* add -disk to filer command * add diskType to filer.grpc * use filer.disk when filerWebDavOptions.disk is empty * add filer.disk to weed server command. --------- Co-authored-by: 三千院羽 <3000y@MacBook-Pro.lan>
This commit is contained in:
@@ -295,6 +295,10 @@ func (fs *FilerServer) DeleteEntry(ctx context.Context, req *filer_pb.DeleteEntr
|
||||
|
||||
func (fs *FilerServer) AssignVolume(ctx context.Context, req *filer_pb.AssignVolumeRequest) (resp *filer_pb.AssignVolumeResponse, err error) {
|
||||
|
||||
if req.DiskType == "" {
|
||||
req.DiskType = fs.option.DiskType
|
||||
}
|
||||
|
||||
so, err := fs.detectStorageOption(req.Path, req.Collection, req.Replication, req.TtlSec, req.DiskType, req.DataCenter, req.Rack, req.DataNode)
|
||||
if err != nil {
|
||||
glog.V(3).Infof("AssignVolume: %v", err)
|
||||
|
||||
@@ -69,6 +69,7 @@ type FilerOption struct {
|
||||
ConcurrentUploadLimit int64
|
||||
ShowUIDirectoryDelete bool
|
||||
DownloadMaxBytesPs int64
|
||||
DiskType string
|
||||
}
|
||||
|
||||
type FilerServer struct {
|
||||
|
||||
@@ -4,12 +4,13 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/operation"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
@@ -97,6 +98,11 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request, conte
|
||||
return
|
||||
}
|
||||
|
||||
// When DiskType is empty,use filer's -disk
|
||||
if so.DiskType == "" {
|
||||
so.DiskType = fs.option.DiskType
|
||||
}
|
||||
|
||||
if query.Has("mv.from") {
|
||||
fs.move(ctx, w, r, so)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user