mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 09:42:29 +08:00
volume: add "hasSlowRead" option to customize read optimization
This commit is contained in:
@@ -28,6 +28,7 @@ type VolumeServer struct {
|
||||
inFlightUploadDataLimitCond *sync.Cond
|
||||
inFlightDownloadDataLimitCond *sync.Cond
|
||||
inflightUploadDataTimeout time.Duration
|
||||
hasSlowRead bool
|
||||
|
||||
SeedMasterNodes []pb.ServerAddress
|
||||
currentMaster pb.ServerAddress
|
||||
@@ -64,6 +65,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
||||
concurrentUploadLimit int64,
|
||||
concurrentDownloadLimit int64,
|
||||
inflightUploadDataTimeout time.Duration,
|
||||
hasSlowRead bool,
|
||||
) *VolumeServer {
|
||||
|
||||
v := util.GetViper()
|
||||
@@ -93,6 +95,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
||||
concurrentUploadLimit: concurrentUploadLimit,
|
||||
concurrentDownloadLimit: concurrentDownloadLimit,
|
||||
inflightUploadDataTimeout: inflightUploadDataTimeout,
|
||||
hasSlowRead: hasSlowRead,
|
||||
}
|
||||
vs.SeedMasterNodes = masterNodes
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
readOption := &storage.ReadOption{
|
||||
ReadDeleted: r.FormValue("readDeleted") == "true",
|
||||
HasSlowRead: vs.hasSlowRead,
|
||||
}
|
||||
|
||||
var count int
|
||||
|
||||
Reference in New Issue
Block a user