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

Function getPersistentVolumePath

src/slave/paths.cpp:699–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697
698
699string getPersistentVolumePath(
700 const string& workDir,
701 const string& role,
702 const string& persistenceId)
703{
704 // Role names might contain literal `/` if the role is part of a
705 // role hierarchy. Since `/` is not allowed in a directory name
706 // under Linux, we could either represent such sub-roles with
707 // sub-directories, or encode the `/` with some other identifier.
708 // To clearly distinguish artifacts in a volume from subroles we
709 // choose to encode `/` in role names as ` ` (literal space) as
710 // opposed to using subdirectories. Whitespace is not allowed as
711 // part of a role name. Also, practically all modern filesystems can
712 // use ` ` in filenames. There are some limitations in auxilary
713 // tooling which are not relevant here, e.g., many shell constructs
714 // require quotes around filesnames containing ` `; containers using
715 // persistent volumes would not see the ` ` as the role-related part
716 // of the path would not be part of a mapping into the container
717 // sandbox.
718 string serializableRole = strings::replace(role, "/", " ");
719
720 return path::join(
721 workDir, "volumes", "roles", serializableRole, persistenceId);
722}
723
724
725string getPersistentVolumePath(

Callers 13

TEST_PFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_PFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
foreachFunction · 0.85
foreachFunction · 0.85
foreachFunction · 0.85
foreachFunction · 0.85

Calls 12

replaceFunction · 0.85
validateIDFunction · 0.85
is_absoluteFunction · 0.85
getMountTargetPathFunction · 0.85
typeMethod · 0.80
rootMethod · 0.80
validateFunction · 0.70
joinFunction · 0.50
diskMethod · 0.45
idMethod · 0.45
pathMethod · 0.45
mountMethod · 0.45

Tested by 8

TEST_PFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_PFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68