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

Method applyCreate

src/resource_provider/storage/provider.cpp:1959–1985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1957
1958
1959Try<vector<ResourceConversion>>
1960StorageLocalResourceProviderProcess::applyCreate(
1961 const Offer::Operation& operation) const
1962{
1963 CHECK(operation.has_create());
1964
1965 foreach (const Resource& resource, operation.create().volumes()) {
1966 CHECK(Resources::isPersistentVolume(resource));
1967 CHECK(resource.disk().source().has_id());
1968
1969 // TODO(chhsiao): Support persistent BLOCK volumes.
1970 if (resource.disk().source().type() != Resource::DiskInfo::Source::MOUNT) {
1971 return Error(
1972 "Cannot create persistent volume '" +
1973 stringify(resource.disk().persistence().id()) + "' on a " +
1974 stringify(resource.disk().source().type()) + " disk");
1975 }
1976
1977 // TODO(chhsiao): Ideally, we could perform a sanity check to verify that
1978 // the target path is empty before creating a new persistent volume.
1979 // However, right now we cannot distinguish the case where a framework is
1980 // recreating its own persistent volume after the agent ID changes from the
1981 // case where existing data is being leaked to another framework.
1982 }
1983
1984 return getResourceConversions(operation);
1985}
1986
1987
1988Try<vector<ResourceConversion>>

Callers

nothing calls this directly

Calls 1

getResourceConversionsFunction · 0.85

Tested by

no test coverage detected