Examples of CorePlan


Examples of org.voltdb.planner.CorePlan

                                matched = boundPlan;
                                break;
                            }
                        }
                        if (matched != null) {
                            CorePlan core = matched.m_core;
                            ParameterSet params = planner.extractedParamValues(core.parameterTypes);
                            AdHocPlannedStatement ahps = new AdHocPlannedStatement(sql.getBytes(Constants.UTF8ENCODING),
                                                                                   core,
                                                                                   params,
                                                                                   null);
                            ahps.setBoundConstants(matched.m_constants);
                            m_cache.put(sql, parsedToken, ahps, extractedLiterals);
                            cacheUse = CacheUse.HIT2;
                            return ahps;
                        }
                    }
                }

                // If not caching or there was no cache hit, do the expensive full planning.
                plan = planner.plan();
                assert(plan != null);
            } catch (Exception e) {
                throw new RuntimeException("Error compiling query: " + e.toString(), e);
            }

            if (plan == null) {
                throw new RuntimeException("Null plan received in PlannerTool.planSql");
            }

            //////////////////////
            // OUTPUT THE RESULT
            //////////////////////
            CorePlan core = new CorePlan(plan, m_catalogVersion);
            AdHocPlannedStatement ahps = new AdHocPlannedStatement(plan, core);

            if (partitioning.isInferred()) {

                // Note either the parameter index (per force to a user-provided parameter) or
                // the actual constant value of the partitioning key inferred from the plan.
                // Either or both of these two values may simply default
                // to -1 and to null, respectively.
                core.setPartitioningParamIndex(partitioning.getInferredParameterIndex());
                core.setPartitioningParamValue(partitioning.getInferredPartitioningValue());

                if (planner.compiledAsParameterizedPlan()) {
                    assert(parsedToken != null);
                    // Again, plans with inferred partitioning are the only ones supported in the cache.
                    m_cache.put(sqlIn, parsedToken, ahps, extractedLiterals);
View Full Code Here

Examples of org.voltdb.planner.CorePlan

        extractedParamValues.flattenToBuffer(buf);
    }

    public static AdHocPlannedStatement fromBuffer(ByteBuffer buf) throws IOException {
        // plan
        CorePlan core = CorePlan.fromBuffer(buf);

        // sql bytes
        short sqlLength = buf.getShort();
        byte[] sql = new byte[sqlLength];
        buf.get(sql);
View Full Code Here

Examples of org.voltdb.planner.CorePlan

                                                                                sql,
                                                                                userParams,
                                                                                false, // mock inferred partitioning
                                                                                null, dummyHandler);
        // Mock up dummy results from the work request.
        CorePlan core = new CorePlan(new byte[0],
                partitionParamIndex == -1 ? new byte[20] : null,
                new byte[20],
                partitionParamIndex == -1 ? new byte[20] : null,
                false,
                true,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.