Package org.voltdb.catalog

Examples of org.voltdb.catalog.PlanFragment


            assertFalse(builders.isEmpty());
       
            for (WorkFragment.Builder builder : builders) {
                assertNotNull(builder);
                for (int frag_id : builder.getFragmentIdList()) {
                    PlanFragment catalog_frag = CatalogUtil.getPlanFragment(catalog_proc, frag_id);
                    assertNotNull(catalog_frag);
                    assertEquals(catalog_frag.fullName(), catalog_stmt, catalog_frag.getParent());
                } // FOR
    //            System.err.println(pf);
            } // FOR
        } // FOR
    }
View Full Code Here


        boolean first = true;
        Statement last = null;
        for (WorkFragment.Builder builder : builders) {
            assertNotNull(builder);
            for (int frag_id : builder.getFragmentIdList()) {
                PlanFragment catalog_frag = CatalogUtil.getPlanFragment(catalog_proc, frag_id);
                assertNotNull(catalog_frag);
                Statement current = catalog_frag.getParent();
                if (last == null || last.equals(current) == false) {
                    batchStmtOrder.add(current);
                }
                last = current;
               
View Full Code Here

           
            // If this WorkFragment is not for the base partition, then
            // we should make sure that it only has distributed queries...
            if (builder.getPartitionId() != BASE_PARTITION) {
                for (int frag_id : builder.getFragmentIdList()) {
                    PlanFragment catalog_frag = CatalogUtil.getPlanFragment(catalogContext.catalog, frag_id);
                    assertNotNull(catalog_frag);
                    Statement catalog_stmt = catalog_frag.getParent();
                    assertNotNull(catalog_stmt);
                    assert(catalog_stmt.getMs_fragments().contains(catalog_frag));
                } // FOR
            }
           
View Full Code Here

            graph.num_rounds = Math.max(num_fragments, graph.num_rounds);

            // Generate the synthetic DependencyIds for the query
            int last_output_id = HStoreConstants.NULL_DEPENDENCY_ID;
            for (int round = 0, cnt = num_fragments; round < cnt; round++) {
                PlanFragment catalog_frag = fragments.get(round);
                PartitionSet f_partitions = frag_partitions.get(catalog_frag);
                assert (f_partitions != null) :
                    String.format("No PartitionIds for [%02d] %s in Statement #%d", round,
                                  catalog_frag.fullName(), stmt_index);
                boolean f_local = (f_partitions.size() == 1 && f_partitions.contains(plan.base_partition));
                final Integer output_id = Integer.valueOf(this.enable_unique_ids ?
                            BatchPlanner.NEXT_DEPENDENCY_ID.getAndIncrement() : last_id++);

                PlanVertex v = new PlanVertex(catalog_frag,
View Full Code Here

                orig_catalog_id = target_frag.getName();
            } // FOR

            // Copy PlanFragments
            for (PlanFragment source_frag : source_stmt.getFragments()) {
                PlanFragment target_frag = target_stmt.getFragments().add(source_frag.getName());

                // Copy fields
                for (String field : source_frag.getFields()) {
                    Object value = source_frag.getField(field);
                    if (!(value instanceof CatalogMap)) {
                        CatalogProxy.set(target_frag, field, value);
                    }
                } // FOR

                if (new_catalog_id == null) {
                    new_catalog_id = target_frag.getName();
                    to_remove.add(target_frag.getName());
                    StringBuilder buffer = new StringBuilder();
                    CatalogProxy.writeCommands(target_frag, buffer);
                    fix.put(orig_catalog_id, buffer.toString().replaceAll(source_proc.getName(), target_proc.getName()));
                }
            } // FOR
View Full Code Here

            sb.append(StringUtil.SINGLE_LINE);
            sb.append(Encoder.hexDecodeToString(((Database)catalog_obj).getSchema()));
        }
        // PLANFRAGMENT
        else if (catalog_obj instanceof PlanFragment) {
            PlanFragment catalog_frgmt = (PlanFragment)catalog_obj;
            try {
                AbstractPlanNode node = PlanNodeUtil.getPlanNodeTreeForPlanFragment(catalog_frgmt);
                sb.append(StringUtil.SINGLE_LINE);
                sb.append(PlanNodeUtil.debug(node));
            } catch (Exception e) {
View Full Code Here

            assert (copy_src_fragments != null);
            assert (copy_dest_fragments != null);

            copy_dest_fragments.clear();
            for (PlanFragment copy_src_frag : copy_src_fragments) {
                PlanFragment copy_dest_frag = copy_dest_fragments.add(copy_src_frag.getName());
                if (trace.val)
                    LOG.trace(String.format("Copying %s to %s", copy_src_frag.fullName(), copy_dest_frag.fullName()));
                copyFields(copy_src_frag, copy_dest_frag, copy_src_frag.getFields().toArray(new String[0]));
            } // FOR
        }
    }
View Full Code Here

        Statement catalog_stmt = CollectionUtil.first(catalog_proc.getStatements());
        assert (catalog_stmt != null);

        for (PlanFragment expected : catalog_stmt.getFragments()) {
            int id = expected.getId();
            PlanFragment actual = CatalogUtil.getPlanFragment(expected, id);
            assertNotNull(actual);
            assertEquals(expected, actual);
        } // FOR
        for (PlanFragment expected : catalog_stmt.getMs_fragments()) {
            int id = expected.getId();
            PlanFragment actual = CatalogUtil.getPlanFragment(expected, id);
            assertNotNull(actual);
            assertEquals(expected, actual);
        } // FOR
    }
View Full Code Here

            assert (copy_src_fragments != null);
            assert (copy_dest_fragments != null);

            for (PlanFragment copy_src_frag : copy_src_fragments) {
                assertNotNull(copy_src_frag);
                PlanFragment copy_dest_frag = copy_dest_fragments.get(copy_src_frag.getName());
                assertNotNull(copy_dest_frag);

                for (String f : copy_src_frag.getFields()) {
                    assertEquals(f, copy_src_frag.getField(f), copy_dest_frag.getField(f));
                } // FOR

                AbstractPlanNode src_root = PlanNodeUtil.getPlanNodeTreeForPlanFragment(copy_src_frag);
                assertNotNull(copy_src_frag.fullName(), src_root);
                AbstractPlanNode dest_root = PlanNodeUtil.getPlanNodeTreeForPlanFragment(copy_dest_frag);
View Full Code Here

            for (WorkFragment.Builder frag : allFragmentBuilders) {
                if (frag.getPartitionId() != this.partitionId) {
                    has_remote = true;
                }
                for (int frag_id : frag.getFragmentIdList()) {
                    PlanFragment catalog_frag = CatalogUtil.getPlanFragment(catalogContext.database, frag_id);
                    Statement catalog_stmt = catalog_frag.getParent();
                    assert(catalog_stmt != null);
                    Procedure catalog_proc = catalog_stmt.getParent();
                    if (catalog_proc.equals(ts.getProcedure()) == false) {
                        LOG.warn(ts.debug() + "\n" + allFragmentBuilders + "\n---- INVALID ----\n" + frag);
                        String msg = String.format("%s - Unexpected %s", ts, catalog_frag.fullName());
                        throw new ServerFaultException(msg, ts.getTransactionId());
                    }
                }
            } // FOR
            if (has_remote == false) {
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.PlanFragment

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.