Disconnect two operators in the plan. @param from Operator edge is coming from @param to Operator edge is going to @return pair of positions, indicating the position in the from and to arrays. @throws FrontendException if the two operators aren't connected.
(Operator from,
Operator to)
| 253 | * @throws FrontendException if the two operators aren't connected. |
| 254 | */ |
| 255 | public Pair<Integer, Integer> disconnect(Operator from, |
| 256 | Operator to) throws FrontendException { |
| 257 | Pair<Operator, Integer> f = fromEdges.removeWithPosition(from, to); |
| 258 | if (f == null) { |
| 259 | throw new FrontendException("Attempt to disconnect operators " + |
| 260 | from.getName() + " and " + to.getName() + |
| 261 | " which are not connected.", 2219); |
| 262 | } |
| 263 | |
| 264 | Pair<Operator, Integer> t = toEdges.removeWithPosition(to, from); |
| 265 | if (t == null) { |
| 266 | throw new FrontendException("Plan in inconssistent state " + |
| 267 | from.getName() + " and " + to.getName() + |
| 268 | " connected in fromEdges but not toEdges.", 2220); |
| 269 | } |
| 270 | |
| 271 | markDirty(); |
| 272 | return new Pair<Integer, Integer>(f.second, t.second); |
| 273 | } |
| 274 | |
| 275 | private void markDirty() { |
| 276 | roots.clear(); |
no test coverage detected