MCPcopy
hub / github.com/rclone/rclone / pairRenamer

Method pairRenamer

fs/sync/sync.go:467–484  ·  view source on GitHub ↗

pairRenamer reads Objects~s on in and attempts to rename them, otherwise it sends them out if they need transferring.

(in *pipe, out *pipe, fraction int, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

465// pairRenamer reads Objects~s on in and attempts to rename them,
466// otherwise it sends them out if they need transferring.
467func (s *syncCopyMove) pairRenamer(in *pipe, out *pipe, fraction int, wg *sync.WaitGroup) {
468 defer wg.Done()
469 for {
470 pair, ok := in.GetMax(s.inCtx, fraction)
471 if !ok {
472 return
473 }
474 src := pair.Src
475 if !s.tryRename(src) {
476 // pass on if not renamed
477 fs.Debugf(src, "Need to transfer - No matching file found at Destination")
478 ok = out.Put(s.inCtx, pair)
479 if !ok {
480 return
481 }
482 }
483 }
484}
485
486// pairCopyOrMove reads Objects on in and moves or copies them.
487func (s *syncCopyMove) pairCopyOrMove(ctx context.Context, in *pipe, fdst fs.Fs, fraction int, wg *sync.WaitGroup) {

Callers 1

startRenamersMethod · 0.95

Calls 5

tryRenameMethod · 0.95
DebugfFunction · 0.92
GetMaxMethod · 0.80
PutMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected