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

Method connect

src/org/apache/pig/impl/plan/OperatorPlan.java:174–204  ·  view source on GitHub ↗

Create an edge between two nodes. The direction of the edge implies data flow. @param from Operator data will flow from. @param to Operator data will flow to. @throws PlanException if this edge will create multiple inputs for an operator that does not support multiple inputs or create multiple outp

(E from, E to)

Source from the content-addressed store, hash-verified

172 * for an operator that does not support multiple outputs.
173 */
174 public void connect(E from, E to) throws PlanException {
175 markDirty();
176
177 // Check that both nodes are in the plan.
178 checkInPlan(from);
179 checkInPlan(to);
180
181 // Check to see if the from operator already has outputs, and if so
182 // whether it supports multiple outputs.
183 if (mFromEdges.get(from) != null &&
184 !from.supportsMultipleOutputs()) {
185 PlanException pe = new PlanException("Attempt to give operator of type " +
186 from.getClass().getName() + " multiple outputs. This operator does "
187 + "not support multiple outputs.");
188 log.error(pe.getMessage());
189 throw pe;
190 }
191
192 // Check to see if the to operator already has inputs, and if so
193 // whether it supports multiple inputs.
194 if (mToEdges.get(to) != null &&
195 !to.supportsMultipleInputs()) {
196 PlanException pe = new PlanException("Attempt to give operator of type " +
197 to.getClass().getName() + " multiple inputs. This operator does "
198 + "not support multiple inputs.");
199 log.error(pe.getMessage());
200 throw pe;
201 }
202 mFromEdges.put(from, to);
203 mToEdges.put(to, from);
204 }
205
206 /**
207 * Create an soft edge between two nodes.

Callers 3

addAsLeafMethod · 0.95
addAsRootMethod · 0.95
removeAndReconnectMethod · 0.95

Calls 10

markDirtyMethod · 0.95
checkInPlanMethod · 0.95
getClassMethod · 0.80
getMethod · 0.65
getNameMethod · 0.45
errorMethod · 0.45
getMessageMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected