Esempio n. 1
0
  // For every fragment, create a Wrapper in PlanningSet.
  @VisibleForTesting
  public void initFragmentWrappers(Fragment rootFragment, PlanningSet planningSet) {
    planningSet.get(rootFragment);

    for (ExchangeFragmentPair fragmentPair : rootFragment) {
      initFragmentWrappers(fragmentPair.getNode(), planningSet);
    }
  }
Esempio n. 2
0
  /**
   * Helper method to reuse the code for QueryWorkUnit(s) generation
   *
   * @param activeEndpoints
   * @param rootFragment
   * @return
   * @throws ExecutionSetupException
   */
  protected PlanningSet getFragmentsHelper(
      Collection<DrillbitEndpoint> activeEndpoints, Fragment rootFragment)
      throws ExecutionSetupException {

    PlanningSet planningSet = new PlanningSet();

    initFragmentWrappers(rootFragment, planningSet);

    final Set<Wrapper> leafFragments = constructFragmentDependencyGraph(planningSet);

    // Start parallelizing from leaf fragments
    for (Wrapper wrapper : leafFragments) {
      parallelizeFragment(wrapper, planningSet, activeEndpoints);
    }

    return planningSet;
  }