mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 11:59:24 +08:00
volume: add "readBufSize" option to customize read optimization (#3702)
* simplify a bit * feat: volume: add "readBufSize" option to customize read optimization * refactor : redbufSIze -> readBufferSize * simplify a bit * simplify a bit
This commit is contained in:
@@ -29,6 +29,7 @@ type VolumeServer struct {
|
||||
inFlightDownloadDataLimitCond *sync.Cond
|
||||
inflightUploadDataTimeout time.Duration
|
||||
hasSlowRead bool
|
||||
readBufferSize int
|
||||
|
||||
SeedMasterNodes []pb.ServerAddress
|
||||
currentMaster pb.ServerAddress
|
||||
@@ -66,6 +67,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
||||
concurrentDownloadLimit int64,
|
||||
inflightUploadDataTimeout time.Duration,
|
||||
hasSlowRead bool,
|
||||
readBufferSize int,
|
||||
) *VolumeServer {
|
||||
|
||||
v := util.GetViper()
|
||||
@@ -96,6 +98,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
||||
concurrentDownloadLimit: concurrentDownloadLimit,
|
||||
inflightUploadDataTimeout: inflightUploadDataTimeout,
|
||||
hasSlowRead: hasSlowRead,
|
||||
readBufferSize: readBufferSize,
|
||||
}
|
||||
vs.SeedMasterNodes = masterNodes
|
||||
|
||||
|
@@ -116,8 +116,9 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
||||
cookie := n.Cookie
|
||||
|
||||
readOption := &storage.ReadOption{
|
||||
ReadDeleted: r.FormValue("readDeleted") == "true",
|
||||
HasSlowRead: vs.hasSlowRead,
|
||||
ReadDeleted: r.FormValue("readDeleted") == "true",
|
||||
HasSlowRead: vs.hasSlowRead,
|
||||
ReadBufferSize: vs.readBufferSize,
|
||||
}
|
||||
|
||||
var count int
|
||||
|
Reference in New Issue
Block a user