MCPcopy Create free account
hub / github.com/apache/pig / disconnect

Method disconnect

src/org/apache/pig/newplan/BaseOperatorPlan.java:255–273  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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();

Callers 4

replaceMethod · 0.95
removeAndReconnectMethod · 0.95
insertBetweenMethod · 0.95
trimBelowMethod · 0.95

Calls 3

markDirtyMethod · 0.95
removeWithPositionMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected