@Override
public QueryWorkUnit getWorkUnit(QueryContext context, PhysicalPlan plan, int maxWidth) throws ExecutionSetupException {
// get the root physical operator and split the plan into sub fragments.
PhysicalOperator root = plan.getSortedOperators(false).iterator().next();
Fragment fragmentRoot = root.accept(fragmenter, null);
// generate a planning set and collect stats.
PlanningSet planningSet = StatsCollector.collectStats(fragmentRoot);
return parallelizer.getFragments(context.getCurrentEndpoint(), context.getQueryId(), context.getActiveEndpoints(), context.getPlanReader(), fragmentRoot, planningSet, maxWidth);