protected final VoltTable[] executeOncePerSite(final int distributeId, final int aggregateId, final ParameterSet params) {
final SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[catalogContext.numberOfSites + 1];
int i = 0;
for (Site catalog_site : catalogContext.sites.values()) {
Partition catalog_part = null;
int first_id = Integer.MAX_VALUE;
for (Partition p : catalog_site.getPartitions().values()) {
if (catalog_part == null || p.getId() < first_id) {
catalog_part = p;
first_id = p.getId();
}
} // FOR
assert(catalog_part != null) : "No partitions for " + catalog_site;
if (debug.val)
LOG.debug(String.format("Creating PlanFragment #%d for %s on %s",
distributeId, catalog_part, catalog_site));
pfs[i] = new SynthesizedPlanFragment();
pfs[i].fragmentId = distributeId;
pfs[i].inputDependencyIds = new int[] { };
pfs[i].outputDependencyIds = new int[] { distributeId };
pfs[i].multipartition = true;
pfs[i].nonExecSites = false;
pfs[i].destPartitionId = catalog_part.getId();
pfs[i].parameters = params;
pfs[i].last_task = (catalog_site.getId() != hstore_site.getSiteId());
i += 1;
} // FOR