diff options
| author | chrislu <chris.lu@gmail.com> | 2025-05-22 09:54:31 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-05-22 09:54:31 -0700 |
| commit | 0d62be44846354c3c37b857028297edd4b8df17b (patch) | |
| tree | c89320a7d58351030f1b740c7267f56bf0206429 /weed/operation | |
| parent | d8c574a5ef1a811f9a0d447097d9edfcc0c1d84c (diff) | |
| download | seaweedfs-origin/changing-to-zap.tar.xz seaweedfs-origin/changing-to-zap.zip | |
Diffstat (limited to 'weed/operation')
| -rw-r--r-- | weed/operation/chunked_file.go | 8 | ||||
| -rw-r--r-- | weed/operation/lookup_vid_cache.go | 6 | ||||
| -rw-r--r-- | weed/operation/submit.go | 10 | ||||
| -rw-r--r-- | weed/operation/upload_content.go | 20 |
4 files changed, 22 insertions, 22 deletions
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go index be3e5c98e..be64f3108 100644 --- a/weed/operation/chunked_file.go +++ b/weed/operation/chunked_file.go @@ -12,7 +12,7 @@ import ( "google.golang.org/grpc" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/util" util_http "github.com/seaweedfs/seaweedfs/weed/util/http" @@ -60,7 +60,7 @@ func LoadChunkManifest(buffer []byte, isCompressed bool) (*ChunkManifest, error) if isCompressed { var err error if buffer, err = util.DecompressData(buffer); err != nil { - glog.V(0).Infof("fail to decompress chunk manifest: %v", err) + log.V(3).Infof("fail to decompress chunk manifest: %v", err) } } cm := ChunkManifest{} @@ -82,12 +82,12 @@ func (cm *ChunkManifest) DeleteChunks(masterFn GetMasterFn, usePublicUrl bool, g } results, err := DeleteFileIds(masterFn, usePublicUrl, grpcDialOption, fileIds) if err != nil { - glog.V(0).Infof("delete %+v: %v", fileIds, err) + log.V(3).Infof("delete %+v: %v", fileIds, err) return fmt.Errorf("chunk delete: %v", err) } for _, result := range results { if result.Error != "" { - glog.V(0).Infof("delete file %+v: %v", result.FileId, result.Error) + log.V(3).Infof("delete file %+v: %v", result.FileId, result.Error) return fmt.Errorf("chunk delete %v: %v", result.FileId, result.Error) } } diff --git a/weed/operation/lookup_vid_cache.go b/weed/operation/lookup_vid_cache.go index 248fc17de..79e8738e8 100644 --- a/weed/operation/lookup_vid_cache.go +++ b/weed/operation/lookup_vid_cache.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" ) var ErrorNotFound = errors.New("not found") @@ -23,7 +23,7 @@ type VidCache struct { func (vc *VidCache) Get(vid string) ([]Location, error) { id, err := strconv.Atoi(vid) if err != nil { - glog.V(1).Infof("Unknown volume id %s", vid) + log.V(2).Infof("Unknown volume id %s", vid) return nil, err } vc.RLock() @@ -42,7 +42,7 @@ func (vc *VidCache) Get(vid string) ([]Location, error) { func (vc *VidCache) Set(vid string, locations []Location, duration time.Duration) { id, err := strconv.Atoi(vid) if err != nil { - glog.V(1).Infof("Unknown volume id %s", vid) + log.V(2).Infof("Unknown volume id %s", vid) return } vc.Lock() diff --git a/weed/operation/submit.go b/weed/operation/submit.go index 9470afced..c9420d81f 100644 --- a/weed/operation/submit.go +++ b/weed/operation/submit.go @@ -14,7 +14,7 @@ import ( "google.golang.org/grpc" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/security" ) @@ -102,14 +102,14 @@ func newFilePart(fullPathFilename string) (ret *FilePart, err error) { ret = &FilePart{} fh, openErr := os.Open(fullPathFilename) if openErr != nil { - glog.V(0).Info("Failed to open file: ", fullPathFilename) + log.V(3).Info("Failed to open file: ", fullPathFilename) return ret, openErr } ret.Reader = fh fi, fiErr := fh.Stat() if fiErr != nil { - glog.V(0).Info("Failed to stat file:", fullPathFilename) + log.V(3).Info("Failed to stat file:", fullPathFilename) return ret, fiErr } ret.ModTime = fi.ModTime().UTC().Unix() @@ -251,7 +251,7 @@ func genFileUrl(ret *AssignResult, id string, usePublicUrl bool) string { func uploadOneChunk(filename string, reader io.Reader, masterFn GetMasterFn, fileUrl string, jwt security.EncodedJwt, ) (size uint32, e error) { - glog.V(4).Info("Uploading part ", filename, " to ", fileUrl, "...") + log.V(-1).Info("Uploading part ", filename, " to ", fileUrl, "...") uploadOption := &UploadOption{ UploadUrl: fileUrl, Filename: filename, @@ -279,7 +279,7 @@ func uploadChunkedFileManifest(fileUrl string, manifest *ChunkManifest, jwt secu if e != nil { return e } - glog.V(4).Info("Uploading chunks manifest ", manifest.Name, " to ", fileUrl, "...") + log.V(-1).Info("Uploading chunks manifest ", manifest.Name, " to ", fileUrl, "...") u, _ := url.Parse(fileUrl) q := u.Query() q.Set("cm", "true") diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 0cf6bf7cf..e583d97a7 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -16,7 +16,7 @@ import ( "sync" "time" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/security" "github.com/seaweedfs/seaweedfs/weed/stats" @@ -114,7 +114,7 @@ func (uploader *Uploader) UploadWithRetry(filerClient filer_pb.FilerClient, assi if grpcAssignErr := filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { resp, assignErr := client.AssignVolume(context.Background(), assignRequest) if assignErr != nil { - glog.V(0).Infof("assign volume failure %v: %v", assignRequest, assignErr) + log.V(3).Infof("assign volume failure %v: %v", assignRequest, assignErr) return assignErr } if resp.Error != "" { @@ -139,7 +139,7 @@ func (uploader *Uploader) UploadWithRetry(filerClient filer_pb.FilerClient, assi } if uploadOption.RetryForever { util.RetryUntil("uploadWithRetryForever", doUploadFunc, func(err error) (shouldContinue bool) { - glog.V(0).Infof("upload content: %v", err) + log.V(3).Infof("upload content: %v", err) return true }) } else { @@ -187,7 +187,7 @@ func (uploader *Uploader) retriedUploadData(data []byte, option *UploadOption) ( uploadResult.RetryCount = i return } - glog.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err) + log.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err) } return } @@ -329,16 +329,16 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er file_writer, cp_err := body_writer.CreatePart(h) if cp_err != nil { - glog.V(0).Infoln("error creating form file", cp_err.Error()) + log.V(3).Infoln("error creating form file", cp_err.Error()) return nil, cp_err } if err := fillBufferFunction(file_writer); err != nil { - glog.V(0).Infoln("error copying data", err) + log.V(3).Infoln("error copying data", err) return nil, err } content_type := body_writer.FormDataContentType() if err := body_writer.Close(); err != nil { - glog.V(0).Infoln("error closing body", err) + log.V(3).Infoln("error closing body", err) return nil, err } if option.BytesBuffer == nil { @@ -348,7 +348,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er } req, postErr := http.NewRequest(http.MethodPost, option.UploadUrl, reqReader) if postErr != nil { - glog.V(1).Infof("create upload request %s: %v", option.UploadUrl, postErr) + log.V(2).Infof("create upload request %s: %v", option.UploadUrl, postErr) return nil, fmt.Errorf("create upload request %s: %v", option.UploadUrl, postErr) } req.Header.Set("Content-Type", content_type) @@ -364,7 +364,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er if post_err != nil { if strings.Contains(post_err.Error(), "connection reset by peer") || strings.Contains(post_err.Error(), "use of closed network connection") { - glog.V(1).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr) + log.V(2).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr) stats.FilerHandlerCounter.WithLabelValues(stats.RepeatErrorUploadContent).Inc() resp, post_err = uploader.httpClient.Do(req) defer util_http.CloseResponse(resp) @@ -389,7 +389,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er unmarshal_err := json.Unmarshal(resp_body, &ret) if unmarshal_err != nil { - glog.Errorf("unmarshal %s: %v", option.UploadUrl, string(resp_body)) + log.Errorf("unmarshal %s: %v", option.UploadUrl, string(resp_body)) return nil, fmt.Errorf("unmarshal %v: %v", option.UploadUrl, unmarshal_err) } if ret.Error != "" { |
