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

Method adjust

src/slave/containerizer/fetcher.cpp:1218–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1216
1217
1218Try<Nothing> FetcherProcess::Cache::adjust(
1219 const shared_ptr<FetcherProcess::Cache::Entry>& entry)
1220{
1221 CHECK(contains(entry));
1222
1223 Try<Bytes> size = os::stat::size(
1224 entry.get()->path().string(),
1225 os::stat::FollowSymlink::DO_NOT_FOLLOW_SYMLINK);
1226
1227 if (size.isSome()) {
1228 off_t d = delta(size.get(), entry);
1229 if (d <= 0) {
1230 entry->size = size.get();
1231
1232 releaseSpace(Bytes(d));
1233 } else {
1234 return Error("More cache size now necessary, not adjusting " +
1235 entry->key);
1236 }
1237 } else {
1238 // This should never be caused by Mesos itself, but cannot be excluded.
1239 return Error("Fetcher cache file for '" + entry->key +
1240 "' disappeared from: " + entry->path().string());
1241 }
1242
1243 return Nothing();
1244}
1245
1246
1247size_t FetcherProcess::Cache::size() const

Callers 1

foreachvalueFunction · 0.80

Calls 10

deltaFunction · 0.85
BytesClass · 0.85
NothingClass · 0.85
containsFunction · 0.50
sizeFunction · 0.50
ErrorFunction · 0.50
stringMethod · 0.45
pathMethod · 0.45
getMethod · 0.45
isSomeMethod · 0.45

Tested by

no test coverage detected