示例#1
0
    /*
     * Multi-partition/non-replicated fragment with collector and aggregator.
     */
    void addFragmentPair(
        int index,
        PlanFragment collectorFragment,
        PlanFragment aggregatorFragment,
        ByteBuffer params) {
      assert (index >= 0);
      assert (index < m_batchSize);
      assert (collectorFragment != null);
      assert (aggregatorFragment != null);
      assert (collectorFragment.getHasdependencies() == false);
      assert (aggregatorFragment.getHasdependencies() == true);

      // frags with no deps are usually collector frags that go to all partitions
      long distributedFragId = CatalogUtil.getUniqueIdForFragment(collectorFragment);
      long localFragId = CatalogUtil.getUniqueIdForFragment(aggregatorFragment);
      // if any frag is transactional, update this check
      if (aggregatorFragment.getNontransactional() == true) {
        m_localFragsAreNonTransactional = true;
      }
      int outputDepId = m_txnState.getNextDependencyId() | DtxnConstants.MULTIPARTITION_DEPENDENCY;
      m_depsForLocalTask[index] = outputDepId;
      // Add local and distributed fragments.
      m_localTask.addFragment(localFragId, m_depsToResume[index], params);
      m_distributedTask.addFragment(distributedFragId, outputDepId, params);
    }
示例#2
0
    /*
     * Replicated fragment.
     */
    void addFragment(int index, PlanFragment frag, ByteBuffer params) {
      assert (index >= 0);
      assert (index < m_batchSize);
      assert (frag != null);
      assert (frag.getHasdependencies() == false);

      // if any frag is transactional, update this check
      if (frag.getNontransactional() == true) m_localFragsAreNonTransactional = true;

      long localFragId = CatalogUtil.getUniqueIdForFragment(frag);
      m_depsForLocalTask[index] = -1;
      // Add the local fragment data.
      m_localTask.addFragment(localFragId, m_depsToResume[index], params);
    }