diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2017-06-09 22:52:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-09 22:52:24 -0700 |
| commit | 761c0eb1ed6cd7645d747726292ff2656d0d4671 (patch) | |
| tree | 7a7843d226d1aa68715b0a7d5812715dc715613c /weed/server | |
| parent | f5bed84340b8b96c8b134b849f302120d85708c6 (diff) | |
| parent | 5047bdb4a20f756f5d025be0788403dbb2db9523 (diff) | |
| download | seaweedfs-761c0eb1ed6cd7645d747726292ff2656d0d4671.tar.xz seaweedfs-761c0eb1ed6cd7645d747726292ff2656d0d4671.zip | |
Merge pull request #508 from chrislusf/skip_memory_pool
skip bytes cache
Diffstat (limited to 'weed/server')
| -rw-r--r-- | weed/server/volume_server.go | 4 | ||||
| -rw-r--r-- | weed/server/volume_server_handlers_read.go | 1 | ||||
| -rw-r--r-- | weed/server/volume_server_handlers_sync.go | 5 | ||||
| -rw-r--r-- | weed/server/volume_server_handlers_write.go | 4 |
4 files changed, 3 insertions, 11 deletions
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index cc06f0092..cace8d181 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -32,8 +32,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, dataCenter string, rack string, whiteList []string, fixJpgOrientation bool, - readRedirect bool, - enableBytesCache bool) *VolumeServer { + readRedirect bool) *VolumeServer { vs := &VolumeServer{ pulseSeconds: pulseSeconds, dataCenter: dataCenter, @@ -44,7 +43,6 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, } vs.SetMasterNode(masterNode) vs.store = storage.NewStore(port, ip, publicUrl, folders, maxCounts, vs.needleMapKind) - storage.EnableBytesCache = enableBytesCache vs.guard = security.NewGuard(whiteList, "") diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go index 8f50b265e..9b0fee4eb 100644 --- a/weed/server/volume_server_handlers_read.go +++ b/weed/server/volume_server_handlers_read.go @@ -72,7 +72,6 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) w.WriteHeader(http.StatusNotFound) return } - defer n.ReleaseMemory() if n.Cookie != cookie { glog.V(0).Infoln("request", r.URL.Path, "with unmaching cookie seen:", cookie, "expected:", n.Cookie, "from", r.RemoteAddr, "agent", r.UserAgent()) w.WriteHeader(http.StatusNotFound) diff --git a/weed/server/volume_server_handlers_sync.go b/weed/server/volume_server_handlers_sync.go index 68c381e28..df1fde590 100644 --- a/weed/server/volume_server_handlers_sync.go +++ b/weed/server/volume_server_handlers_sync.go @@ -50,8 +50,7 @@ func (vs *VolumeServer) getVolumeDataContentHandler(w http.ResponseWriter, r *ht } offset := uint32(util.ParseUint64(r.FormValue("offset"), 0)) size := uint32(util.ParseUint64(r.FormValue("size"), 0)) - content, block, err := storage.ReadNeedleBlob(v.DataFile(), int64(offset)*storage.NeedlePaddingSize, size) - defer storage.ReleaseBytes(block.Bytes) + content, err := storage.ReadNeedleBlob(v.DataFile(), int64(offset)*storage.NeedlePaddingSize, size) if err != nil { writeJsonError(w, r, http.StatusInternalServerError, err) return @@ -83,4 +82,4 @@ func (vs *VolumeServer) getVolumeId(volumeParameterName string, r *http.Request) } return vid, err -}
\ No newline at end of file +} diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index b02a58fc8..e45c2245c 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -64,7 +64,6 @@ func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) { writeJsonQuiet(w, r, http.StatusNotFound, m) return } - defer n.ReleaseMemory() if n.Cookie != cookie { glog.V(0).Infoln("delete", r.URL.Path, "with unmaching cookie from ", r.RemoteAddr, "agent", r.UserAgent()) @@ -133,7 +132,6 @@ func (vs *VolumeServer) batchDeleteHandler(w http.ResponseWriter, r *http.Reques Status: http.StatusNotAcceptable, Error: "ChunkManifest: not allowed in batch delete mode.", }) - n.ReleaseMemory() continue } @@ -144,7 +142,6 @@ func (vs *VolumeServer) batchDeleteHandler(w http.ResponseWriter, r *http.Reques Error: "File Random Cookie does not match.", }) glog.V(0).Infoln("deleting", fid, "with unmaching cookie from ", r.RemoteAddr, "agent", r.UserAgent()) - n.ReleaseMemory() return } if size, err := vs.store.Delete(volumeId, n); err != nil { @@ -160,7 +157,6 @@ func (vs *VolumeServer) batchDeleteHandler(w http.ResponseWriter, r *http.Reques Size: int(size)}, ) } - n.ReleaseMemory() } writeJsonQuiet(w, r, http.StatusAccepted, ret) |
