private SynthesizedPlanFragment[] createReplicatedPlan(LocalTransaction ts, Table catalog_tbl, VoltTable table) {
if (debug.val)
LOG.debug(String.format("%s - %s is replicated. Creating %d fragments to send to all partitions",
ts, catalog_tbl.getName(), catalogContext.numberOfPartitions));
ParameterSet params = new ParameterSet(catalog_tbl.getName(), table);
final SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[2];
int idx = 0;
// Create a work unit to invoke super.loadTable() on each partition
pfs[idx] = new SynthesizedPlanFragment();
pfs[idx].fragmentId = SysProcFragmentId.PF_loadDistribute;
pfs[idx].outputDependencyIds = new int[] { (int)DEP_distribute };
pfs[idx].inputDependencyIds = new int[] { };
pfs[idx].multipartition = true;
pfs[idx].nonExecSites = false;
pfs[idx].parameters = params;
// Create a work unit to aggregate the results.
idx += 1;
pfs[idx] = new SynthesizedPlanFragment();
pfs[idx].fragmentId = SysProcFragmentId.PF_loadAggregate;
pfs[idx].outputDependencyIds = new int[] { (int)DEP_aggregate };
pfs[idx].inputDependencyIds = new int[] { (int)DEP_distribute };
pfs[idx].multipartition = false;
pfs[idx].nonExecSites = false;
pfs[idx].parameters = new ParameterSet();
pfs[idx].destPartitionId = this.partitionId;
return (pfs);
}