final Map<String, BasicOperator> mso,
final BasicOperator rootOperator) {
final Collection<BasicOperator> deleted = new LinkedList<BasicOperator>();
final Collection<BasicOperator> added = new LinkedList<BasicOperator>();
OperatorIDTuple tuple;
final BasicOperator join = mso.get("join");
final List<BasicOperator> pre = join.getPrecedingOperators();
join.setPrecedingOperators(new LinkedList<BasicOperator>());
for (final BasicOperator op : pre) {
if (op instanceof ParallelOperand
|| op instanceof QueryResultInBlocks) {
join.addPrecedingOperator(op);
continue;
}
final Operator par = new ParallelOperand();
par.addPrecedingOperator(op);
added.add(par);
final Operator maybequeryresultinblocks;
if (isBLOCKWISE()) {
maybequeryresultinblocks = new QueryResultInBlocks();
added.add(maybequeryresultinblocks);
par.setSucceedingOperator(new OperatorIDTuple(
maybequeryresultinblocks, 0));
maybequeryresultinblocks.addPrecedingOperator(par);
} else {
maybequeryresultinblocks = par;
}
tuple = op.getOperatorIDTuple(join);
op.replaceOperatorIDTuple(tuple, new OperatorIDTuple(par, 0));
join.addPrecedingOperator(maybequeryresultinblocks);
maybequeryresultinblocks.addSucceedingOperator(new OperatorIDTuple(
join, tuple.getId()));
}
rootOperator.detectCycles();