| 1069 | |
| 1070 | |
| 1071 | ContainerID parseContainerId(const string& value) |
| 1072 | { |
| 1073 | vector<string> tokens = strings::split(value, "."); |
| 1074 | |
| 1075 | Option<ContainerID> result; |
| 1076 | foreach (const string& token, tokens) { |
| 1077 | ContainerID id; |
| 1078 | id.set_value(token); |
| 1079 | |
| 1080 | if (result.isSome()) { |
| 1081 | id.mutable_parent()->CopyFrom(result.get()); |
| 1082 | } |
| 1083 | |
| 1084 | result = id; |
| 1085 | } |
| 1086 | |
| 1087 | CHECK_SOME(result); |
| 1088 | return result.get(); |
| 1089 | } |
| 1090 | |
| 1091 | |
| 1092 | Try<Resources> getConsumedResources(const Offer::Operation& operation) |