EntityTarget targetType = dropNode.getType();
// Perform the operation.
mRootSymbolTable.remove(name);
mSubmitterSession.sendInfo("DROP " + targetType.toString().toUpperCase());
} else if (node instanceof NamedSourceNode) {
NamedSourceNode namedInput = (NamedSourceNode) node;
String streamName = namedInput.getStreamName();
Symbol symbol = mRootSymbolTable.resolve(streamName).resolveAliases();
if (null == symbol) {
throw new DAGOperatorException("No symbol for stream: " + streamName);
}
if (!(symbol instanceof StreamSymbol)) {
throw new DAGOperatorException("Identifier " + streamName + " has type: "
+ symbol.getType() + ", not STREAM.");
}
StreamSymbol streamSymbol = (StreamSymbol) symbol;
switch (streamSymbol.getSourceType()) {
case File:
String fileName = streamSymbol.getSource();
newElem = new FileSourceElement(newContext, fileName, streamSymbol.isLocal(),
namedInput.getFields(), streamSymbol);
break;
case Source:
if (!streamSymbol.isLocal()) {
throw new DAGOperatorException("Do not know how to handle a non-local source yet.");
}
String flumeSource = streamSymbol.getSource();
long flowIdNum = mFlowId.getId();
String flowSourceId = "flumebase-flow-" + flowIdNum + "-" + streamSymbol.getName();
newElem = new LocalFlumeSourceElement(newContext, flowSourceId,
mFlumeConfig, flumeSource, (Schema) namedInput.getAttr(PlanNode.OUTPUT_SCHEMA_ATTR),
namedInput.getFields(), streamSymbol);
if (!streamSymbol.isLocal()) {
LOG.info("Created local Flume logical node: " + flowSourceId);
LOG.info("You may need to connect upstream Flume elements to this source.");
}
// Mark Flume as required to execute this flow.
mLocalFlow.setFlumeRequired(true);
break;
case Memory:
newElem = new LocalInMemSourceElement(newContext,
namedInput.getFields(), (InMemStreamSymbol) streamSymbol);
break;
case Node:
String nodeSourceId = "flumebase-flow-" + mFlowId.getId() + "-" + streamSymbol.getName();
newElem = new FlumeNodeElement(newContext, nodeSourceId,
mFlumeConfig, streamSymbol.getSource(),
(Schema) namedInput.getAttr(PlanNode.OUTPUT_SCHEMA_ATTR),
namedInput.getFields(), streamSymbol);
LOG.info("Created local Flume receiver context: " + nodeSourceId);
LOG.info("This will be connected to upstream Flume node: " + streamSymbol.getSource());
// Mark Flume as required to execute this flow.