| 1156 | |
| 1157 | |
| 1158 | Option<Error> validateCompatibleExecutorInfo( |
| 1159 | const ExecutorInfo& executor, |
| 1160 | Framework* framework, |
| 1161 | Slave* slave) |
| 1162 | { |
| 1163 | CHECK_NOTNULL(framework); |
| 1164 | CHECK_NOTNULL(slave); |
| 1165 | |
| 1166 | const ExecutorID& executorId = executor.executor_id(); |
| 1167 | Option<ExecutorInfo> executorInfo = None(); |
| 1168 | |
| 1169 | if (slave->hasExecutor(framework->id(), executorId)) { |
| 1170 | executorInfo = |
| 1171 | slave->executors.at(framework->id()).at(executorId); |
| 1172 | } |
| 1173 | |
| 1174 | if (executorInfo.isSome() && executor != executorInfo.get()) { |
| 1175 | return Error( |
| 1176 | "ExecutorInfo is not compatible with existing ExecutorInfo" |
| 1177 | " with same ExecutorID.\n" |
| 1178 | "------------------------------------------------------------\n" |
| 1179 | "Existing ExecutorInfo:\n" + |
| 1180 | stringify(executorInfo.get()) + "\n" |
| 1181 | "------------------------------------------------------------\n" |
| 1182 | "ExecutorInfo:\n" + |
| 1183 | stringify(executor) + "\n" |
| 1184 | "------------------------------------------------------------\n"); |
| 1185 | } |
| 1186 | |
| 1187 | return None(); |
| 1188 | } |
| 1189 | |
| 1190 | |
| 1191 | Option<Error> validateFrameworkID( |