MCPcopy Create free account
hub / github.com/apache/mesos / delta

Function delta

src/slave/containerizer/fetcher.cpp:637–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635
636
637static off_t delta(
638 const Bytes& actualSize,
639 const shared_ptr<FetcherProcess::Cache::Entry>& entry)
640{
641 if (actualSize < entry->size) {
642 Bytes delta = entry->size - actualSize;
643 LOG(WARNING) << "URI download result for '" << entry->key
644 << "' is smaller than expected by " << stringify(delta)
645 << " at: " << entry->path();
646
647 return -off_t(delta.bytes());
648 } else if (actualSize > entry->size) {
649 Bytes delta = actualSize - entry->size;
650 LOG(WARNING) << "URI download result for '" << entry->key
651 << "' is larger than expected by " << stringify(delta)
652 << " at: " << entry->path();
653
654 return off_t(delta.bytes());
655 }
656
657 return 0;
658}
659
660
661// For testing only.

Callers 1

adjustMethod · 0.85

Calls 3

stringifyFunction · 0.50
pathMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected