Package edu.brown.hstore.PartitionExecutor

Examples of edu.brown.hstore.PartitionExecutor.SystemProcedureExecutionContext


        return m_hostsWithThisTable;
    }

    @Override
    public SynthesizedPlanFragment[] generateRestorePlan(Table catalogTable) {
        SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
        assert (context != null);
        Host catalog_host = context.getHost();
        Collection<Site> catalog_sites = CatalogUtil.getSitesForHost(catalog_host);

        LOG.info("Replicated :: Table: " + getTableName());

        Set<Integer> execution_site_ids = new TreeSet<Integer>();
View Full Code Here


    }

    private SynthesizedPlanFragment[] generateReplicatedToReplicatedPlan() {
        SynthesizedPlanFragment[] restore_plan = null;

        SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
        assert (context != null);
        Host catalog_host = context.getHost();
        Collection<Site> catalog_sites = CatalogUtil.getSitesForHost(catalog_host);

        Set<Integer> execution_site_ids = new TreeSet<Integer>();
        Set<Integer> execution_partition_ids = new TreeSet<Integer>();
        for (Site catalog_site : catalog_sites) {           
            execution_site_ids.add(catalog_site.getId());
            for(Partition pt : catalog_site.getPartitions()){
                execution_partition_ids.add(pt.getId());
            }           
        }
       
        //LOG.trace("Sites Size ::"+execution_site_ids.size());
        //LOG.trace("Partitions Size ::"+execution_partition_ids.size());

        Set<Integer> sites_missing_table = getSitesMissingTable(execution_site_ids);
        // not sure we want to deal with handling expected load failures,
        // so let's send an individual load to each site with the table
        // and then pick sites to send the table to those without it
        restore_plan = new SynthesizedPlanFragment[execution_partition_ids.size() + 1];
        int restore_plan_index = 0;

        //LOG.trace("getSitesMissingTable :");
        //for(Integer ii : sites_missing_table ) LOG.trace(" "+ii);
       
        for (Integer site_id : m_sitesWithThisTable) {
            for(Partition pt : CatalogUtil.getSiteFromId(context.getHost(),site_id).getPartitions()){
                restore_plan[restore_plan_index] = constructLoadReplicatedTableFragment();
                // XXX restore_plan[restore_plan_index].siteId = site_id;
                restore_plan[restore_plan_index].destPartitionId = pt.getId();
                ++restore_plan_index;
            }
        }
        for (Integer site_id : sites_missing_table) {
            LOG.trace("m_sites_missing_table :: site_id :"+site_id);
            int source_site_id = m_sitesWithThisTable.iterator().next(); // XXX  hacky                                                                        
            for(Partition pt : CatalogUtil.getSiteFromId(context.getHost(), source_site_id).getPartitions()){               
                restore_plan[restore_plan_index] = constructDistributeReplicatedTableFragment(source_site_id, site_id);
                ++restore_plan_index;
            }
        }
        //LOG.trace("restore_plan_index :"+restore_plan_index+" execution_partition_ids :"+execution_partition_ids.size());
View Full Code Here

        plan_fragment.parameters = params;
        return plan_fragment;
    }

    private SynthesizedPlanFragment constructLoadReplicatedTableAggregatorFragment() {
        SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
        assert (context != null);
        int partition_id = context.getPartitionExecutor().getPartitionId();
        LOG.trace("constructLoadReplicatedTableAggregatorFragment - partition : " + partition_id);

        int result_dependency_id = getNextDependencyId();

        SynthesizedPlanFragment plan_fragment = new SynthesizedPlanFragment();
View Full Code Here

                    uncoveredPartitionsAtHostList.add(p.getFirst());
                    originalHosts.add(p.getSecond());
                }
            }

            SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
            assert (context != null);
            Host catalog_host = context.getHost();
            Collection<Site> catalog_sites = CatalogUtil.getSitesForHost(catalog_host);

            List<Integer> sitesAtHost = new ArrayList<Integer>();
            List<Integer> partitionsAtHost = new ArrayList<Integer>();
View Full Code Here

        plan_fragment.parameters = params;
        return plan_fragment;
    }

    private SynthesizedPlanFragment constructDistributePartitionedTableAggregatorFragment() {
        SystemProcedureExecutionContext context = this.getSystemProcedureExecutionContext();
        assert (context != null);
        int partition_id = context.getPartitionExecutor().getPartitionId();
        LOG.trace("constructDistributePartitionedTableAggregatorFragment - partition : " + partition_id);

        int result_dependency_id = getNextDependencyId();
        SynthesizedPlanFragment plan_fragment = new SynthesizedPlanFragment();
        plan_fragment.fragmentId = SysProcFragmentId.PF_restoreDistributePartitionedTableResults;
View Full Code Here

TOP

Related Classes of edu.brown.hstore.PartitionExecutor.SystemProcedureExecutionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.