if (!aliases.contains(alias)) throw new IllegalArgumentException("Illegal request to monitor pig script alias " + alias);
}
// first, make a fresh copy of the query plan so we can mutate (i.e. instrument) it
// since LogicalPlan does not offer a deepCopy() method, we'll do this by re-parsing the original script
ToolsPigServer newPigServer = new ToolsPigServer(pigServer.getPigContext());
newPigServer.registerNoRun(pigScript, new HashMap<String, String>(), new LinkedList<String>());
LogicalPlan instrumentedQueryPlan = newPigServer.getPlans().lp;
if (truncateAtAlias != null) truncate(instrumentedQueryPlan, truncateAtAlias);
Map<String, LogicalRelationalOperator> cloneAliasOperatorMap = new HashMap<String, LogicalRelationalOperator>();
// Ibis change : start
populateAliasOperatorMap(instrumentedQueryPlan, cloneAliasOperatorMap, null);
// Ibis change : end