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

Method getStoragePools

src/resource_provider/storage/provider.cpp:1183–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1181
1182
1183Future<vector<ResourceConversion>>
1184StorageLocalResourceProviderProcess::getStoragePools()
1185{
1186 CHECK(info.has_id());
1187
1188 vector<Future<Resource>> futures;
1189
1190 foreachpair (const string& profile,
1191 const DiskProfileAdaptor::ProfileInfo& profileInfo,
1192 profileInfos) {
1193 futures.push_back(
1194 volumeManager->getCapacity(
1195 profileInfo.capability, profileInfo.parameters)
1196 .then(std::bind(
1197 &createRawDiskResource,
1198 info,
1199 lambda::_1,
1200 profile,
1201 vendor,
1202 None(),
1203 None())));
1204 }
1205
1206 return collect(futures)
1207 .then(defer(self(), [=](const vector<Resource>& resources) {
1208 Resources discovered(resources); // Zero resources will be ignored.
1209 Resources checkpointed =
1210 totalResources.filter([](const Resource& resource) {
1211 return Resources::isDisk(resource, Resource::DiskInfo::Source::RAW) &&
1212 !resource.disk().source().has_id();
1213 });
1214
1215 return vector<ResourceConversion>{
1216 computeConversion(std::move(checkpointed), std::move(discovered))};
1217 }));
1218}
1219
1220
1221void StorageLocalResourceProviderProcess::watchProfiles()

Callers

nothing calls this directly

Calls 5

collectFunction · 0.85
deferFunction · 0.85
thenMethod · 0.45
filterMethod · 0.45
diskMethod · 0.45

Tested by

no test coverage detected